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.
The model
IBPSA.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%.
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 IBPSA.Fluid.Interfaces.StaticTwoPortConservationEquation provides a more efficient implementation.
For a model that instantiates this model, see IBPSA.Fluid.MixingVolumes.MixingVolume.
start
attributes.constant
to a parameter
.stateSelect
for mass m
.U
.use_C_flow
and converted C_flow
to a conditionally removed connector.
This is for
#372.
C_flow
to the steady-state trace substance balance,
and removed the units of C_flow
to allow for PPM.
C_flow
and code for handling trace substance insertions.
simplify_mWat_flow
.
This may lead to smaller algebraic loops.
This is for
#247.
simplify_mWat_flow
to remove dependencies of the pressure drop
calculation on the moisture balance.
preferredMediumStates= false
in
the instance medium
as the default
is already false
.
This is for
#260.
Xi(start=X_start[1:Medium.nXi], each stateSelect=if (not (substanceDynamics == Modelica.Fluid.Types.Dynamics.SteadyState)) then StateSelect.prefer else StateSelect.default),and set
preferredMediumStates = false
because the previous declaration led to more equations and
translation problems in large models.
This is for
#260.
dynBal.U.start
from instance dynBal
of PartialMixingVolume
to this model implementation.
This is required for a pedantic model check in Dymola 2016.
It addresses
issue 266.
This revison also renames the protected variable
rho_nominal
to rho_start
as it depends on the start values and not the nominal values.
p(stateSelect=if not (massDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) then StateSelect.prefer else StateSelect.default)because the previous declaration led to the translation error
The model requires derivatives of some inputs as listed below: 1 inlet.m_flow 1 inlet.pwhen translating
Buildings.Fluid.FMI.ExportContainers.Examples.FMUs.HeaterCooler_u
with a dynamic energy balance.
semiLinear()
function for calculation of
ports_H_flow
. This enables Dymola to simplify based on
the min
and max
attribute of the mass flow rate.
m
is now constant.
initalize_p
from a parameter
to a
constant
. This is only required in finite volume models
of heat exchangers (to avoid consistent but redundant initial conditions)
and hence it should be set as a constant
.
stateSelect.prefer
for temperature.
This is for
#160.
mFactor
to increase the thermal capacity.
medium
to avoid in OpenModelica the warning
alias set with several free start values.
initialize_p
. This is required
to enable the coil models to initialize the pressure in the first
volume, but not in the downstream volumes. Otherwise,
the initial equations will be overdetermined, but consistent.
This change was done to avoid a long information message that appears
when translating models.
Evaluate=true
.
Q_flow
input.
hOut
.
i_w
.Medium.ExtraProperty C[Medium.nC](each nominal=C_nominal)
to
Medium.ExtraProperty C[Medium.nC](nominal=C_nominal)
because C_nominal
is a vector.
This syntax error caused a compilation error in OpenModelica.
mXi_flow[Medium.nXi]
to a scalar input connector mWat_flow
.
The reason is that mXi_flow
does not allow
to compute the other components in mX_flow
and
therefore leads to an ambiguous use of the model.
By only requesting mWat_flow
, the mass balance
and species balance can be implemented correctly.
COut
,
and added min and max attributes for XiOut
.
energyBalance
and massBalance
can lead to inconsistent equations.
h_start
, as this
is not needed for building simulation.
Also removed the reference to Modelica.Fluid.System
.
Moved parameters and medium to
IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations.
substanceDynamics
and
traceDynamics
from energyDynamics
to massDynamics
.
Xi
.
C_nominal
which is used as the nominal attribute for C
.
Without this value, the ODE solver gives wrong results for concentrations around 1E-7.
system.p_start
to Medium.p_default
since HVAC models may have water and
air, which are typically at different pressures.
Medium.BaseProperties
the initialization
X(start=X_start[1:Medium.nX])
. Previously, the initialization
was only done for Xi
but not for X
, which caused the
medium to be initialized to reference_X
, ignoring the value of X_start
.
Buildings
library, based on model from
Modelica.Fluid 1.0
.