Buildings.Examples

Collection of models that illustrate model use and test models

Package Content

NameDescription
Buildings.Examples.BaseClasses BaseClasses Package with base classes for example models
HydronicHeating Test model
VAVSystemCTControl VAV system model of MIT building with continuous time control for static pressure reset


Buildings.Examples.HydronicHeating

Test model

Buildings.Examples.HydronicHeating

Parameters

TypeNameDefaultDescription
IntegernRoo2Number of rooms
VolumeVRoo8*5*3Volume of one room [m3]
RealACH0.5Outside air exchange per hour
AreaAHeaTra(8 + 5)*3Heat transfer area of one room [m2]
PowerQ_flow_nominal1500Nominal power [W]
TemperaturedT_nominal20Nominal temperature difference [K]
MassFlowRatem_flow_nominalQ_flow_nominal/dT_nominal/4200Nominal mass flow rate [kg/s]
PressuredpPip_nominal10000Pressure difference of pipe (without valve) [Pa]
PressuredpVal_nominal1000Pressure difference of valve [Pa]
PressuredpRoo_nominal6000Pressure difference of flow leg that serves a room [Pa]
PressuredpThrWayVal_nominal6000Pressure difference of three-way valve [Pa]
Pressuredp_nominaldpPip_nominal + dpVal_nomina...Pressure difference of loop [Pa]

Modelica definition

