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.Examples Examples Collection of models that illustrate model use and test models
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


This mixing volume is identical to the one from Modelica_Fluid.

Extends from Modelica_Fluid.Vessels.ClosedVolume (Volume of fixed size, closed to the ambient, with inlet/outlet ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
VolumeV Volume [m3]
Ports
IntegernPorts0Number of 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
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
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*rho0, 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 rho0=Medium.density(sta0) 
    "Density, used to compute fluid mass";
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.


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

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
VolumeV Volume [m3]
Ports
IntegernPorts1Number of ports
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.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.


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

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
VolumeV Volume [m3]
Ports
IntegernPorts1Number of ports
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 Thu Feb 19 16:52:40 2009.