Buildings.Airflow.Multizone

Package with models for multizone airflow and contaminant transport

Information

This package provides models to compute the airflow and contaminant transport between different rooms and between a room and the exterior environment. See the User's Guide for more information.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Airflow.Multizone.UsersGuide UsersGuide User's Guide
Buildings.Airflow.Multizone.DoorDiscretizedOpen DoorDiscretizedOpen Door model using discretization along height coordinate
Buildings.Airflow.Multizone.DoorDiscretizedOperable DoorDiscretizedOperable Door model using discretization along height coordinate
Buildings.Airflow.Multizone.EffectiveAirLeakageArea EffectiveAirLeakageArea Effective air leakage area
Buildings.Airflow.Multizone.MediumColumn MediumColumn Vertical shaft with no friction and no storage of heat and mass
Buildings.Airflow.Multizone.MediumColumnDynamic MediumColumnDynamic Vertical shaft with no friction and storage of heat and mass
Buildings.Airflow.Multizone.Orifice Orifice Orifice
Buildings.Airflow.Multizone.ZonalFlow_ACS ZonalFlow_ACS Zonal flow with input air change per second
Buildings.Airflow.Multizone.ZonalFlow_m_flow ZonalFlow_m_flow Zonal flow with input air change per second
Buildings.Airflow.Multizone.Types Types Package with type definitions
Buildings.Airflow.Multizone.Examples Examples Collection of models that illustrate model use and test models
Buildings.Airflow.Multizone.Validation Validation Collection of validation models
Buildings.Airflow.Multizone.BaseClasses BaseClasses Package with base classes for Buildings.Airflow.Multizone

Buildings.Airflow.Multizone.DoorDiscretizedOpen Buildings.Airflow.Multizone.DoorDiscretizedOpen

Door model using discretization along height coordinate

Buildings.Airflow.Multizone.DoorDiscretizedOpen

Information

This model describes the bi-directional air flow through an open door.

To compute the bi-directional flow, the door is discretize along the height coordinate. An orifice equation is used to compute the flow for each compartment.

In this model, the door is always open. Use the model Buildings.Airflow.Multizone.DoorDiscretizedOperable for a door that can either be open or closed.

Extends from Buildings.Airflow.Multizone.BaseClasses.DoorDiscretized (Door model using discretization along height coordinate).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VelocityvZer0.001Minimum velocity to prevent zero flow. Recommended: 0.001 [m/s]
IntegernCom10Number of compartments for the discretization
PressureDifferencedp_turbulent0.01Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01 [Pa]
Geometry
LengthwOpe0.9Width of opening [m]
LengthhOpe2.1Height of opening [m]
LengthhA2.7/2Height of reference pressure zone A [m]
LengthhB2.7/2Height of reference pressure zone B [m]
Orifice characteristics
RealCD0.65Discharge coefficient
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
BooleanforceErrorControlOnFlowtrueFlag to force error control on m_flow. Set to true if interested in flow rate

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)

Modelica definition

model DoorDiscretizedOpen "Door model using discretization along height coordinate" extends Buildings.Airflow.Multizone.BaseClasses.DoorDiscretized; parameter Real CD=0.65 "Discharge coefficient"; protected constant Real mFixed = 0.5 "Fixed value for flow coefficient"; constant Real gamma(min=1) = 1.5 "Normalized flow rate where dphi(0)/dpi intersects phi(1)"; constant Real a = gamma "Polynomial coefficient for regularized implementation of flow resistance"; constant Real b = 1/8*mFixed^2 - 3*gamma - 3/2*mFixed + 35.0/8 "Polynomial coefficient for regularized implementation of flow resistance"; constant Real c = -1/4*mFixed^2 + 3*gamma + 5/2*mFixed - 21.0/4 "Polynomial coefficient for regularized implementation of flow resistance"; constant Real d = 1/8*mFixed^2 - gamma - mFixed + 15.0/8 "Polynomial coefficient for regularized implementation of flow resistance"; equation m=mFixed; A = wOpe*hOpe; kVal = CD*dA*sqrt(2/rho_default); // orifice equation for i in 1:nCom loop dV_flow[i] = Buildings.Airflow.Multizone.BaseClasses.powerLawFixedM( k=kVal, dp=dpAB[i], m=mFixed, a=a, b=b, c=c, d=d, dp_turbulent=dp_turbulent); end for; end DoorDiscretizedOpen;

