This model consist of an HVAC system, a building envelope model and a model
for air flow through building leakage and through open doors.
The HVAC system is a dual-fan, dual-duct system with economizer and a heating and
cooling coil in the air handler unit.
One of the supply air streams is called the hot-deck
and has a heating coil, the other is called
the cold-deck and has a cooling coil. There is also one return fan and
an economizer. The figure below shows the schematic diagram of the dual-fan,
dual-duct system.
Each thermal zone inlet branch has a flow mixer and an air damper
in the hot deck and the cold deck. The air damper control signals are
as shown in the figure below.
Hence, at low room temperatures, the amount
of hot air is increased, and at high room temperatures, the amount
of cold air is increased. In addition, whenever the air mass flow rate
is below a prescribed limit, the hot air deck damper opens to track
the minimum air flow rate. The temperature of the hot-deck is reset
based on the outside air temperature. The temperature of the
cold-deck is constant. The revolutions of both supply fans are controlled
in order to track a pressure difference between VAV damper
inlet and room pressure of 30 Pascals. The return fan is controlled
to track a building pressure of 30 Pascals above outside air pressure.
There is also an economizer.
During night-time, the fans are switched off.
The coils are controlled as follows: The preheat coil is controlled to
maintain an air outlet temperature of 11°C during day-time, and
6°C during night-time. The heating coil is controlled to maintain the
air outlet temperature shown in the figure below.
The cooling coil is controlled to maintain a constant outlet temperature
of 12° during day-time, and 40°C during night-time
There is also a
finite state machine that transitions the mode of operation of
the HVAC system between the modes
occupied, unoccupied off, unoccupied night set back,
unoccupied warm-up and unoccupied pre-cool.
All air flows are computed based on the
duct static pressure distribution and the performance curves of the fans.
Local loop control is implemented using proportional and proportional-integral
controllers, while the supervisory control is implemented
using a finite state machine.
To model the heat transfer through the building envelope,
a model of five interconnected rooms is used.
The five room model is representative of one floor of the
new construction medium office building for Chicago, IL,
as described in the set of DOE Commercial Building Benchmarks
(Deru et al, 2009). There are four perimeter zones and one core zone.
The envelope thermal properties meet ASHRAE Standard 90.1-2004.
The thermal room model computes transient heat conduction through
walls, floors and ceilings and long-wave radiative heat exchange between
surfaces. The convective heat transfer coefficient is computed based
on the temperature difference between the surface and the room air.
There is also a layer-by-layer short-wave radiation,
long-wave radiation, convection and conduction heat transfer model for the
windows. The model is similar to the
Window 5 model and described in TARCOG 2006.
Each thermal zone can have air flow from the HVAC system, through leakages of the building envelope (except for the core zone) and through bi-directional air exchange through open doors that connect adjacent zones. The bi-directional air exchange is modeled based on the differences in static pressure between adjacent rooms at a reference height plus the difference in static pressure across the door height as a function of the difference in air density.
There is also wind pressure acting on each facade. The wind pressure is a function
of the wind speed and wind direction. Therefore, infiltration is a function of the
flow imbalance of the HVAC system and of the wind conditions.
ASHRAE.
Sequences of Operation for Common HVAC Systems.
ASHRAE, Atlanta, GA, 2006.
Deru M., K. Field, D. Studer, K. Benne, B. Griffith, P. Torcellini,
M. Halverson, D. Winiarski, B. Liu, M. Rosenberg, J. Huang, M. Yazdanian, and D. Crawley.
DOE commercial building research benchmarks for commercial buildings.
Technical report, U.S. Department of Energy, Energy Efficiency and
Renewable Energy, Office of Building Technologies, Washington, DC, 2009.
TARCOG 2006: Carli, Inc., TARCOG: Mathematical models for calculation
of thermal performance of glazing systems with our without
shading devices, Technical Report, Oct. 17, 2006.
model ClosedLoop
extends Modelica.Icons.Example;
replaceable package MediumA =
Buildings.Media.Air (T_default=293.15);
package MediumW =
Buildings.Media.Water ;
parameter Real yFan_start=0.0 ;
parameter Boolean from_dp=true ;
parameter Boolean linearizeFlowResistance=false ;
parameter Modelica.SIunits.Volume VRooCor=2698 ;
parameter Modelica.SIunits.Volume VRooSou=568.77 ;
parameter Modelica.SIunits.Volume VRooNor=568.77 ;
parameter Modelica.SIunits.Volume VRooEas=360.08 ;
parameter Modelica.SIunits.Volume VRooWes=360.08 ;
constant Real conv=1.2/3600 ;
parameter Modelica.SIunits.MassFlowRate m0_flow_cor=3*VRooCor*conv ;
parameter Modelica.SIunits.MassFlowRate m0_flow_sou=8*VRooSou*conv ;
parameter Modelica.SIunits.MassFlowRate m0_flow_eas=9*VRooEas*conv ;
parameter Modelica.SIunits.MassFlowRate m0_flow_nor=11*VRooNor*conv ;
parameter Modelica.SIunits.MassFlowRate m0_flow_wes=10*VRooWes*conv ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal=m0_flow_cor +
m0_flow_sou + m0_flow_eas + m0_flow_nor + m0_flow_wes ;
parameter Modelica.SIunits.MassFlowRate mAirOut_flow_nominal=0.3*
m_flow_nominal ;
parameter Modelica.SIunits.MassFlowRate mAirHot_flow_nominal=0.3*
m_flow_nominal ;
parameter Modelica.SIunits.MassFlowRate mAirCol_flow_nominal=m_flow_nominal ;
parameter Modelica.SIunits.MassFlowRate mWatPre_flow_nominal=(TMixHea_nominal -
273.15 - (-20))*1000/15/4200*mAirOut_flow_nominal ;
parameter Modelica.SIunits.MassFlowRate mWatCol_flow_nominal=(28 - 13)*1000*1.3
/4200/15*mAirCol_flow_nominal ;
parameter Modelica.SIunits.MassFlowRate mWatHot_flow_nominal=(40 - (
TMixHea_nominal - 273.15))*1000/15/4200*mAirHot_flow_nominal ;
parameter Modelica.SIunits.Temperature TMixHea_nominal=0.3*(273.15 + (-20)) +
0.7*(273.15 + 20) ;
parameter Modelica.SIunits.Temperature TMixCoo_nominal=0.3*(273.15 + (33)) + 0.7
*(273.15 + 26) ;
parameter Modelica.SIunits.Temperature TSupCol_nominal=12 + 273.15 ;
parameter Modelica.SIunits.Angle lat=41.98*3.14159/180 ;
Buildings.Fluid.Sources.Outside amb(
redeclare package Medium =
MediumA,
nPorts=2) ;
Buildings.Fluid.FixedResistances.PressureDrop fil(
m_flow_nominal=m_flow_nominal,
redeclare package Medium =
MediumA,
dp_nominal=200 + 200 + 100,
from_dp=from_dp,
linearized=linearizeFlowResistance) ;
Buildings.Fluid.HeatExchangers.DryEffectivenessNTU preHeaCoi(
redeclare package Medium1 =
MediumA,
redeclare package Medium2 = MediumW,
allowFlowReversal2=false,
dp2_nominal=6000,
m1_flow_nominal=mAirOut_flow_nominal,
m2_flow_nominal=mWatPre_flow_nominal,
dp1_nominal=200,
Q_flow_nominal=mAirOut_flow_nominal*1006*(TMixHea_nominal - TSupCol_nominal),
T_a1_nominal=281.65,
T_a2_nominal=323.15,
configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.ParallelFlow)
;
Buildings.Fluid.HeatExchangers.WetCoilCounterFlow cooCoi(
redeclare package Medium1 = MediumW,
redeclare package Medium2 =
MediumA,
m1_flow_nominal=mWatCol_flow_nominal,
m2_flow_nominal=mAirCol_flow_nominal,
UA_nominal=-mAirCol_flow_nominal*1000*15/
Buildings.Fluid.HeatExchangers.BaseClasses.lmtd(
T_a1=6,
T_b1=12,
T_a2=28,
T_b2=13),
dp2_nominal=0,
from_dp2=from_dp,
linearizeFlowResistance2=linearizeFlowResistance,
dp1_nominal=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.Movers.SpeedControlled_y fanSupHot(
redeclare package Medium =
MediumA,
per(pressure(V_flow=mAirHot_flow_nominal/1.2*{0,2}, dp=600*{2,0})),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.Movers.SpeedControlled_y fanSupCol(
redeclare package Medium =
MediumA,
per(pressure(V_flow=mAirCol_flow_nominal/1.2*{0,2}, dp=600*{2,0})),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.Movers.SpeedControlled_y fanRet(
redeclare package Medium =
MediumA,
per(pressure(V_flow=m_flow_nominal/1.2*{0,2}, dp=100*{2,0})),
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.Sources.FixedBoundary sinHea(
redeclare package Medium = MediumW,
nPorts=2,
p=300000,
T=308.15) ;
Buildings.Fluid.Sources.FixedBoundary sinCoo(
redeclare package Medium = MediumW,
p=300000,
T=285.15,
nPorts=1) ;
Modelica.Blocks.Routing.RealPassThrough TOut(y(
final quantity="ThermodynamicTemperature",
final unit="K",
displayUnit="degC",
min=0));
Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint
TSupSetHea(TOn=284.15, TOff=279.15) ;
Buildings.Controls.Continuous.LimPID cooCoiCon(
reverseAction=true,
Td=60,
initType=Modelica.Blocks.Types.InitPID.InitialState,
yMax=1,
yMin=0,
Ti=120,
controllerType=Modelica.Blocks.Types.SimpleController.P,
k=1) ;
Buildings.Examples.VAVReheat.Controls.FanVFD conFanSupHot(
initType=Modelica.Blocks.Types.Init.InitialState,
y_start=yFan_start,
xSet_nominal(displayUnit="Pa") = 30,
r_N_min=0.2,
controllerType=Modelica.Blocks.Types.SimpleController.P,
k=1) ;
Buildings.Controls.SetPoints.OccupancySchedule occSch(occupancy=3600*{6,19}) ;
Buildings.Examples.VAVReheat.Controls.ModeSelector modeSelector;
Buildings.Examples.VAVReheat.Controls.ControlBus controlBus;
Buildings.Fluid.Sensors.TemperatureTwoPort TPreHeaCoi(
redeclare package
Medium =
MediumA, m_flow_nominal=m_flow_nominal) ;
Buildings.Utilities.Math.Min min(nin=5) ;
Buildings.Utilities.Math.Average ave(nin=5) ;
Buildings.Fluid.Actuators.Valves.TwoWayLinear valCoo(
redeclare package Medium = MediumW,
CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
m_flow_nominal=m_flow_nominal*1000*15/4200/10,
dpValve_nominal=6000,
from_dp=true,
dpFixed_nominal=6000,
use_inputFilter=false) ;
Buildings.Fluid.Sources.FixedBoundary souCoo(
redeclare package Medium = MediumW,
p=3E5 + 12000,
nPorts=1,
T=279.15) ;
Buildings.Examples.VAVReheat.Controls.Economizer conEco(
dT=1,
VOut_flow_min=0.3*m_flow_nominal/1.2,
k=0.05,
Ti=1200) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TRet(
redeclare package Medium =
MediumA,
m_flow_nominal=m_flow_nominal) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TMix(
redeclare package Medium =
MediumA,
m_flow_nominal=m_flow_nominal) ;
Buildings.Examples.VAVReheat.Controls.RoomTemperatureSetpoint TSetRoo(THeaOff
=289.15);
Buildings.Fluid.Sources.FixedBoundary souHea(
redeclare package Medium = MediumW,
p(displayUnit="Pa") = 300000 + 12000,
T=318.15,
nPorts=2) ;
Buildings.Fluid.Actuators.Dampers.MixingBox eco(
redeclare package Medium =
MediumA,
mOut_flow_nominal=m_flow_nominal,
mRec_flow_nominal=m_flow_nominal,
mExh_flow_nominal=m_flow_nominal,
dpOut_nominal=10,
dpRec_nominal=10,
dpExh_nominal=10,
from_dp=from_dp,
linearized=true,
riseTime=15,
y_start=0) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TCoiCoo(
redeclare package Medium
=
MediumA, m_flow_nominal=mAirCol_flow_nominal) ;
Buildings.Fluid.Sensors.VolumeFlowRate VOut1(
redeclare package Medium =
MediumA,
m_flow_nominal=m_flow_nominal) ;
Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch cor(
redeclare package MediumA =
MediumA,
m_flow_nominal=m0_flow_cor,
VRoo=2698,
from_dp=true) ;
Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch sou(
redeclare package MediumA =
MediumA,
m_flow_nominal=m0_flow_sou,
VRoo=568.77,
from_dp=true) ;
Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch eas(
redeclare package MediumA =
MediumA,
m_flow_nominal=m0_flow_eas,
VRoo=360.08,
from_dp=true) ;
Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch nor(
redeclare package MediumA =
MediumA,
m_flow_nominal=m0_flow_nor,
VRoo=568.77,
from_dp=true) ;
Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch wes(
redeclare package MediumA =
MediumA,
m_flow_nominal=m0_flow_wes,
VRoo=360.08,
from_dp=true) ;
Buildings.Examples.VAVReheat.Controls.FanVFD conFanRet(
xSet_nominal(displayUnit="Pa") = 30,
initType=Modelica.Blocks.Types.Init.InitialState,
y_start=yFan_start,
r_N_min=0.2,
k=1,
Ti=15,
controllerType=Modelica.Blocks.Types.SimpleController.P) ;
Buildings.Fluid.FixedResistances.Junction splRetRoo1(
redeclare package Medium =
MediumA,
m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {30,0,70},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splRetSou(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_sou + m0_flow_eas + m0_flow_nor + m0_flow_wes,
m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_sou},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {20,0,50},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splRetEas(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_nor +
m0_flow_wes,m0_flow_eas},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {20,0,30},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splRetNor(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {20,10,10},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupRoo1Hot(
redeclare package Medium =
MediumA,
m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {240,0,-80},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupSouHot(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_sou + m0_flow_eas + m0_flow_nor + m0_flow_wes,
m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_sou},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-60},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupEasHot(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_nor +
m0_flow_wes,m0_flow_eas},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-40},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupNorHot(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-20},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint
TSetCoo(TOn=285.15, TOff=313.15) ;
BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam="modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
BoundaryConditions.WeatherData.Bus weaBus ;
Buildings.Examples.VAVReheat.ThermalZones.Floor flo(
redeclare package Medium
=
MediumA, lat=lat) ;
Modelica.Blocks.Routing.DeMultiplex5 TRooAir ;
Buildings.Fluid.HeatExchangers.DryEffectivenessNTU heaCoi(
redeclare package Medium1 = MediumW,
redeclare package Medium2 =
MediumA,
m1_flow_nominal=mWatHot_flow_nominal,
m2_flow_nominal=mAirHot_flow_nominal,
Q_flow_nominal=mAirHot_flow_nominal*1000*(45 - 12),
configuration=Buildings.Fluid.Types.HeatExchangerConfiguration.CounterFlow,
dp2_nominal=0,
from_dp2=from_dp,
linearizeFlowResistance2=linearizeFlowResistance,
dp1_nominal=0,
T_a1_nominal=285.15,
T_a2_nominal=318.15) ;
Buildings.Fluid.Sensors.TemperatureTwoPort TCoiHea(
redeclare package Medium
=
MediumA, m_flow_nominal=mAirHot_flow_nominal) ;
Buildings.Fluid.FixedResistances.Junction splHotColDec(
redeclare package Medium =
MediumA,
m_flow_nominal=m_flow_nominal*{1,1,1},
from_dp=from_dp,
linearized=linearizeFlowResistance,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
dp_nominal(
each displayUnit="Pa") = {5,5,0}) ;
Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valPreHea(
redeclare package Medium = MediumW,
CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
dpValve_nominal=6000,
from_dp=true,
m_flow_nominal=mWatPre_flow_nominal,
riseTime=10,
use_inputFilter=false) ;
Buildings.Fluid.Movers.FlowControlled_m_flow pumPreHea(
redeclare package Medium = MediumW,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
m_flow_nominal=mWatPre_flow_nominal,
inputType=Buildings.Fluid.Types.InputType.Continuous) ;
Buildings.Fluid.FixedResistances.Junction splCol1(
from_dp=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
linearized=true,
dp_nominal(
each displayUnit="Pa") = {0,0,0},
redeclare package Medium = MediumW,
m_flow_nominal=mWatPre_flow_nominal*{1,1,1}) ;
Buildings.Fluid.FixedResistances.Junction splCol2(
from_dp=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
linearized=true,
dp_nominal(
each displayUnit="Pa") = {0,0,0},
redeclare package Medium = MediumW,
m_flow_nominal=mWatPre_flow_nominal*{1,1,1}) ;
Buildings.Fluid.Actuators.Valves.TwoWayLinear valHea(
redeclare package Medium = MediumW,
CvData=Buildings.Fluid.Types.CvTypes.OpPoint,
dpValve_nominal=6000,
from_dp=true,
m_flow_nominal=mWatPre_flow_nominal,
dpFixed_nominal=6000,
use_inputFilter=false) ;
Buildings.Controls.Continuous.LimPID heaCoiCon(
Td=60,
initType=Modelica.Blocks.Types.InitPID.InitialState,
yMax=1,
yMin=0,
Ti=120,
controllerType=Modelica.Blocks.Types.SimpleController.P,
k=1) ;
Buildings.Controls.SetPoints.Table TSetHot(table=[273.15 + 5, 273.15 + 40; 273.15
+ 22, 273.15 + 22]) ;
Buildings.Fluid.FixedResistances.Junction splSupRoo1Col(
redeclare package Medium =
MediumA,
m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal(
each displayUnit="Pa") = {240,0,-80},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupSouCol(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_sou + m0_flow_eas + m0_flow_nor + m0_flow_wes,
m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_sou},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-60},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupEasCol(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_eas + m0_flow_nor + m0_flow_wes,m0_flow_nor +
m0_flow_wes,m0_flow_eas},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-40},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.Junction splSupNorCol(
redeclare package Medium =
MediumA,
m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
from_dp=from_dp,
linearized=linearizeFlowResistance,
dp_nominal={20,0,-20},
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Modelica.Blocks.Sources.Constant pStaPre_Set(y(
final unit="Pa", min=0), k=30)
;
Buildings.Examples.VAVReheat.Controls.FanVFD conFanSupCol(
initType=Modelica.Blocks.Types.Init.InitialState,
y_start=yFan_start,
xSet_nominal(displayUnit="Pa") = 30,
r_N_min=0.2) ;
Modelica.Blocks.Sources.Constant pStaBui_Set(y(
final unit="Pa", min=0), k=30)
;
Controls.PreHeatCoil conPreHeatCoi ;
Modelica.Blocks.Math.Gain gaiPumPreCoi(k=mWatPre_flow_nominal) ;
equation
connect(fil.port_b, preHeaCoi.port_a1);
connect(controlBus, modeSelector.cb);
connect(occSch.tNexOcc, controlBus.dTNexOcc);
connect(TOut.y, controlBus.TOut);
connect(occSch.occupied, controlBus.occupied);
connect(min.y, controlBus.TRooMin);
connect(ave.y, controlBus.TRooAve);
connect(TRet.T, conEco.TRet);
connect(TMix.T, conEco.TMix);
connect(controlBus, conEco.controlBus);
connect(TSetRoo.controlBus, controlBus);
connect(fil.port_a, TMix.port_b);
connect(cor.controlBus, controlBus);
connect(sou.controlBus, controlBus);
connect(eas.controlBus, controlBus);
connect(nor.controlBus, controlBus);
connect(wes.controlBus, controlBus);
connect(conEco.yOA, eco.y);
connect(eco.port_Exh, amb.ports[1]);
connect(TCoiCoo.T, cooCoiCon.u_m);
connect(amb.ports[2], VOut1.port_a);
connect(VOut1.port_b, eco.port_Out);
connect(eco.port_Sup, TMix.port_a);
connect(preHeaCoi.port_b1, TPreHeaCoi.port_a);
connect(TRet.port_b, eco.port_Ret);
connect(splRetNor.port_1, splRetEas.port_2);
connect(splRetEas.port_1, splRetSou.port_2);
connect(splRetSou.port_1, splRetRoo1.port_2);
connect(splSupRoo1Hot.port_2, splSupSouHot.port_1);
connect(splSupSouHot.port_2, splSupEasHot.port_1);
connect(splSupEasHot.port_2, splSupNorHot.port_1);
connect(cooCoi.port_b2, TCoiCoo.port_a);
connect(valCoo.port_b, cooCoi.port_a1);
connect(cooCoi.port_b1, sinCoo.ports[1]);
connect(TSetCoo.TSet, cooCoiCon.u_s);
connect(TSetCoo.TSet, conEco.TSupCooSet);
connect(modeSelector.cb, TSetCoo.controlBus);
connect(conEco.VOut_flow, VOut1.V_flow);
connect(weaDat.weaBus, weaBus);
connect(weaBus.TDryBul, TOut.u);
connect(amb.weaBus, weaBus);
connect(cor.port_b, flo.portsCor[1]);
connect(splRetRoo1.port_3, flo.portsCor[2]);
connect(sou.port_b, flo.portsSou[1]);
connect(splRetSou.port_3, flo.portsSou[2]);
connect(eas.port_b, flo.portsEas[1]);
connect(splRetEas.port_3, flo.portsEas[2]);
connect(nor.port_b, flo.portsNor[1]);
connect(splRetNor.port_3, flo.portsNor[2]);
connect(wes.port_b, flo.portsWes[1]);
connect(splRetNor.port_2, flo.portsWes[2]);
connect(weaBus, flo.weaBus);
connect(flo.TRooAir, min.u);
connect(flo.TRooAir, ave.u);
connect(TRooAir.y1[1], sou.TRoo);
connect(TRooAir.y2[1], eas.TRoo);
connect(TRooAir.y3[1], nor.TRoo);
connect(TRooAir.y4[1], wes.TRoo);
connect(TRooAir.y5[1], cor.TRoo);
connect(TRooAir.u, flo.TRooAir);
connect(fanSupCol.port_b, cooCoi.port_a2);
connect(fanSupHot.port_b, heaCoi.port_a2);
connect(heaCoi.port_b2, TCoiHea.port_a);
connect(TPreHeaCoi.port_b, splHotColDec.port_3);
connect(splHotColDec.port_1, fanSupCol.port_a);
connect(pumPreHea.port_b, preHeaCoi.port_a2);
connect(souHea.ports[1], valPreHea.port_a);
connect(valPreHea.port_b, splCol1.port_1);
connect(splCol1.port_2, pumPreHea.port_a);
connect(splCol2.port_3, splCol1.port_3);
connect(splCol2.port_1, preHeaCoi.port_b2);
connect(splCol2.port_2, sinHea.ports[1]);
connect(heaCoi.port_a1, valHea.port_b);
connect(valHea.port_a, souHea.ports[2]);
connect(heaCoi.port_b1, sinHea.ports[2]);
connect(TSetHot.y, heaCoiCon.u_s);
connect(heaCoiCon.u_m, TCoiHea.T);
connect(heaCoiCon.y, valHea.y);
connect(valCoo.port_a, souCoo.ports[1]);
connect(splSupRoo1Col.port_2, splSupSouCol.port_1);
connect(splSupSouCol.port_2, splSupEasCol.port_1);
connect(splSupEasCol.port_2, splSupNorCol.port_1);
connect(cor.port_aHot, splSupRoo1Hot.port_3);
connect(cor.port_aCol, splSupRoo1Col.port_3);
connect(sou.port_aHot, splSupSouHot.port_3);
connect(sou.port_aCol, splSupSouCol.port_3);
connect(eas.port_aHot, splSupEasHot.port_3);
connect(eas.port_aCol, splSupEasCol.port_3);
connect(nor.port_aHot, splSupNorHot.port_3);
connect(nor.port_aCol, splSupNorCol.port_3);
connect(splSupNorHot.port_2, wes.port_aHot);
connect(splSupNorCol.port_2, wes.port_aCol);
connect(nor.p_relHot, conFanSupHot.u_m);
connect(pStaPre_Set.y, conFanSupHot.u);
connect(pStaPre_Set.y, conFanSupCol.u);
connect(nor.p_relCol, conFanSupCol.u_m);
connect(flo.p_rel, conFanRet.u_m);
connect(controlBus.TOut, TSetHot.u);
connect(cooCoiCon.y, valCoo.y);
connect(TSupSetHea.TSet, conEco.TSupHeaSet);
connect(modeSelector.cb, TSupSetHea.controlBus);
connect(conFanRet.y, fanRet.y);
connect(conFanSupHot.y, fanSupHot.y);
connect(conFanSupCol.y, fanSupCol.y);
connect(pStaBui_Set.y, conFanRet.u);
connect(TCoiCoo.port_b, splSupRoo1Col.port_1);
connect(TCoiHea.port_b, splSupRoo1Hot.port_1);
connect(splRetRoo1.port_1, fanRet.port_a);
connect(TRet.port_a, fanRet.port_b);
connect(splHotColDec.port_2, fanSupHot.port_a);
connect(gaiPumPreCoi.y, pumPreHea.m_flow_in);
connect(conPreHeatCoi.yPum, gaiPumPreCoi.u);
connect(conPreHeatCoi.TSupSetHea, TSupSetHea.TSet);
connect(conPreHeatCoi.TMix, TMix.T);
connect(TPreHeaCoi.T, conPreHeatCoi.TAirSup);
connect(conPreHeatCoi.yVal, valPreHea.y);
connect(modeSelector.yFan, conFanSupCol.uFan);
connect(modeSelector.yFan, conFanSupHot.uFan);
connect(modeSelector.yFan, conFanRet.uFan);
connect(cor.yFan, modeSelector.yFan);
connect(modeSelector.yFan, sou.yFan);
connect(modeSelector.yFan, eas.yFan);
connect(modeSelector.yFan, nor.yFan);
connect(modeSelector.yFan, wes.yFan);
end ClosedLoop;