model HydronicHeating "Test model"
// package Medium = Buildings.Media.ConstantPropertyLiquidWater "Medium model";
 package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater 
    "Medium model";
 //package Medium = Modelica.Media.Air.SimpleAir "Medium model";
 //package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir "Medium model";


 parameter Integer nRoo = 2 "Number of rooms";
 parameter Modelica.SIunits.Volume VRoo = 8*5*3 "Volume of one room";
 parameter Real ACH = 0.5 "Outside air exchange per hour";
 parameter Modelica.SIunits.Area AHeaTra=(8+5)*3 
    "Heat transfer area of one room";
 parameter Modelica.SIunits.Power Q_flow_nominal = 1500 "Nominal power";
 parameter Modelica.SIunits.Temperature dT_nominal = 20 
    "Nominal temperature difference";
 parameter Modelica.SIunits.MassFlowRate m_flow_nominal = Q_flow_nominal/dT_nominal/4200 
    "Nominal mass flow rate";
 parameter Modelica.SIunits.Pressure dpPip_nominal = 10000 
    "Pressure difference of pipe (without valve)";
 parameter Modelica.SIunits.Pressure dpVal_nominal = 1000 
    "Pressure difference of valve";

 parameter Modelica.SIunits.Pressure dpRoo_nominal = 6000 
    "Pressure difference of flow leg that serves a room";
 parameter Modelica.SIunits.Pressure dpThrWayVal_nominal = 6000 
    "Pressure difference of three-way valve";
 parameter Modelica.SIunits.Pressure dp_nominal = dpPip_nominal + dpVal_nominal + dpRoo_nominal 
    "Pressure difference of loop";
  Buildings.Fluid.Boilers.BoilerPolynomial boi(
    a={0.9},
    effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant,
    Q_flow_nominal=Q_flow_nominal,
    dT_nominal=dT_nominal,
    redeclare package Medium = Medium,
    allowFlowReversal=false,
    dp_nominal=3000,
    T_start=293.15) "Boiler";
  inner Modelica.Fluid.System system;
  Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TAmb(T=288.15) 
    "Ambient temperature in boiler room";
  Modelica.Fluid.Machines.PrescribedPump pumRad(
    N_nominal=3000,
    use_N_in=true,
    redeclare package Medium = Medium,
    redeclare function flowCharacteristic = 
        Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.linearFlow (
          V_flow_nominal={m_flow_nominal/1000,0.5*m_flow_nominal/1000},
          head_nominal=1.5*dp_nominal/9.81/1000*{1,2}),
    allowFlowReversal=false,
    checkValve=true,
    V=0.01,
    energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial) 
    "Pump that serves the radiators";

  Modelica.Fluid.Vessels.OpenTank expVes(
    height=2,
    crossArea=1,
    level_start=1,
    nPorts=1,
    use_portsData=false,
    redeclare package Medium = Medium,
    massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
    p_ambient=100000) 
    "Expansion vessel, used to set static pressure in water loop";
  Buildings.Fluid.FixedResistances.FixedResistanceDpM res1(
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal,
    dp_nominal=dpPip_nominal/2);
  Buildings.Fluid.FixedResistances.FixedResistanceDpM res2(
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal,
    dp_nominal=dpPip_nominal/2);
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo2;
  Modelica.Blocks.Sources.Constant dpSet(k=dp_nominal) "Pressure set point";
  Modelica.Blocks.Continuous.LimPID conPum(
    controllerType=Modelica.Blocks.Types.SimpleController.P,
    yMax=3000,
    k=1,
    yMin=0.3*3000,
    Ti=60,
    Td=5) "Controller for pump";
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor roo2(T(fixed=true), C=
        10*30*1006) "Heat capacity of room";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut2 
    "Outside temperature boundary condition";
  Modelica.Blocks.Sources.Sine TOutBC(
    freqHz=1/86400,
    offset=283.15,
    amplitude=5,
    phase=-1.5707963267949) "Outside air temperature";
  Buildings.Fluid.Sensors.RelativePressure dpSen(redeclare package Medium = 
        Medium);
  Fluid.Actuators.Valves.TwoWayEqualPercentage val2(
    redeclare package Medium = Medium,
    dp_nominal(displayUnit="Pa") = dpVal_nominal,
    Kv_SI=m_flow_nominal/nRoo/sqrt(dpVal_nominal),
    m_flow_nominal=m_flow_nominal/2,
    l=0.01) "Radiator valve";
  Modelica.Blocks.Continuous.LimPID conRoo2(
    controllerType=Modelica.Blocks.Types.SimpleController.P,
    yMax=1,
    yMin=0,
    k=2) "Controller for room temperature";
  Modelica.Blocks.Sources.Constant TRooSet2(k=273.15 + 20);
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRoo1;
  Modelica.Thermal.HeatTransfer.Components.HeatCapacitor roo1(             T(
        fixed=true), C=VRoo*1006) "Heat capacity of room";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut1 
    "Outside temperature boundary condition";
  Fluid.Actuators.Valves.TwoWayEqualPercentage val1(
    redeclare package Medium = Medium,
    dp_nominal(displayUnit="Pa") = dpVal_nominal,
    Kv_SI=m_flow_nominal/nRoo/sqrt(dpVal_nominal),
    m_flow_nominal=m_flow_nominal/2,
    l=0.01) "Radiator valve";
  Modelica.Blocks.Continuous.LimPID conRoo1(
    controllerType=Modelica.Blocks.Types.SimpleController.P,
    yMax=1,
    yMin=0,
    k=2) "Controller for room temperature";
  Modelica.Blocks.Sources.Constant TRooSet1(
                                           k=273.15 + 20);
  Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad1(
    Q_flow_nominal=Q_flow_nominal/nRoo,
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal/nRoo,
    dT_nominal=(60 + 40)/2 - 20) "Radiator";
  Buildings.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad2(
    Q_flow_nominal=Q_flow_nominal/nRoo,
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal/nRoo,
    dT_nominal=(60 + 40)/2 - 20) "Radiator";
  Buildings.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear thrWayVal(
                                            redeclare package Medium = Medium,
      m_flow_nominal=m_flow_nominal,
    dp_nominal=dpThrWayVal_nominal,
    l={0.01,0.01}) "Three-way valve";
  Modelica.Blocks.Continuous.LimPID conVal(
    k=1,
    Ti=60,
    yMax=1,
    yMin=0,
    initType=Modelica.Blocks.Types.InitPID.InitialState,
    xi_start=1,
    controllerType=Modelica.Blocks.Types.SimpleController.P) 
    "Controller for pump";
  Fluid.Storage.StratifiedEnhanced tan(
    m_flow_nominal=m_flow_nominal,
    dIns=0.3,
    redeclare package Medium = Medium,
    hTan=2,
    VTan=0.1,
    nSeg=5) "Storage tank";
  Modelica.Fluid.Machines.PrescribedPump pumBoi(
    N_nominal=3000,
    use_N_in=true,
    redeclare package Medium = Medium,
    checkValve=true,
    allowFlowReversal=false,
    redeclare function flowCharacteristic = 
        Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.linearFlow (
          head_nominal=1.5*5000/9.81/1000*{1,2}, V_flow_nominal=2*{
            m_flow_nominal/1000,0.5*m_flow_nominal/1000}));
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor tanTemBot 
    "Tank temperature";
  Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor tanTemTop 
    "Tank temperature";
  Modelica.Blocks.Logical.GreaterThreshold greThr(threshold=273.15 + 52);
  Modelica.Blocks.Math.BooleanToReal booToRea;
  Buildings.Fluid.FixedResistances.FixedResistanceDpM res3(
    redeclare package Medium = Medium,
    allowFlowReversal=false,
    m_flow_nominal=2*m_flow_nominal,
    dp_nominal=2000);
  Modelica.Blocks.Math.Gain gain(            k=3000);
  Buildings.Fluid.FixedResistances.FixedResistanceDpM res4(
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal,
    dp_nominal=100);
  Modelica.StateGraph.InitialStepWithSignal iniSte;
  Modelica.StateGraph.TransitionWithSignal transition(enableTimer=false,
      waitTime=0);
  Modelica.StateGraph.StepWithSignal onSta(nIn=2) "State for furnace on";
  inner Modelica.StateGraph.StateGraphRoot stateGraphRoot;
  Modelica.Blocks.Logical.LessThreshold lesThr(threshold=273.15 + 50);
  Modelica.StateGraph.TransitionWithSignal toOff(enableTimer=false);
  Modelica.StateGraph.StepWithSignal offSta(nIn=1) "State for furnace off";
  Modelica.StateGraph.TransitionWithSignal toOn(enableTimer=false);
  Buildings.Fluid.Sensors.Temperature temSup(redeclare package Medium = Medium);
  Buildings.Fluid.Sensors.Temperature temRet(redeclare package Medium = Medium);
  Buildings.Controls.SetPoints.HotWaterTemperatureReset heaCha(
    use_TRoo_in=false,
    dTOutHeaBal=0,
    TSup_nominal=333.15,
    TRet_nominal=313.15,
    TOut_nominal=268.15);
  Buildings.HeatTransfer.ConductorSingleLayer conExt1(
    n=3,
    mat=Buildings.HeatTransfer.Data.Brick(),
    A=AHeaTra,
    x=0.24) "Conduction through exterior facing layer";

  Buildings.HeatTransfer.ConductorSingleLayer conInt1(
    n=3,
    A=AHeaTra,
    mat=Buildings.HeatTransfer.Data.InsulationBoard(),
    x=0.2) "Conduction through interior facing layer";
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor venLos1(G=VRoo*ACH/
        3600*1.2*1006) "Ventilation heat loss";
  Modelica.Thermal.HeatTransfer.Components.ThermalConductor venLos2(G=VRoo*ACH/
        3600*1.2*1006) "Ventilation heat loss";
  Controls.SetPoints.OccupancySchedule occSch1(occupancy=3600*{7,8,10,11,11.5,
        15,19,21}) "Occupancy schedule";
  Modelica.Blocks.Logical.Switch switch1;
  Modelica.Blocks.Sources.RealExpression occ1(y=200) 
    "Heat gain if occupied in room 1";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo1 
    "Prescribed heat flow to model occupancy";
  Modelica.Blocks.Sources.Constant zer(k=0) "Outputs zero";
  Controls.SetPoints.OccupancySchedule occSch2(
      firstEntryOccupied=false, occupancy=3600*{7,10,12,22}) 
    "Occupancy schedule";
  Modelica.Blocks.Logical.Switch switch2;
  Modelica.Blocks.Sources.RealExpression occ2(y=200) 
    "Heat gain if occupied in room 2";
  Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo2 
    "Prescribed heat flow to model occupancy";
  Buildings.HeatTransfer.ConductorSingleLayer conExt2(
    n=3,
    mat=Buildings.HeatTransfer.Data.Brick(),
    A=AHeaTra,
    x=0.24) "Conduction through exterior facing layer";
  Buildings.HeatTransfer.ConductorSingleLayer conInt2(
    n=3,
    A=AHeaTra,
    mat=Buildings.HeatTransfer.Data.InsulationBoard(),
    x=0.2) "Conduction through interior facing layer";
  Buildings.Fluid.FixedResistances.FixedResistanceDpM resRoo1(
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal/nRoo,
    dp_nominal=dpRoo_nominal,
    from_dp=false) "Resistance of pipe leg that serves the room";
  Buildings.Fluid.FixedResistances.FixedResistanceDpM resRoo2(
    redeclare package Medium = Medium,
    m_flow_nominal=m_flow_nominal/nRoo,
    dp_nominal=dpRoo_nominal,
    from_dp=false) "Resistance of pipe leg that serves the room";
  Modelica.Thermal.HeatTransfer.Components.Convection con1 
    "Convective heat transfer";
  Modelica.Thermal.HeatTransfer.Components.Convection con2 
    "Convective heat transfer";
  Modelica.Blocks.Sources.RealExpression hACon1(y=8*AHeaTra) 
    "Convective heat transfer";
  Modelica.Blocks.Sources.RealExpression hACon2(y=8*AHeaTra) 
    "Convective heat transfer";
