Buildings.Examples.VAVReheat.ThermalZones
Package with models for the thermal zones
Information
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name | Description |
---|---|
Floor | Model of a floor of the building |
RoomLeakage | Room leakage model |
VAVBranch | Supply branch of a VAV system |
Buildings.Examples.VAVReheat.ThermalZones.Floor
Model of a floor of the building
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium model for air | |
Boolean | use_windPressure | true | Set to true to enable wind pressure |
InteriorConvection | intConMod | Buildings.HeatTransfer.Types... | Convective heat transfer model for room-facing surfaces of opaque constructions |
Angle | lat | Latitude [rad] | |
Real | winWalRat | 0.33 | Window to wall ratio for exterior walls |
Length | hWin | 1.5 | Height of windows [m] |
Plywood | matFur | matFur( ... | Material for furniture |
Carpet | matCar | Carpet | |
Concrete | matCon | matCon( x=0.1, k=1.311... | Concrete |
Plywood | matWoo | matWoo( x=0.01, k=0.11... | Wood for exterior construction |
Generic | matIns | matIns( x=0.087, k=0.0... | Steelframe construction with insulation |
GypsumBoard | matGyp | matGyp( x=0.0127, k=0.... | Gypsum board |
GypsumBoard | matGyp2 | matGyp2( x=0.025, k=0.... | Gypsum board |
Generic | conExtWal | conExtWal( ... | Exterior construction |
Generic | conIntWal | conIntWal( ... | Interior wall construction |
Generic | conFlo | conFlo( ... | Floor construction (opa_a is carpet) |
Generic | conFur | conFur( ... | Construction for internal mass of furniture |
Plywood | matCarTra | matCarTra( k=0.11, d=5... | Wood for floor |
DoubleClearAir13Clear | glaSys | glaSys( UFra=2, shade=... | Data record for the glazing system |
Real | kIntNor | 1 | Gain factor to scale internal heat gain in north zone |
Experimental (may be changed in future releases) | |||
Boolean | sampleModel | false | Set to true to time-sample the model, which can give shorter simulation time if there is already time sampling in the system model |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium model for air | |
VesselFluidPorts_b | portsSou[2] | Fluid inlets and outlets |
VesselFluidPorts_b | portsEas[2] | Fluid inlets and outlets |
VesselFluidPorts_b | portsNor[2] | Fluid inlets and outlets |
VesselFluidPorts_b | portsWes[2] | Fluid inlets and outlets |
VesselFluidPorts_b | portsCor[2] | Fluid inlets and outlets |
Bus | weaBus | Weather bus |
output RealOutput | TRooAir[5] | Room air temperatures [K] |
output RealOutput | p_rel | Relative pressure signal of building static pressure |
Modelica definition
model Floor "Model of a floor of the building"
replaceable package Medium = Modelica.Media.Interfaces.PartialMedium
"Medium model for air";
parameter Boolean use_windPressure=true
"Set to true to enable wind pressure";
parameter HeatTransfer.Types.InteriorConvection intConMod=Buildings.HeatTransfer.Types.InteriorConvection.Temperature
"Convective heat transfer model for room-facing surfaces of opaque constructions";
parameter Modelica.SIunits.Angle lat "Latitude";
parameter Real winWalRat(
min=0.01,
max=0.99) = 0.33 "Window to wall ratio for exterior walls";
parameter Modelica.SIunits.Length hWin = 1.5 "Height of windows";
parameter HeatTransfer.Data.Solids.Plywood matFur(x=0.15, nStaRef=5)
"Material for furniture";
parameter HeatTransfer.Data.Resistances.Carpet matCar "Carpet";
parameter HeatTransfer.Data.Solids.Concrete matCon(
x=0.1,
k=1.311,
c=836,
nStaRef=5) "Concrete";
parameter HeatTransfer.Data.Solids.Plywood matWoo(
x=0.01,
k=0.11,
d=544,
nStaRef=1) "Wood for exterior construction";
parameter HeatTransfer.Data.Solids.Generic matIns(
x=0.087,
k=0.049,
c=836.8,
d=265,
nStaRef=5) "Steelframe construction with insulation";
parameter HeatTransfer.Data.Solids.GypsumBoard matGyp(
x=0.0127,
k=0.16,
c=830,
d=784,
nStaRef=2) "Gypsum board";
parameter HeatTransfer.Data.Solids.GypsumBoard matGyp2(
x=0.025,
k=0.16,
c=830,
d=784,
nStaRef=2) "Gypsum board";
parameter HeatTransfer.Data.OpaqueConstructions.Generic conExtWal(final nLay=3,
material={matWoo,matIns,matGyp}) "Exterior construction";
parameter HeatTransfer.Data.OpaqueConstructions.Generic conIntWal(final nLay=1,
material={matGyp2}) "Interior wall construction";
parameter HeatTransfer.Data.OpaqueConstructions.Generic conFlo(final nLay=1, material={
matCon}) "Floor construction (opa_a is carpet)";
parameter HeatTransfer.Data.OpaqueConstructions.Generic conFur(final nLay=1, material={
matFur}) "Construction for internal mass of furniture";
parameter HeatTransfer.Data.Solids.Plywood matCarTra(
k=0.11,
d=544,
nStaRef=1,
x=0.215/0.11) "Wood for floor";
parameter HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys(
UFra=2,
shade=Buildings.HeatTransfer.Data.Shades.Gray(),
haveInteriorShade=false,
haveExteriorShade=false) "Data record for the glazing system";
parameter Real kIntNor(min=0, max=1) = 1
"Gain factor to scale internal heat gain in north zone";
constant Modelica.SIunits.Height hRoo=2.74 "Room height";
parameter Boolean sampleModel = false
"Set to true to time-sample the model, which can give shorter simulation time if there is already time sampling in the system model";
Buildings.ThermalZones.Detailed.MixedAir sou(
redeclare package Medium = Medium,
lat=lat,
AFlo=568.77/hRoo,
hRoo=hRoo,
nConExt=0,
nConExtWin=1,
datConExtWin(
layers={conExtWal},
A={49.91*hRoo},
glaSys={glaSys},
wWin={winWalRat/hWin*49.91*hRoo},
each hWin=hWin,
fFra={0.1},
til={Buildings.Types.Tilt.Wall},
azi={Buildings.Types.Azimuth.S}),
nConPar=2,
datConPar(
layers={conFlo,conFur},
A={568.77/hRoo,414.68},
til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Wall}),
nConBou=3,
datConBou(
layers={conIntWal,conIntWal,conIntWal},
A={6.47,40.76,6.47}*hRoo,
til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}),
nSurBou=0,
nPorts=5,
intConMod=intConMod,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final sampleModel=sampleModel) "South zone";
Buildings.ThermalZones.Detailed.MixedAir eas(
redeclare package Medium = Medium,
lat=lat,
AFlo=360.0785/hRoo,
hRoo=hRoo,
nConExt=0,
nConExtWin=1,
datConExtWin(
layers={conExtWal},
A={33.27*hRoo},
glaSys={glaSys},
wWin={winWalRat/hWin*33.27*hRoo},
each hWin=hWin,
fFra={0.1},
til={Buildings.Types.Tilt.Wall},
azi={Buildings.Types.Azimuth.E}),
nConPar=2,
datConPar(
layers={conFlo,conFur},
A={360.0785/hRoo,262.52},
til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Wall}),
nConBou=1,
datConBou(
layers={conIntWal},
A={24.13}*hRoo,
til={Buildings.Types.Tilt.Wall}),
nSurBou=2,
surBou(
each A=6.47*hRoo,
each absIR=0.9,
each absSol=0.9,
til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}),
nPorts=5,
intConMod=intConMod,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final sampleModel=sampleModel) "East zone";
Buildings.ThermalZones.Detailed.MixedAir nor(
redeclare package Medium = Medium,
lat=lat,
AFlo=568.77/hRoo,
hRoo=hRoo,
nConExt=0,
nConExtWin=1,
datConExtWin(
layers={conExtWal},
A={49.91*hRoo},
glaSys={glaSys},
wWin={winWalRat/hWin*49.91*hRoo},
each hWin=hWin,
fFra={0.1},
til={Buildings.Types.Tilt.Wall},
azi={Buildings.Types.Azimuth.N}),
nConPar=2,
datConPar(
layers={conFlo,conFur},
A={568.77/hRoo,414.68},
til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Wall}),
nConBou=3,
datConBou(
layers={conIntWal,conIntWal,conIntWal},
A={6.47,40.76,6.47}*hRoo,
til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}),
nSurBou=0,
nPorts=5,
intConMod=intConMod,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final sampleModel=sampleModel) "North zone";
Buildings.ThermalZones.Detailed.MixedAir wes(
redeclare package Medium = Medium,
lat=lat,
AFlo=360.0785/hRoo,
hRoo=hRoo,
nConExt=0,
nConExtWin=1,
datConExtWin(
layers={conExtWal},
A={33.27*hRoo},
glaSys={glaSys},
wWin={winWalRat/hWin*33.27*hRoo},
each hWin=hWin,
fFra={0.1},
til={Buildings.Types.Tilt.Wall},
azi={Buildings.Types.Azimuth.W}),
nConPar=2,
datConPar(
layers={conFlo,conFur},
A={360.0785/hRoo,262.52},
til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Wall}),
nConBou=1,
datConBou(
layers={conIntWal},
A={24.13}*hRoo,
til={Buildings.Types.Tilt.Wall}),
nSurBou=2,
surBou(
each A=6.47*hRoo,
each absIR=0.9,
each absSol=0.9,
til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}),
nPorts=5,
intConMod=intConMod,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final sampleModel=sampleModel) "West zone";
Buildings.ThermalZones.Detailed.MixedAir cor(
redeclare package Medium = Medium,
lat=lat,
AFlo=2698/hRoo,
hRoo=hRoo,
nConExt=0,
nConExtWin=0,
nConPar=2,
datConPar(
layers={conFlo,conFur},
A={360.0785/hRoo,262.52},
til={Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Wall}),
nConBou=0,
nSurBou=4,
surBou(
A={40.76,24.13,40.76,24.13}*hRoo,
each absIR=0.9,
each absSol=0.9,
til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}),
nPorts=11,
intConMod=intConMod,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
final sampleModel=sampleModel) "Core zone";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsSou[2](
redeclare package Medium = Medium) "Fluid inlets and outlets";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsEas[2](
redeclare package Medium = Medium) "Fluid inlets and outlets";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsNor[2](
redeclare package Medium = Medium) "Fluid inlets and outlets";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsWes[2](
redeclare package Medium = Medium) "Fluid inlets and outlets";
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b portsCor[2](
redeclare package Medium = Medium) "Fluid inlets and outlets";
Modelica.Blocks.Math.MatrixGain gai(K=20*[0.4; 0.4; 0.2])
"Matrix gain to split up heat gain in radiant, convective and latent gain";
Modelica.Blocks.Sources.Constant uSha(k=0)
"Control signal for the shading device";
Modelica.Blocks.Routing.Replicator replicator(nout=1);
BoundaryConditions.WeatherData.Bus weaBus "Weather bus";
RoomLeakage leaSou(redeclare package Medium = Medium, VRoo=568.77,
s=49.91/33.27,
azi=Buildings.Types.Azimuth.S,
final use_windPressure=use_windPressure)
"Model for air infiltration through the envelope";
RoomLeakage leaEas(redeclare package Medium = Medium, VRoo=360.0785,
s=33.27/49.91,
azi=Buildings.Types.Azimuth.E,
final use_windPressure=use_windPressure)
"Model for air infiltration through the envelope";
RoomLeakage leaNor(redeclare package Medium = Medium, VRoo=568.77,
s=49.91/33.27,
azi=Buildings.Types.Azimuth.N,
final use_windPressure=use_windPressure)
"Model for air infiltration through the envelope";
RoomLeakage leaWes(redeclare package Medium = Medium, VRoo=360.0785,
s=33.27/49.91,
azi=Buildings.Types.Azimuth.W,
final use_windPressure=use_windPressure)
"Model for air infiltration through the envelope";
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temAirSou
"Air temperature sensor";
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temAirEas
"Air temperature sensor";
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temAirNor
"Air temperature sensor";
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temAirWes
"Air temperature sensor";
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temAirPer5
"Air temperature sensor";
Modelica.Blocks.Routing.Multiplex5 multiplex5_1;
Modelica.Blocks.Interfaces.RealOutput TRooAir[5](
each unit="K",
each displayUnit="degC") "Room air temperatures";
Airflow.Multizone.DoorDiscretizedOpen opeSouCor(redeclare package Medium =
Medium, wOpe=10,
forceErrorControlOnFlow=false)
"Opening between perimeter1 and core";
Airflow.Multizone.DoorDiscretizedOpen opeEasCor(redeclare package Medium =
Medium, wOpe=10,
forceErrorControlOnFlow=false)
"Opening between perimeter2 and core";
Airflow.Multizone.DoorDiscretizedOpen opeNorCor(redeclare package Medium =
Medium, wOpe=10,
forceErrorControlOnFlow=false)
"Opening between perimeter3 and core";
Airflow.Multizone.DoorDiscretizedOpen opeWesCor(redeclare package Medium =
Medium, wOpe=10,
forceErrorControlOnFlow=false)
"Opening between perimeter3 and core";
Modelica.Blocks.Sources.CombiTimeTable intGaiFra(
table=[0,0.05;
8,0.05;
9,0.9;
12,0.9;
12,0.8;
13,0.8;
13,1;
17,1;
19,0.1;
24,0.05],
timeScale=3600,
extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic)
"Fraction of internal heat gain";
Buildings.Fluid.Sensors.RelativePressure senRelPre(redeclare package Medium = Medium)
"Building pressure measurement";
Buildings.Fluid.Sources.Outside out(nPorts=1, redeclare package Medium = Medium);
Modelica.Blocks.Interfaces.RealOutput p_rel
"Relative pressure signal of building static pressure";
Modelica.Blocks.Math.Gain gaiIntNor[3](each k=kIntNor)
"Gain for internal heat gain amplification for north zone";
Modelica.Blocks.Math.Gain gaiIntSou[3](each k=2 - kIntNor)
"Gain to change the internal heat gain for south";
equation
connect(sou.surf_conBou[1], wes.surf_surBou[2]);
connect(sou.surf_conBou[2], cor.surf_surBou[1]);
connect(sou.surf_conBou[3], eas.surf_surBou[1]);
connect(eas.surf_conBou[1], cor.surf_surBou[2]);
connect(eas.surf_surBou[2], nor.surf_conBou[1]);
connect(nor.surf_conBou[2], cor.surf_surBou[3]);
connect(nor.surf_conBou[3], wes.surf_surBou[1]);
connect(wes.surf_conBou[1], cor.surf_surBou[4]);
connect(uSha.y, replicator.u);
connect(replicator.y, nor.uSha);
connect(replicator.y, wes.uSha);
connect(replicator.y, eas.uSha);
connect(replicator.y, sou.uSha);
connect(replicator.y, cor.uSha);
connect(gai.y, cor.qGai_flow);
connect(gai.y, eas.qGai_flow);
connect(gai.y, wes.qGai_flow);
connect(sou.weaBus, weaBus);
connect(eas.weaBus, weaBus);
connect(nor.weaBus, weaBus);
connect(wes.weaBus, weaBus);
connect(cor.weaBus, weaBus);
connect(weaBus, leaSou.weaBus);
connect(weaBus, leaEas.weaBus);
connect(weaBus, leaNor.weaBus);
connect(weaBus, leaWes.weaBus);
connect(multiplex5_1.y, TRooAir);
connect(temAirSou.T, multiplex5_1.u1[1]);
connect(temAirEas.T, multiplex5_1.u2[1]);
connect(temAirNor.T, multiplex5_1.u3[1]);
connect(temAirWes.T, multiplex5_1.u4[1]);
connect(temAirPer5.T, multiplex5_1.u5[1]);
connect(sou.heaPorAir, temAirSou.port);
connect(eas.heaPorAir, temAirEas.port);
connect(nor.heaPorAir, temAirNor.port);
connect(wes.heaPorAir, temAirWes.port);
connect(cor.heaPorAir, temAirPer5.port);
connect(sou.ports[1], portsSou[1]);
connect(sou.ports[2], portsSou[2]);
connect(eas.ports[1], portsEas[1]);
connect(eas.ports[2], portsEas[2]);
connect(nor.ports[1], portsNor[1]);
connect(nor.ports[2], portsNor[2]);
connect(wes.ports[1], portsWes[1]);
connect(wes.ports[2], portsWes[2]);
connect(cor.ports[1], portsCor[1]);
connect(cor.ports[2], portsCor[2]);
connect(leaSou.port_b, sou.ports[3]);
connect(leaEas.port_b, eas.ports[3]);
connect(leaNor.port_b, nor.ports[3]);
connect(leaWes.port_b, wes.ports[3]);
connect(opeSouCor.port_b1, cor.ports[3]);
connect(opeSouCor.port_a2, cor.ports[4]);
connect(opeSouCor.port_a1, sou.ports[4]);
connect(opeSouCor.port_b2, sou.ports[5]);
connect(opeEasCor.port_b1, eas.ports[4]);
connect(opeEasCor.port_a2, eas.ports[5]);
connect(opeEasCor.port_a1, cor.ports[5]);
connect(opeEasCor.port_b2, cor.ports[6]);
connect(opeNorCor.port_b1, nor.ports[4]);
connect(opeNorCor.port_a2, nor.ports[5]);
connect(opeNorCor.port_a1, cor.ports[7]);
connect(opeNorCor.port_b2, cor.ports[8]);
connect(opeWesCor.port_b1, cor.ports[9]);
connect(opeWesCor.port_a2, cor.ports[10]);
connect(opeWesCor.port_a1, wes.ports[4]);
connect(opeWesCor.port_b2, wes.ports[5]);
connect(intGaiFra.y, gai.u);
connect(cor.ports[11], senRelPre.port_a);
connect(out.weaBus, weaBus);
connect(out.ports[1], senRelPre.port_b);
connect(senRelPre.p_rel, p_rel);
connect(gai.y, gaiIntNor.u);
connect(gaiIntNor.y, nor.qGai_flow);
connect(gai.y, gaiIntSou.u);
connect(gaiIntSou.y, sou.qGai_flow);
end Floor;
Buildings.Examples.VAVReheat.ThermalZones.RoomLeakage
Room leakage model
Information
Room leakage.
Extends from Buildings.BaseClasses.BaseIcon (Base icon).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the component | |
Volume | VRoo | Room volume [m3] | |
Boolean | use_windPressure | false | Set to true to enable wind pressure |
Real | s | Side ratio, s=length of this wall/length of adjacent wall | |
Angle | azi | Surface azimuth (South:0, West:pi/2) [rad] |
Connectors
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
FluidPort_b | port_b | |
Bus | weaBus | Bus with weather data |
Modelica definition
model RoomLeakage "Room leakage model"
extends Buildings.BaseClasses.BaseIcon;
replaceable package Medium = Modelica.Media.Interfaces.PartialMedium
"Medium in the component";
parameter Modelica.SIunits.Volume VRoo "Room volume";
parameter Boolean use_windPressure=false
"Set to true to enable wind pressure";
Buildings.Fluid.FixedResistances.PressureDrop res(
redeclare package Medium = Medium,
dp_nominal=50,
m_flow_nominal=VRoo*1.2/3600) "Resistance model";
Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =
Medium);
Buildings.Fluid.Sources.Outside_CpLowRise
amb(redeclare package Medium = Medium, nPorts=1,
s=s,
azi=azi,
Cp0=if use_windPressure then 0.6 else 0);
BoundaryConditions.WeatherData.Bus weaBus "Bus with weather data";
Buildings.Fluid.Sensors.MassFlowRate senMasFlo1(redeclare package Medium = Medium,
allowFlowReversal=true) "Sensor for mass flow rate";
Modelica.Blocks.Math.Gain ACHInf(k=1/VRoo/1.2*3600, y(unit="1/h"))
"Air change per hour due to infiltration";
parameter Real s "Side ratio, s=length of this wall/length of adjacent wall";
parameter Modelica.SIunits.Angle azi "Surface azimuth (South:0, West:pi/2)";
equation
connect(res.port_b, port_b);
connect(amb.weaBus, weaBus);
connect(amb.ports[1], senMasFlo1.port_a);
connect(senMasFlo1.port_b, res.port_a);
connect(senMasFlo1.m_flow, ACHInf.u);
end RoomLeakage;
Buildings.Examples.VAVReheat.ThermalZones.VAVBranch
Supply branch of a VAV system
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
---|---|---|---|
replaceable package MediumA | Modelica.Media.Interfaces.Pa... | Medium model for air | |
replaceable package MediumW | Modelica.Media.Interfaces.Pa... | Medium model for water | |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
MassFlowRate | m_flow_nominal | Mass flow rate of this thermal zone [kg/s] | |
Volume | VRoo | Room volume [m3] |
Connectors
Type | Name | Description |
---|---|---|
replaceable package MediumA | Medium model for air | |
replaceable package MediumW | Medium model for water | |
FluidPort_a | port_a | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_a | port_b | Fluid connector b (positive design flow direction is from port_a1 to port_b1) |
input RealInput | yVAV | Actuator position for VAV damper (0: closed, 1: open) |
input RealInput | yVal | Actuator position for reheat valve (0: closed, 1: open) |
Modelica definition
model VAVBranch "Supply branch of a VAV system"
extends Modelica.Blocks.Icons.Block;
replaceable package MediumA = Modelica.Media.Interfaces.PartialMedium
"Medium model for air";
replaceable package MediumW = Modelica.Media.Interfaces.PartialMedium
"Medium model for water";
parameter Boolean allowFlowReversal=true
"= false to simplify equations, assuming, but not enforcing, no flow reversal";
parameter Modelica.SIunits.MassFlowRate m_flow_nominal
"Mass flow rate of this thermal zone";
parameter Modelica.SIunits.Volume VRoo "Room volume";
Buildings.Fluid.Actuators.Dampers.PressureIndependent vav(
redeclare package Medium = MediumA,
m_flow_nominal=m_flow_nominal,
dp_nominal = 220 + 20,
allowFlowReversal=allowFlowReversal) "VAV box for room";
Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU terHea(
redeclare package Medium1 = MediumA,
redeclare package Medium2 = MediumW,
m1_flow_nominal=m_flow_nominal,
m2_flow_nominal=m_flow_nominal*1000*(50 - 17)/4200/10,
Q_flow_nominal=m_flow_nominal*1006*(50 - 16.7),
configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow,
dp1_nominal=0,
from_dp2=true,
dp2_nominal=0,
allowFlowReversal1=allowFlowReversal,
allowFlowReversal2=false,
T_a1_nominal=289.85,
T_a2_nominal=355.35) "Heat exchanger of terminal box";
Buildings.Fluid.Sources.Boundary_pT sinTer(
redeclare package Medium = MediumW,
p(displayUnit="Pa") = 3E5,
nPorts=1) "Sink for terminal box ";
Modelica.Fluid.Interfaces.FluidPort_a port_a(
redeclare package Medium = MediumA)
"Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)";
Modelica.Fluid.Interfaces.FluidPort_a port_b(
redeclare package Medium = MediumA)
"Fluid connector b (positive design flow direction is from port_a1 to port_b1)";
Buildings.Fluid.Sensors.MassFlowRate senMasFlo(
redeclare package Medium = MediumA,
allowFlowReversal=allowFlowReversal)
"Sensor for mass flow rate";
Modelica.Blocks.Math.Gain fraMasFlo(k=1/m_flow_nominal)
"Fraction of mass flow rate, relative to nominal flow";
Modelica.Blocks.Math.Gain ACH(k=1/VRoo/1.2*3600) "Air change per hour";
Fluid.Sources.MassFlowSource_T souTer(
redeclare package Medium = MediumW,
nPorts=1,
use_m_flow_in=true,
T=323.15) "Source for terminal box ";
Modelica.Blocks.Interfaces.RealInput yVAV
"Actuator position for VAV damper (0: closed, 1: open)";
Modelica.Blocks.Interfaces.RealInput yVal
"Actuator position for reheat valve (0: closed, 1: open)";
Buildings.Controls.OBC.CDL.Continuous.Gain gaiM_flow(
final k=m_flow_nominal*1000*15/4200/10) "Gain for mass flow rate";
equation
connect(fraMasFlo.u, senMasFlo.m_flow);
connect(vav.port_b, senMasFlo.port_a);
connect(ACH.u, senMasFlo.m_flow);
connect(souTer.ports[1], terHea.port_a2);
connect(port_a, terHea.port_a1);
connect(senMasFlo.port_b, port_b);
connect(terHea.port_b1, vav.port_a);
connect(vav.y, yVAV);
connect(souTer.m_flow_in, gaiM_flow.y);
connect(sinTer.ports[1], terHea.port_b2);
connect(gaiM_flow.u, yVal);
end VAVBranch;