The model Buildings.ThermalZones.Detailed.CFD is a room model in which the room air heat and mass balance is computed using the Computational Fluid Dynamics (CFD).
The model is identical with Buildings.ThermalZones.Detailed.MixedAir, except for the following points:
sensorName
.
This parameter is an array of strings. The same strings must be used
in the CFD input file when declaring the sensor in order to send the
CFD results to the output signal of Modelica.
ports
using the parameter
portName
.
This parameter is an array of strings. The same strings must be used
in the CFD input file when declaring the inlet and outlet boundary conditions.
The following conventions are made:
The port heaPorAir
contains the average room air temperature, defined as
Ta = 1 ⁄ V ∫V T(dV) dV,
where Ta is the average room air temperature, V is the room air volume and T(dV) is the room air temperature in the control volume dV. The average room air temperature Ta is computed by the CFD program.
heaPorAir
, then the heat will be distributed to all
cells. The amount of heat flow rate that each cell exchanges with heaPorAir
is
proportional to its volume.
The quantities that are exchanged between the programs are defined as follows:
Xi
.
It does not do a moisture balance for each cell.
However, for trace substances C
, CFD does a contaminant balance for each cell
and return C_outflow
to be the contaminant concentration of that cell.
This section explains how the data exchange between Modelica and CFD is implemented. The section is only of interest to developers. Users may skip this section.
Interfacing CFD with the Modelica room air heat and mass balance is done in the model Buildings.ThermalZones.Detailed.BaseClasses.CFDAirHeatMassBalance. To interface variables from Modelica and CFD, the following classes and conventions are used in this model.
ports
,
then no variables are exchanged for this quantity with the block cfd
.
bouCon
, two of these ports are conditionally removed.
This allows to use the parameter bouCon
to specify whether
the surface should be used with a temperature or a heat flow rate
boundary condition.
Therefore, the inputs and outputs to the instance cfd
are either temperatures or heat flow rates.
The parameter surIde
of this model, which is also
propagated to the instance cfd
, declares what
type of boundary condition is used.
ports
are exchanged with the CFD block
through the instance intFlu
.
This interface is implemented in
Buildings.ThermalZones.Detailed.BaseClasses.CFDFluidInterface.
Its output and input signals are connected to the cfd
block as follows:
cfd
block is a vector
[p, m_flow[nPorts], T_inflow[nPorts], X_inflow[nPorts*Medium.nXi],
C_inflow[nPorts*Medium.nC]]
.
The quantity p
is the total pressure of the fluid ports (all fluid ports have the same
total pressure).
Therefore, the flow resistance of the diffusor or exhaust grill must be computed in the
Modelica HVAC system that is connected to the room model.
The quantities X_inflow
and C_inflow
(or X_inflow
and C_inflow
)
are vectors with components X_inflow[1:Medium.nXi]
and C_inflow[1:Medium.nC]
.
For example, for moist air, X_inflow
has one element which is equal to the mass fraction of air,
relative to the total air mass and not the dry air.
[T_outflow[nPorts], X_outflow[nPorts*Medium.nXi], C_outflow[nPorts*Medium.nC]]
.
The quantities *_outflow
are the fluid properties of the cell to which the port is
connected.
Medium.nXi=0
(e.g., for dry air) or Medium.nC=0
,
then these signals are not present as input/output signals of the CFD block.
The data exchange with the CFD interface is done through the instance
cfd
, and implemented in
Buildings.ThermalZones.Detailed.BaseClasses.CFDExchange.
This block exchanges the following data with the CFD simulation:
During the initialzation, the following data are sent from Modelica to CFD:
name
.
The orders of elements in this array are as follows:
nConExt
elements are the names of the exterior constructions
declared as datConExt
. The order is the same as
in the declaration of datConExt
.
nConExtWin
elements are the names of the exterior constructions
declared as datConExtWin
. These constructions embed windows
and a frame. Therefore, what follows are
nConExtWin
elements where each string is the same as above,
but ' (glass, unshaded)'
has been appended,
then -- if and only if the window has a shade --
nConExtWin
elements follow with
' (glass, shaded)'
appended, and,
finally,
nConExtWin
elements follow with ' (frame)'
appended.
nConPar
elements for the surface a
of datConPar
.
To these names, the string ' (surface a)'
is appended.
Next, there are nConPar
elements with ' (surface b)'
appended.
nConBou
elements for the surfaces of datConBou
.
nSurBou
elements for the surfaces of nSurBou
.
A
,
an array for the surface tilt til
and the type of the boundary conditions bouCon
for each of these surfaces.
If bouCon[i] = 1
,
then temperature is sent from Modelica to CFD.
If bouCon[i] = 2
, then
heat flow rate is sent from Modelica to CFD.
sensorName
that contains the names of all sensors,
in the same order as they are declared when instantiating the model
Buildings.ThermalZones.Detailed.CFD.
If no sensors are declared in Modelica, then this array will have zero elements.
How many sensor are declared in Modelica can be checked through the variable nSen
,
which is sent from Modelica to CFD.
AirProperty
that contains the properties of the air.
The orders of elements in this array are as follows:
During the time integration, and array u
is sent from Modelica to CFD, and Modelica
receives an array y
from CFD.
The elements of the array u
are as follows:
name
. The units are [K] or [W].
The array bouCon
that is sent during the
initialization declares the type of boundary
condition.
There are nSur
elements for surfaces.
nConExtWin
elements are the shading control signals. u=0
means
that the shade is not deployed,
and u=1
means that the shade is
completely deployed (blocking solar radiation).
If there is no window in the room, then these elements are not present.
nConExtWin
elements are the radiations in [W] that are absorbed by the
respective shades.
If there is no window in the room, then these elements are not present.
nPorts
elements are the mass flow rates
into the room in [kg/s].
A positive value is used if the air flows into the room,
otherwise the value is negative.
The first element is connected to ports[1]
, the second to
ports[2]
etc.
nPorts
elements are the air temperatures
that the medium has
if it were flowing into the room, e.g., the "inflowing medium"
computed based on inStream(h_outflow)
.
nPorts*Medium.nXi
elements are the
species concentration of the inflowing
medium.
The first Medium.nXi
elements are for port 1, then for
port 2 etc.
The units are in [kg/kg] total mass, and not in [kg/kg] dry air.
nPorts*Medium.nC
elements are the trace substances
of the inflowing
medium.
The first Medium.nC
elements are for port 1, then for
port 2 etc.
y
that is sent from CFD to Modelica are as follows:
name
.
The array bouCon
that is sent during the
initialization declares the type of boundary
condition.
If bouCon[i] = 1
, then heat flow rate in [W]
is sent from CFD to Modelica.
If bouCon[i] = 2
, then temperature in [K]
is sent from CFD to Modelica.
There are nSur
elements for surfaces.
nConExtWin
elements are the temperature of the
shade in [K].
nPorts
elements are the air temperatures
in [K]
of the cells that are connected to the inlet or outlet diffusor
of ports[1], ports[2], etc.
.
nPorts*Medium.nXi
elements are the
species concentration of the cells to which the ports are
connected.
The first Medium.nXi
elements are for port 1, then for
port 2 etc.
The units are in [kg/kg] total mass, and not in [kg/kg] dry air.
nPorts*Medium.nC
elements are the trace substances
of the cells to which the ports are connected to.
The first Medium.nC
elements are for port 1, then for
port 2 etc.
Wangda Zuo, Michael Wetter, Wei Tian, Dan Li, Mingang Jin, Qingyan Chen.
Coupling Indoor Airflow, HVAC, Control and Building Envelope Heat Transfer in the Modelica Buildings Library.
Journal of Building Performance Simulation, 9(4), pp. 366-381, 2016.
http://dx.doi.org/10.1080/19401493.2015.1062557.
Wangda Zuo, Michael Wetter, Dan Li, Mingang Jin, Wei Tian, Qingyan Chen.
Coupled Simulation of Indoor Environment, HVAC and Control System by Using Fast Fluid Dynamics and the Modelica Buildings Library.
Proc. of the 2014 ASHRAE/IBPSA-USA Building Simulation Conference, Atlanta, GA, September 10-12, 2014.