Buildings.Airflow.Multizone.DoorDiscretizedOperable Buildings.Airflow.Multizone.DoorDiscretizedOperable

Door model using discretization along height coordinate

Buildings.Airflow.Multizone.DoorDiscretizedOperable

Information

This model describes the bi-directional air flow through an open door.

To compute the bi-directional flow, the door is discretize along the height coordinate, and uses an orifice equation to compute the flow for each compartment.

The door can be either open or closed, depending on the input signal y. Set y=0 if the door is closed, and y=1 if the door is open. Use the model Buildings.Airflow.Multizone.DoorDiscretizedOpen for a door that is always closed.

Extends from Buildings.Airflow.Multizone.BaseClasses.DoorDiscretized (Door model using discretization along height coordinate).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
VelocityvZer0.001Minimum velocity to prevent zero flow. Recommended: 0.001 [m/s]
IntegernCom10Number of compartments for the discretization
PressureDifferencedp_turbulent0.01Pressure difference where laminar and turbulent flow relation coincide. Recommended: 0.01 [Pa]
Geometry
LengthwOpe0.9Width of opening [m]
LengthhOpe2.1Height of opening [m]
LengthhA2.7/2Height of reference pressure zone A [m]
LengthhB2.7/2Height of reference pressure zone B [m]
Rating conditions
PressureDifferencedpCloRat4Pressure drop at rating condition of closed door [Pa]
RealCDCloRat1Discharge coefficient at rating conditions of closed door
Closed door
AreaLCloLClo(min=0)Effective leakage area of closed door [m2]
RealCDClo0.65Discharge coefficient of closed door
RealmClo0.65Flow exponent for crack of closed door
Open door
RealCDOpe0.65Discharge coefficient of open door
RealmOpe0.5Flow exponent for door of open door
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
BooleanforceErrorControlOnFlowtrueFlag to force error control on m_flow. Set to true if interested in flow rate

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input RealInputyOpening signal, 0=closed, 1=open [1]

Modelica definition

model DoorDiscretizedOperable "Door model using discretization along height coordinate" extends Buildings.Airflow.Multizone.BaseClasses.DoorDiscretized; parameter Modelica.SIunits.PressureDifference dpCloRat(min=0, displayUnit="Pa") = 4 "Pressure drop at rating condition of closed door"; parameter Real CDCloRat(min=0, max=1)=1 "Discharge coefficient at rating conditions of closed door"; parameter Modelica.SIunits.Area LClo(min=0) "Effective leakage area of closed door"; parameter Real CDOpe=0.65 "Discharge coefficient of open door"; parameter Real CDClo=0.65 "Discharge coefficient of closed door"; parameter Real mOpe = 0.5 "Flow exponent for door of open door"; parameter Real mClo= 0.65 "Flow exponent for crack of closed door"; Modelica.Blocks.Interfaces.RealInput y(min=0, max=1, unit="1") "Opening signal, 0=closed, 1=open"; protected parameter Modelica.SIunits.Area AOpe=wOpe*hOpe "Open aperture area"; parameter Modelica.SIunits.Area AClo(fixed=false) "Closed aperture area"; Real kOpe "Open aperture flow coefficient, k = V_flow/ dp^m"; Real kClo "Closed aperture flow coefficient, k = V_flow/ dp^m"; Real fraOpe "Fraction of aperture that is open"; initial equation AClo=CDClo/CDCloRat * LClo * dpCloRat^(0.5-mClo); equation fraOpe =y; kClo = CDClo * AClo/nCom * sqrt(2/rho_default); kOpe = CDOpe * AOpe/nCom * sqrt(2/rho_default); // flow exponent m = fraOpe*mOpe + (1-fraOpe)*mClo; // opening area A = fraOpe*AOpe + (1-fraOpe)*AClo; // friction coefficient for power law kVal = fraOpe*kOpe + (1-fraOpe)*kClo; // orifice equation for i in 1:nCom loop dV_flow[i] = Buildings.Airflow.Multizone.BaseClasses.powerLaw( k=kVal, dp=dpAB[i], m=m, dp_turbulent=dp_turbulent); end for; end DoorDiscretizedOperable;

Buildings.Airflow.Multizone.EffectiveAirLeakageArea Buildings.Airflow.Multizone.EffectiveAirLeakageArea

