modelMixingVolumeMoistAir

Mixing volume with heat port for latent heat exchange, to be used if moisture is added or removed

Extends from Buildings.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume (Partial mixing volume with inlet and outlet ports (flow reversal is allowed)).

Information

Model for an ideally mixed fluid volume and the ability to store mass and energy. The volume is fixed, and latent and sensible heat can be exchanged.

This model represents the same physics as Buildings.Fluid.MixingVolumes.MixingVolume, but in addition, it allows adding or subtracting water to the control volume. The mass flow rate of the added or subtracted water is specified at the port mWat_flow. Adding mWat_flow itself does not affect the energy balance in this model. Hence, the enthalpy that is added or removed with the flow of mWat_flow needs to be added to the heat port heatPort.

To increase the numerical robustness of the model, the constant prescribedHeatFlowRate can be set by the user. This constant only has an effect if the model has exactly two fluid ports connected, and if it is used as a steady-state model. Use the following settings:

  • Set 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.
  • Set 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.
    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 set prescribedHeatFlowRate=false.

Options

The parameter mSenFac can be used to increase the thermal mass of this model without increasing its volume. This way, species concentrations are still calculated correctly even though the thermal mass increases. The additional thermal mass is calculated based on the density and the value of the function HeatCapacityCp of the medium state state_default.
This parameter can for instance be useful in a pipe model when the developer wants to lump the pipe thermal mass to the fluid volume. By default mSenFac = 1, hence the mass is unchanged. For higher values of mSenFac, the mass will be scaled proportionally.

Set the parameter use_C_flow = true to enable an input connector for the trace substance flow rate. This allows to directly add or subtract trace substances such as CO2 to the volume. See Buildings.Fluid.Sensors.Examples.PPM for an example.

Parameters

TypeNameDefaultDescription
BooleanprescribedHeatFlowRate (from PartialMixingVolume)falseSet to true if the model has a prescribed heat flow at its heatPort. If the heat flow rate at the heatPort is only based on temperature difference, then set to false
Booleansimplify_mWat_flow (from PartialMixingVolume)trueSet to true to cause port_a.m_flow + port_b.m_flow = 0 even if mWat_flow is non-zero
Modelica.Units.SI.VolumeV (from PartialMixingVolume)Volume
Dynamics › Conservation equations
Modelica.Fluid.Types.DynamicsenergyDynamics (from LumpedVolumeDeclarations)Modelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicssubstanceDynamics (from LumpedVolumeDeclarations)energyDynamicsType of independent mass fraction balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicstraceDynamics (from LumpedVolumeDeclarations)energyDynamicsType of trace substance balance: dynamic (3 initialization options) or steady state
Advanced › Dynamics
Modelica.Fluid.Types.DynamicsmassDynamics (from LumpedVolumeDeclarations)energyDynamicsType of mass balance: dynamic (3 initialization options) or steady state, must be steady state if energyDynamics is steady state
Initialization
Medium.AbsolutePressurep_start (from LumpedVolumeDeclarations)Medium.p_defaultStart value of pressure
Medium.TemperatureT_start (from LumpedVolumeDeclarations)Medium.T_defaultStart value of temperature
Medium.MassFraction[Medium.nX]X_start (from LumpedVolumeDeclarations)Medium.X_defaultStart value of mass fractions m_i/m
Medium.ExtraProperty[Medium.nC]C_start (from LumpedVolumeDeclarations)fill(0, Medium.nC)Start value of trace substances
Medium.ExtraProperty[Medium.nC]C_nominal (from LumpedVolumeDeclarations)fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Dynamics
RealmSenFac (from LumpedVolumeDeclarations)1Factor for scaling the sensible thermal mass of the volume
Advanced
Booleaninitialize_p (from PartialMixingVolume)not Medium.singleState= true to set up initial equations for pressure
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialMixingVolume)1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Booleanuse_C_flowfalseSet to true to enable input connector for trace substance
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialMixingVolume)Nominal mass flow rate
General › Ports
IntegernPorts (from PartialMixingVolume)0Number of ports
Assumptions
BooleanallowFlowReversal (from PartialMixingVolume)true= false to simplify equations, assuming, but not enforcing, no flow reversal. Used only if model has two ports.

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b[nPorts]ports (from PartialMixingVolume)Fluid inlets and outlets
Modelica.Blocks.Interfaces.RealOutputU (from PartialMixingVolume)Internal energy of the component
Modelica.Blocks.Interfaces.RealOutputm (from PartialMixingVolume)Mass of the component
Modelica.Blocks.Interfaces.RealOutput[Medium.nXi]mXi (from PartialMixingVolume)Species mass of the component
Modelica.Blocks.Interfaces.RealOutput[Medium.nC]mC (from PartialMixingVolume)Trace substance mass of the component
Modelica.Blocks.Interfaces.RealInputmWat_flowWater flow rate added into the medium
Modelica.Blocks.Interfaces.RealOutputX_wSpecies composition of medium
Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_aheatPortHeat port for sensible plus latent heat exchange with the control volume
Modelica.Blocks.Interfaces.RealInputC_flowTrace substance mass flow rate added to the medium

