LBL logo

Buildings.Examples.DualFanDualDuct

Dual fan dual duct HVAC system with five thermal zones

Information

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.Examples.DualFanDualDuct.ClosedLoop ClosedLoop Closed loop model of a dual-fan dual-duct system
Buildings.Examples.DualFanDualDuct.Controls Controls Package with controller models
Buildings.Examples.DualFanDualDuct.ThermalZones ThermalZones Package with models for the thermal zones


Buildings.Examples.DualFanDualDuct.ClosedLoop Buildings.Examples.DualFanDualDuct.ClosedLoop

Closed loop model of a dual-fan dual-duct system

Buildings.Examples.DualFanDualDuct.ClosedLoop

Information

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.

References

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.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
replaceable package MediumABuildings.Media.GasesPTDecou... 
RealyFan_start0.0Initial or guess value of output (= state)
BooleandynamicBalanceJunctiontrueSet to true to use a dynamic balance for junction volumes, which often leads to smaller systems of equations
DynamicsenergyDynamicsJunctionsModelica.Fluid.Types.Dynamic...Formulation of energy balance in junction volumes
Booleanfrom_dptrue= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
VolumeVRooCor2698Room volume corridor [m3]
VolumeVRooSou568.77Room volume south [m3]
VolumeVRooNor568.77Room volume north [m3]
VolumeVRooEas360.08Room volume east [m3]
VolumeVRooWes360.08Room volume west [m3]
MassFlowRatem0_flow_cor3*VRooCor*convDesign mass flow rate core [kg/s]
MassFlowRatem0_flow_sou8*VRooSou*convDesign mass flow rate perimeter 1 [kg/s]
MassFlowRatem0_flow_eas9*VRooEas*convDesign mass flow rate perimeter 2 [kg/s]
MassFlowRatem0_flow_nor11*VRooNor*convDesign mass flow rate perimeter 3 [kg/s]
MassFlowRatem0_flow_wes10*VRooWes*convDesign mass flow rate perimeter 4 [kg/s]
MassFlowRatem_flow_nominalm0_flow_cor + m0_flow_sou + ...Nominal air mass flow rate [kg/s]
MassFlowRatemAirOut_flow_nominal0.3*m_flow_nominalNominal outside air mass flow rate [kg/s]
MassFlowRatemAirHot_flow_nominal0.3*m_flow_nominalNominal air mass flow rate for hot deck [kg/s]
MassFlowRatemAirCol_flow_nominalm_flow_nominalNominal air mass flow rate for cold deck [kg/s]
MassFlowRatemWatPre_flow_nominal(TMixHea_nominal - 273.15 - ...Nominal water mass flow rate for preheat coil [kg/s]
MassFlowRatemWatCol_flow_nominal(28 - 13)*1000*1.3/4200/15*m...Nominal water mass flow rate for cooling coil of cold deck [kg/s]
MassFlowRatemWatHot_flow_nominal(40 - (TMixHea_nominal - 273...Nominal water mass flow rate for heating coil of cold deck [kg/s]
TemperatureTMixHea_nominal0.3*(273.15 + (-20)) + 0.7*(...Mixed air temperature at winter design conditions [K]
TemperatureTMixCoo_nominal0.3*(273.15 + (33)) + 0.7*(2...Mixed air temperature at summer design conditions [K]
TemperatureTSupCol_nominal12 + 273.15Cold deck temperature at nominal condition [K]
Anglelat41.98*3.14159/180Latitude [rad]

Connectors

TypeNameDescription
replaceable package MediumA 
ControlBuscontrolBus 
BusweaBusWeather Data Bus

Modelica definition

model ClosedLoop "Closed loop model of a dual-fan dual-duct system"
  import Buildings;
  extends Modelica.Icons.Example;

  replaceable package MediumA =
      Buildings.Media.GasesPTDecoupled.MoistAirUnsaturated;
  package MediumW = Buildings.Media.ConstantPropertyLiquidWater 
    "Medium model for water";

  parameter Real yFan_start=0.0 "Initial or guess value of output (= state)";
  parameter Boolean dynamicBalanceJunction=true 
    "Set to true to use a dynamic balance for junction volumes, which often leads to smaller systems of equations";
  parameter Modelica.Fluid.Types.Dynamics energyDynamicsJunctions=Modelica.Fluid.Types.Dynamics.FixedInitial 
    "Formulation of energy balance in junction volumes";
  parameter Boolean from_dp=true 
    "= true, use m_flow = f(dp) else dp = f(m_flow)";
  parameter Boolean linearizeFlowResistance=false 
    "= true, use linear relation between m_flow and dp for any flow rate";

  parameter Modelica.SIunits.Volume VRooCor=2698 "Room volume corridor";
  parameter Modelica.SIunits.Volume VRooSou=568.77 "Room volume south";
  parameter Modelica.SIunits.Volume VRooNor=568.77 "Room volume north";
  parameter Modelica.SIunits.Volume VRooEas=360.08 "Room volume east";
  parameter Modelica.SIunits.Volume VRooWes=360.08 "Room volume west";

  constant Real conv=1.2/3600 "Conversion factor for nominal mass flow rate";
  parameter Modelica.SIunits.MassFlowRate m0_flow_cor=3*VRooCor*conv 
    "Design mass flow rate core";
  parameter Modelica.SIunits.MassFlowRate m0_flow_sou=8*VRooSou*conv 
    "Design mass flow rate perimeter 1";
  parameter Modelica.SIunits.MassFlowRate m0_flow_eas=9*VRooEas*conv 
    "Design mass flow rate perimeter 2";
  parameter Modelica.SIunits.MassFlowRate m0_flow_nor=11*VRooNor*conv 
    "Design mass flow rate perimeter 3";
  parameter Modelica.SIunits.MassFlowRate m0_flow_wes=10*VRooWes*conv 
    "Design mass flow rate perimeter 4";

  parameter Modelica.SIunits.MassFlowRate m_flow_nominal=m0_flow_cor +
      m0_flow_sou + m0_flow_eas + m0_flow_nor + m0_flow_wes 
    "Nominal air mass flow rate";
  parameter Modelica.SIunits.MassFlowRate mAirOut_flow_nominal = 0.3*m_flow_nominal 
    "Nominal outside air mass flow rate";
  parameter Modelica.SIunits.MassFlowRate mAirHot_flow_nominal = 0.3*m_flow_nominal 
    "Nominal air mass flow rate for hot deck";
  parameter Modelica.SIunits.MassFlowRate mAirCol_flow_nominal = m_flow_nominal 
    "Nominal air mass flow rate for cold deck";
  ///////////////////////////////////////////////////////////////////////////////////////
  // Water mass flow rates
  parameter Modelica.SIunits.MassFlowRate mWatPre_flow_nominal = (TMixHea_nominal-273.15-(-20))*1000/15/4200*mAirOut_flow_nominal 
    "Nominal water mass flow rate for preheat coil";
  parameter Modelica.SIunits.MassFlowRate mWatCol_flow_nominal = (28-13)*1000*1.3/4200/15*mAirCol_flow_nominal 
    "Nominal water mass flow rate for cooling coil of cold deck";
  parameter Modelica.SIunits.MassFlowRate mWatHot_flow_nominal = (40-(TMixHea_nominal-273.15))*1000/15/4200*mAirHot_flow_nominal 
    "Nominal water mass flow rate for heating coil of cold deck";
  // Water temperatures
  parameter Modelica.SIunits.Temperature TMixHea_nominal = 0.3*(273.15+(-20)) + 0.7 * (273.15+20) 
    "Mixed air temperature at winter design conditions";
  parameter Modelica.SIunits.Temperature TMixCoo_nominal = 0.3*(273.15+(33)) + 0.7 * (273.15+26) 
    "Mixed air temperature at summer design conditions";
  parameter Modelica.SIunits.Temperature TSupCol_nominal = 12+273.15 
    "Cold deck temperature at nominal condition";
  parameter Modelica.SIunits.Angle lat=41.98*3.14159/180 "Latitude";

  Fluid.Sources.Outside amb(redeclare package Medium = MediumA, nPorts=2) 
    "Ambient conditions";
  Buildings.Fluid.FixedResistances.FixedResistanceDpM fil(
    m_flow_nominal=m_flow_nominal,
    redeclare package Medium = MediumA,
    dp_nominal=200 + 200 + 100,
    from_dp=from_dp,
    linearized=linearizeFlowResistance) "Filter";
  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) 
    "Preheat coil";

  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) "Cooling coil";
  Buildings.Fluid.Movers.FlowMachine_y fanSupHot(
    redeclare package Medium = MediumA,
    pressure(V_flow=mAirHot_flow_nominal/1.2*{0,2}, dp=600*{2,0}),
    energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
    dynamicBalance=true) "Supply air fan for hot deck";
  Buildings.Fluid.Movers.FlowMachine_y fanSupCol(
    redeclare package Medium = MediumA,
    pressure(V_flow=mAirCol_flow_nominal/1.2*{0,2}, dp=600*{2,0}),
    energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
    dynamicBalance=true) "Supply air fan for cold deck";
  Buildings.Fluid.Movers.FlowMachine_y fanRet(
    redeclare package Medium = MediumA,
    pressure(V_flow=m_flow_nominal/1.2*{0,2}, dp=100*{2,0}),
    energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial,
    dynamicBalance=true) "Return air fan";
  Buildings.Fluid.Sources.FixedBoundary sinHea(
    redeclare package Medium = MediumW,
    nPorts=2,
    p=300000,
    T=308.15) "Sink for heating coil";
  Buildings.Fluid.Sources.FixedBoundary sinCoo(
    redeclare package Medium = MediumW,
    p=300000,
    T=285.15,
    nPorts=1) "Sink for cooling coil";
  Modelica.Blocks.Routing.RealPassThrough TOut(y(
      final quantity="ThermodynamicTemperature",
      final unit="K",
      displayUnit="degC",
      min=0));
  inner Modelica.Fluid.System system(
    p_ambient(displayUnit="Pa"),
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    m_flow_small=1E-4*m_flow_nominal);
  Buildings.Examples.DualFanDualDuct.Controls.HeatingCoilTemperatureSetpoint
                                   TSupSetHea(TOn=284.15, TOff=279.15) 
    "Supply air temperature setpoint for heating";
  Buildings.Controls.Continuous.LimPID preHeaCoiCon(
    yMax=1,
    yMin=0,
    Td=60,
    initType=Modelica.Blocks.Types.InitPID.InitialState,
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    Ti=120,
    k=0.1) "Controller for pre-heating coil";
  Buildings.Controls.Continuous.LimPID cooCoiCon(
    reverseAction=true,
    Td=60,
    initType=Modelica.Blocks.Types.InitPID.InitialState,
    yMax=1,
    yMin=0,
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    k=0.1,
    Ti=120) "Controller for cooling coil";
  Buildings.Examples.VAVReheat.Controls.FanVFD conFanSupHot(
    initType=Modelica.Blocks.Types.Init.InitialState,
    y_start=yFan_start,
    r_N_min=0,
    xSet_nominal(displayUnit="Pa") = 30) "Controller for fan of hot deck";
  Buildings.Controls.SetPoints.OccupancySchedule occSch(occupancy=3600*{6,19}) 
    "Occupancy schedule";
  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) 
    "Preheating coil outlet temperature";
  Buildings.Utilities.Math.Min min(nin=5) "Computes lowest room temperature";
  Buildings.Utilities.Math.Average ave(nin=5) 
    "Compute average of room temperatures";
  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) "Cooling coil valve";
  Buildings.Fluid.Sources.FixedBoundary souCoo(
    redeclare package Medium = MediumW,
    p=3E5 + 12000,
    nPorts=1,
    T=279.15) "Source for cooling coil";
  Buildings.Examples.VAVReheat.Controls.Economizer conEco(
    dT=1,
    Ti=60,
    VOut_flow_min=0.3*m_flow_nominal/1.2,
    k=0.1) "Controller for economizer";
  Buildings.Fluid.Sensors.TemperatureTwoPort TRet(redeclare package Medium =
        MediumA, m_flow_nominal=m_flow_nominal) "Return air temperature sensor";
  Buildings.Fluid.Sensors.TemperatureTwoPort TMix(redeclare package Medium =
        MediumA, m_flow_nominal=m_flow_nominal) "Mixed air temperature sensor";
  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) "Source for heating coil";
  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=linearizeFlowResistance) "Economizer";
  Buildings.Fluid.Sensors.TemperatureTwoPort TCoiCoo(
    redeclare package Medium = MediumA,
    m_flow_nominal=mAirCol_flow_nominal) "Cooling coil outlet temperature";
  Buildings.Fluid.Sensors.VolumeFlowRate VOut1(redeclare package Medium =
        MediumA, m_flow_nominal=m_flow_nominal) "Outside air volume flow rate";
  Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch
                                                    cor(
    redeclare package MediumA = MediumA,
    m_flow_nominal=m0_flow_cor,
    VRoo=2698,
    energyDynamicsJunctions=energyDynamicsJunctions,
    dynamicBalanceJunction=dynamicBalanceJunction,
    from_dp=true) "Zone for core of buildings (azimuth will be neglected)";
  Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch
                                                    sou(
    redeclare package MediumA = MediumA,
    m_flow_nominal=m0_flow_sou,
    VRoo=568.77,
    energyDynamicsJunctions=energyDynamicsJunctions,
    dynamicBalanceJunction=dynamicBalanceJunction,
    from_dp=true) "South-facing thermal zone";
  Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch
                                                    eas(
    redeclare package MediumA = MediumA,
    m_flow_nominal=m0_flow_eas,
    VRoo=360.08,
    energyDynamicsJunctions=energyDynamicsJunctions,
    dynamicBalanceJunction=dynamicBalanceJunction,
    from_dp=true) "East-facing thermal zone";
  Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch
                                                    nor(
    redeclare package MediumA = MediumA,
    m_flow_nominal=m0_flow_nor,
    VRoo=568.77,
    energyDynamicsJunctions=energyDynamicsJunctions,
    dynamicBalanceJunction=dynamicBalanceJunction,
    from_dp=true) "North-facing thermal zone";
  Buildings.Examples.DualFanDualDuct.ThermalZones.SupplyBranch
                                                    wes(
    redeclare package MediumA = MediumA,
    m_flow_nominal=m0_flow_wes,
    VRoo=360.08,
    energyDynamicsJunctions=energyDynamicsJunctions,
    dynamicBalanceJunction=dynamicBalanceJunction,
    from_dp=true) "West-facing thermal zone";
  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) "Controller for return air fan";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splRetRoo1(
    redeclare package Medium = MediumA,
    m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {30,0,70}) "Splitter for room return";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {20,0,50}) "Splitter for room return";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {20,0,30}) "Splitter for room return";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splRetNor(
    redeclare package Medium = MediumA,
    m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {20,10,10}) "Splitter for room return";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splSupRoo1Hot(
    redeclare package Medium = MediumA,
    m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {240,0,-80}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-60}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-40}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splSupNorHot(
    redeclare package Medium = MediumA,
    m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-20}) "Splitter for room supply";
  Buildings.Examples.DualFanDualDuct.Controls.CoolingCoilTemperatureSetpoint
                                                                       TSetCoo(TOn=
        285.15, TOff=313.15) "Setpoint for cooling coil";
  BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
  BoundaryConditions.WeatherData.Bus weaBus "Weather Data Bus";
  Buildings.Examples.VAVReheat.ThermalZones.Floor flo(
    redeclare package Medium = MediumA,
    lat=lat) 
    "Model of a floor of the building that is served by this VAV system";
  Modelica.Blocks.Routing.DeMultiplex5 TRooAir 
    "Demultiplex for room air temperature";

  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) "Heating coil for hot deck";
  Buildings.Fluid.Sensors.TemperatureTwoPort TCoiHea(
    redeclare package Medium = MediumA,
    m_flow_nominal=mAirHot_flow_nominal) "Heating coil outlet temperature";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splHotColDec(
    redeclare package Medium = MediumA,
    m_flow_nominal=m_flow_nominal*{1,1,1},
    dp_nominal(displayUnit="Pa") = {0,0,0},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance) "Splitter for cold deck";
  Buildings.Fluid.Actuators.Valves.TwoWayLinear 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) "Preheating coil valve";
  Fluid.Movers.FlowMachine_m_flow pumPreHea(redeclare package Medium = MediumW,
      m_flow_nominal=mWatPre_flow_nominal) 
    "Pump for preheat coil (to ensure constant flow through the coil)";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splCol1(
    from_dp=true,
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    linearized=true,
    dp_nominal(displayUnit="Pa") = {0,0,0},
    redeclare package Medium = MediumW,
    m_flow_nominal=mWatPre_flow_nominal*{1,1,1}) "Splitter for cold deck";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splCol2(
    from_dp=true,
    energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    linearized=true,
    dp_nominal(displayUnit="Pa") = {0,0,0},
    redeclare package Medium = MediumW,
    m_flow_nominal=mWatPre_flow_nominal*{1,1,1}) "Splitter for cold deck";
  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) "Heating coil valve";
  Buildings.Controls.Continuous.LimPID heaCoiCon(
    Td=60,
    initType=Modelica.Blocks.Types.InitPID.InitialState,
    yMax=1,
    yMin=0,
    controllerType=Modelica.Blocks.Types.SimpleController.PI,
    Ti=120,
    k=0.1) "Controller for heating coil";
  Buildings.Controls.SetPoints.Table TSetHot(table=[273.15 + 5,273.15 + 40; 273.15
         + 22,273.15 + 22]) "Setpoint for hot deck temperature";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splSupRoo1Col(
    redeclare package Medium = MediumA,
    m_flow_nominal={m_flow_nominal,m_flow_nominal - m0_flow_cor,m0_flow_cor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal(displayUnit="Pa") = {240,0,-80}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-60}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM 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},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-40}) "Splitter for room supply";
  Buildings.Fluid.FixedResistances.SplitterFixedResistanceDpM splSupNorCol(
    redeclare package Medium = MediumA,
    m_flow_nominal={m0_flow_nor + m0_flow_wes,m0_flow_wes,m0_flow_nor},
    energyDynamics=energyDynamicsJunctions,
    massDynamics=energyDynamicsJunctions,
    dynamicBalance=dynamicBalanceJunction,
    from_dp=from_dp,
    linearized=linearizeFlowResistance,
    dp_nominal={20,0,-20}) "Splitter for room supply";
  Modelica.Blocks.Sources.Constant pStaPre_Set(      y(final unit="Pa", min=0), k=30) 
    "Setpoint for static pressure";
  Buildings.Examples.VAVReheat.Controls.FanVFD conFanSupCol(
    initType=Modelica.Blocks.Types.Init.InitialState,
    y_start=yFan_start,
    r_N_min=0,
    xSet_nominal(displayUnit="Pa") = 30) "Controller for fan of cold deck";
  Modelica.Blocks.Logical.Switch swiPumPreCoi "Switch for preheat coil pump";
  Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold=273.15 + 10);
  Modelica.Blocks.Sources.Constant mWatPreOn(k=mWatPre_flow_nominal) 
    "Water flow rate at preheat coil if on";
  Modelica.Blocks.Sources.Constant mWatPreOff(k=0) 
    "Water flow rate at preheat coil if off";
  Modelica.Blocks.Sources.Constant pStaBui_Set(y(final unit="Pa", min=0), k=30) 
    "Setpoint for static pressure of building";

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(controlBus, conFanSupHot.controlBus);
  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(TPreHeaCoi.T, preHeaCoiCon.u_m);
  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(controlBus, conFanRet.controlBus);
  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(conFanSupCol.controlBus, conFanSupHot.controlBus);
  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(preHeaCoiCon.y, valPreHea.y);
  connect(TSupSetHea.TSet, conEco.TSupHeaSet);
  connect(modeSelector.cb, TSupSetHea.controlBus);
  connect(TSupSetHea.TSet, preHeaCoiCon.u_s);
  connect(lessThreshold.y, swiPumPreCoi.u2);
  connect(lessThreshold.u, TMix.T);
  connect(mWatPreOn.y, swiPumPreCoi.u1);
  connect(swiPumPreCoi.y, pumPreHea.m_flow_in);
  connect(mWatPreOff.y, swiPumPreCoi.u3);
  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);
end ClosedLoop;

Automatically generated Wed Feb 29 16:57:56 2012.