Effective air leakage area

Buildings.Airflow.Multizone.EffectiveAirLeakageArea

Information

This model describes the one-directional pressure driven air flow through a crack-like opening, using the equation

V̇ = k Δpm,

where is the volume flow rate, k is a flow coefficient and m is the flow exponent. The flow coefficient is

k = L CD,Rat ΔpRat(0.5-m) (2/ρ0)0.5,

where L is the effective air leakage area, CD,Rat is the discharge coefficient at the reference condition, ΔpRat is the pressure drop at the rating condition, and ρ0 is the mass density at the medium default pressure, temperature and humidity.

The effective air leakage area L can be obtained, for example, from the ASHRAE fundamentals (ASHRAE, 1997, p. 25.18). In the ASHRAE fundamentals, the effective air leakage area is based on a reference pressure difference of ΔpRat = 4 Pa and a discharge coefficient of CD,Rat = 1. A similar model is also used in the CONTAM software (Dols and Walton, 2002). Dols and Walton (2002) recommend to use for the flow exponent m=0.6 to m=0.7 if the flow exponent is not reported with the test results.

References

Extends from Buildings.Airflow.Multizone.BaseClasses.PowerLawResistance (Flow resistance that uses the power law).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Realm0.65Flow exponent, m=0.5 for turbulent, m=1 for laminar
AreaLL(min=0)Effective leakage area [m2]
Rating conditions
PressureDifferencedpRat4Pressure drop [Pa]
RealCDRat1Discharge coefficient
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
BooleanforceErrorControlOnFlowtrueFlag to force error control on m_flow. Set to true if interested in flow rate
BooleanuseDefaultPropertiestrueSet to false to use density and viscosity based on actual medium state, rather than using default values
PressureDifferencedp_turbulent0.1Pressure difference where laminar and turbulent flow relation coincide. Recommended = 0.1 [Pa]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model EffectiveAirLeakageArea "Effective air leakage area" extends Buildings.Airflow.Multizone.BaseClasses.PowerLawResistance( m=0.65, final k=L * CDRat * sqrt(2.0/rho_default) * dpRat^(0.5-m)); parameter Modelica.SIunits.PressureDifference dpRat( min=0, displayUnit="Pa") = 4 "Pressure drop"; parameter Real CDRat( min=0, max=1) = 1 "Discharge coefficient"; parameter Modelica.SIunits.Area L(min=0) "Effective leakage area"; equation v = V_flow/L; end EffectiveAirLeakageArea;

Buildings.Airflow.Multizone.MediumColumn Buildings.Airflow.Multizone.MediumColumn

Vertical shaft with no friction and no storage of heat and mass

Buildings.Airflow.Multizone.MediumColumn

Information

This model describes the pressure difference of a vertical medium column. It can be used to model the pressure difference caused by stack effect.

Typical use and important parameters

The model can be used with the following three configurations, which are controlled by the setting of the parameter densitySelection:

The settings top and bottom should be used when rooms or different floors of a building are connected since multizone airflow models assume that each floor is completely mixed. For these two seetings, this model will compute the pressure between the center of the room and an opening that is at height h relative to the center of the room. The setting actual may be used to model a chimney in which a column of air will change its density based on the flow direction.

In this model, the parameter h must always be positive, and the port port_a must be at the top of the column.

Dynamics

