Package with interfaces for fluid models
This package contains basic classes that are used to build component models that change the state of the fluid. The classes are not directly usable, but can be extended when building a new model.
Extends from Modelica.Icons.InterfacesPackage (Icon for packages containing interfaces).
Name | Description |
---|---|
UsersGuide | User's Guide |
ConservationEquation | Lumped volume with mass and energy balance |
FourPortHeatMassExchanger | Model transporting two fluid streams between four ports with storing mass or energy |
PartialFourPort | Partial model with four ports |
PartialFourPortInterface | Partial model transporting fluid between two ports without storing mass or energy |
PartialTwoPort | Partial component with two ports |
PartialTwoPortInterface | Partial model transporting fluid between two ports without storing mass or energy |
PartialTwoPortTransport | Partial element transporting fluid between two ports without storage of mass or energy |
PrescribedOutletState | Component that assigns the outlet fluid property at port_a based on an input signal |
StaticFourPortHeatMassExchanger | Partial model transporting two fluid streams between four ports without storing mass or energy |
StaticTwoPortConservationEquation | Partial model for static energy and mass conservation equations |
StaticTwoPortHeatMassExchanger | Partial model transporting fluid between two ports without storing mass or energy |
TwoPortHeatMassExchanger | Partial model transporting one fluid stream with storing mass or energy |
FourPortFlowResistanceParameters | Parameters for flow resistance for models with four ports |
LumpedVolumeDeclarations | Declarations for lumped volumes |
PrescribedOutletStateParameters | Parameters for models with prescribed outlet state |
TwoPortFlowResistanceParameters | Parameters for flow resistance for models with two ports |
Examples | Collection of models that illustrate model use and test models |
Lumped volume with mass and energy balance
Basic model for an ideally mixed fluid volume with the ability to store mass and energy. It implements a dynamic or a steady-state conservation equation for energy and mass fractions. The model has zero pressure drop between its ports.
If the constant simplify_mWat_flow = true
then adding
moisture does not increase the mass of the volume or the leaving mass flow rate.
It does however change the mass fraction medium.Xi
.
This allows to decouple the moisture balance from the pressure drop equations.
If simplify_mWat_flow = false
, then
the outlet mass flow rate is
mout = min (1 + Δ Xw),
where
Δ Xw is the change in water vapor mass
fraction across the component. In this case,
this component couples
the energy calculation to the
pressure drop versus mass flow rate calculations.
However, in typical building HVAC systems,
Δ Xw < 0.005 kg/kg.
Hence, by tolerating a relative error of 0.005 in the mass balance,
one can decouple these equations.
Decoupling these equations avoids having
to compute the energy balance of the humidifier
and its upstream components when solving for the
pressure drop of downstream components.
Therefore, the default value is simplify_mWat_flow = true
.
Set the parameter use_mWat_flow_in=true
to enable an
input connector for mWat_flow
.
Otherwise, the model uses mWat_flow = 0
.
If the constant simplify_mWat_flow = true
, which is its default value,
then the equation
port_a.m_flow + port_b.m_flow = - mWat_flow;
is simplified as
port_a.m_flow + port_b.m_flow = 0;
This causes an error in the mass balance of about 0.5%, but generally leads to simpler equations because the pressure drop equations are then decoupled from the mass exchange in this component.
When extending or instantiating this model, the input
fluidVolume
, which is the actual volume occupied by the fluid,
needs to be assigned.
For most components, this can be set to a parameter.
Q_flow
, which is the sensible plus latent heat flow rate added to the medium,
mWat_flow
, which is the moisture mass flow rate added to the medium, and
C_flow
, which is the trace substance mass flow rate added to the medium.
The model can be used as a dynamic model or as a steady-state model. However, for a steady-state model with exactly two fluid ports connected, the model Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation provides a more efficient implementation.
For a model that instantiates this model, see Buildings.Fluid.MixingVolumes.MixingVolume.
Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Volume | fluidVolume | Volume [m3] | |
Dynamics | |||
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Initialization | |||
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Advanced | |||
Boolean | use_mWat_flow | false | Set to true to enable input connector for moisture mass flow rate |
Boolean | use_C_flow | false | Set to true to enable input connector for trace substance |
Type | Name | Description |
---|---|---|
input RealInput | Q_flow | Sensible plus latent heat flow rate transferred into the medium [W] |
input RealInput | mWat_flow | Moisture mass flow rate added to the medium [kg/s] |
input RealInput | C_flow[Medium.nC] | Trace substance mass flow rate added to the medium |
output RealOutput | hOut | Leaving specific enthalpy of the component [J/kg] |
output RealOutput | XiOut[Medium.nXi] | Leaving species concentration of the component [1] |
output RealOutput | COut[Medium.nC] | Leaving trace substances of the component |
output RealOutput | UOut | Internal energy of the component [J] |
output RealOutput | mXiOut[Medium.nXi] | Species mass of the component [kg] |
output RealOutput | mOut | Mass of the component [kg] |
output RealOutput | mCOut[Medium.nC] | Trace substance mass of the component [kg] |
VesselFluidPorts_b | ports[nPorts] | Fluid inlets and outlets |
Model transporting two fluid streams between four ports with storing mass or energy
This component transports two fluid streams between four ports. It provides the basic model for implementing a dynamic heat exchanger.
The model can be used as-is, although there will be no heat or mass transfer
between the two fluid streams.
To add heat transfer, heat flow can be added to the heat port of the two volumes.
See for example
Buildings.Fluid.Chillers.Carnot_y.
To add moisture input into (or moisture output from) volume vol2
,
the model can be replaced as shown in
Buildings.Fluid.HeatExchangers.BaseClasses.HexElement.
The variable names follow the conventions used in Modelica.Fluid.HeatExchangers.BasicHX.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
MixingVolume | vol2 | redeclare Buildings.Fluid.Mi... | Volume for fluid 2 |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | Nominal mass flow rate [kg/s] | |
MassFlowRate | m2_flow_nominal | Nominal mass flow rate [kg/s] | |
PressureDifference | dp1_nominal | Pressure difference [Pa] | |
PressureDifference | dp2_nominal | Pressure difference [Pa] | |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | true | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance | |||
Medium 1 | |||
Boolean | computeFlowResistance1 | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp1 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance1 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM1 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Medium 2 | |||
Boolean | computeFlowResistance2 | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp2 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance2 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM2 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics | |||
Nominal condition | |||
Time | tau1 | 30 | Time constant at nominal flow [s] |
Time | tau2 | 30 | Time constant at nominal flow [s] |
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Initialization | |||
Medium 1 | |||
AbsolutePressure | p1_start | Medium1.p_default | Start value of pressure [Pa] |
Temperature | T1_start | Medium1.T_default | Start value of temperature [K] |
MassFraction | X1_start[Medium1.nX] | Medium1.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C1_start[Medium1.nC] | fill(0, Medium1.nC) | Start value of trace substances |
ExtraProperty | C1_nominal[Medium1.nC] | fill(1E-2, Medium1.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Medium 2 | |||
AbsolutePressure | p2_start | Medium2.p_default | Start value of pressure [Pa] |
Temperature | T2_start | Medium2.T_default | Start value of temperature [K] |
MassFraction | X2_start[Medium2.nX] | Medium2.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C2_start[Medium2.nC] | fill(0, Medium2.nC) | Start value of trace substances |
ExtraProperty | C2_nominal[Medium2.nC] | fill(1E-2, Medium2.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Partial model with four ports
This model defines an interface for components with four ports.
The parameters allowFlowReversal1
and
allowFlowReversal2
may be used by models that extend
this model to treat flow reversal.
This model is identical to Modelica.Fluid.Interfaces.PartialTwoPort, except for the fowllowing:
port_a_exposesState
,
port_b_exposesState
and
showDesignFlowDirection
are not implemented.
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | Modelica.Media.Interfaces.Pa... | Medium 1 in the component | |
replaceable package Medium2 | Modelica.Media.Interfaces.Pa... | Medium 2 in the component | |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | true | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Type | Name | Description |
---|---|---|
replaceable package Medium1 | Medium 1 in the component | |
replaceable package Medium2 | Medium 2 in the component | |
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
Partial model transporting fluid between two ports without storing mass or energy
This component defines the interface for models that transport two fluid streams between four ports. It is similar to Buildings.Fluid.Interfaces.PartialTwoPortInterface, but it has four ports instead of two.
The model is used by other models in this package that add heat transfer, mass transfer and pressure drop equations.
Extends from Buildings.Fluid.Interfaces.PartialFourPort (Partial model with four ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | Nominal mass flow rate [kg/s] | |
MassFlowRate | m2_flow_nominal | Nominal mass flow rate [kg/s] | |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | true | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
Partial component with two ports
This partial model defines an interface for components with two ports.
The treatment of the design flow direction and of flow reversal are predefined based on the parameter allowFlowReversal
.
The component may transport fluid and may have internal storage for a given fluid Medium
.
This model is similar to
Modelica.Fluid.Interfaces.PartialTwoPort
but it does not use the outer system
declaration.
This declaration is omitted as in building energy simulation,
many models use multiple media, an in practice,
users have not used this global definition to assign parameters.
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component | |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
Partial model transporting fluid between two ports without storing mass or energy
This component defines the interface for models that transports a fluid between two ports. It is similar to Modelica.Fluid.Interfaces.PartialTwoPortTransport, but it does not include the species balance
port_b.Xi_outflow = inStream(port_a.Xi_outflow);
Thus, it can be used as a base class for a heat and mass transfer component
The model is used by other models in this package that add heat transfer, mass transfer and pressure drop equations. See for example Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger.
Extends from Buildings.Fluid.Interfaces.PartialTwoPort (Partial component with two ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Partial element transporting fluid between two ports without storage of mass or energy
This component transports fluid between its two ports, without storing mass or energy.
Energy may be exchanged with the environment though, e.g., in the form of work.
PartialTwoPortTransport
is intended as base class for devices like orifices, valves and simple fluid machines.
Three equations need to be added by an extending class using this component:
dp
and the mass flow rate m_flow
,port_b.h_outflow
for flow in design direction, andport_a.h_outflow
for flow in reverse direction.Moreover appropriate values shall be assigned to the following parameters:
dp_start
for a guess of the pressure dropm_flow_small
for regularization of zero flow.
This is similar to
Modelica.Fluid.Interfaces.PartialTwoPortTransport
except that it does not use the outer system
declaration.
This declaration is omitted as in building energy simulation,
many models use multiple media, an in practice,
users have not used this global definition to assign parameters.
Extends from Buildings.Fluid.Interfaces.PartialTwoPort (Partial component with two ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
PressureDifference | dp_start | 0 | Guess value of dp = port_a.p - port_b.p [Pa] |
MassFlowRate | m_flow_start | 0 | Guess value of m_flow = port_a.m_flow [kg/s] |
MassFlowRate | m_flow_small | Small mass flow rate for regularization of zero flow [kg/s] | |
Diagnostics | |||
Boolean | show_T | true | = true, if temperatures at port_a and port_b are computed |
Boolean | show_V_flow | true | = true, if volume flow rate at inflowing port is computed |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
Component that assigns the outlet fluid property at port_a based on an input signal
This model sets the temperature of the medium that leaves port_a
to the value given by the input TSet
, subject to optional
limitations on the heating and cooling capacity.
In case of reverse flow, the set point temperature is still applied to
the fluid that leaves port_b
.
If the parameter energyDynamics
is not equal to
Modelica.Fluid.Types.Dynamics.SteadyState
,
the component models the dynamic response using a first order differential equation.
The time constant of the component is equal to the parameter tau
.
This time constant is adjusted based on the mass flow rate using
τeff = τ |ṁ| ⁄ ṁnom
where τeff is the effective time constant for the given mass flow rate ṁ and τ is the time constant at the nominal mass flow rate ṁnom. This type of dynamics is equal to the dynamics that a completely mixed control volume would have.
This model has no pressure drop. See Buildings.Fluid.HeatExchangers.HeaterCooler_T for a model that instantiates this model and that has a pressure drop.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortTransport (Partial element transporting fluid between two ports without storage of mass or energy), Buildings.Fluid.Interfaces.PrescribedOutletStateParameters (Parameters for models with prescribed outlet state).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
HeatFlowRate | Q_flow_maxHeat | Modelica.Constants.inf | Maximum heat flow rate for heating (positive) [W] |
HeatFlowRate | Q_flow_maxCool | -Modelica.Constants.inf | Maximum heat flow rate for cooling (negative) [W] |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate, used for regularization near zero flow [kg/s] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
PressureDifference | dp_start | 0 | Guess value of dp = port_a.p - port_b.p [Pa] |
MassFlowRate | m_flow_start | 0 | Guess value of m_flow = port_a.m_flow [kg/s] |
MassFlowRate | m_flow_small | Small mass flow rate for regularization of zero flow [kg/s] | |
Diagnostics | |||
Boolean | show_T | false | = true, if temperatures at port_a and port_b are computed |
Boolean | show_V_flow | false | = true, if volume flow rate at inflowing port is computed |
Dynamics | |||
Time | tau | 10 | Time constant at nominal flow rate (used if energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState) [s] |
Initialization | |||
Temperature | T_start | Medium.T_default | Initial or guess value of set point [K] |
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | TSet | Set point temperature of the fluid that leaves port_b [K] |
output RealOutput | Q_flow | Heat added to the fluid (if flow is from port_a to port_b) [W] |
Partial model transporting two fluid streams between four ports without storing mass or energy
This component transports two fluid streams between four ports, without storing mass or energy. It is similar to Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger, but it has four ports instead of two.
If dpN_nominal > Modelica.Constants.eps
,
where N
denotes the fluid 1 or 2,
then the model computes
pressure drop due to flow friction in the respective fluid stream.
The pressure drop is defined by a quadratic function that goes through
the point (mN_flow_nominal, dpN_nominal)
.
At |mN_flow| < deltaMN * mN_flow_nominal
,
the pressure drop vs. flow relation is linearized.
If the parameter linearizeFlowResistanceN
is set to true,
then the whole pressure drop vs. flow resistance curve is linearized.
This model uses inputs and constants that need to be set by models
that extend or instantiate this model.
The following inputs need to be assigned, where N
denotes 1
or
2
:
QN_flow
, which is the heat flow rate added to the medium N.
mWatN_flow
, which is the moisture mass flow rate added to the medium N.
Set the constant sensibleOnlyN=true
if the model that extends
or instantiates this model sets mWatN_flow = 0
.
Note that the model does not implement 0 = Q1_flow + Q2_flow
or
0 = mXi1_flow + mXi2_flow
. If there is no heat or mass transfer
with the environment, then a model that extends this model needs to provide these
equations.
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
Boolean | sensibleOnly1 | Set to true if sensible exchange only for medium 1 | |
Boolean | sensibleOnly2 | Set to true if sensible exchange only for medium 2 | |
Nominal condition | |||
MassFlowRate | m1_flow_nominal | Nominal mass flow rate [kg/s] | |
MassFlowRate | m2_flow_nominal | Nominal mass flow rate [kg/s] | |
PressureDifference | dp1_nominal | Pressure difference [Pa] | |
PressureDifference | dp2_nominal | Pressure difference [Pa] | |
Initialization | |||
MassFlowRate | m1_flow.start | 0 | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp1.start | 0 | Pressure difference between port_a1 and port_b1 [Pa] |
MassFlowRate | m2_flow.start | 0 | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp2.start | 0 | Pressure difference between port_a2 and port_b2 [Pa] |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = true to allow flow reversal in medium 1, false restricts to design direction (port_a -> port_b) |
Boolean | allowFlowReversal2 | true | = true to allow flow reversal in medium 2, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m1_flow_small | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
MassFlowRate | m2_flow_small | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance | |||
Medium 1 | |||
Boolean | computeFlowResistance1 | (dp1_nominal > Modelica.Cons... | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp1 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance1 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM1 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Medium 2 | |||
Boolean | computeFlowResistance2 | (dp2_nominal > Modelica.Cons... | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp2 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance2 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM2 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_a2 | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
Partial model for static energy and mass conservation equations
This model transports fluid between its two ports, without storing mass or energy. It implements a steady-state conservation equation for energy and mass fractions. The model has zero pressure drop between its ports.
Set the parameter use_mWat_flow_in=true
to enable an
input connector for mWat_flow
.
Otherwise, the model uses mWat_flow = 0
.
If the constant simplify_mWat_flow = true
, which is its default value,
then the equation
port_a.m_flow + port_b.m_flow = - mWat_flow;
is simplified as
port_a.m_flow + port_b.m_flow = 0;
This causes an error in the mass balance of about 0.5%, but generally leads to simpler equations because the pressure drop equations are then decoupled from the mass exchange in this component.
To increase the numerical robustness of the model, the constant
prescribedHeatFlowRate
can be set.
Use the following settings:
prescribedHeatFlowRate=true
if the only means of heat transfer
at the heatPort
is a prescribed heat flow rate that
is not a function of the temperature difference
between the medium and an ambient temperature. Examples include an ideal electrical heater,
a pump that rejects heat into the fluid stream, or a chiller that removes heat based on a performance curve.
If the heatPort
is not connected, then set prescribedHeatFlowRate=true
as
in this case, heatPort.Q_flow=0
.
prescribedHeatFlowRate=false
if there is heat flow at the heatPort
computed as K * (T-heatPort.T), for some temperature T and some conductance K,
which may itself be a function of temperature or mass flow rate.prescribedHeatFlowRate=false
.
If prescribedHeatFlow=true
, then energy and mass balance
equations are formulated to guard against numerical problems near
zero flow that can occur if Q_flow
or m_flow
are the results of an iterative solver.
Input connectors of the model are
Q_flow
, which is the sensible plus latent heat flow rate added to the medium,
mWat_flow
, which is the moisture mass flow rate added to the medium, and
C_flow
, which is the trace substance mass flow rate added to the medium.
The model can only be used as a steady-state model with two fluid ports. For a model with a dynamic balance, and more fluid ports, use Buildings.Fluid.Interfaces.ConservationEquation.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
Initialization | |||
MassFlowRate | m_flow.start | 0 | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp.start | 0 | Pressure difference between port_a and port_b [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | use_mWat_flow | false | Set to true to enable input connector for moisture mass flow rate |
Boolean | use_C_flow | false | Set to true to enable input connector for trace substance |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | Q_flow | Sensible plus latent heat flow rate transferred into the medium [W] |
input RealInput | mWat_flow | Moisture mass flow rate added to the medium [kg/s] |
input RealInput | C_flow[Medium.nC] | Trace substance mass flow rate added to the medium |
output RealOutput | hOut | Leaving specific enthalpy of the component [J/kg] |
output RealOutput | XiOut[Medium.nXi] | Leaving species concentration of the component [1] |
output RealOutput | COut[Medium.nC] | Leaving trace substances of the component |
Partial model transporting fluid between two ports without storing mass or energy
This component transports fluid between its two ports, without storing mass or energy. It is based on Modelica.Fluid.Interfaces.PartialTwoPortTransport but it does use a different implementation for handling reverse flow because in this component, mass flow rate can be added or removed from the medium.
If dp_nominal > Modelica.Constants.eps
, this component computes
pressure drop due to flow friction.
The pressure drop is defined by a quadratic function that goes through
the point (m_flow_nominal, dp_nominal)
. At |m_flow| < deltaM * m_flow_nominal
,
the pressure drop vs. flow relation is linearized.
If the parameter linearizeFlowResistance
is set to true,
then the whole pressure drop vs. flow resistance curve is linearized.
Q_flow
, which is the heat flow rate added to the medium.
mWat_flow
, which is the moisture mass flow rate added to the medium.
Set the constant sensibleOnly=true
if the model that extends
or instantiates this model sets mWat_flow = 0
.
To increase the numerical robustness of the model, the constant
prescribedHeatFlowRate
can be set.
Use the following settings:
prescribedHeatFlowRate=true
if the only means of heat transfer
at the heatPort
is a prescribed heat flow rate that
is not a function of the temperature difference
between the medium and an ambient temperature. Examples include an ideal electrical heater,
a pump that rejects heat into the fluid stream, or a chiller that removes heat based on a performance curve.
If the heatPort
is not connected, then set prescribedHeatFlowRate=true
as
in this case, heatPort.Q_flow=0
.
prescribedHeatFlowRate=false
if there is heat flow at the heatPort
computed as K * (T-heatPort.T), for some temperature T and some conductance K,
which may itself be a function of temperature or mass flow rate.prescribedHeatFlowRate=false
.
If prescribedHeatFlow=true
, then energy and mass balance
equations are formulated to guard against numerical problems near
zero flow that can occur if Q_flow
or m_flow
are the results of an iterative solver.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | sensibleOnly | Set to true if sensible exchange only | |
Boolean | prescribedHeatFlowRate | Set to true if the heat flow rate is not a function of the component temperature | |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
PressureDifference | dp_nominal | Pressure difference [Pa] | |
Initialization | |||
MassFlowRate | m_flow.start | 0 | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp.start | 0 | Pressure difference between port_a and port_b [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance | |||
Boolean | computeFlowResistance | (abs(dp_nominal) > Modelica.... | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
output RealOutput | hOut | Leaving temperature of the component [J/kg] |
output RealOutput | XiOut[Medium.nXi] | Leaving species concentration of the component [1] |
output RealOutput | COut[Medium.nC] | Leaving trace substances of the component |
Partial model transporting one fluid stream with storing mass or energy
This component transports one fluid stream.
It provides the basic model for implementing dynamic and steady-state
models that exchange heat and water vapor with the fluid stream.
The model also computes the pressure drop due to the flow resistance.
By setting the parameter dp_nominal=0
, the computation
of the pressure drop can be avoided.
The variable vol.heatPort.T
always has the value of
the temperature of the medium that leaves the component.
For the actual temperatures at the port, the variables sta_a.T
and sta_b.T
can be used. These two variables are provided by
the base class
Buildings.Fluid.Interfaces.PartialTwoPortInterface.
The variable names follow the conventions used in Modelica.Fluid.Examples.HeatExchanger.BaseClasses.BasicHX .
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
MixingVolume | vol | redeclare Buildings.Fluid.Mi... | Volume for fluid stream |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
PressureDifference | dp_nominal | Pressure difference [Pa] | |
Initialization | |||
MassFlowRate | m_flow.start | 0 | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s] |
PressureDifference | dp.start | 0 | Pressure difference between port_a and port_b [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (port_a -> port_b) |
Advanced | |||
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics | |||
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance | |||
Boolean | computeFlowResistance | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics | |||
Nominal condition | |||
Time | tau | 30 | Time constant at nominal flow (if energyDynamics <> SteadyState) [s] |
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Initialization | |||
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Parameters for flow resistance for models with four ports
Type | Name | Default | Description |
---|---|---|---|
Nominal condition | |||
PressureDifference | dp1_nominal | Pressure difference [Pa] | |
PressureDifference | dp2_nominal | Pressure difference [Pa] | |
Flow resistance | |||
Medium 1 | |||
Boolean | computeFlowResistance1 | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp1 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance1 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM1 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Medium 2 | |||
Boolean | computeFlowResistance2 | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp2 | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance2 | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM2 | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Declarations for lumped volumes
This class contains parameters and medium properties that are used in the lumped volume model, and in models that extend the lumped volume model.
These parameters are used by Buildings.Fluid.Interfaces.ConservationEquation, Buildings.Fluid.MixingVolumes.MixingVolume, Buildings.Rooms.MixedAir, and by Buildings.Rooms.BaseClasses.MixedAir.
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component | |
Dynamics | |||
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Real | mSenFac | 1 | Factor for scaling the sensible thermal mass of the volume |
Initialization | |||
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
ExtraProperty | C_nominal[Medium.nC] | fill(1E-2, Medium.nC) | Nominal value of trace substances. (Set to typical order of magnitude.) |
Parameters for models with prescribed outlet state
This record declares parameters that are used by models with prescribed outlet temperature.
Type | Name | Default | Description |
---|---|---|---|
HeatFlowRate | Q_flow_maxHeat | Modelica.Constants.inf | Maximum heat flow rate for heating (positive) [W] |
HeatFlowRate | Q_flow_maxCool | -Modelica.Constants.inf | Maximum heat flow rate for cooling (negative) [W] |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate, used for regularization near zero flow [kg/s] | |
Dynamics | |||
Time | tau | 10 | Time constant at nominal flow rate (used if energyDynamics <> Modelica.Fluid.Types.Dynamics.SteadyState) [s] |
Initialization | |||
Temperature | T_start | Initial or guess value of set point [K] | |
Equations | |||
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Parameters for flow resistance for models with two ports
Type | Name | Default | Description |
---|---|---|---|
Nominal condition | |||
PressureDifference | dp_nominal | Pressure difference [Pa] | |
Flow resistance | |||
Boolean | computeFlowResistance | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |