////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] iNH3 (--) Value of the NH3 trace compound state.
/// @param[in] iCO (--) Value of the CO trace compound state.
///
/// @details  Constructs the trace compounds state union from the scalar value arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name    (--) Name of the network for H&S messages.
/// @param[in] network (--) Pointer to the main network object.
///
/// @details  Default constructs the DrawElect Network Config Data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] network (--) Pointer to the main network object.
///
/// @details  Default constructs the DrawElect Network Input Data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name (--) Name of the network for H&S messages.
///
/// @details  Default constructs the DrawElect Network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name    (--) Name of the network for H&S messages.
/// @param[in] network (--) Pointer to the main network object.
///
/// @details  Default constructs the DrawFluid Network Config Data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] network (--) Pointer to the main network object.
///
/// @details  Default constructs the DrawFluid Network Input Data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name (--) Name of the network for H&S messages.
///
/// @details  Default constructs the DrawFluid Network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] iGUNNS_N2 (--) Mass fraction of the GUNNS_N2 constituent in the composite fluid.
/// @param[in] iGUNNS_O2 (--) Mass fraction of the GUNNS_O2 constituent in the composite fluid.
/// @param[in] iGUNNS_WATER (--) Mass fraction of the GUNNS_WATER constituent in the composite fluid.
///
/// @details  Constructs the mass fraction union from the scalar mass fraction arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the fluid node
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Synchronizes the last pass values and generic node potential to be consistent with the
///           initial fluid properties that may have been set by any incident links.  This should
///           only be used at load start-up, not checkpoint/restart.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @throws   TsInitializationException
///
/// @details  Validates this Gunns Fluid Node initial state.  Exceptions are thrown for any errors.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] volume (m3) Desired node volume
///
/// @throws   TsInitializationException
///
/// @details  This method is used to initialize the node volume. Mass is updated to reflect the new
///           volume, keeping the other state parameters (Density, P, T) the same.  LastVolume is
///           reset to avoid compression from the volume change.  An exception is thrown if negative
///           volume is requested.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] volume (m3) Desired node volume
///
/// @throws   TsOutOfBoundsException, TsInitializationException
///
/// @details  Sets the volume of the node in run-time, to allow for flexible volume objects such as
///           accumulators, etc.  An exception is thrown if negative volume is attempted.  If either
///           the new or last volume are zero, then initVolume method is called to ensure that there
///           will be no compression effects working on zero mass.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  potential (kPa) New node potential (pressure)
///
/// @throws   TsInitializationException
///
/// @details  This updates the generic node object potential and fluid content pressure.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] expansionScaleFactor (--) Isentropic expansion effect scale factor (0-1)
///
/// @throws   TsOutOfBoundsException
///
/// @details  Sets the expansion scale factor.  An exception is thrown if the input argument is
///           outside of 0-1.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] mass (kg) Non-fluid equivalent thermal mass
///
/// @throws   TsOutOfBoundsException
///
/// @details  Sets the thermal damping mass.  An exception is thrown if the input argument is
///           negative.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  This function resets the flows incident on the node.  Current pressure is also saved
///           for next pass.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return   (kg*mol) Delta-temperature source vector contribution
///
/// @details  Computes the thermal capacitance of the node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return   (kg*mol) Compression source vector contribution.
///
/// @details  Computes the fluid compression of the node.  This is the effect of changing volume on
///           pressure.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fluxRate (kg/s) Node influx Rate
/// @param[in] fluid    (--)   Node inflow fluid
///
/// @details  This function adds an incoming fluid to the collection terms for the Node, mixing this
///           fluid's properties with what has been collected so far.  When the Node updates, it
///           will zero out the collection terms for next pass.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] tcIndex (--)   Index of the trace compound in the network's trace compounds.
/// @param[in] rate    (kg/s) Mass flow rate of the trace compound into the node.
///
/// @throws   TsOutOfBoundsException
///
/// @details  Sets the flow rate state of the given trace compound index to the given rate.  This is
///           for trace compound flows into or out of the node that are not associated with the
///           mInflow or mOutflow bulk fluid flows.  Throws exception if the given index is out of
///           range of the network's trace compounds or if there are no trace compounds in this
///           network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt          (s)  Integration time step.
///
/// @throws   TsInitializationException, TsOutOfBoundsException
///
/// @details  Calculates new fluid properties in a node as a result of inflows, outflows,
///           temperature, pressure & mixture changes.  Pressure is the only fluid property that is
///           not updated here, as that comes from the network solver.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return   (kPa) Pressure correction
///
/// @details  This method computes a correction to node pressure to flow out the accumulated mass
///           error.  There may be a small discrepancy between the actual mass and that predicted
///           by the equation of state from the solver's pressure.  This is due to the solver not
///           being able to perfectly solve for heat transfer, etc.  We correct this by resetting
///           node Pressure to that calculated by the new mass & temperature.  This is a very small
///           adjustment that is transparent to the users.  It is made to preserve perfect mass
///           balance.  Keep track of how big the adjustment is for debug purposes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name  (--)  Instance name for self-identification in messages.
///
/// @details  Default constructs this GUNNS Fluid Volume Monitor Spotter configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  linkPort (--) Which of the link's port nodes to monitor.
///
/// @details  Default constructs this GUNNS Fluid Volume Monitor Spotter input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  nodeList  (--)  Reference to the network node list.
/// @param[in]  link      (--)  Reference to the link of interest.
///
/// @details Default constructs this GUNNS Fluid Volume Monitor Spotter.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Deletes allocated memory objects
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Execution time step (not used).
///
/// @details  Copies desired properties from the node.  This is done post-solution so we'll see the
///           most recent balanced node properties.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                (--) Link name.
/// @param[in] nodes               (--) Network nodes array.
/// @param[in] defaultConductivity (--) Default conductivity of the link.
/// @param[in] selfSealing         (--) Self-seals when disconnected.
///
/// @details  Constructs the Basic Socket Config data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy from.
///
/// @details  Copy Constructs the Basic Socket Config data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1)
///
/// @details  Default constructs this Basic Socket input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Basic Socket input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the Basic Socket Object
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) Reference to Link Config Data
/// @param[in]     inputData    (--) Reference to Link Input Data
/// @param[in,out] networkLinks (--) Reference to the Network Link Vector
/// @param[in]     port0        (--) Port 0 Mapping
/// @param[in]     port1        (--) Port 1 Mapping
///
/// @throws   TsInitializationException
///
/// @details  Initializes the Basic Socket with config and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @throws   TsInitializationException
///
/// @details  During load initialization, there is an order dependency between GunnsBasicSocket and
///           GunnsBasicJumper objects.  The socket links must be initialized before the jumper
///           links, so that the sockets can return the proper nodes when the jumpers make their
///           initial socket requests.  To ensure that the order is correct, requestConnection and
///           requestDisconnection methods call this method before proceeding.  This method checks
///           the link's initialization flag and if it hasn't been set, an exception is thrown.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] plug (--) Pointer to the plug requesting the connection.
///
/// @returns  (--) Index of the Node to connect to.
///
/// @throws   TsInvalidStateTransitionException
///
/// @details  Processes a request from a GUNNS jumper plug to connect to the GUNNS Basic Node this
///           GUNNS Basic Socket link is connected to on port 0.  If the request is granted (there
///           is not another plug already connected), the index of the port 0 Node is returned, and
///           the socket stores the address of the plug as its active connection, otherwise an
///           exception is thrown which will cause the jumper to fail to connect to the node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] plug (--) Pointer to the plug requesting the disconnection.
///
/// @returns  (--) Index of the Node to connect to.
///
/// @details  Processes a request from a GUNNS jumper plug to disconnect from the GUNNS Basic Node
///           this GUNNS Basic Socket link is connected to on port 0.  The index of the ambient node
///           is always returned, so an unconnected plug may be moved from one ambient node to
///           another.  The socket's connection pointer is only reset to null if the plug was
///           the one actually connected.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @details  Updates the socket's conductivity based on connection state and whether it is self-
///           sealing.  Only a non-self-sealing socket that has no connection will have
///           conductivity.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name     (--) Link name
/// @param[in] nodeList (--) Network nodes structure
///
/// @details  Constructs the Basic Link Config data
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy Constructs the Basic Link Config data
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1)
///
/// @details  Default constructs this Basic Link input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Basic Link input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the Basic Link admittance map.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] numPorts (--) The number of ports the link has
///
/// @details  Constructs the Basic Link Object
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData (--) GUNNS Basic Link Config Data
/// @param[in,out] inputData  (--) GUNNS Basic Link Input Data
/// @param[in]     links      (--) Network links
/// @param[in]     ports      (--) Network port mapping array
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Basic Link with configuration and input data and sets up its
///           connectivity to the network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Performs reset of link attributes needed after a checkpoint load.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] portMap (--) Network port mapping array
/// @param[in] source  (--) Source of the port assignment command for output message (i.e. "user")
/// @param[in] verbose (--) Whether to output H&S messages indicating the move took place
///
/// @details  Assigns each port to the node position given by the portMap argument.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port  (--)  Port number to deactivate the override for.
///
/// @details  This sets the override flag for the given port false.  The link's potential vector is
///           left alone, assuming that the solver will return it to normal network solution values
///           after the next solution.  The port is checked for a valid port number and if it's
///           invalid, a warning message is sent an no other action taken.
///
///           Calling this method with default arguments results in the override flag being reset
///           for all ports.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] numNodes (--) Number of nodes in the array
/// @param[in] nodes    (--) The nodes array
///
/// @details  Default constructs the Gunns node list structure
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the basic node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name       (--) Node name
/// @param[in]     potential  (--) Initial potential
///
/// @throws   TsInitializationException
///
/// @details  Initializes this basic node with its name and initial potential.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Validates this Gunns Basic Node initial state.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  This method calculates the net and through flux terms for model insight.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Fluid Distributed Interface data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this Fluid Distributed Interface data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name          (--)  Link name.
/// @param[in] nodes         (--)  Network nodes array.
/// @param[in] isPairMaster  (--)  This is the master of the pair.
/// @param[in] useEnthalpy   (--)  Transport energy as specific enthalpy instead of temperature.
/// @param[in] demandOption  (--)  Demand mode option to trade stability for less restriction on flow rate.
/// @param[in] capacitorLink (--)  Pointer to the node capacitor link.
///
/// @details  Default GUNNS Fluid Distributed Interface Link Config Data Constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] nFluids  (--)  Number of primary fluid compounds override value.
/// @param[in] nTc      (--)  Number of trace compounds override value.
///
/// @details  Sets the fluid mixture sizes override flag true, and sets the primary and trace fluid
///           compound mixture sizes to the given values.  This is used to force the interface
///           fluid mixture arrays to different sizes then the sizes in the GUNNS fluid network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag   (--)  Blockage malfunction flag.
/// @param[in] malfBlockageValue  (--)  Blockage malfunction fractional value (0-1).
/// @param[in] forceDemandMode    (--)  Forces the link to always be in Demand mode.
/// @param[in] forceSupplyMode    (--)  Forces the link to always be in Supply mode.
///
/// @details  Default GUNNS Fluid Distributed Interface Link Input Data Constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default GUNNS Fluid Distributed Interface Link Constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default GUNNS Fluid Distributed Interface Link Destructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) Reference to link Config Data.
/// @param[in]     inputData    (--) Reference to link Input Data.
/// @param[in,out] networkLinks (--) Network links vector.
/// @param[in]     port0        (--) Network port 0.
///
/// @throws   TsInitializationException
///
/// @details  Initializes this Fluid Distributed Interface link with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  inputData (--) Reference to link Input Data.
///
/// @throws   TsInitializationException
///
/// @details  Validates this GUNNS Fluid Distributed Interface initial state.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  otherIf  (--)  Address of another GunnsFluidDistributedIf link to store.
///
/// @details  Pushes the given GunnsFluidDistributedIf link pointer onto the mOtherIfs vector.
///           Duplicate object, including this, are quietly ignored.  This is a convenience to allow
///           the same list of links to be passed to all links in a network from the input file.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Pre-network step calculations.  Processes the incoming data from the external
///           interface, flips modes and updates frame counters.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      pressure  (kPa)  Pressure to set the fluid to.
/// @param[in,out]  fluid     (--)   Pointer to the PolyFluid object to be set.
///
/// @throws   TsOutOfBoundsException
///
/// @returns  double (--) Sum of input bulk compound mole fractions, <= 1.
///
/// @details  Copies the incoming fluid state from the other side of the interface (mInData) into
///           the given fluid object and sets it to the given pressure.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Processes inputs from the other side of the interface when in supply mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Processes inputs from the other side of the interface when in demand mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  fluid  (--)  Fluid state to be output to the other side of the interface.
///
/// @returns  double (--)  Sum of all bulk and trace compound mole fractions, >= 1.
///
/// @details  Copies the given fluid state for output to the other side of the interface.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  End-of-network calculation of outputs to the other side of the interface when this
///           side is in Supply mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  End-of-network calculation of outputs to the other side of the interface when this
///           side is in Demand mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Calculates and sets the outgoing capacitance value.  This is the network capacitance
///           of the node, minus the effective capacitance added by this link in Demand mode (the
///           mSuppliedCapacitance), and minus the effective capacitance at our node added by other
///           links in Demand mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @details  Calculates this link's contributions to the network system of equations.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step (unused).
///
/// @details  Computes the flux across the link, sets port flow directions and schedules outflux
///           from the source node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step (unused).
///
/// @details  Updates mass flow rate and transports fluid from or to the node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned.
/// @param[in] node (--) The desired node to assign the port to.
///
/// @returns  bool  (--) Returns true if all rules checks pass
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           this specific class.  These are:
///           - A GunnsFluidDistributedIf must not map port 0 to the network vacuum node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fluid (--) Pointer to the fluid object to check.
///
/// @returns  bool (--)  True if any fractions are negative.
///
/// @details  Checks all the bulk and trace compound mixture fractions in the given fluid for any
///           negative values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name     (--) Link name
/// @param[in] nodeList (--) Network nodes structure
///
/// @details  Default constructs this Fluid Link configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Fluid Link configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1)
///
/// @details  Default constructs this Fluid Link input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Fluid Link input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] numPorts (--) The number of ports the link has
///
/// @details  Constructs the Fluid Link
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData (--) Configuration data
/// @param[in,out] inputData  (--) Input data
/// @param[in]     links      (--) Link vector
/// @param[in]     ports      (--) Port map indices
///
/// @throws   TsInitializationException
///
/// @details  Initializes this Fluid link with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] forcedOutflow (--) Indicates that this flow is leaving the node, but changes the
///                               mixture of the node (by only flowing out certain constituents), so
///                               this flow must be collected as an influx with negative flowrate,
///                               rather than a normal outflux.  Normal outfluxes cannot change the
///                               node mixture.
/// @param[in] fromPort      (--) The port the fluid is transported out of (defaults to 0)
/// @param[in] toPort        (--) The port the fluid is transported into (default to 1)
///
/// @details  This function adds the link's flow to the node's collection terms.
///
///           Flow is defined positive going from the fromPort to the toPort, so a positive flow
///           will add mass to port 1 and remove from port 0 (using default port arguments).
///
///           If mInternalFluid is not NULL, then this link is intended to modify the fluid as it
///           passes through, so we pass this fluid's address to the receiving node, as
///           mInternalFluid represents the exit properties of the link.  If mInternalFluid is NULL,
///           then we just pass the source node's fluid to the receiving node.
///
/// @note     No flux is transported if any of the ports don't exist.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @throws  TsInitializationException
///
/// @details  This method creates the link's internal fluid by copy-constructing one of the attached
///           node's content fluid.  However, we can't copy-construct the Vacuum node's contents,
///           so this method will throw an exception if all of the link ports are mapped to the
///           Vacuum node or otherwise have not been mapped.  This means that to create an internal
///           fluid, the link must be mapped to at least one non-Vacuum node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] initialFluidState (--) The desired initial properties of the internal fluid
///
/// @throws  TsInitializationException
///
/// @details  This overloaded method creates the link's internal fluid and then initializes its
///           properties with the given fluid input data.  The createInternalFluid() method is used,
///           so its port mapping limitations also apply.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) Link port number to access
///
/// @return  PolyFluid* Returns a pointer to the specified port node content fluid, or NULL if the
///                     port is invalid
///
/// @throws  TsOutOfBoundsException
///
/// @details Returns a pointer to the port Node fluid content.  If the user calls an out of index
///          value it will throw a TsOutOfBoundsException.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port   (--) The port to be updated
///
/// @details  Sets the port node pointer to the address of the node object number from the network
///           node list indicated by the port's node map.  This ensures the node pointed to always
///           matches the node map value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flow     (--) Mass flow or flux rate, only the sign (direction) is used
/// @param[in] fromPort (--) Link port that positive flow flows from
/// @param[in] toPort   (--) Link port that positive flow flows to
///
/// @returns   int      (--) Port whose node should supply the fluid properties for the flow,
///                          defaults to fromPort if flow = 0.
///
/// @details  Normally the node actually supplying the flow should supply its fluid properties as
///           the properties of the flow.  However if that node is the ground node, it has no valid
///           fluid properties, so instead use the other port's node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Execution time step (unused).
///
/// @throws   TsInitializationException
///
/// @details  This default implementation throws an exception, as all derived fluid links should
///           override this.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                   (--) Name of object.
/// @param[in] nodes                  (--) Pointer to nodes.
/// @param[in] maxConductivity        (m2) Max conductivity.
/// @param[in] expansionScaleFactor   (--) Scale factor for isentropic gas cooling.
/// @param[in] filterProportionalGain (--) (0-1) proportional gain for stability filter.
/// @param[in] enableReverseControl   (--) Flag to enable control in reverse flow direction.
///
/// @details  Default constructs this GUNNS Fluid Flow Controller link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Source object to copy.
///
/// @details  Copy constructs this GUNNS Fluid Flow Controller link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--)   Blockage malfunction flag
/// @param[in] malfBlockageValue (--)   Blockage malfunction fractional value (0-1)
/// @param[in] malfFlowRateFlag  (--)   Malfunction flow rate flag.
/// @param[in] malfFlowRateValue (kg/s) Malfunction flow rate value.
/// @param[in] flowRateCommand   (kg/s) Initial commanded flow rate.
///
/// @details  Default constructs this GUNNS Fluid Flow Controller link model input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  Source object to copy.
///
/// @details  Copy constructs this GUNNS Fluid Flow Controller link model input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @note     This should be followed by a call to the initialize method before calling an update
///           method.
///
/// @details  Default constructs this GUNNS Fluid Flow Controller link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      inputData   (--)  Input data.
/// @param[in,out]  links       (--)  Link vector.
/// @param[in]      port0       (--)  Nominal inlet port map index.
/// @param[in]      port1       (--)  Nominal outlet port map index.
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Flow Controller link model with configuration and input
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @throws   TsInitializationException
///
/// @details  Validates this GUNNS Fluid Flow Controller link model initial state.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Not used.
///
/// @details  Updates this GUNNS Fluid Flow Controller link model conductivity to cause flow through
///           the link that approaches the input commanded rate.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag   (--)    Malfunction activation flag.
/// @param[in] value  (kg/s)  Desired mass flow rate.
///
/// @details  Arguments are defaulted to deactivate the malfunction, so you can conveniently turn
///           it off by calling setMalfFlowRate().
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Builds the source vector terms of the link's contribution to the network.  This sign
///          convention creates positive flow from port 0 to port 1.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                  (--)  Link name
/// @param[in] nodes                 (--)  Network nodes array
/// @param[in] maxConductivity       (m2)  Maximum possible effective conductivity of the link
/// @param[in] expansionScaleFactor  (--)  Isentropic gas expansion scale factor
/// @param[in] controlTarget         (--)  The value the control must match to activate shadowing
/// @param[in] inputMixtureType      (--)  Type of the input fluid constituent partials
/// @param[in] outputMixtureType     (--)  Type of the output fluid constituent partials
/// @param[in] externalConfig        (--)  Pointer to the external network fluid config
/// @param[in] convertToType         (--)  Fluid type to convert extra external constituents into
///
/// @details  Default GUNNS Fluid Shadow Config Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  GUNNS Fluid Shadow Config Data Copy Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--)  Blockage malfunction flag
/// @param[in] malfBlockageValue (--)  Blockage malfunction fractional value (0-1)
/// @param[in] sourcePressure    (kPa) Initial pressure rise of the link
///
/// @details  Default GUNNS Fluid Shadow Input Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Input source to copy
///
/// @details  Copy constructs this Fluid Shadow input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default GUNNS Fluid Shadow Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default GUNNS Fluid Shadow Destructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Handles the incoming external fluid properties read from the sim bus.  Data is moved
///          from the sim bus input members into the link internal members.  If the external fluid
///          properties update at a different rate than this network, we always want their latest
///          properties regardless of how often it runs, therefore we don't use a queue in the sim
///          bus.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Handles data written to the external network's supply link, via the sim bus.  Data is
///          moved from the demand node into the sim bus output members.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Updates the State of the Link during the step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned
/// @param[in] node (--) The desired node to assign the port to
///
/// @returns  bool  (--) Returns true if all rules checks pass
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           this specific class.  These are:
///           - A GunnsFluidShadow must map port 0 to the network vacuum node.
///           - A GunnsFluidShadow must not map port 1 to the network vacuum node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] pressure    (kPa) The pressure of the input fluid
/// @param[in] temperature (K)   The temperature of the input fluid
/// @param[in] mixture     (--)  The generic constituent partials of the input fluid
///
/// @throws   TsOutOfBoundsException
///
/// @details  Sets the input fluid properties equal to an external supply, as an alternative to
///           using the sim bus.  These fluid properties will be processed by the processInputs
///           method just as if they had been set via the sim bus prior to the network step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] pressure    (kPa) The pressure of the input fluid
/// @param[in] temperature (K)   The temperature of the input fluid
/// @param[in] mixture     (--)  The generic constituent partials of the input fluid
///
/// @throws   TsOutOfBoundsException
///
/// @details  Returns the output fluid properties by argument, as an alternative to using the sim
///           bus.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] potentials (--) Array of node potentials to use for SLAVE mode.
///
/// @details  This copies the values from the given array into mSlavePotentialVector, but only when
///           the solver is in SLAVE mode, otherwise does nothing.  This assumes that the given
///           potentials array is as large as the network size.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return   std::string (--) A list of various modes and their states as a string.
///
/// @details  This string includes the solver mode, island mode, and run mode.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                  (--) Link name
/// @param[in] nodes                 (--) Network nodes array
/// @param[in] externalConfig        (--) Pointer to the external network's fluid config data
/// @param[in] convertToType         (--) Fluid type to convert extra external constituents to
/// @param[in] useNetworkCapacitance (--) Causes mSupplyCapacitance to be available for external demands
///
/// @details  Default GUNNS Fluid External Supply Config Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  GUNNS Fluid External Supply Config Data Copy Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag      (--)   Blockage malfunction flag
/// @param[in] malfBlockageValue     (--)   Blockage malfunction fractional value (0-1)
/// @param[in] flowDemand            (kg/s) Initial demanded mass flow rate of the link
/// @param[in] demandTemperature     (K)    Initial demand temperature
/// @param[in] demandMassFractions   (--)   Initial demand mass fractions
/// @param[in] demandTcMoleFractions (--)   Initial demand trace compounds mole fractions
///
/// @details  Default constructs this Fluid External Supply input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Fluid External Supply input data.
///
/// @note  This is a shallow copy, mDemandMassFractions will point to the same address as the source
///        object's pointer.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Constructs the Link
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Destructs the Link
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Handles data read from the external network's demand link, via the sim bus.  Data is
///          moved from the storage terms input from simbus into the link internal members.  The
///          demand flow rate is supported as either a mass flow (mFlowDemand) or molar flow
///          (mDemandFlux) rate.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Handles data written to the external network's demand link, via the simbus.  Data is
///          moved from the supply node's content into the storage terms for output to simbus.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Not used.
///
/// @details  Updates the link during the time step.
///
/// @note     The blockage malfunction is deliberately not implemented, so that we are forced to
///           send the same flux as the external network demands in order to conserve mass.  To
///           block the flux across the interface, use the malfunction on the demand link side.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Not used.
///
/// @details  Transports the flows across the link.  This overrides the base class implementation in
///           two important ways: 1) updateFluid is not called, as this class is not meant to modify
///           the fluid, 2) this version cannot force a mixture change in the port 1 node if the
///           internal fluid mixture is different from the port 1 node content.  This is an
///           important distinction: if the external network has a different fluid configuration
///           than ours, the constituents in our network that aren't present in the external network
///           will be missing from our internal fluid (as our internal fluid state comes from the
///           external network).  We want flow from our network to the external network to move all
///           of our constituents out of our network, even if it is converted to another fluid type
///           in the external network.
///
/// @note     Volumetric flow and hydraulic power are not calculated for this link, as they would
///           match the GunnsFluidExternalDemand that this link is paired to.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned
/// @param[in] node (--) The desired node to assign the port to
///
/// @returns  bool  (--) Returns true if all rules checks pass
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           this specific class.  These are:
///           - A GunnsFluidExternalSupply must not map port 0 to the network vacuum node.
///           - A GunnsFluidExternalSupply must map port 1 to the network vacuum node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] linkNumPorts (--) Number of ports in the link.
///
/// @details   Default constructs this minor step link data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return  std::string (--) Text representation of the link solution result enumeration.
///
/// @details  Returns a text string representation of the link's solution result enumeration value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] networkSize  (--) Number of rows in the network system of equations.
/// @param[in] numLinks     (--) Number of links in the network.
/// @param[in] links        (--) Array of pointers to the network links.
///
/// @details   Default constructs this minor step data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  std::string  (--)  Network solution result as a string.
///
/// @details  Returns a text string representation of the network solution result enumeration
///           value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  modeCommand  (--)  Commanded operating mode.
/// @param[in]  logSteps     (--)  Number of minor steps to record in each log.
/// @param[in]  path         (--)  File system relative path for output files to go.
///
/// @details  Default constructs this minor step input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the GUNNS Solver Minor Step Log.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  networkSize  (--)  Number of nodes in the network, not counting the ground node.
/// @param[in]  numLinks     (--)  Number of links in the network.
/// @param[in]  links        (--)  Array of pointers to the network links.
///
/// @throws  TsInitializationException
///
/// @details  Initializes this GUNNS Solver Minor Step Log.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Handles user mode commands and most state moding at the beginning of the solver major
///           step.  Pauses and resumes recording in response to commands, and initiates log file
///           write for the SNAP command.
///
/// @note  This should be the first function called by the solver in a major step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  majorStep  (--)  Major step count.
/// @param[in]  minorStep  (--)  Minor step count in the current major step.
///
/// @details  If recording is enabled, calls the step function to advance the ring buffer to the
///           next step, and record the major and minor step values for the new step.  Also records
///           CONFIRM for initial link results; these may be overwritten later in the step by the
///           solver.
///
/// @note  This should be the first function called by the solver in a minor step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  potential (--) Array of network solution potentials.
///
/// @details  If recording is enabled, records the given solver potential vector to the ring buffer
///           head.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  nodesConvergence (--) Array of network solution node convergence values.
///
/// @details  If recording is enabled, records the given solver nodes convergence array to the ring
///           buffer head.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  If recording is enabled, records all of the link's current admittance matrix and
///           source vector values to the ring buffer head.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  link    (--)  Index of the link to record.
/// @param[in]  result  (--)  The indexed link's solution confirmation result.
///
/// @details  If recording is enabled, records the given solution result for the given link index to
///           the ring buffer head.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  result  (--)  The link solution confirmation result to record for all links.
///
/// @details  If recording is enabled, records the given solution result for all of the network
///           links to the ring buffer head.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  decomposition  (--)  Decomposition count in the current major step.
/// @param[in]  result         (--)  Solution result of the minor step.
///
/// @details  If recording is enabled, records the given network solution result and decomposition
///           count to the ring buffer head.
///
/// @note  This should be the last function called by the solver in a minor step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  After the solver major step has completed, this initiates log file write from the
///           RECORD_AUTO state if the latest record has any non-success indication from the solver.
///
/// @note  This should be the last function called by the solver in a major step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Writes the output file if the output file name has been set.  This method should be
///           called in an asynchronous thread that does not interfere with the real-time GUNNS
///           network thread.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  If the commanded size is different from the current buffer size, then clear the buffer
///           vector and refill the vector with fill data to the new given size.  The startLogging
///           function is called to reset the buffer head and valid frames count, and enable
///           recording from the solver.
///
/// @note  This should only be called in simulation initialization or freeze, because it can take
///        a long time complete and could cause frame overruns if called during run.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name         (--)  Name of the object.
/// @param[in]  networkSize  (--)  Number of nodes in the network, not counting the ground node.
/// @param[in]  numLinks     (--)  Number of links in the network.
/// @param[in]  links        (--)  Array of pointers to the network links.
///
/// @throws  TsInitializationException
///
/// @details  Validates the initialization data for this GUNNS Solver Minor Step Log, and stores the
///           given object name.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Builds the header row for the output file.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  std::string (--) Formatted log data output with comma separated values and newlines.
///
/// @details  Returns the recorded data log as a csv format, with comma separated values and
///           newlines.  One row of data for each valid minor step of data, starting at the tail
///           and ending at the head of the buffer.  The first row is column labels.
///
/// @note  If the mIsRecording flag is set, meaning recording from the solver is active, this will
///        not return the logged data, and instead return a failure message.  This helps ensure
///        that data frames will not be recorded while the output file is still being written.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Initiates the file write by pausing recording, moding to the WRITING_FILE state and
///           sending the output filename to the asynchronous file output function (updateAsync),
///           which triggers the actual file write.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name  (--) Link name
/// @param[in] nodes (--) Network nodes array
///
/// @details  Default GUNNS Fluid Source Config Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  GUNNS Fluid Source Config Data Copy Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--)   Blockage malfunction flag
/// @param[in] malfBlockageValue (--)   Blockage malfunction fractional value (0-1)
/// @param[in] flowDemand        (kg/s) Initial demanded mass flow rate of the link
///
/// @details  Default constructs this Fluid Source input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Fluid Source input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) GUNNS Fluid Source Config Data
/// @param[in]     inputData    (--) GUNNS Fluid Source Input Data
/// @param[in,out] networkLinks (--) Network links
/// @param[in]     port0        (--) Network port 0
/// @param[in]     port1        (--) Network port 1
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Source with configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Updates the link during the time step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Computes the flow rate across this link and schedules flow demand from source nodes.
///           Mole flow rate (mFlux) is already calculated in the step method as the input to the
///           system of equations.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Updates final flow properties and transports fluid from source to sink nodes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                (--) Link name
/// @param[in] nodes               (--) Network nodes array
/// @param[in] defaultConductivity (--) Default conductivity of the link
///
/// @details  Constructs the Basic Potential Config data
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy from
///
/// @details  Copy Constructs the Basic Potential Config data
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1)
/// @param[in] sourcePotential   (--) Initial potential rise of the link
///
/// @details  Default constructs this Basic Potential input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Basic Potential input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the Basic Potential Object
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) Reference to Link Config Data
/// @param[in]     inputData    (--) Reference to Link Input Data
/// @param[in,out] networkLinks (--) Reference to the Network Link Vector
/// @param[in]     port0        (--) Port 0 Mapping
/// @param[in]     port1        (--) Port 1 Mapping
///
/// @throws   TsInitializationException
///
/// @details  Initializes the basic potential link with config and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Updates the link during the time step
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Protected method for building the admittance and potential terms
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name  (--)  Instance name for self-identification in messages.
///
/// @details  Default constructs this GUNNS Basic Island Analyzer Spotter configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  nodeList  (--)  Reference to the network node list.
///
/// @details Default constructs this GUNNS Basic Island Analyzer Spotter.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  configData  (--)  Instance configuration data.
///
/// @returns  GunnsBasicIslandAnalyzerConfigData (--) Type-casted and validated config data pointer.
///
/// @throws   TsInitializationException
///
/// @details  Type-casts the base config data class pointer to this spotter's config data type,
///           checks for valid type-cast and validates contained data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  inputData  (--)  Instance input data.
///
/// @returns  GunnsBasicIslandAnalyzerInputData (--) Type-casted and validated input data pointer.
///
/// @throws   TsInitializationException
///
/// @details  Type-casts the base input data class pointer to this spotter's input data type,
///           checks for valid type-cast and validates contained data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Execution time step (unused).
///
/// @details Calls the analyze method to to perform its island analysis after the network solution.
///          Resets the state data each pass, then only analyzes the island if the attached node is
///          a valid non-ground node number.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Clear & initialize state parameters prior to analyzing the island.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Determines details about the attached island.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                (--) Link name.
/// @param[in] nodes               (--) Network nodes array.
/// @param[in] defaultConductivity (--) Default conductivity of the link.
/// @param[in] plug0               (--) Pointer to jumper plug for port 0.
/// @param[in] plug1               (--) Pointer to jumper plug for port 1.
/// @param[in] selfSealing0        (--) Plug 0 self-seals when un-plugged.
/// @param[in] selfSealing1        (--) Plug 1 self-seals when un-plugged.
///
/// @details  Constructs the Basic Jumper Config data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy from.
///
/// @details  Copy Constructs the Basic Jumper Config data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag.
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1).
/// @param[in] connection0       (--) Index of the initial plug 0 socket.
/// @param[in] connection1       (--) Index of the initial plug 1 socket.
///
/// @details  Default constructs this Basic Jumper input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  Copy constructs this Basic Jumper input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Constructs the Basic Jumper Object
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) Reference to Link Config Data.
/// @param[in]     inputData    (--) Reference to Link Input Data.
/// @param[in,out] networkLinks (--) Reference to the Network Link Vector.
/// @param[in]     port0        (--) Port 0 Mapping.
/// @param[in]     port1        (--) Port 1 Mapping.
///
/// @throws   TsInitializationException
///
/// @details  Initializes the Basic Jumper with config and input data.
//////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @throws   TsOutOfBoundsException
///
/// @details  Updates the jumper's conductivity based on the plug connection states and whether the
///           plugs are self-sealing.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @throws   TsOutOfBoundsException
///
/// @details  Updates the plugs and maps link ports to the connected nodes if they have changed.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                 (--) Link name
/// @param[in] nodes                (--) Network nodes array
/// @param[in] maxConductivity      (m2) Maximum possible effective conductivity of the link
/// @param[in] expansionScaleFactor (--) Scale factor for isentropic cooling across the link (0-1)
/// @param[in] pressureExponent     (--) Exponent on the flow equation pressure term
///
/// @details  Default GUNNS Fluid Conductor Config Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Input source to copy
///
/// @details  Copy constructs this Gunns Fluid Conductor configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--) Blockage malfunction flag
/// @param[in] malfBlockageValue (--) Blockage malfunction fractional value (0-1)
///
/// @details  Default GUNNS Fluid Conductor Input Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Input source to copy
///
/// @details  Copy constructs this Fluid Conductor input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default Gunns Fluid Conductor Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     configData   (--) GUNNS Fluid Conductor Config Data
/// @param[in]     inputData    (--) GUNNS Fluid Conductor Input Data
/// @param[in,out] networkLinks (--) Network links
/// @param[in]     port0        (--) Network port 0
/// @param[in]     port1        (--) Network port 1
///
/// @throws   TsInitializationException
///
/// @details  This method initializes this Fluid Conductor with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @throws   TsInitializationException
///
/// @details  Validates this GUNNS Fluid Conductor initial state.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Calls step on the fluid conductor to update the state and compute a new conductivity
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Applies a linearization of the fluid momentum equation to create the non-linear
///           relationship between flow and pressure over multiple network steps.
///
/// @returns  double  (kg*mol/kPa/s)  Linearized molar conductance.
///
/// @note     This method is virtual for the derived classes needing a different linearization or
///           none at all.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Builds the Admittance Matrix for the link
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Computes the flow rate across this link and schedules flow demand from source nodes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flowRate (kg/s) Desired flow rate to tune the link to
///
/// @details  This method sets the link conductivity such that it will create the desired flow rate
///           at the current network conditions, and resets the blockage malfunction if it was
///           active, so that the blockage will not interfere with the desired rate.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  numLinks  (--)  The number of links in the network.
/// @param[in]  numNodes  (--)  The number of nodes in the network, including the Ground node.
///
/// @details  Default constructs this GUNNS Fluid Flow Orchestrator.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Flow Orchestrator.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name         (--)  Instance name for messages.
/// @param[in]  links        (--)  Pointer to the network links.
/// @param[in]  nodes        (--)  Pointer to the network nodes.
/// @param[in]  linkNodeMaps (--)  Pointer to the network links node maps.
/// @param[in]  linkNumPorts (--)  Pointer to the network links number of ports.
///
/// @details  Initializes this Fluid Flow Orchestrator.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @throws  TsOutOfBoundsException
///
/// @details  See the class details.  More notes:
///
///           When a node is not overflowing, outflow links take the node's previous content state
///           before the node's inflows are mixed in.  However if a node is overflowing, then the
///           node's inflows are mixed in before the outflowing link updates, so the outflow link
///           takes the node's final mixed state.
///
///           This will throw a TsOutOfBoundsException when we have to emergency break out of the do
///           loop to avoid an infinite loop.  This may leave some fluid transport and node state
///           balancing unfinished.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @throws   TsOutOfBoundsException
///
/// @returns  bool  (--)  True if all nodes and links are complete.
///
/// @details  Checks completion of all nodes and links.  Updates the incomplete link count.  Breaks
///           a loop of overflowing nodes by forcing links to complete early until the loop is
///           broken.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  bool  (--)  True if all nodes are complete.
///
/// @details  Loops over all nodes and returns false as soon as one is found to be incomplete.  If
///           the loop finished and none were found incomplete, returns true.
///
/// @note     This method is only virtual to allow for manipulation in the unit test.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @throws   TsOutOfBoundsException
///
/// @returns  int  (--)  The index of the first link that has not completed.
///
/// @details  Finds the first link that has not completed.  Because all links should have been
///           completed before the last node is updated, then this function shouldn't be called if
///           there are no incomplete links.  If there still are none, then there is a problem,
///           probably some nodes stuck not completing.  Then we throw an exception to break us out
///           of a potential infinite do loop.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  link  (--)  Index of the link to check.
///
/// @returns  bool  (--)  True if the link is ready to do flow transport.
///
/// @details  Determines whether the link is ready to do its flow transport.  The link is ready when
///           all of its source nodes are either complete, or otherwise not overflowing.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  node  (--)  Index of the node to check.
///
/// @returns  bool  (--)  True if the node is ready to do flow integration.
///
/// @details  Determines whether a node is ready to do its flow integration.  The node is ready when
///           all of its input flow links are complete.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  int  (--)  Number of incomplete links.
///
/// @details  Counts the number of false (incomplete) flags in the links completion states array.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  name  (--)  Instance name for self-identification in messages.
///
/// @details  Default constructs this GUNNS Fluid Island Analyzer Spotter configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  nodeList  (--)  Reference to the network node list.
///
/// @details Default constructs this GUNNS Fluid Island Analyzer Spotter.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Island Analyzer Spotter.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name     (--) The name of the plug object for error messages.
/// @param[in] listSize (--) The number of sockets that will be in the list.
///
/// @details  Default constructs this Fluid Jumper Plug.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @throws   TsOutOfBoundsException
///
/// @details  Processes a direct connect request for this Plug.
///
/// @note     Unlike the connection and disconnection requests, which are meant to be applied
///           occasionally and asynchronously, the direct connection request is a continuously
///           applied command.  As such, the command term is only reset every pass when it is
///           disabled, and this allows the user to manually inspect that the command has been
///           received by the plug when it is enabled.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  double  (s)  A clock time value.
///
/// @details  In the Trick environment, returns the Trick's clock_time() value converted to units of
///           seconds.  In non-Trick environments, returns the value of mClockTime.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  bool  (--)  A monte carlo slave flag.
///
/// @details  In the Trick environment, returns the Trick's mc_is_slave() value.  In non-Trick
///           environments, returns the value of mMcIsSlave.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  int  (--)  A monte carlo slave ID value.
///
/// @details  In the Trick environment, returns the Trick's mc_get_slave_id() value.  In non-Trick
///           environments, returns the value of mMcSlaveId.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[out]  var  (--)  A double value read from the monte carlo data buffer.
///
/// @details  In the Trick environment, returns the next double from the MC Slave-to-Master data
///           buffer.  In non-Trick environments, pops the back off of the mMcRead vector and
///           returns its value.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  var  (--)  A double value written to the monte carlo data buffer.
///
/// @details  In the Trick environment, writes the given value to the MC Slave-to-Master data
///           buffer.  In non-Trick environments, pushes the value to the back of the mMcWrite
///           vector.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  std::vector<double> (--) An empty vector of doubles.
///
/// @details  Constructs and returns an empty vector of doubles, used elsewhere for static
///           definition.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name                 (--) Link name
/// @param[in] nodes                (--) Network nodes array
/// @param[in] expansionScaleFactor (--) Scale factor for isentropic gas cooling (0-1)
///
/// @details  Default GUNNS Fluid Capacitor Config Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy
///
/// @details  GUNNS Fluid Capacitor Config Data Copy Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag   (--) Blockage malfunction flag
/// @param[in] malfBlockageValue  (--) Blockage malfunction fractional value (0-1)
/// @param[in] initialVolume      (m3) Maximum possible effective conductivity of the link
/// @param[in] initialFluidState  (--) Initial state of the port 0 node contents
///
/// @details  Default GUNNS Fluid Capacitor Input Data Constructor
////////////////////////////////////////////////////////////////////////////////////////////////////