For a dynamic model, use Buildings.Airflow.Multizone.MediumColumnDynamic instead of this model.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Lengthh3Height of shaft [m]
densitySelectiondensitySelection Select how to pick density

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model MediumColumn "Vertical shaft with no friction and no storage of heat and mass" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.SIunits.Length h(min=0) = 3 "Height of shaft"; parameter Buildings.Airflow.Multizone.Types.densitySelection densitySelection "Select how to pick density"; Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare package Medium = Medium, p(start=Medium.p_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_b( redeclare package Medium = Medium, p(start=Medium.p_default)) "Fluid connector b (positive design flow direction is from port_a to port_b)"; Modelica.SIunits.VolumeFlowRate V_flow "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; Modelica.SIunits.MassFlowRate m_flow "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; Modelica.SIunits.PressureDifference dp(displayUnit="Pa") "Pressure difference between port_a and port_b"; Modelica.SIunits.Density rho "Density in medium column"; protected Medium.ThermodynamicState sta_a=Medium.setState_phX( port_a.p, actualStream(port_a.h_outflow), actualStream(port_a.Xi_outflow)) "Medium properties in port_a"; Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; initial equation // The next assert tests for all allowed values of the enumeration. // Testing against densitySelection > 0 gives an error in OpenModelica as enumerations start with 1. assert(densitySelection == Buildings.Airflow.Multizone.Types.densitySelection.fromTop or densitySelection == Buildings.Airflow.Multizone.Types.densitySelection.fromBottom or densitySelection == Buildings.Airflow.Multizone.Types.densitySelection.actual, "You need to set the parameter \"densitySelection\" for the model MediumColumn."); equation // Design direction of mass flow rate m_flow = port_a.m_flow; // Pressure difference between ports // Xi is computed first as it is used in two expression, and in one // of them only one component is used. // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no // moisture and hence Xi[1] is an illegal statement. // We first compute temperature and then invoke a density function that // takes temperature as an argument. Simply calling a density function // of a medium that takes enthalpy as an argument would be dangerous // as different media can have different datum for the enthalpy. if (densitySelection == Buildings.Airflow.Multizone.Types.densitySelection.fromTop) then Xi = inStream(port_a.Xi_outflow); rho = Buildings.Utilities.Psychrometrics.Functions.density_pTX( p=Medium.p_default, T=Medium.temperature(Medium.setState_phX(port_a.p, inStream(port_a.h_outflow), Xi)), X_w=if Medium.nXi == 0 then 0 else Xi[1]); elseif (densitySelection == Buildings.Airflow.Multizone.Types.densitySelection.fromBottom) then Xi = inStream(port_b.Xi_outflow); rho = Buildings.Utilities.Psychrometrics.Functions.density_pTX( p=Medium.p_default, T=Medium.temperature(Medium.setState_phX(port_b.p, inStream(port_b.h_outflow), Xi)), X_w=if Medium.nXi == 0 then 0 else Xi[1]); else Xi = actualStream(port_a.Xi_outflow); rho = Buildings.Utilities.Psychrometrics.Functions.density_pTX( p=Medium.p_default, T=Medium.temperature(Medium.setState_phX(port_a.p, actualStream(port_a.h_outflow), Xi)), X_w=if Medium.nXi == 0 then 0 else Xi[1]); end if; V_flow = m_flow/Medium.density(sta_a); dp = port_a.p - port_b.p; dp = -h*rho*Modelica.Constants.g_n; // Isenthalpic state transformation (no storage and no loss of energy) port_a.h_outflow = inStream(port_b.h_outflow); port_b.h_outflow = inStream(port_a.h_outflow); // Mass balance (no storage) port_a.m_flow + port_b.m_flow = 0; // Transport of substances port_a.Xi_outflow = inStream(port_b.Xi_outflow); port_b.Xi_outflow = inStream(port_a.Xi_outflow); port_a.C_outflow = inStream(port_b.C_outflow); port_b.C_outflow = inStream(port_a.C_outflow); end MediumColumn;

Buildings.Airflow.Multizone.MediumColumnDynamic Buildings.Airflow.Multizone.MediumColumnDynamic

Vertical shaft with no friction and storage of heat and mass

Buildings.Airflow.Multizone.MediumColumnDynamic

Information

This model contains a completely mixed fluid volume and models that take into account the pressure difference of a medium column that is at the same temperature as the fluid volume. It can be used to model the pressure difference caused by a stack effect.

Typical use and important parameters

Set the parameter use_HeatTransfer=true to expose a heatPort. This heatPort can be used to add or subtract heat from the volume. This allows, for example, to use this model in conjunction with a model for heat transfer through walls to model a solar chimney that stores heat.

Dynamics

For a steady-state model, use Buildings.Airflow.Multizone.MediumColumn instead of this model.

In this model, the parameter h must always be positive, and the port port_a must be at the top of the column.

Extends from Buildings.Fluid.Interfaces.LumpedVolumeDeclarations (Declarations for lumped volumes).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Lengthh3Height of shaft [m]
VolumeV Volume in medium shaft [m3]
Dynamics
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
RealmSenFac1Factor for scaling the sensible thermal mass of the volume
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
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
ExtraPropertyC_nominal[Medium.nC]fill(1E-2, Medium.nC)Nominal value of trace substances. (Set to typical order of magnitude.)
Assumptions
Heat transfer
Booleanuse_HeatTransferfalse= true to use the HeatTransfer model
replaceable model HeatTransferModelica.Fluid.Vessels.BaseC...Wall heat transfer

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
HeatPort_aheatPortHeat port to exchange energy with the fluid volume
Assumptions
Heat transfer
replaceable model HeatTransferWall heat transfer

Modelica definition

model MediumColumnDynamic "Vertical shaft with no friction and storage of heat and mass" extends Buildings.Fluid.Interfaces.LumpedVolumeDeclarations; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.SIunits.Length h(min=0) = 3 "Height of shaft"; Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare final package Medium = Medium, p(start=Medium.p_default)) "Fluid connector a (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_b( redeclare final package Medium = Medium, p(start=Medium.p_default)) "Fluid connector b (positive design flow direction is from port_a to port_b)"; parameter Modelica.SIunits.Volume V "Volume in medium shaft"; // Heat transfer through boundary parameter Boolean use_HeatTransfer = false "= true to use the HeatTransfer model"; // m_flow_nominal is not used by vol, since this component // can only be configured as a dynamic model. // Therefore we set it to about 10 air changes per hour Buildings.Fluid.MixingVolumes.MixingVolume vol( final nPorts=2, redeclare final package Medium = Medium, final m_flow_nominal=V/360, final V=V, final energyDynamics=energyDynamics, final massDynamics=massDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start) "Air volume in the shaft"; MediumColumn colTop( redeclare final package Medium = Medium, final densitySelection=Buildings.Airflow.Multizone.Types.densitySelection.fromBottom, h=h/2) "Medium column that connects to top port"; MediumColumn colBot( redeclare final package Medium = Medium, final densitySelection=Buildings.Airflow.Multizone.Types.densitySelection.fromTop, h=h/2) "Medium colum that connects to bottom port"; replaceable model HeatTransfer = Modelica.Fluid.Vessels.BaseClasses.HeatTransfer.IdealHeatTransfer constrainedby Modelica.Fluid.Vessels.BaseClasses.HeatTransfer.PartialVesselHeatTransfer "Wall heat transfer"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort if use_HeatTransfer "Heat port to exchange energy with the fluid volume"; equation connect(colBot.port_a, vol.ports[1]); connect(vol.ports[2], colTop.port_b); connect(colTop.port_a, port_a); connect(colBot.port_b, port_b); connect(heatPort, vol.heatPort); end MediumColumnDynamic;

