GunnsFluidExternalDemand - nasa/gunns GitHub Wiki

GunnsFluidExternalDemand

default_img

Background

This class inherits GunnsFluidPotential, and is used in tandem with the GunnsFluidExternalSupply class to connect two separate Gunns networks together, with this class applying pressure from the external supply-side network to our local demand-side network as a potential source and calculating a demand flow rate to apply to the supply network.

How To Use in GunnsDraw

This picture shows how to hook up the GunnsFluidExternalDemand in the local network and the GunnsFluidExternalSupply link in the external network and the simbus interfaces between the networks. The arrowheads in the supply & demand link shapes imply a flow direction from the supply node to the demand node, but in fact flow can go in either direction, and always flows from the higher-pressure side to the lower-pressure side, as a regular conductor would. The arrowheads simply indicate the direction of positive flow values.

default_img

Normally you'll pair up this Demand link with a Supply link as shown above. However this is optional, and you also have the option of using this link standalone. In lieu of a run-time simbus interface, you can specify the supply fluid properties in this link's Input Data, detailed below.

Port Connection Rules (These are limitations on the port connection to nodes that the link enforces in run-time):

  • Port 0 must always be attached to Ground. This is an optional port in GunnsDraw, and GunnsDraw will automatically connect it to Ground when the port is not drawn.
  • Port 1 cannot be attached to Ground.

Other Rules (These are extra rules you should always try to follow):

  • The demand node must NOT be capacitive, so don't put any capacitors, tanks, accumulators, etc on that node.
  • The demand link should be used in the network with the smaller local capacitance - which is usually the network that has the smaller nearby volume.
  • In general, the interface location should be chosen where the supply network has a large nearby capacitance relative to the demanded flow rates. In other words, a location where typical interface flow rates will result in small pressure changes in the supply network. Such an interface is called "loosely coupled" because the demand network can't really affect the supply network. Loosely coupled interfaces are more stable. "Tightly coupled" interfaces, where even small demand flow rates cause large changes in the supply pressure, are very unstable and should be avoided whenever possible.
  • First test the interface for stability before applying either stability filter mode (see below). Most supply/demand interfaces, when chosen in a loosely-coupled location, work fine without needing either mode.

Configuration Data Parameters:

  • maxConductivity (default = 0.0 m2, must be >= 0): This is a base class attribute not used by the demand link, and should be left zero.
  • expansionScaleFactor (default = 0.0, must be (0-1)): Same as the GunnsFluidConductor term.
  • In order to improve stability, the demand link filters its effective conductivity based on the capacitance of the supply network. This filter has 2 modes:
    • The supply network's capacitance is received directly from the supply network via simbus (see useNetworkCapacitance in the GunnsFluidExternalSupply help page). In this mode filterMinConductivity, filterMinDeltaP and filterCapacitanceGain are not used and can keep their default values. This is the better mode and should be your first choice when more stability is needed.
    • NOTE: this is an obsolete mode only preserved for already-developed TS21 ISS network interfaces. Using the supply network capacitance directly provides superior stability and should be your first choice when extra stability is needed. When NOT receiving the supply network capacitance, this demand link attempts to estimate the supply network capacitance using a filter based on the last 2 pass data trends accounting for simbus lag. The estimated capacitance results in a new value for this link's effective conductivity, using these 3 config parameters:
      • filterMinConductivity (default = 1.0 m2, must be >= 0.0): Recommend using the default value.
      • filterMinDeltaP (default = 1.0E-8 kPa, must be >= 0.0): Recommend using the default value.
      • filterCapacitanceGain (default = 0.05, must be (0-1)): Recommend using the default value.
  • externalConfig (default = NULL, must != NULL): This must be set to the address of an External Fluid Config object that defines the types and order of fluid constituents in the supply network. This External Fluid Config object must be identical to the Internal Fluid Config of the supply network. This tells the demand link which fluid types and in what order the constituent mass fractions input from the supply link are. If the local network has the same fluid configuration as the external network, or if you are using this link standalone, you can reuse the network's Internal Fluid Config object.
  • convertToType (default = FluidProperties::NO_FLUID): similar to the GunnsFluidExternalSupply term.

Input Data Parameters:

  • malfBlockageFlag (default = false): Initial state of the blockage malfunction activation flag. This malfunction cuts off the pressure source to the demand node. A value of 1.0 completely isolates the supply & demand networks from each other.
  • malfBlockageValue (default = 0.0, must be (0-1)): Initial state of the blockage malfunction activation value.
  • The following terms can be used to specify the initial supply fluid properties, if desired. Normally, you'll pair this link with a Supply link as in the above picture, and these terms can be left with their default values. However, you can also use this link standalone without being pared to a Supply link. You can use the following parameters to set up the properties of a constant supply boundary condition on this link:
    • sourcePressure (default = 0.0 kPa): Same as GunnsFluidPotential. This specifies the initial supply pressure.
    • supplyCapacitance (default = 0.0 kg*mol/kPa): This specifies the initial supply capacitance. If this value is > DBL_EPSILON then the link will use this value as the supply network capacitance in its effective conductivity filter, as described above.
    • supplyTemperature (default = 0.0 K): This is the initial temperature of any supply fluid added to the node. If this value is < DBL_EPSILON, the link will use the demand node's initial temperature instead.
    • supplyMassFractions (default = 0): This is a pointer to an array specifying the initial mass fractions of any supply fluid added to the node. If this pointer is left 0 (NULL), then the fractions will be initialized to {1.0, 0.0 ...} instead. It is best to assign this array in the Trick Input File. NOTE: these fractions correspond to the externalConfig fluid types, not the network's Internal Fluid Config.

Common Problems

  • Pressure/flow oscillations: Oscillations in supply pressure and demand flow are very bad to have because they typically can go unconverged and can blow up both networks. This is the biggest stability risk in GUNNS fluid networks. This usually occurs in locations where the interface is too tightly coupled, i.e. not enough capacitance on the supply node. Try remedying a problem in this order:
    • First, make sure you are following the rules for using supply & demand links (see above).
    • Find a more loosely-coupled location to apply the interface.
    • If not doing so, use the useNetworkCapacitance flag in the supply link and provide its network capacitance to the demand link's stability filter (see above). This can fix some stability problems.
    • Increase the capacitance of the supply node by increasing the volume of the attached capacitor link. This is usually not the best option because it can add unrealistic volume to your system. Or,
    • Decrease the conductivities of links that attach the demand node to the rest of the demand network. This reduces the coupling between the networks at the expense of higher and possibly unreaslistic delta-pressures across the interface and reduced flow rates.
    • As a last resort, use the blockage malfunction with increasing values to de-couple the networks.
  • Mass fraction errors: Health & Status messages from this link or the demand node, especially in the flavor of "mass fractions do not sum to 1", are usually due to a mismatch between the externalConfig config data and the supply network's fluid config, or improper simbus ICD transfer of the supply link's supply mass fractions to the demand link's supply mass fractions arrays. These arrays are always sized to match the sender's array size, so the mSupplyMassFractions array writes & reads should transfer the full size of the supply link's mSupplyMassFractions array. Likewise, the mDemandMassFractions array writes & reads should transfer the full size of the demand link's mDemandMassFractions array.

References

  • N/A
⚠️ **GitHub.com Fallback** ⚠️