VirtualFCS.Fluid.MixingVolume

A lumped fixed volume

Model Description and References

This class implements a fixed mixing volume with two non-directional flow ports and a conditional heat port.

The volume does not exchange work, but can exchange heat through the heatPort. The state of the internal holdup is described by the medium variable, whose properties are bound to the port pressure and outflow variables.

If the heatPort is inactive, the volume will be maintained at the constant temperature given by T; if heatPort is active, the temperature may vary, in particular adiabatically if nothing is connected to the heatPort.

Note that T is a parameter inherited by ConditionalHeatPort: when the heatPort is active, its value is arbitrary and inconsequential. The temperature of the fluid in the volume is always given by medium.T, not just T.

A pressure drop is implemented with linear hydraulic resistance R_flow. Note that the outlet flow is not guaranteed to be the same as the inlet, so the average value is used.
The medium is assumed to be represented by the average of inlet and outlet pressure.

Numerical stability note

Please note that low values of R_flow can have destabilising numerical effects and induce singularities.

Governing Equations

port_a.p - port_b.p = R_flow * (port_a.m_flow-port_b.m_flow)/2 "Pressure drop proportional to average mass flow";

medium.p = (port_a.p + port_b.p)/2;

Parameters

NameTypeUnitDefaultDescription
energyDynamicsModelica.Fluid.Types.Dynamics-system.energyDynamicsFormulation of energy balance (inherited)
massDynamicsModelica.Fluid.Types.Dynamics-Modelica.Fluid.Types.Dynamics.FixedInitialFormulation of mass balance (inherited)
substanceDynamicsModelica.Fluid.Types.Dynamics-massDynamicsFormulation of substance balance (inherited)
traceDynamicsModelica.Fluid.Types.Dynamics-massDynamicsFormulation of trace substance balance (inherited)
p_startMedium.AbsolutePressurePasystem.p_startStart value of pressure (inherited)
use_T_startBoolean1true= true, use T_start, otherwise h_start (inherited)
T_startMedium.TemperatureKif use_T_start then system.T_start else Medium.temperature_phX(p_start, h_start, X_start)Start value of temperature (inherited)
h_startMedium.SpecificEnthalpyJ/kgif use_T_start then Medium.specificEnthalpy_pTX(p_start, T_start, X_start) else Medium.h_defaultStart value of specific enthalpy (inherited)
X_startMedium.MassFraction[Medium.nX]1Medium.X_defaultStart value of mass fractions m_i/m (inherited)
C_startMedium.ExtraProperty[Medium.nC]-Medium.C_defaultStart value of trace substances (inherited)
allowFlowReversalBoolean1system.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b) (inherited)
useHeatPortBoolean1false= true, if heatPort is enabled (inherited)
TModelica.Units.SI.TemperatureK293.15Fixed device temperature if useHeatPort = false (inherited)
VModelica.Units.SI.Volumem31E-3Manifold total volume
R_flowModelica.Fluid.Types.HydraulicResistance-1000Resistance to mass flow

Interfaces and Connections

NameKindTypeUnitDescription
fluidVolumeInput signalModelica.Units.SI.Volumem3Volume
port_aConnectionModelica.Fluid.Interfaces.FluidPort_aPa; kg/s; J/kgFluid connector a (positive design flow direction is from port_a to port_b)
port_bConnectionModelica.Fluid.Interfaces.FluidPort_bPa; kg/s; J/kgFluid connector b (positive design flow direction is from port_a to port_b)
heatPortConnectionModelica.Thermal.HeatTransfer.Interfaces.HeatPort_aK; WConditional heat port