Buildings.Airflow.Multizone.Orifice Buildings.Airflow.Multizone.Orifice

Orifice

Buildings.Airflow.Multizone.Orifice

Information

This model describes the mass flow rate and pressure difference relation of an orifice in the form

V̇ = k Δpm,

where is the volume flow rate, k is a flow coefficient and m is the flow exponent. The flow coefficient is

k = CD A (2/ρ0)0.5,

where CD is the discharge coefficient, A is the cross section area and ρ0 is the mass density at the medium default pressure, temperature and humidity.

For turbulent flow, set m=1/2 and for laminar flow, set m=1. Large openings are characterized by values close to 0.5, while values near 0.65 have been found for small crack-like openings (Dols and Walton, 2002).

References

Extends from Buildings.Airflow.Multizone.BaseClasses.PowerLawResistance (Flow resistance that uses the power law).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Realm0.5Flow exponent, m=0.5 for turbulent, m=1 for laminar
Orifice characteristics
AreaA Area of orifice [m2]
RealCD0.65Discharge coefficient
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
BooleanforceErrorControlOnFlowtrueFlag to force error control on m_flow. Set to true if interested in flow rate
BooleanuseDefaultPropertiestrueSet to false to use density and viscosity based on actual medium state, rather than using default values
PressureDifferencedp_turbulent0.1Pressure difference where laminar and turbulent flow relation coincide. Recommended = 0.1 [Pa]

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Modelica definition

model Orifice "Orifice" extends Buildings.Airflow.Multizone.BaseClasses.PowerLawResistance( m=0.5, k=CD*A*sqrt(2.0/rho_default)); parameter Modelica.SIunits.Area A "Area of orifice"; parameter Real CD=0.65 "Discharge coefficient"; equation v = V_flow/A; end Orifice;

