GunnsFluidSensor - nasa/gunns GitHub Wiki

GunnsFluidSensor

default_img

Background

This link extends GunnsFluidConductor with extra data attributes for output to sensor models:

  • mTemperature (K) that stores the temperature of the Port 0 node contents.
  • mPressure (kPa) that stores the absolute pressure of the Port 0 node contents.
  • mDeltaPressure (kPa) that stores the difference in pressure between the Port 0 and Port 1 node contents.
  • mPartialPressure (kPa), and array that stores the constituent partial pressures of the Port 0 node contents.
  • mMassFlowRate (kg/s) that stores the mass flow rate from Port 0 to Port 1.
  • mVolumetricFlowRate (m3/s) that stores the true volumetric flow rate from Port 0 to Port 1.

The link does not modify the mixture of the fluid passing through it.

How To Use in GunnsDraw

The GunnsFluidSensor can be hooked up to nodes in exactly the same ways that regular fluid conductors can. Typical uses of the sensor link are shown below. The default text label of the shape is a "P", but this can be changed in the TypeLabel shape data. This can be used to document to the user what parameters are being sent to the sensor models.

default_img

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

  • Ports 0 and 1 cannot connect to the same non-Ground node.
  • Port 1 is optional. If not drawn, GunnsDraw will automatically connect Port 1 to the Ground node.

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

  • Do not mix fluid phases across the link. That is, both nodes should contain the same phase (gas or liquid), and not different phases.
  • Note: remember that this link is a conductor and will flow between the nodes if maxConductivity is not zero! In some applications like absolute pressure & temperature sensors, you'll want zero flow through the link.
  • For all pressure parameters, always have some non-zero volume on the nodes being measured. This is because non-capacitive nodes can sometimes have their pressures go undefined. This volume can be very small (> DBL_EPSILON) if need be.
  • Absolute pressure and temperature sensors only look at the Port 0 node, so Port 1 is typically attached to Ground. In this case, make sure to set the maxConductivity term to zero to avoid leaking flow between the nodes. Sometimes it is desirable to have a small non-zero conductivity to simulate a broken or leaky diaphram in a delta-pressure sensor, etc.
  • Delta- and gauge- pressure sensors need to measure the difference between two nodes, so Port 1 is usually attached to a non-Ground node. The link's mDeltaPressure parameter measures the Port 0 pressure minus the Port 1 pressure, so it is used for reporting gauge pressure. The link's mPressure term measures the absolute pressure of the Port 0 node, regardless of whether Port 1 is connected to Ground or any other node.
  • The mass and volumetric flow rate parameters only work if there is flow through the link, so for these applications, arrange the link in series with the flow to be measured and an appropriately tuned maxConductivity. As with other fluid conductors, try to merge multiple conductors in series into this link to reduce the network node count.

Configuration Data Parameters:

  • maxConductivity: Same as GunnsFluidConductor. Note that in some applications you'll want to set this to zero to avoid flow leaking through the sensor link.
  • expansionScaleFactor: Same as GunnsFluidConductor.

Input Data Parameters:

Common Problems

  • N/A

References

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