equation 
  connect(TAmb.port,boi. heatPort);
  connect(dpSet.y, conPum.u_s);
  connect(TOutBC.y, TOut2.T);
  connect(roo2.port, TRoo2.port);
  connect(TRooSet2.y, conRoo2.u_s);
  connect(TRoo2.T, conRoo2.u_m);
  connect(pumRad.port_b, dpSen.port_a);
  connect(roo1.port, TRoo1.port);
  connect(TRoo1.T, conRoo1.u_m);
  connect(rad1.heatPortCon, roo1.port);
  connect(dpSen.port_b, pumRad.port_a);
  connect(dpSen.p_rel, conPum.u_m);
  connect(res1.port_b, val1.port_a);
  connect(val1.port_b, rad1.port_a);
  connect(res1.port_b, val2.port_a);
  connect(val2.port_b, rad2.port_a);
  connect(conRoo1.y, val1.y);
  connect(conRoo2.y, val2.y);
  connect(pumRad.port_a, thrWayVal.port_2);
  connect(boi.port_b,pumBoi. port_a);
  connect(tan.heaPorVol[1], tanTemTop.port);
  connect(tanTemBot.port, tan.heaPorVol[tan.nSeg]);
  connect(tanTemBot.T, greThr.u);
  connect(pumBoi.port_b, res3.port_a);
  connect(res4.port_b, tan.port_b);
  connect(tanTemTop.T, lesThr.u);
  connect(iniSte.outPort[1], transition.inPort);
  connect(transition.outPort, onSta.inPort[1]);
  connect(onSta.outPort[1], toOff.inPort);
  connect(toOff.outPort, offSta.inPort[1]);
  connect(toOn.outPort, onSta.inPort[2]);
  connect(offSta.outPort[1], toOn.inPort);
  connect(lesThr.y, toOn.condition);
  connect(conPum.y, pumRad.N_in);
  connect(gain.y,pumBoi. N_in);
  connect(pumRad.port_b, res1.port_a);
  connect(pumRad.port_b, temSup.port);
  connect(temSup.T, conVal.u_m);
  connect(res2.port_b, temRet.port);
  connect(conVal.y, thrWayVal.y);
  connect(onSta.active, booToRea.u);
  connect(boi.port_a, expVes.ports[1]);
  connect(lesThr.y, transition.condition);
  connect(greThr.y, toOff.condition);
  connect(heaCha.TSup, conVal.u_s);
  connect(TOutBC.y, heaCha.TOut);
  connect(TOutBC.y, TOut1.T);
  connect(booToRea.y,boi. y);
  connect(booToRea.y, gain.u);
  connect(tan.port_b, boi.port_a);
  connect(tan.port_a, thrWayVal.port_1);
  connect(res3.port_b, tan.port_a);
  connect(res4.port_a, res2.port_b);
  connect(res2.port_b, thrWayVal.port_3);
  connect(venLos1.port_a, TOut1.port);
  connect(venLos1.port_b, roo1.port);
  connect(venLos2.port_a, TOut2.port);
  connect(venLos2.port_b, roo2.port);
  connect(TOut1.port, conExt1.port_a);
  connect(conExt1.port_b, conInt1.port_a);
  connect(occSch1.occupied, switch1.u2);
  connect(occ1.y, switch1.u1);
  connect(switch1.y, preHeaFlo1.Q_flow);
  connect(zer.y, switch1.u3);
  connect(occSch2.occupied, switch2.u2);
  connect(switch2.y, preHeaFlo2.Q_flow);
  connect(occ2.y, switch2.u1);
  connect(zer.y, switch2.u3);
  connect(TRooSet1.y, conRoo1.u_s);
  connect(conExt2.port_b, conInt2.port_a);
  connect(TOut2.port, conExt2.port_a);
  connect(rad1.port_b, resRoo1.port_a);
  connect(resRoo1.port_b, res2.port_a);
  connect(rad2.port_b, resRoo2.port_a);
  connect(resRoo2.port_b, res2.port_a);

  connect(conInt1.port_b, con1.solid);
  connect(con1.fluid, roo1.port);
  connect(conInt2.port_b, con2.solid);
  connect(con2.fluid, roo2.port);
  connect(hACon1.y, con1.Gc);
  connect(hACon2.y, con2.Gc);
  connect(preHeaFlo2.port, roo2.port);
  connect(preHeaFlo1.port, roo1.port);
  connect(rad2.heatPortCon, roo2.port);
  connect(rad2.heatPortRad, conInt2.port_b);
  connect(rad1.heatPortRad, conInt1.port_b);
