////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that  (--)  Source to copy.
///
/// @details  Copy constructs this GUNNS Fluid Phase Change Source 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 Phase Change Source link model with obviously
///           invalid data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Phase Change Source 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.
///
/// @return      void
///
/// @throws      TsInitializationException
///
/// @details     Initializes this GUNNS Fluid Phase Change Source link model with configuration and
///              input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
///
/// @return      void
///
/// @throws      TsInitializationException
///
/// @details     Validates the initialization of this GUNNS Fluid Phase Change Source link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned
/// @param[in] node (--) The desired node to assign the port to
///
/// @return   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:
///           - Neither port may be mapped to the network's vacuum/ground node.
///           - A GunnsFluidPhaseChangeSource must map port 0 to a liquid node.
///           - A GunnsFluidPhaseChangeSource must map port 1 to a gas node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step
///
/// @return   void
///
/// @details  Computes the mass flow of phase change based on input power, and contributions to the
///           system of equations.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step
///
/// @details  Computes the flows across the link.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step
///
/// @details  transports the flows across the link.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] forcedOutflow (--) not used.
/// @param[in] fromPort      (--) not used.
/// @param[in] toPort        (--) not used.
///
/// @details  This function adds the phase-change flow to the node's collection terms.
///
///           Flow is defined positive going from the Port 0 to Port 1, so a positive flow
///           will add mass to port 1 and remove from port 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Builds the Admittance Matrix for the link.   This is the same as a regular fluid
///           conductor - a conductive path between ports 0 and 1.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Sorption Bed Sorbate.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] properties  (--)        Pointer to the sorbate properties object.
/// @param[in] fluidIndex  (--)        Index of this sorbate in the fluid constituents.
/// @param[in] tcIndex     (--)        Index of this sorbate in the trace compounds.
/// @param[in] loading     (kg*mol/m3) Initial sorbate loading.
/// @param[in] volume      (m3)        Effective volume of sorbant.
/// @param[in] fluid       (--)        Pointer to the link internal fluid.
///
/// @details  Initializes this sorption bed sorbate.  Caller must ensure that the initial loading
///           value is >= 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] sorbates  (--) Array of all sorbate types in the sorption bed.
/// @param[in] nSorbates (--) Size of the sorbates array.
///
/// @details  Stores pointers to the other sorbates that interact with this sorbate in the bed as
///           blocking compounds, so that we can reference them and compute their effect in
///           updateLoadingEquil.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  pp          (kPa)  Partial pressure of the sorbate in the freestream.
/// @param[in]  temperature (K)    Temperature of the freestream.
///
/// @details  Computes & stores the equilibrium loading of the sorbate under current conditions,
///           using the Toth isotherm equation for this sorbate-sorbant pair, and including the
///           effect of blocking compounds.
///
/// @note  The caller must ensure temperature > 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] timestep    (s)           Integration time step.
/// @param[in] inFlux      (kg*mol/m3/s) Flow rate of sorbate in the freestream prior to sorption.
/// @param[in] desorbLimit (kg*mol/m3/s) Limit on desorption rate, as positive value > 0.
///
/// @details  Computes & stores the current loading rate, limited to the incoming freestream mass
///           (for adsorption) or the loaded mass (for desorption), and integrates it into the
///           updated loading and loading fraction terms.
///
/// @note  The caller must ensure timestep > 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fluid (--) Pointer to the fluid object.
///
/// @returns  double (--) Mole fraction of this sorbate in the given fluid.
///
/// @details  The sorbate can exist in the network as a bulk fluid and/or a trace compound.  This
///           sums both the bulk fluid's and the trace compound's mole fractions, whichever are
///           present.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  volume  (m3)  Volume of sorbing sorbant in the segment.
///
/// @details  Updates the loaded mass from the loading, sorbant volume, and sorbate molecular weight
///           and updates the adsorption rate from the loading rate and sorbant volume.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Resets non-checkpointed and non-configuration data values post-checkpoint load.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name    (--)  Reference to the segment object name.
/// @param[in] sorbant (--)  Pointer to the Sorbant Properties in this segment.
/// @param[in] volume  (m3)  Total volume of this segment including sorbant material and voids.
/// @param[in] htc     (W/K) Convective heat transfer coefficient between the sorbant and the fluid stream.
///
/// @details  Constructs this Sorption Bed Segment Configuration Data with arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Reference to the object to be copied.
///
/// @details  Copy constructs this Sorption Bed Segment Configuration Data from the given object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] segment (--)        The segment number to load.
/// @param[in] sorbate (--)        The sorbate compound type to load.
/// @param[in] loading (kg*mol/m3) The initial loading amount.
///
/// @details  Constructs this Sorption Bed Segment Input Data with arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Reference to the object to be copied.
///
/// @details  Copy constructs this Sorption Bed Segment Input Data from the given object.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Sorption Bed Segment.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] configData  (--) Reference to the configuration data for this bed segment.
/// @param[in] fluidConfig (--) Pointer to the network fluid configuration (unused).
/// @param[in] loading     (--) Reference to vector of initial sorbate loadings.
///
/// @throws   TsInitializationException
///
/// @details  Initializes this sorbant segment with given values.  Sorbates are optional in the
///           network.  They can either be present as bulk fluid types, trace compounds or both,
///           or they can be missing entirely if they're not desired to be modeled.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in, out] flowIn   (kg/s) Total gas mass flow rate through this segment, always >= 0.
/// @param[in]      pIn      (kPa)  Gas pressure at the inlet to this segment.
/// @param[in]      pOut     (kPa)  Gas pressure at the exit of this segment.
/// @param[in]      timestep (s)    Integration time step.
///
/// @details  Updates the state of this sorbate segment, computes exit fluid properties and heat
///           transfer with the wall.
//TODO break this up, get the cyclo complex down...
//TODO note design limitation on desorption of trace compounds.  Because we can't create bulk flow
//     when only desorbing trace compounds, mass isn't conserved.  Workaround is to have the user
//     create a small leak flow from the pressurized cabin side through this link, by using a
//     selective membrane link allowing N2 or some other inert fluid relative to our sorbants, to
//     create a small bulk flow to allow TC's to desorb into.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] fluidIndex (--)       Index of the compound in the network bulk fluids.
/// @param[in] tcIndex    (--)       Index of the compound in the trace compounds.
/// @param[in] mdotInBulk (kg/s)     Incoming sorbate bulk fluid mass flow rate before exchange.
/// @param[in] ndotInTc   (kg*mol/s) Incoming sorbate trace compound mole flow rate before exchange.
/// @param[in] dndot      (kg*mol/s) Mole rate of sorbate added to the fluid.
/// @param[in] molWeight  (1/mol)    Molecular weight of the compound.
///
/// @returns  double (m/s) mass rate added (desorbed) to the bulk fluid.
///
/// @details  Updates the compound mass in mFluid.  Only the masses of the bulk fluid constituents
///           and trace compounds are set here, and their mixture fractions must be updated later.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                 (--) Name of object.
/// @param[in,out] nodes                (--) Pointer to nodes.
/// @param[in]     maxConductivity      (m2) Maximum conductivity.
///
/// @details  Default constructs this GUNNS Fluid Sorption Bed link config data.  The mSegments
///           vector is empty and must be populated with segment configurations after this
///           constructor is called and before the GunnsFluidSorptionBed's iniitalize is called.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] density  (kg/m3)  Density of the sorbant material.
/// @param[in] porosity (--)     Fraction of the packed sorbant enclosure volume that is voids.
/// @param[in] cp       (J/kg/K) Specific heat of the sorbant material.
///
/// @returns  SorbantProperties* (--) Pointer to the new sorbant properties.
///
/// @details  Adds a new custom sorbant type to this bed with given density, porosity and specific
///           head, and returns its address.  This sorbant has no sorbates yet, and the user must
///           add them.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] definedType (--)  Defined type of sorbant in the segment.
/// @param[in] volume      (m3)  Total volume of the segment including sorbant and voids.
/// @param[in] htc         (W/K) Convective heat transfer coefficient of the segment.
///
/// @throws   TsInitializationException
///
/// @details  This is called from the input file to add a segment and configure its sorbant
///           properties, volume, and heat transfer coefficient.  This overloaded function accepts a
///           defined sorbant type.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] customType (--)  Pointer to the custom sorbant properties for this segment.
/// @param[in] volume     (m3)  Total volume of the segment including sorbant and voids.
/// @param[in] htc        (W/K) Convective heat transfer coefficient of the segment.
///
/// @throws   TsInitializationException
///
/// @details  This is called from the input file to add a segment and configure its sorbant
///           properties, volume, and heat transfer coefficient.  This overloaded function accepts a
///           pointer to one of this bed's custom sorbant properties.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  malfBlockageFlag     (--)  Blockage malfunction flag.
/// @param[in]  malfBlockageValue    (--)  Blockage malfunction fractional value (0-1).
/// @param[in]  wallTemperature      (K)   Tube wall temperature for thermal convection.
///
/// @details  Default constructs this GUNNS Fluid Sorption Bed link 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 Sorption Bed link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Sorption Bed link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Zeroes the bulk fluid and trace compounds adsorbed mass and adsorption rate arrays.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Zeroes the bulk fluid and trace compounds adsorbed mass and adsorption rate temprary
///           working arrays.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Computes the bulk fluid and trace compounds adsorbed mass and adsorption rate values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @details  Calculates bulk through-flow properties, updates the bed segments, and transports the
///           through-fluid from the source node and, after sorption exchange, to the sink node.
///           Note that even with no pressure gradient across the link to cause fluid flow to
///           conduct through the link, segments can desorb into the fluid, creating flow source to
///           a node - this always is applied to the port 1 node.  This is a flow source effect,
///           applied to the source vector on the next pass.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt            (s)     Integration time step.
/// @param[in]  sourceDensity (kg/m3) Inlet fluid density.
/// @param[in]  sourcePort    (--)    Port number supplying the inlet flow to this bed link.
///
/// @returns  double (kg/s) Flow rate exiting the bed link to the downstream node, after sorption.
///
/// @details  Iterates over the bed segments based on flow direction, updates them for sorption and
///           and exchange with the through-fluid, and returns the exiting through flowrate after
///           sorption.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned (unused)
/// @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 GunnsFluidSorptionBed must not map either port to a liquid node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////
/// @param [in] type (--) The trace compound type to return the adsorbed mass of.
///
/// @return  double (kg) The total adsorbed mass of the given trace compound type.
///
/// @throws   TsOutOfBoundsException
///
/// @details  Returns the total adsorbed mass of the given trace compound type.
////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////
/// @param [in] type (--) The trace compound type to return the adsorption rate of.
///
/// @return  double (kg) The total adsorption rate of the given trace compound type.
///
/// @throws   TsOutOfBoundsException
///
/// @details  Returns the total adsorption rate of the given trace compound type.
////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  configData  (--)  Configuration data (unused).
/// @param[in]  inputData   (--)  Input data (unused).
///
/// @details  Validates the initialization of this GUNNS Fluid Hot Adsorber link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data (unused).
/// @param[in]      inputData   (--)  Input data (unused).
///
/// @details  Validates the initialization of this GUNNS Fluid Hot Reactor link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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]    nNominal           (--)    Number of crew members in NOMINAL state.
/// @param[in]    nSleep             (--)    Number of crew members in SLEEP state.
/// @param[in]    nRecovery0         (--)    Number of crew members in RECOVERY_0 state.
/// @param[in]    nRecovery1         (--)    Number of crew members in RECOVERY_1 state.
/// @param[in]    nRecovery2         (--)    Number of crew members in RECOVERY_2 state.
/// @param[in]    nRecovery3         (--)    Number of crew members in RECOVERY_3 state.
/// @param[in]    nAerobic0          (--)    Number of crew members in AEROBIC_0 state.
/// @param[in]    nAerobic1          (--)    Number of crew members in AEROBIC_1 state.
/// @param[in]    nResistive0        (--)    Number of crew members in RESISTIVE_0 state.
/// @param[in]    nResistive1        (--)    Number of crew members in RESISTIVE_1 state.
/// @param[in]    nResistive2        (--)    Number of crew members in RESISTIVE_2 state.
/// @param[in]    nResistive3        (--)    Number of crew members in RESISTIVE_3 state.
///
/// @details  Default constructs this GUNNS Fluid Metabolic link model input data with arguments
///           and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  Computes the potential drop and port direction across the link.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @details  transports the flows across the link.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name             (--)      Name of object.
/// @param[in] nodes            (--)      Pointer to nodes.
/// @param[in] gasType          (--)      Gas type that the liquid phase changes into.
/// @param[in] evaporationCoeff (1/s/kPa) Evaporation rate coefficient.
/// @param[in] poolMassExponent (--)      Exponent on pool mass contribution to evaporation rate.
/// @param[in] liquidPoolAccum  (--)      Pointer to the liquid pool accumulator.
///
/// @details  Default constructs this GUNNS Evaporation link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  malfBlockageFlag   (--)    Blockage malfunction flag.
/// @param[in]  malfBlockageValue  (--)    Blockage malfunction fractional value (0-1).
/// @param[in]  gasTotalPressure   (kPa)   Initial gas-side total pressure.
/// @param[in]  vaporPotential     (kPa)   Initial gas-side vapor potential.
/// @param[in]  evaporationRate    (kg/s)  Initial evaporation mass rate.
///
/// @details  Default constructs this GUNNS Evaporation link model input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that   (--)  Source to copy.
///
/// @details  Copy constructs this GUNNS Evaporation 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 Evaporation 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.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Evaporation link model with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] configData (--) The configuration data to be validated.
/// @param[in] inputData (--) The input data to be validated.
///
/// @throws   TsInitializationException
///
/// @details  Validates this GUNNS Evaporation link model initial state.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s)  Execution time step.
///
/// @details  Updates the evaporation model and builds this link's contributions to the network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  When attached to a gas node, compute the "vapor potential", or delta of the
///           evaporation gas saturation and partial pressures in the gas node.  Otherwise, this
///           will be provided by init value and/or the gas-side link via sim bus.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s)  Execution time step.
///
/// @details  When attached to a liquid node, compute the evaporation flow rate.  Otherwise, this
///           will be provided by init value and/or the liquid-side link via sim bus.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  When attached to a gas node, compute the heat of evaporation and store it in mPower.
///
/// @note     This redefines the meaning of mPower for this link, different from the base class.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  unused.
///
/// @details  Computes Source/sink directions values for portDirections.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] port (--) The port to be assigned.
/// @param[in] node (--) The desired node to assign the port to.
///
/// @return   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 GunnsFluidEvaporation must map port 0 to a liquid or the Ground node.
///           - A GunnsFluidEvaporation must map port 1 to a gas or the Ground node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      name                (--)        Name of object.
/// @param[in,out]  nodes               (--)        Pointer to nodes.
/// @param[in]      numCells            (--)        Number of reaction cells in the stack.
/// @param[in]      cellVoltageLoaded   (V)         Nominal cell voltage under load.
/// @param[in]      cellH2ReactRate     (kg/s/amp)  Cell H2 reaction mass rate per amp.
/// @param[in]      maxEfficiency       (--)        Maximum efficiency (0-1) of the reaction.
///
/// @details  Default constructs this Simple H2 Redox link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      malfBlockageFlag   (--)    Blockage malfunction flag.
/// @param[in]      malfBlockageValue  (--)    Blockage malfunction fractional value (0-1).
/// @param[in]      current            (amp)   Initial electrical current.
/// @param[in]      trippedOff         (--)    Initial tripped off flag.
///
/// @details  Default constructs this Simple H2 Redox 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 Simple H2 Redox link model with obviously invalid data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this Simple H2 Redox link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      inputData   (--)  Input data.
/// @param[in,out]  links       (--)  Link vector.
/// @param[in]      port0       (--)  Fuel (H2/CH4) node port map index.
/// @param[in]      port1       (--)  Air (O2/He) node port map index.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this Simple H2 Redox link model with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      inputData   (--)  Input data.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this Simple H2 Redox link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step (not used).
///
/// @details  Updates the model state: computes reaction flow rates and updates the link's
///           contributions to the network system of equations.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details Builds the source vector terms of the link's contribution to the network.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @details  Compute Fluid properties for flow transport.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  Integration time step.
///
/// @details  Transports the reaction constituent flows to/from the nodes.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    port  (--)  The port to be assigned.
/// @param[in]    node  (--)  The desired node to assign the port to.
///
/// @returns  (--) True if all rules checks pass.
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           Simple H2 Redox link.  These are:
///           - No port can connect to the network's vacuum boundary node.
///           - The node at both ports must contain gas phase.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      name                  (--)  Name of object.
/// @param[in,out]  nodes                 (--)  Pointer to nodes.
/// @param[in]      maxConductivity       (m2)  Maximum conductivity.
/// @param[in]      expansionScaleFactor  (--)  Scale factor for isentropic gas cooling.
/// @param[in]      reactions             (--)  Pointer to Defined Chemical Reactions.
/// @param[in]      reactionTypes         (--)  Array of Chemical Reaction Types.
/// @param[in]      nReactions            (--)  Number of Chemical Reactions.
/// @param[in]      compounds             (--)  Pointer to Defined Chemical Compounds.
/// @param[in]      compoundTypes         (--)  Array of Chemical Compound types.
/// @param[in]      nCompounds            (--)  Number of Chemical Compounds.
/// @param[in]      thermalLength         (m)   Tube length for thermal convection.
/// @param[in]      thermalDiameter       (m)   Tube inner diameter for thermal convection.
/// @param[in]      surfaceRoughness      (m)   Tube wall surface roughness for thermal convection.
///
/// @details  Default constructs this GUNNS Fluid Reactor link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Deletes dynamically allocated arrays.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      malfBlockageFlag   (--)    Blockage malfunction flag.
/// @param[in]      malfBlockageValue  (--)    Blockage malfunction fractional value (0-1).
/// @param[in]      totalMasses        (--)    Array of Chemical Compound total masses.
/// @param[in]      wallTemperature    (K)     Tube wall temperature for thermal convection.
///
/// @details  Default constructs this GUNNS Fluid Reactor link model input data with arguments
///           and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this GUNNS Fluid Chemical Reaction State.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this GUNNS Fluid Chemical Compound State.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @note     This should be followed by a call to the initialize method before calling an update
///           method.
///
/// @details  Default constructs this GUNNS Fluid Reactor link model with obviously invalid data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Reactor 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.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Reactor link model with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      inputData   (--)  Input data.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Reactor link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      compound    (--)  Compound type.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Checks that the specified chemical compound is defined and available.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData  (--)  Configuration data.
/// @param[in]      inputData   (--)  Input data.
///
/// @return   void
///
/// @details  Initializes the derived attributes of this GUNNS Fluid Reactor link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt        (s)     Time step.
/// @param[in]      flowrate  (kg/s)  Mass flow rate (not used).
///
/// @return   void
///
/// @details  Perform the chemical reaction and update the Chemical Compounds involved. The reaction
///           is constrained by the available reactant and reagent, and the reactant efficiency. The
///           atmosphere is updated for compounds it contains.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt  (s)  Time step.
///
/// @return   void
///
/// @details  Sets the compound states from the input atmosphere.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt  (s)  Time step.
///
/// @return   void
///
/// @details  Performs the reactions.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt  (s)  Time step.
///
/// @return   void
///
/// @details  Sets the reaction fluids (output atmosphere) from the compound states.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt  (s)  Time step.
///
/// @return   (--)  Efficiency of the reaction (0-1).
///
/// @note     Derived classes may override, e.g., to model heat of combustion.
///
/// @details  Updates the reaction fluid temperature for thermal convection with the wall.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      dt  (s)  Time step.
///
/// @details  Adds or removes the heat from the reactions to the reaction fluid.
///
///           For a reaction: aA + bB -> cC + dD  with dH = h;
///
///           The dH is tied with the chemical equation so if the balance changed, dH will
///           change.
///
///           For example:
///               H2O(l) -> H2O(g) dH = 44 kJ/mole;
///           while
///               2H2O(l) -> 2H2O(g) dH = 88 kJ/mole
///
///           With that information, here are the steps to compute heat generation (unit: J)
///           1. We can use any of the products or reactants to do the computation. [we use the
///           product 1 mole ratio (c)]
///           2. Compute conversion factor using h [kJ/mole] and c [--] cFactor = h/c [unit: kJ/mole]
///           3. Compute heat generation [J] using product C's mass [kg], C's molar weight [g/mole], and cFactor [kJ/mole]
///              Heat[J] = mass_c [kg] * 1000[g/kg] * (1/ molarW_c[g/mole]) * cFactor[kJ/mole] * 1000[J/kJ]
///
///           NOTE: we can also use A, B, or D to do the computation; the steps will be the same,
///           and the result should be the same. Use of product 1 mole ratio was determined to be
///           the best option because not all chem rxns have products 2, 3, etc...
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      i  (--)  Reaction index.
///
/// @return   (--)  Efficiency of the reaction (0-1).
///
/// @note     Derived classes may override, e.g., to model temperature dependence.
///
/// @details  Computes and returns the reactant efficiency of the specified reaction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] forcedOutflow (--) Unused in this implementation
/// @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 flows to the node's collection terms.
///
///           This implementation overrides the base class with these major differences:
///           - Conduction flow with mInternalFluid is transported between the nodes before the
///             reaction flows are added to the downstream node.
///           - Adds the reaction flows effect on downstream pressure via the source vector.
///           - Expansion scale factor and the isentropic expansion effect are not used or modeled.
///           - Skips checks for mInternalFluid, since it is always present in this class.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                    (--)    Name of object
/// @param[in,out] nodes                   (--)    Pointer to nodes
/// @param[in]     gasType                 (--)    Gas phase of the operating fluid
/// @param[in]     heatOfVaporization      (kJ/kg) Heat of vaporization of the operating fluid
/// @param[in]     heatOfFusion            (kJ/kg) Heat of fusion (melting) of the operating fluid
/// @param[in]     triplePointTemperature  (K)     Temperature of the operating fluid triple point
/// @param[in]     maxIceMass              (kg)    Maximum mass of ice the sublimator can form
/// @param[in]     iceCoverageFraction     (--)    (0-1) fraction of maximum ice mass for complete plate coverage
/// @param[in]     maxThermalConductivity  (J/s/K) Maximum conductivity of the GunnsThermalPotential
/// @param[in]     plateConductivity       (m2)    Effective conductivity of plate with no ice coverage
/// @param[in]     thermalConductivityGain (--)    (0-1) Recommend 0.01, thermal conductivity filter gain
///
/// @details  Default constructs this GUNNS Fluid Sublimator link model configuration data with
///           arguments and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    iceMass              (kg)   Initial mass of ice in the sublimator
/// @param[in]    structureTemperature (K)    Initial temperature of the sublimator structure
///
/// @details  Default constructs this GUNNS Fluid Sublimator link model input data with
///           arguments and obviously invalid default values.
///
/// @note     The malfunction terms are not provided as arguments to the constructor, and they are
///           only present in the input data class to support unit testing.  The constructor
///           defaults all malfunctions to off.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that  (--)   Source to copy from.
///
/// @details  Copy constructs this GUNNS Fluid Sublimator 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 Sublimator link model with obviously invalid
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   (--)  Configuration data.
/// @param[in]      inputData    (--)  Input data.
/// @param[in,out]  links        (--)  Link vector.
/// @param[in]      port0        (--)  feedwater supply port map index.
/// @param[in]      port1        (--)  vapor vent port map index.
///
/// @returns  void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Sublimator link model with configuration and input
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   (--)  Configuration data.
/// @param[in]      inputData    (--)  Input data.
///
/// @returns  void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Sublimator link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns  void
///
/// @details  Initializes the attributes of this GUNNS Fluid Sublimator link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step
///
/// @returns  void
///
/// @details  Method to update the link during a time step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step (not used)
///
/// @returns  void
///
/// @details  Method to update the potential drop and flux and set port directions.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step (not used)
///
/// @returns  void
///
/// @details  Method to update flow quantities and transport fluid masses during the step.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    port  (--)  The port to be assigned.
/// @param[in]    node  (--)  The desired node to assign the port to.
///
/// @returns  (--) True if all rules checks pass.
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           Gunns Fluid Sublimator link model.  These are:
///           - A GunnsFluidSublimator must not map port 0 to the network's vacuum boundary node.
///           - The node at port 0 must contain liquid phase.
///           - The node at port 1 must contain gas phase OR be the network's vacuum boundary node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag  (--)   Malfunction activation flag, true activates
/// @param[in] value (kg/s) Malfunction value to bias the feed rate
///
/// @details  Sets the malf parameters to the given values.  Calling this method with default
///           arguments resets the malfunction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                 (--) Name of object.
/// @param[in,out] nodes                (--) Pointer to nodes.
/// @param[in]     maxConductivity      (m2) Maximum possible effective conductivity of the link.
/// @param[in]     expansionScaleFactor (--) Scale factor for isentropic cooling across the link.
/// @param[in]     liquidType           (--) Liquid phase fluid type of constituent being separated.
///
/// @details  Default constructs this GUNNS Fluid Separator Liquid link model configuration data
///           with arguments and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that   --  Source to copy.
///
/// @details  Copy constructs this GUNNS Fluid Separator Liquid link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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.
/// @param[in] transferTemperature (K)   Temperature of incoming liquid.
///
/// @details  Default constructs this GUNNS Fluid Separator Liquid link model input data with
///           arguments and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that  --   Source to copy from.
///
/// @details  Copy constructs this GUNNS Fluid Separator Liquid 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 Separator Liquid link model with obviously invalid
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Separator Liquid link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @details  Initializes the attributes of this GUNNS Fluid Separator Liquid link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    dt         (s)    Time step.
/// @param[in]    flowrate   (kg/s) Mass flow rate (not used).
///
/// @return   void
///
/// @details  Updates the incoming fluid temperature based on inputs from the gas aspect.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    port  --  The port to be assigned.
/// @param[in]    node  --  The desired node to assign the port to.
///
/// @returns  -- True if all rules checks pass.
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           Gunns Fluid Separator Liquid link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name               (--) Link name.
/// @param[in] nodes              (--) Network nodes array.
/// @param[in] flipFlowSign       (--) True makes positive flow rate go out of the node.
/// @param[in] traceCompoundsOnly (--) True only flows trace compounds, not bulk fluid.
///
/// @details  Default GUNNS Fluid Source Boundary Config Data Constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy.
///
/// @details  GUNNS Fluid Source Boundary 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] internalFluid      (--)   Initial fluid properties of the link flow.
///
/// @details  Default constructs this Fluid Source Boundary input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


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


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Unused.
///
/// @details  When in override mode, loads the override bulk constituent flow rates into the
///           internal fluid and sets the link total flow demand to the sum of the override rates.
///
/// @note  When exiting override mode, the user is responsible for resetting the internal fluid
///        and/or the flow demand rate.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt   (s)    Unused.
/// @param[in] mdot (kg/s) Unused.
///
/// @details  When in override mode, updates the internal fluid temperature, then adds the extra
///           override heat to the node's extra heat collection.  The temperature override is
///           optional.  If a value > DBL_EPSILON is set, the internal fluid will take that override
///           temperature.  If it is <= DBL_EPSILON (default), then the internal fluid will take the
///           temperature of the boundary node's contents.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] forcedOutflow (--) Not used.
/// @param[in] fromPort      (--) Not used.
/// @param[in] toPort        (--) Not used.
///
/// @details  This function adds the link's flow to the attached node's collection terms.
///           Flow is defined positive going to the node, so a positive flow will add mass to it.
///
///           This implementation is simplified from the base class in several important ways:
///           - Since this is a 1-port link, the port arguments are ignored and all flows go to/from
///             the port 0 node.
///           - This method doesn't verify the port arguments since they're ignored.
///           - This link always has the internal fluid specified, so we don't check for it.
///           - This link always forces mixture change of the node for outflows, so we ignore the
///             forcedOutflow argument.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                --      Name of object
/// @param[in,out] nodes               --      Pointer to nodes.
/// @param[in]     consumptionRateO2   (kg/s)  Nominal O2 consumption rate for a crew member.
/// @param[in]     productionRateCO2   (kg/s)  Nominal CO2 production rate for a crew member.
/// @param[in]     productionRateH2O   (kg/s)  Nominal CO2 production rate for a crew member.
/// @param[in]     productionRateHeat  (W)     Nominal heat production rate for a crew member.
/// @param[in]     sleepScaleFactor     --     Sleep production/consumption scale factor.
/// @param[in]     recoveryScaleFactor  --     Recovery production/consumption scale factor.
/// @param[in]     exerciseScaleFactor  --     Exercise production/consumption scale factor.
///
/// @details  Default constructs this GUNNS Fluid Metabolic link model configuration data with
///           arguments and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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]    nNominal           --      Number of crew members in nominal state.
/// @param[in]    nSleep             --      Number of crew members in sleep state.
/// @param[in]    nRecovery          --      Number of crew members in recovery state.
/// @param[in]    nExercise          --      Number of crew members in exercise state.
///
/// @details  Default constructs this GUNNS Fluid Metabolic link model input data with arguments
///           and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that  --   Source to copy from.
///
/// @details  Copy constructs this GUNNS Fluid Metabolic link model input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Metabolic link model with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Metabolic link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @details  Initializes the derived attributes of this GUNNS Fluid Metabolic link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  number     (--)  Number of crew members (> 0) to transition.
/// @param[in]  fromState  (--)  Initial metabolic state.
/// @param[in]  toState    (--)  Final metabolic state.
///
/// @return   void
///
/// @details  Transitions the specified crew members from one metabolic state to another, subject
///           to the constraint that the number of crew members in any state must be non-negative.
///           NO_METABOLIC in the fromState or toState arguments can be used to increase or decrease
///           the total # of crew.  If NO_METABOLIC is given as the fromState, then the total # of
///           crew is increased by number, all in the toState.  Likewise, if NO_METABOLIC is given
///           as the toState, then the total # of crew are decreased by number, all from the
///           fromState.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    port  --  The port to be assigned.
/// @param[in]    node  --  The desired node to assign the port to.
///
/// @returns  -- True if all rules checks pass
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           a Gunns Fluid Metabolic link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                 (--)             Name of object.
/// @param[in,out] nodes                (--)             Pointer to nodes.
/// @param[in]     maxConductivity      (m2)             Maximum effective conductivity of the link.
/// @param[in]     gasType              (--)             Gas phase fluid type of separated constituent.
/// @param[in]     massExponent         (--)             Mass factor exponent in separator power curve.
/// @param[in]     maxLiquidMass        (kg)             Liquid mass capacity of separator.
/// @param[in]     referenceSpeed       (revolution/min) Reference speed for separator power curve.
/// @param[in]     referencePressure    (kPa)            Reference pressure for separator power curve.
/// @param[in]     referenceRemovalRate (kg/s)           Reference liquid removal rate.
///
/// @details  Default constructs this GUNNS Fluid Separator Gas link model configuration data with
///           arguments and obviously invalid default values.  The conductor's expansion scale
///           factor is deliberately configured to zero, as we do not want that effect in the
///           separator.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag  (--)             Blockage malfunction flag.
/// @param[in] malfBlockageValue (--)             Blockage malfunction fractional value (0-1).
/// @param[in] separatorSpeed    (revolution/min) Separator speed.
/// @param[in] transferFlowRate  (kg/s)           Flow rate of outgoing liquid.
/// @param[in] liquidMass        (kg)             Mass of liquid in separator.
///
/// @details  Default constructs this GUNNS Fluid Separator Gas link model input data with
///           arguments and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Source object to copy.
///
/// @details  Copy constructs this GUNNS Fluid Separator Gas 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 Separator Gas link model with obviously invalid
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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 (vacuum node).
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Separator Gas link model with configuration and input
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Separator Gas link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   --  Configuration data.
/// @param[in]      inputData    --  Input data.
///
/// @return   void
///
/// @details  Initializes the attributes of this GUNNS Fluid Separator Gas link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    dt         (s)    Time step.
/// @param[in]    flowrate   (kg/s) Mass flow rate (not used).
///
/// @return   void
///
/// @details  Updates the atmosphere for the extracted liquid, the liquid mass within the separator,
///           and liquid source pressure head created by the separator.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @return   void
///
/// @details  Prepares outputs to the liquid separator aspect.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name            (--)       Name of this instance for messages.
/// @param[in,out] nodes           (--)       Pointer to the network nodes.
/// @param[in]     maxConductance  (m2)       Max conductance of the flow-thru path.
/// @param[in]     absorptionCoeff (kg/s/kPa) Absorption coefficient of the membrane.
/// @param[in]     externalType    (--)       Membrane absorbed fluid type in the external vent.
/// @param[in]     internalType    (--)       Membrane absorbed fluid type in the internal bulk flow.
///
/// @details  Default constructs this GUNNS Fluid Selective Membrane link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this GUNNS Fluid Selective Membrane link model input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    that  (--)   Source to copy from.
///
/// @details  Copy constructs this GUNNS Fluid Selective Membrane 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 Selective Membrane link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default destructs this GUNNS Fluid Selective Membrane link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      configData   (--)  Configuration data.
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Fluid Selective Membrane link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step.
///
/// @details  Computes this link's contributions to the network system of equations, models a normal
///           conductive flow path between Ports 0 & 1 similar to a GunnsFluidConductor, and models
///           selective fluid absorption through the membrane proportional to the fluid partial
///           pressures across the membrane.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  unused.
///
/// @details  Computes Delta Potential and Flux. Sets port Directions for ports zero, one, and two.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  dt  (s)  unused.
///
/// @details  transports flow-thru path and membrane flows between nodes and adds heat of phase
///           change when present.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Computes the molar flux rate through the link.  Units:
///           Flux (kgmol/s) = Admittance (kgmol/kPa/s) * dP (kPa)
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]    port  (--)  The port to be assigned.
/// @param[in]    node  (--)  The desired node to assign the port to.
///
/// @returns  bool (--) True if all rules checks pass
///
/// @details  Checks the requested port & node arguments for validity against rules that apply to
///           a Gunns Fluid Selective Membrane link model.
///           - Ports 0 and 1 must match the phase of the Internal fluid type or be the Ground node.
///           - Port 2 must match the phase of the External fluid type or be the Ground node.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag  (--) Malfunction activation flag, true activates.
/// @param[in] value (--) (0-1) Malfunction value to degrade the membrane.
///
/// @details  Sets the malf parameters to the given values.  Calling this method with default
///           arguments resets the malfunction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag  (--) Fire activation flag.
/// @param[in] value (W)  Fire heat output value.
///
/// @details  Sets the malf parameters to the given values.  Calling this method with default
///           arguments resets the malfunction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  For this link, mPower is just the heat output of the fire malfunction when active.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @details  Default constructs this Fluid Adsorbed Compound Model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]  that  (--)  The object to be copied from.
///
/// @details  Copy constructs this Fluid Adsorbed Compound Model.
///
/// @note  This is a shallow copy, and the copied object needs to be initialized.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name              (--) Name of this instance for H&S messages.
/// @param[in] config            (--) Reference to another oject containing configuration values to copy.
/// @param[in] fluid             (--) Pointer to the fluid object that this compound sorbs to/from.
/// @param[in] dependentCompound (--) Pointer to another object representing the dependent compound, can be NULL.
///
/// @throws   TsInitializationException
///
/// @details  Initializes this Fluid Adsorbed Compound Model with its name & configuration data, and
///           validates the initialization.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt   (s)    Integration time step.
/// @param[in] tAvg (K)    Average of the adsorber inlet and outlet temperatures.
/// @param[in] pAvg (kPa)  Average of the adsorber inlet and outlet total pressures.
/// @param[in] mdot (kg/s) Total fluid mass flow rate through the adsorber.
///
/// @details  Computes adsorption or desorption rate as a function of: fluid stream pressure &
///           temperature, fill fraction of this compound and the optional dependent compound, and
///           efficiency override malfunction.  Updates the adsorbed mass and outputs the
///           sorbing mass rate and reaction heat.
///
/// @note  The caller must ensure dt > 0.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] flag  (--) True activates the malfunction.
/// @param[in] value (--) Fraction (0-1) of degradation, fraction of sorbant that cannot sorb.
///
/// @details  Calling this with default arguments deactivates the malfunction.
////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @returns double (m3) Effective sorbant volume with degradation malfunction applied.
///
/// @details  Computes and returns the effective sorbant volume considering degradation malfunction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] segment (--)        The segment number to load.
/// @param[in] sorbate (--)        The sorbate compound type to load.
/// @param[in] loading (kg*mol/m3) The initial loading amount.
///
/// @details  Adds a new GunnsFluidSorptionBedSegmentInputData to mLoading, with the given
///           values.
////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      name                  (--)   Name of object.
/// @param[in,out]  nodes                 (--)   Pointer to nodes.
/// @param[in]      maxConductivity       (m2)   Maximum conductivity.
/// @param[in]      expansionScaleFactor  (--)   Scale factor for isentropic gas cooling.
/// @param[in]      reactions             (--)   Pointer to Defined Chemical Reactions.
/// @param[in]      reactionTypes         (--)   Array of Chemical Reaction Types.
/// @param[in]      nReactions            (--)   Number of Chemical Reactions.
/// @param[in]      compounds             (--)   Pointer to Defined Chemical Compounds.
/// @param[in]      compoundTypes         (--)   Array of Chemical Compound types.
/// @param[in]      nCompounds            (--)   Number of Chemical Compounds.
/// @param[in]      thermalLength         (m)    Tube length for thermal convection.
/// @param[in]      thermalDiameter       (m)    Tube inner diameter for thermal convection.
/// @param[in]      surfaceRoughness      (m)    Tube wall surface roughness for thermal convection.
/// @param[in]      efficiencyBias        (1/K)  Bias for the dependency of efficiency on temperature.
/// @param[in]      efficiencyScaleFactor (--)   Scale factor for the dependency of efficiency on temperature.
///
/// @details  Default constructs this GUNNS Fluid Hot Reactor link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      malfBlockageFlag    (--)    Blockage malfunction flag.
/// @param[in]      malfBlockageValue   (--)    Blockage malfunction fractional value (0-1).
/// @param[in]      totalMasses         (--)    Array of Chemical Compound total masses.
/// @param[in]      wallTemperature     (K)     Tube wall temperature for thermal convection.
///
/// @details  Default constructs this GUNNS Fluid Hot Reactor link model input data with arguments
///           and obviously invalid default values.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      that  (--)  Source to copy from.
///
/// @details  Copy constructs this GUNNS Fluid Hot Reactor 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 Hot Reactor link model with obviously invalid data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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.
///
/// @return   void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Fluid Hot Reactor link model with configuration and input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]      i  (--)  Reaction index.
///
/// @return   (--)  Efficiency of the reaction (0-1).
///
/// @details  Computes and returns the efficiency of the specified reaction linearly dependent on
///           fluid temperature.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in]     name                    (--)   Name of object.
/// @param[in,out] nodes                   (--)   Pointer to network nodes.
/// @param[in]     cycleVolume             (--)   Volume of fluid displaced per cycle.
/// @param[in]     driveRatio              (--)   Gear ratio of motor to impeller speed.
/// @param[in]     thermalLength           (m)    Impeller length for thermal convection.
/// @param[in]     thermalDiameter         (m)    Impeller inner diameter for thermal convection.
/// @param[in]     surfaceRoughness        (m)    Impeller wall surface roughness for convection.
/// @param[in]     liquidType              (--)   Type of the operating liquid.
/// @param[in]     autoCavitationDuration  (s)    Duration of auto-cavitation effect.
/// @param[in]     autoCavitationAmplitude (m3/s) Amplitude of auto-cavitation pressure noise.
///
/// @details  Default constructs this GUNNS Liquid Displacement Pump link model configuration data
///           with arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Object to copy.
///
/// @details  Copy constructs this GUNNS Liquid Displacement Pump link model configuration data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag     (--)      Blockage malfunction flag.
/// @param[in] malfBlockageValue    (--)      Blockage malfunction fractional value (0-1).
/// @param[in] flowDemand           (kg/s)    Demanded mass flow rate of the link.
/// @param[in] motorSpeed           (rev/min) Initial speed of the motor.
/// @param[in] wallTemperature      (K)       Initial impeller wall temperature.
/// @param[in] enableAutoCavitation (--)      Enables the automatic cavitation model.
///
/// @details  Default constructs this GUNNS Liquid Displacement Pump link model input data with
///           arguments.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] that (--) Source to copy from.
///
/// @details  Copy constructs this GUNNS Liquid Displacement Pump 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 Liquid Displacement Pump link model with obviously
///           invalid data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @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.
///
/// @returns  void
///
/// @throws   TsInitializationException
///
/// @details  Initializes this GUNNS Liquid Displacement Pump link model with configuration and input
///           data.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] configData (--) Configuration data.
///
/// @returns  void
///
/// @throws   TsInitializationException
///
/// @details  Validates the initialization of this GUNNS Liquid Displacement Pump link model.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Time step.
///
/// @returns  void
///
/// @details  Updates the cavitation object and applies its effects to the volumetric flow rate
///           generated by the displacement pump.  This model supports pump speed in either
///           direction, so we send the correct inlet node to the cavitation object based on flow
///           direction.
////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] name               (--)   Link name.
/// @param[in] nodes              (--)   Network nodes array.
/// @param[in] fireO2ConsumpRate  (kg/J) O2 mass consumption per Joule of fire energy output.
/// @param[in] fireCO2ProductRate (kg/J) CO2 mass production per Joule of fire energy output.
/// @param[in] fireH2OProductRate (kg/J) H2O mass production per Joule of fire energy output.
/// @param[in] fireMinReqO2       (kPa)  Minimum partial pressure of O2 to sustain fire
/// @param[in] traceCompoundRates (kg/J) Array of trace compound mass production per Joule of fire energy output.
///
/// @details  Default GUNNS Fluid Fire Source Config Data Constructor.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] malfBlockageFlag   (--)   Blockage malfunction flag.
/// @param[in] malfBlockageValue  (--)   Blockage malfunction fractional value (0-1).
/// @param[in] malfFireFlag       (--)   Initial fire malfunction activation flag
/// @param[in] malfFireHeat       (W)    Initial fire malfunction generated heat value.
///
/// @details  Default constructs this Fluid Fire Source input data.
////////////////////////////////////////////////////////////////////////////////////////////////////


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


////////////////////////////////////////////////////////////////////////////////////////////////////
/// @param[in] dt (s) Integration time step (unused)
///
/// @details  Computes the flows across the link.
////////////////////////////////////////////////////////////////////////////////////////////////////