Buildings.Airflow.Multizone.ZonalFlow_ACS Buildings.Airflow.Multizone.ZonalFlow_ACS

Zonal flow with input air change per second

Buildings.Airflow.Multizone.ZonalFlow_ACS

Information

This model computes the air exchange between volumes.

Input is the air change per seconds. The volume flow rate is computed as

  V_flow = ACS * V

where ACS is an input and the volume V is a parameter.

Extends from Buildings.Airflow.Multizone.BaseClasses.ZonalFlow (Flow across zonal boundaries of a room).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMedium 
BooleanuseDefaultPropertiesfalseSet to true to use constant density
VolumeV Volume of room [m3]
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input RealInputACSAir change per seconds, relative to the smaller of the two volumes

Modelica definition

model ZonalFlow_ACS "Zonal flow with input air change per second" extends Buildings.Airflow.Multizone.BaseClasses.ZonalFlow; parameter Boolean useDefaultProperties = false "Set to true to use constant density"; parameter Modelica.SIunits.Volume V "Volume of room"; Modelica.Blocks.Interfaces.RealInput ACS "Air change per seconds, relative to the smaller of the two volumes"; protected Modelica.SIunits.VolumeFlowRate V_flow "Volume flow rate at standard pressure"; Modelica.SIunits.MassFlowRate m_flow "Mass flow rate"; parameter Medium.ThermodynamicState sta_default = Medium.setState_pTX(T=Medium.T_default, p=Medium.p_default, X=Medium.X_default); parameter Modelica.SIunits.Density rho_default=Medium.density(sta_default) "Density, used to compute fluid volume"; Medium.ThermodynamicState sta_a1_inflow= Medium1.setState_phX(port_a1.p, port_b1.h_outflow, port_b1.Xi_outflow) "Medium properties in port_a1"; Medium.ThermodynamicState sta_a2_inflow= Medium1.setState_phX(port_a2.p, port_b2.h_outflow, port_b2.Xi_outflow) "Medium properties in port_a2"; equation when useDefaultProperties and initial() then assert( abs(1-rho_default/((Medium.density(sta_a1_inflow) + Medium.density(sta_a2_inflow))/2)) < 0.2, "Wrong density. Densities need to match."); // The next three lines have been removed as they cause // a compilation error in OpenModelica. // + "\n Medium.density(sta_a1) = " + String(Medium.density(sta_a1_inflow)) // + "\n Medium.density(sta_a2) = " + String(Medium.density(sta_a2_inflow)) // + "\n rho_nominal = " + String(rho_default)); end when; V_flow = V * ACS; m_flow / V_flow = if useDefaultProperties then rho_default else (Medium.density(sta_a1_inflow) + Medium.density(sta_a2_inflow))/2; // assign variable in base class port_a1.m_flow = m_flow; port_a2.m_flow = m_flow; end ZonalFlow_ACS;

Buildings.Airflow.Multizone.ZonalFlow_m_flow Buildings.Airflow.Multizone.ZonalFlow_m_flow

Zonal flow with input air change per second

Buildings.Airflow.Multizone.ZonalFlow_m_flow

Information

This model computes the air exchange between volumes.

Input is the mass flow rate from port_a1 to port_b1 and from port_a2 to port_b2.

Extends from Buildings.Airflow.Multizone.BaseClasses.ZonalFlow (Flow across zonal boundaries of a room).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMedium 
Advanced
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed

Connectors

TypeNameDescription
FluidPort_aport_a1Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_bport_b1Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
FluidPort_aport_a2Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
FluidPort_bport_b2Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
input RealInputmAB_flowMass flow rate from A to B, positive if flow from port_a1 to port_b1
input RealInputmBA_flowMass flow rate from B to A, positive if flow from port_a2 to port_b2

Modelica definition

model ZonalFlow_m_flow "Zonal flow with input air change per second" extends Buildings.Airflow.Multizone.BaseClasses.ZonalFlow; Modelica.Blocks.Interfaces.RealInput mAB_flow "Mass flow rate from A to B, positive if flow from port_a1 to port_b1"; Modelica.Blocks.Interfaces.RealInput mBA_flow "Mass flow rate from B to A, positive if flow from port_a2 to port_b2"; equation port_a1.m_flow = mAB_flow; port_a2.m_flow = mBA_flow; end ZonalFlow_m_flow;