end HydronicHeating;

Buildings.Examples.VAVSystemCTControl

VAV system model of MIT building with continuous time control for static pressure reset

Buildings.Examples.VAVSystemCTControl

Parameters

TypeNameDefaultDescription
MassFlowRatemMIT_flowroo.m0Tot_flowNominal mass flow rate of MIT system model as in ASHRAE 825-RP [kg/s]
PressuredpSuiSup_nominal95Pressure drop supply air leg with splitters of one suite (obtained from simulation) [Pa]
PressuredpSuiRet_nominal233Pressure drop return air leg with splitters of one suite (obtained from simulation) [Pa]
PressuredpFanSupMIT_nominal1050Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa]
PressuredpFanRetMIT_nominal347Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation) [Pa]
RealscaM_flow1/3Scaling factor for mass flow rate
RealscaDpFanSup_nominal1Scaling factor for supply fan pressure lift with NSui number of suites
RealscaDpFanRet_nominal1Scaling factor for supply fan pressure lift with NSui number of suites

Modelica definition

model VAVSystemCTControl 
  "VAV system model of MIT building with continuous time control for static pressure reset"

  // package Medium = Buildings.Media.IdealGases.SimpleAir;
package Medium = Buildings.Media.GasesPTDecoupled.SimpleAir(extraPropertiesNames={"CO2"});
  //  package Medium = Buildings.Media.GasesPTDecoupled.MoistAir;


 parameter Modelica.SIunits.MassFlowRate mMIT_flow = roo.m0Tot_flow 
    "Nominal mass flow rate of MIT system model as in ASHRAE 825-RP";

