Buildings.Fluids.MixingVolumes

Package with mixing volumes

Package Content

NameDescription
Buildings.Fluids.MixingVolumes.BaseClasses BaseClasses Package with base classes for mixing volumes
Buildings.Fluids.MixingVolumes.MixingVolume MixingVolume Mixing volume with inlet and outlet ports (flow reversal is allowed)
Buildings.Fluids.MixingVolumes.MixingVolumeDryAir MixingVolumeDryAir Mixing volume with heat port for latent heat exchange, to be used with dry air
Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir MixingVolumeMoistAir Mixing volume with heat port for latent heat exchange, to be used with media that conatin water


Buildings.Fluids.MixingVolumes.MixingVolume Buildings.Fluids.MixingVolumes.MixingVolume

Mixing volume with inlet and outlet ports (flow reversal is allowed)

Buildings.Fluids.MixingVolumes.MixingVolume

Information


Model for an ideally mixed fluid volume with nP ports and the ability 
to store mass and energy. The volume is fixed.

This model represents the same physics as Modelica_Fluid.Volumes.MixingVolume, but it allows to have more than two fluid ports. This is convenient for modeling the room volume in a building energy simulation since rooms often have more than two fluid connections, such as an HVAC inlet, outlet and a leakage flow to other rooms or the outside. If a fluid port is connected twice, the model will terminate the simulation with an error message.

The thermal port need not be connected, but can have any number of connections.


Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
IntegernP2Number of ports
BooleansteadyStatefalseSet to true for steady state model
Initialization
TempinitTypeTypes.Init.NoInitInitialization option
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then Medium.T...Start value of temperature [K]
SpecificEnthalpyh_startif use_T_start then Medium.s...Start value of specific enthalpy [J/kg]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]

Connectors

TypeNameDescription
FluidPort_aport[nP]Fluid port
HeatPort_athermalPortThermal port

Modelica definition

model MixingVolume 
  "Mixing volume with inlet and outlet ports (flow reversal is allowed)" 
  extends BaseClasses.PartialMixingVolume;
  
equation 
// Mass and energy balance 
  if steadyState then
    0 = sum(port[i].m_flow for i in 1:nP);
    zeros(Medium.nXi) = sum(port[i].mXi_flow for i in 1:nP);
    0 = sum(port[i].H_flow for i in 1:nP) + Qs_flow + Ws_flow;
  else
    der(m) = sum(port[i].m_flow for i in 1:nP);
    der(mXi) = sum(port[i].mXi_flow for i in 1:nP);
    der(U) = sum(port[i].H_flow for i in 1:nP) + Qs_flow + Ws_flow;
  end if;
  
 //  /* der(m) */ 0 = sum(port[i].m_flow for i in 1:nP);
 //  /* der(mXi) */ zeros(Medium.nXi) = sum(port[i].mXi_flow for i in 1:nP);
 //  /* der(U) */ 0 = sum(port[i].H_flow for i in 1:nP) + Qs_flow + Ws_flow;
end MixingVolume;

Buildings.Fluids.MixingVolumes.MixingVolumeDryAir Buildings.Fluids.MixingVolumes.MixingVolumeDryAir

Mixing volume with heat port for latent heat exchange, to be used with dry air

Buildings.Fluids.MixingVolumes.MixingVolumeDryAir

Information


Model for an ideally mixed fluid volume with nP ports 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.Fluids.MixingVolumes.MixingVolume, but in addition, it allows adding (or subtracting) water in liquid phase, which causes a change in enthalpy and species concentration. The water flow rate is assumed to be added or extracted at the temperature of the input port TWat, or if this port is not connected at the medium default temperature as returned by Medium.T_default.

