Buildings.Fluid.Interfaces
Package with interfaces for fluid models
Information
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).
Package Content
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 |
PartialFourPortParallel | Partial model with four ports for components with parallel flow |
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 |
PartialTwoPortVector | Partial component with two ports, one of which being vectorized |
PrescribedOutlet | 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 |
TwoPortFlowResistanceParameters | Parameters for flow resistance for models with two ports |
Examples | Collection of models that illustrate model use and test models |
Buildings.Fluid.Interfaces.ConservationEquation
Lumped volume with mass and energy balance
Information
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
.
Typical use and important parameters
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.
The model
Buildings.Fluid.MixingVolumes.Validation.MixingVolumeAdiabaticCooling
shows that the relative error on the temperature difference between these
two options of simplify_mWat_flow
is less than
0.1%.
Implementation
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).
Parameters
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 | initialize_p | not Medium.singleState | = true to set up initial equations for pressure |
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 |
Connectors
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 |
Modelica definition
Buildings.Fluid.Interfaces.FourPortHeatMassExchanger
Model transporting two fluid streams between four ports with storing mass or energy
Information
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 with
Buildings.Fluid.MixingVolumes.MixingVolumeMoistAir.
Implementation
The variable names follow the conventions used in Modelica.Fluid.Examples.HeatExchanger.BaseClasses.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).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium1 | PartialMedium | Medium 1 in the component | |
replaceable package Medium2 | PartialMedium | Medium 2 in the component | |
MixingVolumeHeatPort | vol1 | redeclare Buildings.Fluid.Mi... | Volume for fluid 1 |
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] | |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
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.) |
Modelica definition
Buildings.Fluid.Interfaces.PartialFourPort
Partial model with four ports
Information
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:
- it has four ports, and
-
the parameters
port_a_exposesState
,port_b_exposesState
andshowDesignFlowDirection
are not implemented.
Parameters
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 | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.PartialFourPortInterface
Partial model transporting fluid between two ports without storing mass or energy
Information
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).
Parameters
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 | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
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 |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.PartialFourPortParallel
Partial model with four ports for components with parallel flow
Information
This model defines an interface for components with four ports
in which flows occur in parallel.
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 following:
- it has four ports, and
- the parameter
showDesignFlowDirection
is not implemented.
Parameters
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) |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.PartialTwoPort
Partial component with two ports
Information
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
.
Implementation
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.
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.PartialTwoPortInterface
Partial model transporting fluid between two ports without storing mass or energy
Information
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).
Parameters
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 | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Modelica definition
Buildings.Fluid.Interfaces.PartialTwoPortTransport
Partial element transporting fluid between two ports without storage of mass or energy
Information
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:
- The momentum balance specifying the relationship between the pressure drop
dp
and the mass flow ratem_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.
Implementation
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).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.PartialTwoPortVector
Partial component with two ports, one of which being vectorized
Information
This partial model defines an interface for components with two ports, of which one is vectorized.
The treatment of the design flow direction and of flow reversal are
determined based on the parameter allowFlowReversal
.
The component may transport fluid and may have internal storage.
Implementation
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, and in practice,
users have not used this global definition to assign parameters.
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) |
Connectors
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 ports_b) |
FluidPorts_b | ports_b[nPorts] | Fluid connectors b (positive design flow direction is from port_a to ports_b) |
Modelica definition
Buildings.Fluid.Interfaces.PrescribedOutlet
Component that assigns the outlet fluid property at port_a based on an input signal
Information
This model sets the temperature or the water vapor mass fraction
of the medium that leaves port_a
to the value given by the input TSet
or X_wSet
,
subject to optional limitations on the capacity
for heating and cooling, or limitations on the humidification or dehumidification
moisture mass flow rate.
Also, optionally the model allows to take into account first order dynamics.
If the parameters energyDynamics
or
massDynamics
are 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.PrescribedOutlet for a model that instantiates this model and that has a pressure drop.
In case of reverse flow,
the fluid that leaves port_a
has the same
properties as the fluid that enters port_b
.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
HeatFlowRate | QMax_flow | Modelica.Constants.inf | Maximum heat flow rate for heating (positive) [W] |
HeatFlowRate | QMin_flow | -Modelica.Constants.inf | Maximum heat flow rate for cooling (negative) [W] |
MassFlowRate | mWatMax_flow | Modelica.Constants.inf | Maximum water mass flow rate addition (positive) [kg/s] |
MassFlowRate | mWatMin_flow | -Modelica.Constants.inf | Maximum water mass flow rate removal (negative) [kg/s] |
Boolean | use_TSet | true | Set to false to disable temperature set point |
Boolean | use_X_wSet | true | Set to false to disable water vapor set point |
Nominal condition | |||
MassFlowRate | m_flow_nominal | Nominal mass flow rate [kg/s] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Dynamics | |||
Time | tau | 10 | Time constant at nominal flow rate (used if energyDynamics or massDynamics not equal Modelica.Fluid.Types.Dynamics.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 | |||
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 [1] |
Connectors
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] |
input RealInput | X_wSet | Set point for water vapor mass fraction of the fluid that leaves port_b [1] |
output RealOutput | Q_flow | Heat flow rate added to the fluid (if flow is from port_a to port_b) [W] |
output RealOutput | mWat_flow | Water vapor mass flow rate added to the fluid (if flow is from port_a to port_b) [kg/s] |
Modelica definition
Buildings.Fluid.Interfaces.StaticFourPortHeatMassExchanger
Partial model transporting two fluid streams between four ports without storing mass or energy
Information
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.
Implementation
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 sensible and latent 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).
Parameters
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] | |
Assumptions | |||
Boolean | allowFlowReversal1 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
Boolean | allowFlowReversal2 | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
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 |
Connectors
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) |
Modelica definition
Buildings.Fluid.Interfaces.StaticTwoPortConservationEquation
Partial model for static energy and mass conservation equations
Information
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.
Typical use and important parameters
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:
- Set
prescribedHeatFlowRate=true
if the only means of heat transfer at theheatPort
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 theheatPort
is not connected, then setprescribedHeatFlowRate=true
as in this case,heatPort.Q_flow=0
. - Set
prescribedHeatFlowRate=false
if there is heat flow at theheatPort
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.
If there is a combination of K * (T-heatPort.T) and a prescribed heat flow rate, for example a solar collector that dissipates heat to the ambient and receives heat from the solar radiation, then setprescribedHeatFlowRate=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.
Implementation
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).
Parameters
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 | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Connectors
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 |
Modelica definition
Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger
Partial model transporting fluid between two ports without storing mass or energy
Information
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.
Implementation
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:-
Q_flow
, which is the sensible and latent 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:
- Set
prescribedHeatFlowRate=true
if the only means of heat transfer at theheatPort
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 theheatPort
is not connected, then setprescribedHeatFlowRate=true
as in this case,heatPort.Q_flow=0
. - Set
prescribedHeatFlowRate=false
if there is heat flow at theheatPort
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.
If there is a combination of K * (T-heatPort.T) and a prescribed heat flow rate, for example a solar collector that dissipates heat to the ambient and receives heat from the solar radiation, then setprescribedHeatFlowRate=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).
Parameters
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] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Connectors
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 |
Modelica definition
Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger
Partial model transporting one fluid stream with storing mass or energy
Information
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 ideal heater or cooler Buildings.Fluid.HeatExchangers.HeaterCooler_u, and
- the ideal humidifier Buildings.Fluid.Humidifiers.Humidifier_u.
Implementation
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).
Parameters
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] | |
Assumptions | |||
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
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 |
Modelica definition
Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters
Parameters for flow resistance for models with four ports
Information
This class contains parameters that are used to compute the pressure drop in components that have two fluid streams. Note that the nominal mass flow rate is not declared here because the model PartialFourPortInterface already declares it.Parameters
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 |
Modelica definition
Buildings.Fluid.Interfaces.LumpedVolumeDeclarations
Declarations for lumped volumes
Information
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 for example by Buildings.Fluid.Interfaces.ConservationEquation, Buildings.Fluid.MixingVolumes.MixingVolume and Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2.
Parameters
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.) |
Modelica definition
Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters
Parameters for flow resistance for models with two ports
Information
This class contains parameters that are used to compute the pressure drop in models that have one fluid stream. Note that the nominal mass flow rate is not declared here because the model PartialTwoPortInterface already declares it.Parameters
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 |