Buildings.Fluid.MixingVolumes

Package with mixing volumes

Package Content

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


Buildings.Fluid.MixingVolumes.MixingVolume Buildings.Fluid.MixingVolumes.MixingVolume

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

Buildings.Fluid.MixingVolumes.MixingVolume

Information


This mixing volume is identical to the one from Modelica.Fluid,
but it sets parameters in the parent class and declares protected
variables that are needed by its child classes.

Extends from Buildings.Fluid.MixingVolumes.BaseClasses.ClosedVolume (Volume of fixed size, closed to the ambient, with inlet/outlet ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
Ports
Booleanuse_portsDatafalse= false to neglect pressure loss and kinetic energy
VesselPortsDataportsData[nPorts] Data of inlet/outlet ports
Assumptions
Dynamics
DynamicsenergyDynamicssystem.energyDynamicsFormulation of energy balance
DynamicsmassDynamicssystem.massDynamicsFormulation of mass balance
DynamicssubstanceDynamicsenergyDynamicsFormulation of substance balance
DynamicstraceDynamicsenergyDynamicsFormulation of trace substance balance
Heat transfer
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model
replaceable model HeatTransferIdealHeatTransferWall heat transfer
Initialization
AbsolutePressurep_startsystem.p_startStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then system.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]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances
Advanced
Port properties
MassFlowRatem_flow_smallsystem.m_flow_smallRegularization range at zero mass flow rate [kg/s]

Connectors

TypeNameDescription
VesselFluidPorts_bports[nPorts]Fluid inlets and outlets
HeatPort_aheatPort 

Modelica definition

model MixingVolume 
  "Mixing volume with inlet and outlet ports (flow reversal is allowed)"
  //extends Modelica.Fluid.Vessels.ClosedVolume(m(start=V*rho_nominal, fixed=false), use_portsData=false);
  extends Buildings.Fluid.MixingVolumes.BaseClasses.ClosedVolume(m(start=V*rho_nominal, fixed=false), use_portsData=false);

protected 
   parameter Medium.ThermodynamicState sta0 = Medium.setState_pTX(T=T_start,
         p=p_start, X=X_start[1:Medium.nXi]);
   parameter Modelica.SIunits.Density rho_nominal=Medium.density(sta0) 
    "Density, used to compute fluid mass";
end MixingVolume;

Buildings.Fluid.MixingVolumes.MixingVolumeDryAir Buildings.Fluid.MixingVolumes.MixingVolumeDryAir

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

Buildings.Fluid.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.Fluid.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.Fluid.MixingVolumes.MixingVolumeDryAir.

Extends from BaseClasses.PartialMixingVolumeWaterPort (Partial mixing volume that allows adding or subtracting water vapor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
Assumptions
Dynamics
DynamicsenergyDynamicssystem.energyDynamicsFormulation of energy balance
DynamicsmassDynamicssystem.massDynamicsFormulation of mass balance
Heat transfer
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model
replaceable model HeatTransferModelica.Fluid.Vessels.BaseC...Wall heat transfer
Initialization
AbsolutePressurep_startsystem.p_startStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then system.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]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPorts_bports[nPorts]Fluid outlets
HeatPort_aheatPort 
input RealInputmWat_flowWater flow rate added into the medium [kg/s]
input RealInputTWatTemperature of liquid that is drained from or injected into volume [K]
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.Fluid.MixingVolumes.MixingVolumeMoistAir Buildings.Fluid.MixingVolumes.MixingVolumeMoistAir

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

Buildings.Fluid.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.Fluid.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 defined 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.Fluid.MixingVolumes.MixingVolumeDryAir.

Extends from BaseClasses.PartialMixingVolumeWaterPort (Partial mixing volume that allows adding or subtracting water vapor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VolumeV Volume [m3]
Assumptions
Dynamics
DynamicsenergyDynamicssystem.energyDynamicsFormulation of energy balance
DynamicsmassDynamicssystem.massDynamicsFormulation of mass balance
Heat transfer
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model
replaceable model HeatTransferModelica.Fluid.Vessels.BaseC...Wall heat transfer
Initialization
AbsolutePressurep_startsystem.p_startStart value of pressure [Pa]
Booleanuse_T_starttrue= true, use T_start, otherwise h_start
TemperatureT_startif use_T_start then system.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]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPorts_bports[nPorts]Fluid outlets
HeatPort_aheatPort 
input RealInputmWat_flowWater flow rate added into the medium [kg/s]
input RealInputTWatTemperature of liquid that is drained from or injected into volume [K]
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;

protected 
  parameter Integer iWat(min=1, fixed=false) "Index for water substance";
initial algorithm 
  iWat :=1;
  if cardinality(mWat_flow) > 0 then
    for i in 1:Medium.nXi loop
      if Modelica.Utilities.Strings.isEqual(Medium.substanceNames[i], "Water") then
        iWat :=i;
      end if;
    end for;
  end if;
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 == iWat) then mWat_flow else 0;
    end for;
  end if;
// Medium species concentration
  XWat = medium.X[iWat];
end MixingVolumeMoistAir;

HTML-documentation generated by Dymola Sat Feb 6 17:33:42 2010.