Note that this model can only be used with medium models that include water as a substance. In particular, the medium model need to provide the function enthalpyOfLiquid(T) and the integer variable Water that contains the index to the water substance. For medium that do not provide this functionality, use instead the model Buildings.Fluids.MixingVolumes.MixingVolumeDryAir.


Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
IntegernP2Number of ports
BooleansteadyStatefalseSet to true for steady state model
Initialization
TempinitTypeTypes.Init.NoInitInitialization option
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then Medium.T...Start value of temperature [K]
SpecificEnthalpyh_startif use_T_start then Medium.s...Start value of specific enthalpy [J/kg]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]

Connectors

TypeNameDescription
FluidPort_aport[nP]Fluid port
HeatPort_athermalPortThermal port
input RealInputmWat_flowWater flow rate added into the medium
input RealInputTWatTemperature of liquid that is drained from or injected into volume
output RealOutputXWatSpecies composition of medium

Modelica definition

model MixingVolumeDryAir 
  "Mixing volume with heat port for latent heat exchange, to be used with dry air" 
  extends BaseClasses.PartialMixingVolumeWaterPort;
  
equation 
  if cardinality(mWat_flow) == 0 then
    mWat_flow = 0;
  end if;
  if cardinality(TWat) == 0 then
    TWat = Medium.T_default;
  end if;
  HWat_flow = 0;
  mXi_flow  = zeros(Medium.nXi);
// Assign output port
  XWat = 0;
end MixingVolumeDryAir;

Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir

Mixing volume with heat port for latent heat exchange, to be used with media that conatin water

Buildings.Fluids.MixingVolumes.MixingVolumeMoistAir

Information


Model for an ideally mixed fluid volume with nP ports 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.Fluids.MixingVolumes.MixingVolume, but in addition, it allows adding (or subtracting) water in liquid phase, which causes a change in enthalpy and species concentration. The water flow rate is assumed to be added or extracted at the temperature of the input port TWat, or if this port is not connected at the medium default temperature as returned by Medium.T_default.

Note that this model can only be used with medium models that include water as a substance. In particular, the medium model need to provide the function enthalpyOfLiquid(T) and the integer variable Water that contains the index to the water substance. For medium that do not provide this functionality, use instead the model Buildings.Fluids.MixingVolumes.MixingVolumeDryAir.


Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
IntegernP2Number of ports
BooleansteadyStatefalseSet to true for steady state model
Initialization
TempinitTypeTypes.Init.NoInitInitialization option
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then Medium.T...Start value of temperature [K]
SpecificEnthalpyh_startif use_T_start then Medium.s...Start value of specific enthalpy [J/kg]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]

Connectors

TypeNameDescription
FluidPort_aport[nP]Fluid port
HeatPort_athermalPortThermal port
input RealInputmWat_flowWater flow rate added into the medium
input RealInputTWatTemperature of liquid that is drained from or injected into volume
output RealOutputXWatSpecies composition of medium

Modelica definition

model MixingVolumeMoistAir 
  "Mixing volume with heat port for latent heat exchange, to be used with media that conatin water" 
  extends BaseClasses.PartialMixingVolumeWaterPort;
  // redeclare Medium with a more restricting base class. This improves the error
  // message if a user selects a medium that does not contain the function
  // enthalpyOfLiquid(.)
  replaceable package Medium = Modelica.Media.Interfaces.PartialCondensingGases;
  
equation 
  if cardinality(mWat_flow) == 0 then
    mWat_flow = 0;
    HWat_flow = 0;
    mXi_flow  = zeros(Medium.nXi);
  else
    if cardinality(TWat) == 0 then
       HWat_flow = mWat_flow * Medium.enthalpyOfLiquid(Medium.T_default);
    else
       HWat_flow = mWat_flow * Medium.enthalpyOfLiquid(TWat);
    end if;
    for i in 1:Medium.nXi loop
      mXi_flow[i] = if ( i == Medium.Water) then mWat_flow else 0;
    end for;
  end if;
// Medium species concentration
  XWat = medium.X[Medium.Water];
end MixingVolumeMoistAir;

HTML-documentation generated by Dymola Fri Oct 31 16:23:49 2008.