parameter Modelica.SIunits.Pressure dpSuiSup_nominal = 95 
    "Pressure drop supply air leg with splitters of one suite (obtained from simulation)";
parameter Modelica.SIunits.Pressure dpSuiRet_nominal = 233 
    "Pressure drop return air leg with splitters of one suite (obtained from simulation)";
parameter Modelica.SIunits.Pressure dpFanSupMIT_nominal = 1050 
    "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)";
parameter Modelica.SIunits.Pressure dpFanRetMIT_nominal = 347 
    "Pressure increase over supply fan in MIT system model as in ASHRAE 825-RP (obtained from simulation)";

parameter Real scaM_flow = 1/3 "Scaling factor for mass flow rate";
parameter Real scaDpFanSup_nominal = 1 
    "Scaling factor for supply fan pressure lift with NSui number of suites";
parameter Real scaDpFanRet_nominal = 1 
    "Scaling factor for supply fan pressure lift with NSui number of suites";

  Modelica.Blocks.Sources.Constant PAtm(k=101325);
  Modelica.Blocks.Sources.Constant yDam(k=0.5);
Buildings.Fluid.FixedResistances.FixedResistanceDpM res31(
                                               dp_nominal=0.546,
  m_flow_nominal=scaM_flow*1,
  dh=sqrt(scaM_flow)*1,
  redeclare package Medium = Medium);
Buildings.Fluid.Movers.FlowMachinePolynomial fan32(
  D=0.6858,
  a={4.2904,-1.387,4.2293,-3.92920,0.8534},
  b={0.1162,1.5404,-1.4825,0.7664,-0.1971},
  mNorMin_flow=1,
  mNorMax_flow=2,
  scaM_flow=scaM_flow,
  scaDp=scaDpFanSup_nominal,
  redeclare package Medium = Medium,
    m_flow_nominal=mMIT_flow);
Buildings.Fluid.FixedResistances.FixedResistanceDpM res33(
  dp_nominal=0.164,
  dh=sqrt(scaM_flow)*1,
  m_flow_nominal=scaM_flow*1,
  redeclare package Medium = Medium);