Components

TypeNameDefaultDescription
Medium.TemperatureT (from PartialMixingVolume)Medium.temperature_phX(p = p, h = hOut_internal, X = if Medium.reducedX then cat(1, Xi, {1 - sum(Xi)}) else Xi)Temperature of the fluid
Modelica.Units.SI.Pressurep (from PartialMixingVolume)if nPorts > 0 then ports[1].p else p_startPressure of the fluid
Modelica.Units.SI.MassFraction[Medium.nXi]Xi (from PartialMixingVolume)XiOut_internalSpecies concentration of the fluid
Medium.ExtraProperty[Medium.nC]C (from PartialMixingVolume)COut_internalTrace substance mixture content

Revisions

  • October 19, 2017, by Michael Wetter:
    Set initialize_p to final so that it does not appear as a user-selectable parameter. This is done because initialize_p has been changed from a constant to a parameter for Buildings, issue 1013.
  • April 11, 2017, by Michael Wetter:
    Changed comment of heat port, as this needs to be the total heat flow rate in order to be able to use this model for modeling steam humidifiers and adiabatic humidifiers.
    Removed blocks QSen_flow and QLat_flow.
    This is for issue Buildings #704.
  • January 22, 2016 by Michael Wetter:
    Removed assignment of sensibleOnly in steBal as this constant is no longer used.
  • January 19, 2016, by Michael Wetter:
    Updated documentation due to the addition of an input for trace substance in the mixing volume. This is for issue 372.
  • February 11, 2014 by Michael Wetter:
    Redesigned implementation of latent and sensible heat flow rates as port of the correction of issue #197.
  • December 18, 2013 by Michael Wetter:
    Changed computation of s to allow this model to also be used with Buildings.Media.Water.
  • October 21, 2013 by Michael Wetter:
    Removed dublicate declaration of medium model.
  • September 27, 2013 by Michael Wetter:
    Reformulated assignment of i_w to avoid a warning in OpenModelica.
  • September 17, 2013 by Michael Wetter:
    Changed model to no longer use the obsolete model Buildings.Fluid.MixingVolumes.BaseClasses.PartialMixingVolumeWaterPort.
  • July 30, 2013 by Michael Wetter:
    Changed connector mXi_flow[Medium.nXi] to a scalar input connector mWat_flow in the conservation equation model. 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.
  • April 18, 2013 by Michael Wetter:
    Removed the use of the deprecated cardinality function. Therefore, all input signals must be connected.
  • February 7, 2012 by Michael Wetter:
    Revised base classes for conservation equations in Buildings.Fluid.Interfaces.
  • February 22, by Michael Wetter:
    Improved the code that searches for the index of 'water' in the medium model.
  • May 29, 2010 by Michael Wetter:
    Rewrote computation of index of water substance. For the old formulation, Dymola 7.4 failed to differentiate the model when trying to reduce the index of the DAE.
  • August 7, 2008 by Michael Wetter:
    First implementation.