GunnsFluidShadow - nasa/gunns GitHub Wiki

GunnsFluidShadow

default_img

Background

This class inherits GunnsFluidPotential, and is placed on a node to force its fluid contents to match an externally supplied set of fluid properties. This causes the node to effectively shadow a fluid in an external network. It also outputs the node's fluid properties, so that it can be paired with another GunnsFluidShadow link, allowing two nodes to switch between shadowing each other. This is useful in a master/slave relationship between two networks.

This link is very similar to GunnsFluidExternalDemand but differs in a few key ways:

  • This link constrains the port 1 node fluid to the incoming fluid properties the same way fluid demand does, but does not output a demand flux.
  • The link has 2 modes, shadowing active and inactive. The port 1 node fluid is only set to the incoming fluid properties when shadowing is active. When the link is not shadowing, it outputs its node's fluid properties, but otherwise has no effect on the node.
  • Can accept incoming and format output fluid mixture information as either mass fractions, mole fractions, or partial pressures.

How To Use in GunnsDraw

This picture shows how the GunnsFluidShadow link should be connected to the node it controls.

default_img

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

  • Port 0 must connect to the Ground node. This port is optional. If not drawn, GunnsDraw will automatically connect it to the Ground node.
  • Port 1 must connect to a non-Ground node.

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

  • Unlike GunnsFluidExternalDemand, the port 1 node can be capacitive. In fact, for networks that use this link to shadow each other, capacitive nodes are the most important nodes to shadow.

Configuration Data Parameters:

  • maxConductivity: Same as GunnsFluidConductor. This should be set as an "ideal" pressure source, so we recomment a value of 1.0E+15.
  • expansionScaleFactor: Same as GunnsFluidConductor. The expansion effect is not modeled in this link and this term has no effect.
  • controlTarget (default = 0): This is the target value for the link's mShadowActiveControl to match for shadowing to be active. The mShadowActiveControl term is usually input from the user or another model via simbus, etc. When it equals controlTarget, shadowing is active, otherwise it is inactive. This allows two shadow links to switch between shadowing each other based on the same input term. For instance if one shadow link configures controlTarget = 1 and the other link = 0, then when the same mShadowActiveControl control is sent to both links and switches between 1 and 0, the two shadow links switch between shadowing each other.
  • mInputMixtureType (default = GunnsFluidUtils::MASS_FRACTION): This tells the link what format the incoming fluid mixture array is in (MASS_FRACTION, MOLE_FRACTION, or PARTIAL_PRESSURE) so it can format the data properly for its internal use when shadowing is active.
  • mOutputMixtureType (default = GunnsFluidUtils::MASS_FRACTION): This tells the link how to format the outgoing fluid mixture array (MASS_FRACTION, MOLE_FRACTION, or PARTIAL_PRESSURE) for use by the receiving party.
  • externalConfig
  • (default = NULL, must != NULL): Similar to GunnsFluidExternalDemand, this must be set to the address of an External Fluid Config object that defines the types and order of fluid constituents in the incoming fluid mixture array.
  • convertToType (default = FluidProperties::NO_FLUID): Same as GunnsFluidExternalSupply.

Input Data Parameters:

  • malfBlockageFlag: Same as GunnsFluidConductor. This malfunction only affects the "idealness" of the pressure source when shadowing is active. When fully blocked and shadowing is active, the link still controls the node contents mixture and temperature but cannot affect its pressure. This malfunction has no effect when shadowing is inactive.
  • malfBlockageValue: Same as GunnsFluidConductor.
  • sourcePressure (default = 0.0 (kPa), and non-zero magnitudes should be positive and between E-15 and E+15): This is the initial ideal source pressure value. It is usually overridden by incoming pressure information when shadowing is active.

Common Problems

  • N/A

References

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