Buildings.Fluid.FixedResistances.FixedResistanceDpM res57(
                                               dp_nominal=0.118000,
  m_flow_nominal=scaM_flow*1,
  dh=sqrt(scaM_flow)*1,
  redeclare package Medium = Medium);
Buildings.Fluid.Movers.FlowMachinePolynomial fan56(
  D=1.13,
  a={4.19370,-1.63370,12.2110,-23.9619,9.81620},
  b={0.619000E-01,3.14170,-5.75510,6.16760,-3.37480},
  mNorMin_flow=0.7,
  mNorMax_flow=1.0,
  scaM_flow=scaM_flow,
  scaDp=scaDpFanRet_nominal,
  redeclare package Medium = Medium,
    m_flow_nominal=mMIT_flow);
BaseClasses.Suite roo(redeclare package Medium = Medium, scaM_flow=scaM_flow);
Buildings.Fluid.Actuators.Dampers.OAMixingBoxMinimumDamper mixBox(
  dpOut_nominal=0.467,
  dpRec_nominal=0.665,
  dpExh_nominal=0.164,
  dpOutMin_nominal=0.467,
  AOutMin=scaM_flow*0.38,
  AOut=scaM_flow*1.32,
  AExh=scaM_flow*1.05,
  ARec=scaM_flow*1.05,
  m0OutMin_flow=scaM_flow*0.1*1,
  m0Out_flow=scaM_flow*1,
  m0Rec_flow=scaM_flow*1,
  m0Exh_flow=scaM_flow*1,
  redeclare package Medium = Medium) "mixing box";
  Buildings.Fluid.Sources.Boundary_pT bouIn(
    redeclare package Medium = Medium,
    use_p_in=true,
    nPorts=3,
    T=293.15);
Modelica.Blocks.Continuous.FirstOrder gaiSup(
                                 k=22.333,
  y_start=0.01,
    initType=Modelica.Blocks.Types.Init.InitialOutput,
    T=120) "Gain for supply air fan";
Modelica.Blocks.Continuous.FirstOrder gaiRet(
                                 k=8,
  y_start=0.01,
    initType=Modelica.Blocks.Types.Init.InitialOutput,
    T=120) "Gain for return air fan";
  inner Modelica.Fluid.System system;

   Modelica.Blocks.Continuous.LimPID PID(
    Ti=60,
    yMax=1,
    yMin=0,
    initType=Modelica.Blocks.Types.InitPID.InitialState,
    k=0.01,
    controllerType=Modelica.Blocks.Types.SimpleController.PI);
  Modelica.Blocks.Sources.Constant const(k=120);
  Buildings.Fluid.Delays.DelayFirstOrder delSup(
    redeclare package Medium = Medium,
    m_flow_nominal=mMIT_flow,
    tau=120) "Delay to break algebraic loop";
  Buildings.Fluid.Delays.DelayFirstOrder delRet(
    redeclare package Medium = Medium,
    m_flow_nominal=mMIT_flow,
    tau=120) "Delay to break algebraic loop";
equation 
  connect(PAtm.y, bouIn.p_in);
  connect(bouIn.ports[1], mixBox.port_OutMin);
  connect(bouIn.ports[2], mixBox.port_Out);
  connect(bouIn.ports[3], mixBox.port_Exh);
  connect(res57.port_a, fan56.port_b);
  connect(fan32.N_in, gaiSup.y);
  connect(fan56.N_in, gaiRet.y);
  connect(const.y, PID.u_s);
  connect(roo.p_rel, PID.u_m);
  connect(PID.y, gaiSup.u);
  connect(PID.y, gaiRet.u);
  connect(yDam.y, mixBox.yOutMin);
  connect(yDam.y, mixBox.y);
  connect(roo.p, PAtm.y);
  connect(res31.port_b, fan32.port_a);
  connect(mixBox.port_Sup, res31.port_a);
  connect(fan32.port_b, res33.port_a);
  connect(res33.port_b, delSup.ports[1]);
  connect(delSup.ports[2], roo.port_aSup);
  connect(roo.port_bExh, delRet.ports[1]);
  connect(delRet.ports[2], fan56.port_a);
  connect(res57.port_b, mixBox.port_Ret);
end VAVSystemCTControl;

HTML-documentation generated by Dymola Tue Sep 29 08:10:55 2009.