diff --git a/.gitignore b/.gitignore index 11f5b2162..412ddce06 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.bak *.pyc *.txt !version.txt diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirSide.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirSide.mo index c784933c6..fb5b21356 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirSide.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirSide.mo @@ -134,19 +134,26 @@ model Airside "Air side system" "Heat exchanger effectiveness of vav 1"; final parameter Real alpha = 0.8 "Sizing factor"; - package MediumAir = Buildings.Media.Air "Medium model for air"; + //package MediumAir = Buildings.Media.Air "Medium model for air"; + package MediumAir = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Buildings library air media package with CO2"; package MediumCHW = Buildings.Media.Water "Medium model for chilled water"; package MediumHeaWat = Buildings.Media.Water "Medium model for heating water"; Modelica.Blocks.Interfaces.RealInput loa[15] "Load from external calculator" annotation (Placement(transformation(extent={{-128,46},{-100,74}}), - iconTransformation(extent={{-128,16},{-100,44}}))); + iconTransformation(extent={{-128,36},{-100,64}}))); Modelica.Blocks.Interfaces.RealOutput TZon[15] "Zone air temperature" annotation (Placement(transformation(extent={{200,-10},{220,10}}), - iconTransformation(extent={{100,-10},{120,10}}))); + iconTransformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealInput TDryBul "Zone air dry bulb temperature" annotation (Placement(transformation(extent={{-128,-14},{-100,14}}), iconTransformation(extent={{-128,-34},{-100,-6}}))); + Modelica.Blocks.Interfaces.RealInput numOcc[15] "Number of occupant" + annotation (Placement(transformation(extent={{-128,6},{-100,34}}), + iconTransformation(extent={{-128,6},{-100,34}}))); + Modelica.Blocks.Math.Gain numOCCMulMidFlo[5](k=10) + "Occupant multiplier for ten floors modelled as one middle floor" + annotation (Placement(transformation(extent={{-94,14},{-82,26}}))); MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.AirsideFloor floor1( @@ -158,9 +165,10 @@ model Airside "Air side system" Fan_Ti=600, booleanExpression(y=if floor1.duaFanAirHanUni.TOut < 283.15 then floor1.duaFanAirHanUni.On else true)), - fivZonVAV(vol(V=200000)), + fivZonVAV(vol(each V=200000)), redeclare package MediumAir = MediumAir, redeclare package MediumHeaWat = MediumHeaWat, + C_start=fill(400e-6*Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM/Modelica.Media.IdealGases.Common.SingleGasesData.Air.MM, MediumAir.nC), PreDroCoiAir=PreDroCoiAir, PreDroMixingBoxAir=PreDroMixingBoxAir, PreDroCooWat=PreDroCooWat, @@ -232,6 +240,7 @@ model Airside "Air side system" fivZonVAV(vol(V=200000)), redeclare package MediumAir = MediumAir, redeclare package MediumHeaWat = MediumHeaWat, + C_start=fill(400e-6*Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM/Modelica.Media.IdealGases.Common.SingleGasesData.Air.MM, MediumAir.nC), PreDroCoiAir=PreDroCoiAir, PreDroMixingBoxAir=PreDroMixingBoxAir, PreDroCooWat=PreDroCooWat, @@ -303,6 +312,7 @@ model Airside "Air side system" fivZonVAV(vol(V=200000)), redeclare package MediumAir = MediumAir, redeclare package MediumHeaWat = MediumHeaWat, + C_start=fill(400e-6*Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM/Modelica.Media.IdealGases.Common.SingleGasesData.Air.MM, MediumAir.nC), PreDroCoiAir=PreDroCoiAir, PreDroMixingBoxAir=PreDroMixingBoxAir, PreDroCooWat=PreDroCooWat, @@ -365,9 +375,12 @@ model Airside "Air side system" nPorts=3, redeclare package Medium = MediumAir, each p(displayUnit="Pa") = 100000, + each C=fill(400e-6*Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM/ + Modelica.Media.IdealGases.Common.SingleGasesData.Air.MM, MediumAir.nC), use_T_in=true) "Source" annotation (Placement(transformation(extent={{40,30},{60,50}}))); + Modelica.Blocks.Sources.Constant TSupAirSet[n](k=273.15 + 12.88) "AHU supply air temperature setpoint" annotation (Placement(transformation(extent={{-70,46},{-50,66}}))); @@ -376,7 +389,7 @@ model Airside "Air side system" annotation (Placement(transformation(extent={{-70,16},{-50,36}}))); Modelica.Blocks.Sources.BooleanExpression onZon[n](each y=true) "Zone VAV terminal on signal" - annotation (Placement(transformation(extent={{40,62},{60,82}}))); + annotation (Placement(transformation(extent={{40,60},{60,80}}))); MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.AirHandlingUnit.BaseClasses.ZoneSetpoint TZonAirSet[15]( @@ -411,7 +424,7 @@ equation annotation (Line(points={{38,44},{-38,44},{-38,1.77636e-15},{-114, 1.77636e-15}}, color={0,0,127})); connect(floor1.port_Exh_Air, sou[1].ports[1]) annotation (Line( - points={{113.375,30.5},{90,30.5},{90,42.6667},{60,42.6667}}, + points={{113.375,30.5},{90,30.5},{90,38.6667},{60,38.6667}}, color={0,140,72}, thickness=0.5)); connect(floor1.port_Fre_Air, sou[1].ports[2]) annotation (Line( @@ -426,16 +439,17 @@ equation 100},{-36,86},{106,86},{106,28.75},{112.438,28.75}}, color={255,0,255})); connect(floor1.OnZon, onZon[1].y) annotation (Line(points={{112.438,21.75},{ - 108,21.75},{108,22},{104,22},{104,72},{61,72}}, + 108,21.75},{108,22},{104,22},{104,70},{61,70}}, color={255,0,255})); for j in 1:5 loop connect(loa[(1 - 1)*5 + j], floor1.Q_flow[j]); connect(floor1.TZon[j], TZon[(1-1)*5+j]); connect(TZonAirSet[(1 - 1)*5 + j].SetPoi[1], floor1.zonCooTSet[j]) - annotation (Line(points={{20,99},{96,99},{96,55},{112.438,55}}, color={0, + annotation (Line(points={{20,99.5},{96,99.5},{96,55},{112.438,55}}, + color={0, 0,127})); connect(TZonAirSet[(1 - 1)*5 + j].SetPoi[2], floor1.zonHeaTSet[j]) - annotation (Line(points={{20,101},{96,101},{96,51.5},{112.438,51.5}}, + annotation (Line(points={{20,100.5},{96,100.5},{96,51.5},{112.438,51.5}}, color={0,0,127})); end for; @@ -474,8 +488,8 @@ equation end for; connect(booRep.y, TZonAirSet.Occ) annotation (Line(points={{-9,100},{-4,100}}, color={255,0,255})); - connect(floor1.TOut, TDryBul) annotation (Line(points={{136.813,18.25},{ - 136.813,0},{-84,0},{-84,1.77636e-15},{-114,1.77636e-15}}, + connect(floor1.TOut, TDryBul) annotation (Line(points={{136.812,18.25},{ + 136.812,0},{-84,0},{-84,0},{-114,0}}, color={0,0,127})); connect(floor2.TOut, TDryBul); connect(floor3.TOut, TDryBul); @@ -487,6 +501,16 @@ equation connect(reaToBooOcc.y, booRep.u) annotation (Line(points={{-39,100},{-32,100}}, color={255,0,255})); + connect(numOcc[1:5], floor1.nPeo) annotation (Line(points={{-114,17.2},{-114, + 10},{92,10},{92,35.75},{112.438,35.75}}, color={0,0,127})); + connect(numOcc[6:10], numOCCMulMidFlo.u) annotation (Line(points={{-114, + 21.8667},{-114,20},{-95.2,20}}, + color={0,0,127})); + connect(numOCCMulMidFlo.y, floor2.nPeo) annotation (Line(points={{-81.4,20},{ + 92,20},{92,35.75},{112.438,35.75}}, + color={0,0,127})); + connect(numOcc[11:15], floor3.nPeo) annotation (Line(points={{-114,26.5333},{ + -114,10},{92,10},{92,35.75},{112.438,35.75}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, {100,100}}), graphics={ Rectangle( diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirsideFloor.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirsideFloor.mo index d86b891d0..522f9b324 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirsideFloor.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/AirsideFloor.mo @@ -2,6 +2,7 @@ within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses; model AirsideFloor "Thermal zones and corresponding air side HVAC systems" replaceable package MediumAir = Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + //replaceable package MediumAir = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Buildings library air media package with CO2"; replaceable package MediumHeaWat = Modelica.Media.Interfaces.PartialMedium "Medium for the heating water"; @@ -151,6 +152,26 @@ model AirsideFloor "Thermal zones and corresponding air side HVAC systems" parameter Modelica.Units.SI.Efficiency eps5(max=1) = 0.8 "Heat exchanger effectiveness of vav 5"; + // Initialization + parameter MediumAir.AbsolutePressure p_start = MediumAir.p_default + "Start value of zone air pressure" + annotation(Dialog(tab = "Initialization")); + parameter MediumAir.Temperature T_start=MediumAir.T_default + "Start value of zone air temperature" + annotation(Dialog(tab = "Initialization")); + parameter MediumAir.MassFraction X_start[MediumAir.nX]( + quantity=MediumAir.substanceNames) = MediumAir.X_default + "Start value of zone air mass fractions m_i/m" + annotation (Dialog(tab="Initialization", enable=Medium.nXi > 0)); + parameter MediumAir.ExtraProperty C_start[MediumAir.nC]( + quantity=MediumAir.extraPropertiesNames)=fill(0, MediumAir.nC) + "Start value of zone air trace substances" + annotation (Dialog(tab="Initialization", enable=Medium.nC > 0)); + parameter MediumAir.ExtraProperty C_nominal[MediumAir.nC]( + quantity=MediumAir.extraPropertiesNames) = fill(1E-2, MediumAir.nC) + "Nominal value of zone air trace substances. (Set to typical order of magnitude.)" + annotation (Dialog(tab="Initialization", enable=Medium.nC > 0)); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.AirHandlingUnit.DuaFanAirHanUnit duaFanAirHanUni( numTemp=5, @@ -192,6 +213,11 @@ model AirsideFloor "Thermal zones and corresponding air side HVAC systems" fivZonVAV( redeclare package MediumAir = MediumAir, redeclare package MediumWat = MediumHeaWat, + p_start=p_start, + T_start=T_start, + X_start=X_start, + C_start=C_start, + C_nominal=C_nominal, PreAirDroMai1=PreAirDroMai1, PreAirDroMai2=PreAirDroMai2, PreAirDroMai3=PreAirDroMai3, @@ -358,15 +384,18 @@ model AirsideFloor "Thermal zones and corresponding air side HVAC systems" nout=5) annotation (Placement(transformation(extent={{-72,68},{-52,88}}))); + Modelica.Blocks.Interfaces.RealInput nPeo[5] "Number of occupant" annotation ( + Placement(transformation(extent={{-180,-28},{-160,-8}}), + iconTransformation(extent={{-180,-20},{-160,0}}))); equation connect(fivZonVAV.port_a_Air, duaFanAirHanUni.port_b_Air) annotation ( Line( - points={{30,-37.6},{-10,-37.6},{-10,-22},{-20,-22},{-20,1},{-50,1}}, + points={{30,-37.6},{-20,-37.6},{-20,-0.181818},{-50,-0.181818}}, color={0,140,72}, thickness=0.5)); connect(fivZonVAV.port_b_Air, duaFanAirHanUni.port_a_Air) annotation ( Line( - points={{30,-23.6},{16,-23.6},{16,-4},{-50,-4},{-50,11.4}}, + points={{30,-23.6},{16,-23.6},{16,12},{-50,12},{-50,9.27273}}, color={0,140,72}, thickness=0.5)); connect(duaFanAirHanUni.port_b_Wat, port_b_CooWat) annotation (Line( @@ -386,226 +415,230 @@ equation color={255,0,0}, thickness=1)); connect(duaFanAirHanUni.port_Exh_Air, port_Exh_Air) annotation (Line( - points={{-78.28,1},{-114,1},{-114,-40},{-164,-40}}, + points={{-78.28,-0.181818},{-114,-0.181818},{-114,-40},{-164,-40}}, color={0,140,72}, thickness=0.5)); connect(duaFanAirHanUni.port_Fre_Air, port_Fre_Air) annotation (Line( - points={{-78,-6.8},{-114,-6.8},{-114,40},{-160,40}}, + points={{-78,-7.27273},{-114,-7.27273},{-114,40},{-160,40}}, color={0,140,72}, thickness=0.5)); connect(booleanReplicator.y, fivZonVAV.On) annotation (Line( points={{-125.3,-90},{0,-90},{0,-30.32},{28.2,-30.32}}, color={255,0,255})); connect(fivZonVAV.p, duaFanAirHanUni.pMea) annotation (Line(points={{67.8, - -19.4},{70,-19.4},{70,-16},{-88,-16},{-88,-11.22},{-79.4,-11.22}}, + -19.4},{70,-19.4},{70,-16},{-88,-16},{-88,-11.2909},{-79.4,-11.2909}}, color={0,0,127})); - connect(fivZonVAV.TZon, duaFanAirHanUni.zonT) annotation (Line(points={{ - 67.8,-40.4},{84,-40.4},{84,-64},{-104,-64},{-104,6.2},{-79.4,6.2}}, + connect(fivZonVAV.TZon, duaFanAirHanUni.zonT) annotation (Line(points={{67.8, + -37.6},{84,-37.6},{84,-64},{-104,-64},{-104,4.54545},{-79.4,4.54545}}, color={0,0,127})); connect(OnFan, duaFanAirHanUni.On) annotation (Line(points={{-170,-50},{-108, - -50},{-108,14},{-79.4,14}}, color={255,0,255})); + -50},{-108,11.6364},{-79.4,11.6364}}, + color={255,0,255})); connect(booleanReplicator.u, OnZon) annotation (Line( points={{-141.4,-90},{-170,-90}}, color={255,0,255})); connect(fivZonVAV.Q_flow, Q_flow) annotation (Line( - points={{28.2,-20.8},{2,-20.8},{2,-70},{16,-70},{16,-110}}, + points={{28.2,-21.64},{2,-21.64},{2,-70},{16,-70},{16,-110}}, color={0,0,127})); connect(fivZonVAV.TZon, TZon) annotation (Line( - points={{67.8,-40.4},{146,-40.4},{146,0},{170,0}}, + points={{67.8,-37.6},{146,-37.6},{146,0},{170,0}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(port_a_CooWat, port_a_CooWat) annotation (Line(points={{-30,-100}, {-30,-100}}, color={0,127,255})); - connect(duaFanAirHanUni.TOut, TOut) annotation (Line(points={{-79.4,11.4}, - {-112,11.4},{-112,-74},{-14,-74},{-14,-110}}, color={0,0,127})); + connect(duaFanAirHanUni.TOut, TOut) annotation (Line(points={{-79.4,9.27273}, + {-112,9.27273},{-112,-74},{-14,-74},{-14,-110}}, + color={0,0,127})); connect(OnFan, reaAhu.occ_in) annotation (Line(points={{-170,-50},{-112,-50}, - {-112,62},{26,62},{26,62.3826}}, color={255,0,255})); + {-112,62},{26,62},{26,62.8}}, color={255,0,255})); connect(duaFanAirHanUni.TSupAir, reaAhu.TSup_in) annotation (Line( - points={{-48.6,-4.2},{-34,-4.2},{-34,54.8696},{26,54.8696}}, + points={{-48.6,-4.90909},{-34,-4.90909},{-34,56.1538},{26,56.1538}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.TMixAir, reaAhu.TMix_in) annotation (Line( - points={{-48.6,-2.64},{-48.6,-4},{-32,-4},{-32,50.6957},{26,50.6957}}, + points={{-48.6,-3.49091},{-48.6,-4},{-32,-4},{-32,52.4615},{26,52.4615}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.TRetAir, reaAhu.TRet_in) annotation (Line( - points={{-48.6,8.02},{-28,8.02},{-28,46.5217},{26,46.5217}}, + points={{-48.6,6.2},{-28,6.2},{-28,48.7692},{26,48.7692}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.V_flowSupAir, reaAhu.V_flow_sup_in) annotation ( Line( - points={{-48.6,-1.08},{-26,-1.08},{-26,42.3478},{26,42.3478}}, + points={{-48.6,-2.07273},{-26,-2.07273},{-26,45.0769},{26,45.0769}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.V_flowRetAir, reaAhu.V_flow_ret_in) annotation ( Line( - points={{-48.6,9.58},{-30,9.58},{-30,38.1739},{26,38.1739}}, + points={{-48.6,7.61818},{-30,7.61818},{-30,41.3846},{26,41.3846}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.yDamOutAir, reaAhu.yOA_in) annotation (Line( - points={{-48.6,-11.22},{-24,-11.22},{-24,34.2783},{26,34.2783}}, + points={{-48.6,-11.2909},{-24,-11.2909},{-24,37.9385},{26,37.9385}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.pMea, reaAhu.dp_in) annotation (Line( - points={{-79.4,-11.22},{-22,-11.22},{-22,29.8261},{26,29.8261}}, + points={{-79.4,-11.2909},{-22,-11.2909},{-22,34},{26,34}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.PFan, reaAhu.PFanTot_in) annotation (Line( - points={{-48.6,4.64},{-20,4.64},{-20,25.6522},{26,25.6522}}, + points={{-48.6,3.12727},{-20,3.12727},{-20,30.3077},{26,30.3077}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.TSupCHW, reaAhu.TCooCoiSup_in) annotation (Line( - points={{-48.6,-9.4},{-18,-9.4},{-18,21.4783},{26,21.4783}}, + points={{-48.6,-9.63636},{-18,-9.63636},{-18,26.6154},{26,26.6154}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.TRetCHW, reaAhu.TCooCoiRet_in) annotation (Line( - points={{-48.6,2.82},{-16,2.82},{-16,17.3043},{26,17.3043}}, + points={{-48.6,1.47273},{-16,1.47273},{-16,22.9231},{26,22.9231}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(reaAhu.yCooVal_in, duaFanAirHanUni.yCooVal) annotation (Line( - points={{26,13.1304},{-14,13.1304},{-14,6.2},{-48.6,6.2}}, + points={{26,19.2308},{-14,19.2308},{-14,4.54545},{-48.6,4.54545}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(duaFanAirHanUni.V_flowOutAir, reaAhu.V_flow_OA_in) annotation ( Line( - points={{-48.6,-6.8},{-48.6,-4},{-12,-4},{-12,10},{26,10},{26,8.95652}}, + points={{-48.6,-7.27273},{-48.6,-6},{-12,-6},{-12,16},{26,16},{26,15.5385}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(TSupAirSet.y, reaAhu.TSup_set_in) annotation (Line( - points={{-127.4,60},{26,60},{26,58.2087}}, + points={{-127.4,60},{26,60},{26,59.1077}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(disTSet, TSupAirSet.u) annotation (Line(points={{-170,60},{-141.2,60}}, color={0,0,127})); - connect(TSupAirSet.y, duaFanAirHanUni.disTSet) annotation (Line(points={{ - -127.4,60},{-110,60},{-110,3.6},{-79.4,3.6}}, color={0,0,127})); + connect(TSupAirSet.y, duaFanAirHanUni.disTSet) annotation (Line(points={{-127.4, + 60},{-110,60},{-110,2.18182},{-79.4,2.18182}},color={0,0,127})); connect(pSet, dpSet.u) annotation (Line(points={{-170,10},{-141.2,10}}, color={0,0,127})); - connect(dpSet.y, duaFanAirHanUni.pSet) annotation (Line(points={{-127.4, - 10},{-110,10},{-110,8.8},{-79.4,8.8}}, color={0,0,127})); + connect(dpSet.y, duaFanAirHanUni.pSet) annotation (Line(points={{-127.4,10},{ + -110,10},{-110,6.90909},{-79.4,6.90909}}, + color={0,0,127})); connect(fivZonVAV.yDam[1], reaZonCor.yDam_in) annotation (Line( - points={{67.8,-35.08},{88,-35.08},{88,141},{98,141}}, + points={{67.8,-33.4},{88,-33.4},{88,141.125},{98,141.125}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yDam[2], reaZonSou.yDam_in) annotation (Line( - points={{67.8,-35.64},{88,-35.64},{88,77},{98,77}}, + points={{67.8,-33.68},{88,-33.68},{88,77.125},{98,77.125}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yDam[3], reaZonEas.yDam_in) annotation (Line( - points={{67.8,-36.2},{88,-36.2},{88,13},{98,13}}, + points={{67.8,-33.96},{88,-33.96},{88,13.125},{98,13.125}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yDam[4], reaZonNor.yDam_in) annotation (Line( - points={{67.8,-36.76},{128,-36.76},{128,109},{138,109}}, + points={{67.8,-34.24},{128,-34.24},{128,109.125},{138,109.125}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yDam[5], reaZonWes.yDam_in) annotation (Line( - points={{67.8,-37.32},{128,-37.32},{128,47},{138,47}}, + points={{67.8,-34.52},{128,-34.52},{128,47.125},{138,47.125}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yReaHea[1], reaZonCor.yReheaVal_in) annotation (Line( - points={{67.8,-30.88},{92,-30.88},{92,138},{98,138}}, + points={{67.8,-30.04},{92,-30.04},{92,138.5},{98,138.5}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yReaHea[2], reaZonSou.yReheaVal_in) annotation (Line( - points={{67.8,-31.44},{92,-31.44},{92,74},{98,74}}, + points={{67.8,-30.32},{92,-30.32},{92,74.5},{98,74.5}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yReaHea[3], reaZonEas.yReheaVal_in) annotation (Line( - points={{67.8,-32},{92,-32},{92,10},{98,10}}, + points={{67.8,-30.6},{92,-30.6},{92,10.5},{98,10.5}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yReaHea[4], reaZonNor.yReheaVal_in) annotation (Line( - points={{67.8,-32.56},{130,-32.56},{130,106},{138,106}}, + points={{67.8,-30.88},{130,-30.88},{130,106.5},{138,106.5}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.yReaHea[5], reaZonWes.yReheaVal_in) annotation (Line( - points={{67.8,-33.12},{130,-33.12},{130,44},{138,44}}, + points={{67.8,-31.16},{130,-31.16},{130,44.5},{138,44.5}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TZon[1], reaZonCor.TZon_in) annotation (Line( - points={{67.8,-39.28},{84,-39.28},{84,135},{98,135}}, + points={{67.8,-37.04},{84,-37.04},{84,135.875},{98,135.875}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TZon[2], reaZonSou.TZon_in) annotation (Line( - points={{67.8,-39.84},{84,-39.84},{84,71},{98,71}}, + points={{67.8,-37.32},{84,-37.32},{84,71.875},{98,71.875}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TZon[3], reaZonEas.TZon_in) annotation (Line( - points={{67.8,-40.4},{84,-40.4},{84,7},{98,7}}, + points={{67.8,-37.6},{84,-37.6},{84,7.875},{98,7.875}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TZon[4], reaZonNor.TZon_in) annotation (Line( - points={{67.8,-40.96},{126,-40.96},{126,103},{138,103}}, + points={{67.8,-37.88},{126,-37.88},{126,103.875},{138,103.875}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TZon[5], reaZonWes.TZon_in) annotation (Line( - points={{67.8,-41.52},{126,-41.52},{126,41},{138,41}}, + points={{67.8,-38.16},{126,-38.16},{126,41.875},{138,41.875}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TSup[1], reaZonCor.TSup_in) annotation (Line(points={{67.8, - -43.48},{94,-43.48},{94,132},{98,132}}, color={0,0,127})); - connect(fivZonVAV.TSup[2], reaZonSou.TSup_in) annotation (Line(points={{ - 67.8,-44.04},{94,-44.04},{94,68},{98,68}}, color={0,0,127})); - connect(fivZonVAV.TSup[3], reaZonEas.TSup_in) annotation (Line(points={{ - 67.8,-44.6},{94,-44.6},{94,4},{98,4}}, color={0,0,127})); + -40.68},{94,-40.68},{94,133.25},{98,133.25}},color={0,0,127})); + connect(fivZonVAV.TSup[2], reaZonSou.TSup_in) annotation (Line(points={{67.8, + -40.96},{94,-40.96},{94,69.25},{98,69.25}},color={0,0,127})); + connect(fivZonVAV.TSup[3], reaZonEas.TSup_in) annotation (Line(points={{67.8, + -41.24},{94,-41.24},{94,5.25},{98,5.25}}, + color={0,0,127})); connect(fivZonVAV.TSup[4], reaZonNor.TSup_in) annotation (Line( - points={{67.8,-45.16},{132,-45.16},{132,100},{138,100}}, + points={{67.8,-41.52},{132,-41.52},{132,101.25},{138,101.25}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.TSup[5], reaZonWes.TSup_in) annotation (Line( - points={{67.8,-45.72},{134,-45.72},{134,38},{138,38}}, + points={{67.8,-41.8},{134,-41.8},{134,39.25},{138,39.25}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow[1], reaZonCor.V_flow_in) annotation (Line( - points={{67.8,-22.48},{82,-22.48},{82,129.2},{98,129.2}}, + points={{67.8,-22.76},{82,-22.76},{82,130.8},{98,130.8}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow[2], reaZonSou.V_flow_in) annotation (Line( - points={{67.8,-23.04},{82,-23.04},{82,65.2},{98,65.2}}, + points={{67.8,-23.04},{82,-23.04},{82,66.8},{98,66.8}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow[3], reaZonEas.V_flow_in) annotation (Line( - points={{67.8,-23.6},{82,-23.6},{82,1.2},{98,1.2}}, + points={{67.8,-23.32},{82,-23.32},{82,2.8},{98,2.8}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow[4], reaZonNor.V_flow_in) annotation (Line( - points={{67.8,-24.16},{124,-24.16},{124,97.2},{138,97.2}}, + points={{67.8,-23.6},{124,-23.6},{124,98.8},{138,98.8}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow[5], reaZonWes.V_flow_in) annotation (Line( - points={{67.8,-24.72},{124,-24.72},{124,35.2},{138,35.2}}, + points={{67.8,-23.88},{124,-23.88},{124,36.8},{138,36.8}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow_set[1], reaZonCor.Vflow_set_in) annotation (Line( - points={{67.8,-26.68},{80,-26.68},{80,126.6},{98,126.6}}, + points={{67.8,-26.4},{80,-26.4},{80,128.525},{98,128.525}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow_set[2], reaZonSou.Vflow_set_in) annotation (Line( - points={{67.8,-27.24},{80,-27.24},{80,62.6},{98,62.6}}, + points={{67.8,-26.68},{80,-26.68},{80,64.525},{98,64.525}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow_set[3], reaZonEas.Vflow_set_in) annotation (Line( - points={{67.8,-27.8},{80,-27.8},{80,-1.4},{98,-1.4}}, + points={{67.8,-26.96},{80,-26.96},{80,0.525},{98,0.525}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow_set[4], reaZonNor.Vflow_set_in) annotation (Line( - points={{67.8,-28.36},{122,-28.36},{122,94.6},{138,94.6}}, + points={{67.8,-27.24},{122,-27.24},{122,96.525},{138,96.525}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(fivZonVAV.Vflow_set[5], reaZonWes.Vflow_set_in) annotation (Line( - points={{67.8,-28.92},{124,-28.92},{124,32.6},{138,32.6}}, + points={{67.8,-27.52},{124,-27.52},{124,34.525},{138,34.525}}, color={0,0,127}, pattern=LinePattern.Dash)); connect(zonVAVCon.yValPos, fivZonVAV.yVal) annotation (Line(points={{7,122}, @@ -616,106 +649,156 @@ equation {8,132},{8,-32.84},{28.2,-32.84}}, color={0,0,127})); connect(zonVAVCon.yCoo, fivZonVAV.yCoo) annotation (Line(points={{7,136}, {10,136},{10,-35.64},{28.2,-35.64}}, color={0,0,127})); - connect(zonVAVCon.T, fivZonVAV.TZon) annotation (Line(points={{-16,128},{ - -26,128},{-26,98},{88,98},{88,-40.4},{67.8,-40.4}}, color={0,0, + connect(zonVAVCon.T, fivZonVAV.TZon) annotation (Line(points={{-16,128},{-26, + 128},{-26,98},{88,98},{88,-37.6},{67.8,-37.6}}, color={0,0, 127})); - connect(zonHeaTSet[1], oveZonCor.TZonHeaSet_in) annotation (Line(points={ - {-170,72},{-150,72},{-150,192},{-122,192}}, color={0,0,127})); - connect(zonHeaTSet[2], oveZonSou.TZonHeaSet_in) annotation (Line(points={ - {-170,76},{-150,76},{-150,164},{-122,164}}, color={0,0,127})); + connect(zonHeaTSet[1], oveZonCor.TZonHeaSet_in) annotation (Line(points={{-170,76}, + {-150,76},{-150,192},{-122,192}}, color={0,0,127})); + connect(zonHeaTSet[2], oveZonSou.TZonHeaSet_in) annotation (Line(points={{-170,78}, + {-150,78},{-150,164},{-122,164}}, color={0,0,127})); connect(zonHeaTSet[3], oveZonEas.TZonHeaSet_in) annotation (Line(points={ {-170,80},{-150,80},{-150,136},{-122,136}}, color={0,0,127})); - connect(zonHeaTSet[4], oveZonNor.TZonHeaSet_in) annotation (Line(points={ - {-170,84},{-150,84},{-150,112},{-122,112}}, color={0,0,127})); - connect(zonHeaTSet[5], oveZonWes.TZonHeaSet_in) annotation (Line(points={ - {-170,88},{-150,88},{-150,84},{-122,84}}, color={0,0,127})); - connect(zonCooTSet[1], oveZonCor.TZonCooSet_in) annotation (Line(points={ - {-170,92},{-154,92},{-154,184},{-122,184}}, color={0,0,127})); - connect(zonCooTSet[2], oveZonSou.TZonCooSet_in) annotation (Line(points={ - {-170,96},{-154,96},{-154,156},{-122,156}}, color={0,0,127})); + connect(zonHeaTSet[4], oveZonNor.TZonHeaSet_in) annotation (Line(points={{-170,82}, + {-150,82},{-150,112},{-122,112}}, color={0,0,127})); + connect(zonHeaTSet[5], oveZonWes.TZonHeaSet_in) annotation (Line(points={{-170,84}, + {-150,84},{-150,84},{-122,84}}, color={0,0,127})); + connect(zonCooTSet[1], oveZonCor.TZonCooSet_in) annotation (Line(points={{-170,96}, + {-154,96},{-154,184},{-122,184}}, color={0,0,127})); + connect(zonCooTSet[2], oveZonSou.TZonCooSet_in) annotation (Line(points={{-170,98}, + {-154,98},{-154,156},{-122,156}}, color={0,0,127})); connect(zonCooTSet[3], oveZonEas.TZonCooSet_in) annotation (Line(points={ {-170,100},{-154,100},{-154,128},{-122,128}}, color={0,0,127})); connect(zonCooTSet[4], oveZonNor.TZonCooSet_in) - annotation (Line(points={{-170,104},{-122,104}}, color={0,0,127})); - connect(zonCooTSet[5], oveZonWes.TZonCooSet_in) annotation (Line(points={ - {-170,108},{-150,108},{-150,76},{-122,76}}, color={0,0,127})); + annotation (Line(points={{-170,102},{-146,102},{-146,104},{-122,104}}, + color={0,0,127})); + connect(zonCooTSet[5], oveZonWes.TZonCooSet_in) annotation (Line(points={{-170, + 104},{-150,104},{-150,76},{-122,76}}, color={0,0,127})); connect(oveZonCor.TZonHeaSet_out, TZonHeaSet.u[1]) annotation (Line( - points={{-99,192},{-76,192},{-76,174.4},{-72,174.4}}, color={0,0, + points={{-99,192},{-76,192},{-76,175.2},{-72,175.2}}, color={0,0, 127})); connect(oveZonSou.TZonHeaSet_out, TZonHeaSet.u[2]) annotation (Line( - points={{-99,164},{-76,164},{-76,175.2},{-72,175.2}}, color={0,0, + points={{-99,164},{-76,164},{-76,175.6},{-72,175.6}}, color={0,0, 127})); connect(oveZonEas.TZonHeaSet_out, TZonHeaSet.u[3]) annotation (Line( points={{-99,136},{-76,136},{-76,176},{-72,176}}, color={0,0,127})); connect(oveZonNor.TZonHeaSet_out, TZonHeaSet.u[4]) annotation (Line( - points={{-99,112},{-76,112},{-76,176.8},{-72,176.8}}, color={0,0, + points={{-99,112},{-76,112},{-76,176.4},{-72,176.4}}, color={0,0, 127})); connect(oveZonWes.TZonHeaSet_out, TZonHeaSet.u[5]) annotation (Line( - points={{-99,84},{-76,84},{-76,176},{-72,176},{-72,177.6}}, color={ + points={{-99,84},{-76,84},{-76,176},{-72,176},{-72,176.8}}, color={ 0,0,127})); connect(TZonHeaSet.y, zonVAVCon.THeaSet) annotation (Line(points={{-48, 176},{-24,176},{-24,122},{-16,122}}, color={0,0,127})); connect(oveZonCor.TZonCooSet_out, TZonCooSet.u[1]) annotation (Line( - points={{-99,184},{-80,184},{-80,76.4},{-74,76.4}}, color={0,0,127})); + points={{-99,184},{-80,184},{-80,77.2},{-74,77.2}}, color={0,0,127})); connect(oveZonSou.TZonCooSet_out, TZonCooSet.u[2]) annotation (Line( - points={{-99,156},{-80,156},{-80,77.2},{-74,77.2}}, color={0,0,127})); + points={{-99,156},{-80,156},{-80,77.6},{-74,77.6}}, color={0,0,127})); connect(oveZonEas.TZonCooSet_out, TZonCooSet.u[3]) annotation (Line( points={{-99,128},{-80,128},{-80,78},{-74,78}}, color={0,0,127})); connect(oveZonNor.TZonCooSet_out, TZonCooSet.u[4]) annotation (Line( - points={{-99,104},{-80,104},{-80,78.8},{-74,78.8}}, color={0,0,127})); + points={{-99,104},{-80,104},{-80,78.4},{-74,78.4}}, color={0,0,127})); connect(oveZonWes.TZonCooSet_out, TZonCooSet.u[5]) annotation (Line( - points={{-99,76},{-80,76},{-80,79.6},{-74,79.6}}, color={0,0,127})); + points={{-99,76},{-80,76},{-80,78.8},{-74,78.8}}, color={0,0,127})); connect(TZonCooSet.y, zonVAVCon.TCooSet) annotation (Line(points={{-50,78}, {-28,78},{-28,134},{-16,134}}, color={0,0,127})); - connect(TZonCooSet.y, duaFanAirHanUni.cooTSet) annotation (Line(points={{ - -50,78},{-50,58},{-110,58},{-110,-4.2},{-79.4,-4.2}}, color={0,0, + connect(TZonCooSet.y, duaFanAirHanUni.cooTSet) annotation (Line(points={{-50,78}, + {-50,58},{-110,58},{-110,-4.90909},{-79.4,-4.90909}}, color={0,0, 127})); - connect(TZonHeaSet.y, duaFanAirHanUni.heaTSet) annotation (Line(points={{ - -48,176},{-48,60},{-106,60},{-106,-9.4},{-79.4,-9.4}}, color={0,0, + connect(TZonHeaSet.y, duaFanAirHanUni.heaTSet) annotation (Line(points={{-48,176}, + {-48,60},{-106,60},{-106,-9.63636},{-79.4,-9.63636}}, color={0,0, 127})); connect(TZonHeaSet.y[1], reaZonCor.TRoo_Hea_set_in) annotation (Line( - points={{-48,174.4},{76,174.4},{76,123.8},{98,123.8}}, color={0,0, + points={{-48,175.2},{76,175.2},{76,126.075},{98,126.075}}, + color={0,0, 127})); connect(TZonHeaSet.y[2], reaZonSou.TRoo_Hea_set_in) annotation (Line( - points={{-48,175.2},{76,175.2},{76,59.8},{98,59.8}}, color={0,0,127})); + points={{-48,175.6},{76,175.6},{76,62.075},{98,62.075}}, + color={0,0,127})); connect(TZonHeaSet.y[3], reaZonEas.TRoo_Hea_set_in) annotation (Line( - points={{-48,176},{76,176},{76,-4.2},{98,-4.2}}, color={0,0,127})); + points={{-48,176},{76,176},{76,-1.925},{98,-1.925}}, + color={0,0,127})); connect(TZonHeaSet.y[4], reaZonNor.TRoo_Hea_set_in) annotation (Line( - points={{-48,176.8},{76,176.8},{76,91.8},{138,91.8}}, color={0,0, + points={{-48,176.4},{76,176.4},{76,94.075},{138,94.075}}, + color={0,0, 127})); connect(TZonHeaSet.y[5], reaZonWes.TRoo_Hea_set_in) annotation (Line( - points={{-48,177.6},{78,177.6},{78,29.8},{138,29.8}}, color={0,0, + points={{-48,176.8},{78,176.8},{78,32.075},{138,32.075}}, + color={0,0, 127})); connect(TZonCooSet.y[1], reaZonCor.TRoo_Coo_set_in) annotation (Line( - points={{-50,76.4},{70,76.4},{70,120.6},{98,120.6}}, color={0,0,127})); + points={{-50,77.2},{70,77.2},{70,123.275},{98,123.275}}, + color={0,0,127})); connect(TZonCooSet.y[2], reaZonSou.TRoo_Coo_set_in) annotation (Line( - points={{-50,77.2},{70,77.2},{70,56.6},{98,56.6}}, color={0,0,127})); + points={{-50,77.6},{70,77.6},{70,59.275},{98,59.275}}, + color={0,0,127})); connect(TZonCooSet.y[3], reaZonEas.TRoo_Coo_set_in) annotation (Line( - points={{-50,78},{70,78},{70,-7.4},{98,-7.4}}, color={0,0,127})); + points={{-50,78},{70,78},{70,-4.725},{98,-4.725}}, + color={0,0,127})); connect(TZonCooSet.y[4], reaZonNor.TRoo_Coo_set_in) annotation (Line( - points={{-50,78.8},{70,78.8},{70,88.6},{138,88.6}}, color={0,0,127})); + points={{-50,78.4},{70,78.4},{70,91.275},{138,91.275}}, + color={0,0,127})); connect(TZonCooSet.y[5], reaZonWes.TRoo_Coo_set_in) annotation (Line( - points={{-50,79.6},{70,79.6},{70,26.6},{138,26.6}}, color={0,0,127})); + points={{-50,78.8},{70,78.8},{70,29.275},{138,29.275}}, + color={0,0,127})); connect(zonVAVCon[1].yCoo, reaZonCor.yCoo_in) annotation (Line(points={{7,136}, - {68,136},{68,118},{98,118}}, color={0,0,127})); + {68,136},{68,121},{98,121}}, color={0,0,127})); connect(zonVAVCon[2].yCoo, reaZonSou.yCoo_in) annotation (Line(points={{7,136}, - {68,136},{68,54},{98,54}}, color={0,0,127})); + {68,136},{68,57},{98,57}}, color={0,0,127})); connect(zonVAVCon[3].yCoo, reaZonEas.yCoo_in) annotation (Line(points={{7,136}, - {68,136},{68,-10},{98,-10}}, color={0,0,127})); + {68,136},{68,-7},{98,-7}}, color={0,0,127})); connect(zonVAVCon[4].yCoo, reaZonNor.yCoo_in) annotation (Line(points={{7,136}, - {70,136},{70,86},{138,86}}, color={0,0,127})); + {70,136},{70,89},{138,89}}, color={0,0,127})); connect(zonVAVCon[5].yCoo, reaZonWes.yCoo_in) annotation (Line(points={{7,136}, - {68,136},{68,24},{138,24}}, color={0,0,127})); + {68,136},{68,27},{138,27}}, color={0,0,127})); connect(zonVAVCon[1].yHea, reaZonCor.yHea_in) annotation (Line(points={{7,132}, - {66,132},{66,115},{98,115}}, color={0,0,127})); + {66,132},{66,118.375},{98,118.375}}, + color={0,0,127})); connect(zonVAVCon[2].yHea, reaZonSou.yHea_in) annotation (Line(points={{7,132}, - {66,132},{66,51},{98,51}}, color={0,0,127})); + {66,132},{66,54.375},{98,54.375}}, + color={0,0,127})); connect(zonVAVCon[3].yHea, reaZonEas.yHea_in) annotation (Line(points={{7,132}, - {66,132},{66,-13},{98,-13}}, color={0,0,127})); + {66,132},{66,-9.625},{98,-9.625}},color={0,0,127})); connect(zonVAVCon[4].yHea, reaZonNor.yHea_in) annotation (Line(points={{7,132}, - {66,132},{66,83},{138,83}}, color={0,0,127})); + {66,132},{66,86.375},{138,86.375}}, + color={0,0,127})); connect(zonVAVCon[5].yHea, reaZonWes.yHea_in) annotation (Line(points={{7,132}, - {66,132},{66,21},{138,21}}, color={0,0,127})); + {66,132},{66,24.375},{138,24.375}}, + color={0,0,127})); + connect(nPeo, fivZonVAV.nPeo) + annotation (Line(points={{-170,-18},{28.2,-18}}, color={0,0,127})); + connect(fivZonVAV.CO2Zon[1], reaZonCor.CO2Zon_in) annotation (Line( + points={{67.8,-44.04},{90,-44.04},{90,115.75},{98,115.75}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(fivZonVAV.CO2Zon[2], reaZonSou.CO2Zon_in) annotation (Line( + points={{67.8,-44.32},{78,-44.32},{78,-44},{90,-44},{90,52},{98,52},{98, + 51.75}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(fivZonVAV.CO2Zon[3], reaZonEas.CO2Zon_in) annotation (Line( + points={{67.8,-44.6},{90,-44.6},{90,-12},{98,-12},{98,-12.25}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(fivZonVAV.CO2Zon[4], reaZonNor.CO2Zon_in) annotation (Line( + points={{67.8,-44.88},{134,-44.88},{134,83.75},{138,83.75}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(fivZonVAV.CO2Zon[5], reaZonWes.CO2Zon_in) annotation (Line( + points={{67.8,-45.16},{134,-45.16},{134,22},{138,22},{138,21.75}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(duaFanAirHanUni.CO2_AHUSupAir, reaAhu.CO2_AHUSup_in) annotation (Line( + points={{-48.6,14.2364},{22,14.2364},{22,11.8462},{26,11.8462}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(duaFanAirHanUni.CO2_AHUFreAir, reaAhu.CO2_AHUFre_in) annotation (Line( + points={{-48.6,12.8182},{20,12.8182},{20,8.15385},{26,8.15385}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(duaFanAirHanUni.CO2_AHURetAir, reaAhu.CO2_AHURet_in) annotation (Line( + points={{-48.6,11.6364},{18,11.6364},{18,4.46154},{26,4.46154}}, + color={0,0,127}, + pattern=LinePattern.Dash)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-160, -100},{160,140}}), graphics={ Rectangle( diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/BoilerPlant.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/BoilerPlant.mo index 3116229eb..1597902a3 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/BoilerPlant.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/BoilerPlant.mo @@ -24,9 +24,7 @@ model BoilerPlant "Boiler hot water plant" "Nominal pressure drop for the secondary hot water pump "; parameter Real v_flow_rate[m,:] = {{0.1*sum(mHW_flow_nominal)/m/996,0.6*sum(mHW_flow_nominal)/m/996,0.8*sum(mHW_flow_nominal)/m/996,sum(mHW_flow_nominal)/m/996,1.2*sum(mHW_flow_nominal)/m/996} for i in linspace(1,m,m)}; parameter Real pressure[m,:] = {{2*dP_nominal,1.5*dP_nominal,1.1*dP_nominal,dP_nominal,0.75*dP_nominal} for i in linspace(1,m,m)}; - - parameter Real Motor_eta_Sec[m,:] = {{0.6,0.76,0.87,0.86,0.74} for i in linspace(1,m,m)} - "Motor efficiency"; + parameter Real Motor_eta_Sec[m,:] = {{0.6,0.76,0.87,0.86,0.74} for i in linspace(1,m,m)} "Motor efficiency"; parameter Real Hydra_eta_Sec[m,:] = {{1,1,1,1,1} for i in linspace(1,m,m)} "Hydraulic efficiency"; Component.FlowMover.Pump.PumpSystem pumSecHW( diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component.mo deleted file mode 100644 index 7ec531548..000000000 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component.mo +++ /dev/null @@ -1,7717 +0,0 @@ -within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses; -package Component "System conmponent models" - - model conPI "PI Controller with ON/OFF Signal" - - parameter Real yMin(min=0, max=1, unit="1") = 0 - "Lowest y output"; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - parameter Boolean reverseActing=true - "Set to true for reverse acting, or false for direct acting control action"; - Modelica.Blocks.Interfaces.BooleanInput On - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealOutput y "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Buildings.Controls.OBC.CDL.Continuous.PIDWithReset - conPID( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - yMin=yMin, - xi_start=0, - k=k, - Ti=Ti, - reverseActing=reverseActing, - y_reset=yMin) - annotation (Placement(transformation(extent={{-8,-30},{12,-10}}))); - Modelica.Blocks.Interfaces.RealInput set - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealInput mea - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swi - annotation (Placement(transformation(extent={{40,10},{60,-10}}))); - - Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerSpe(k=0) - "Zero fan speed when it becomes OFF" - annotation (Placement(transformation(extent={{-10,26},{10,46}}))); - equation - connect(conPID.u_s, set) annotation (Line(points={{-10,-20},{-66,-20},{ - -66,0},{-120,0}}, color={0,0,127})); - connect(swi.y, y) annotation (Line( - points={{62,0},{110,0}}, - color={0,0,127})); - connect(mea, conPID.u_m) annotation (Line( - points={{-120,-60},{-60,-60},{2,-60},{2,-32}}, - color={0,0,127})); - connect(On, swi.u2) annotation (Line(points={{-120,60},{-40,60},{-40,0},{38,0}}, - color={255,0,255})); - connect(conPID.y, swi.u1) annotation (Line(points={{14,-20},{20,-20},{20,-8},{ - 38,-8}}, color={0,0,127})); - connect(zerSpe.y, swi.u3) - annotation (Line(points={{12,36},{30,36},{30,8},{38,8}}, color={0,0,127})); - connect(On, conPID.trigger) annotation (Line(points={{-120,60},{-60,60},{-60,-40}, - {-4,-40},{-4,-32}}, color={255,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-66,50},{62,-48}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - textString="PI"), - Text( - extent={{-152,110},{148,150}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false), graphics={Line(points={{32,-16}}, color={28, - 108,200})}), - Documentation(info=" -

This model is a PI controller with an external boolean signal. When the boolean signal is true, the model outputs the PI controller output. When it is false, the model outputs zero.

-")); - end conPI; - - package AirSide "\"Models for device level components\"" - package AirHandlingUnit - - model DuaFanAirHanUnit "AHU with supply/return fans and cooling coil." - - replaceable package MediumAir = - Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - replaceable package MediumWat = - Modelica.Media.Interfaces.PartialMedium "Medium for the water"; - parameter Real UA "Rated heat exchange coefficients"; - parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.MassFlowRate mWatFloRat - "mass flow rate for water"; - parameter Modelica.Units.SI.Pressure PreDroCoiAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroMixingBoxAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroWat - "Pressure drop in the water side"; - parameter Real Coi_k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Coi_Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - parameter Modelica.Units.SI.Efficiency eps(max=1) = 1 - "Heat exchanger effectiveness"; - - parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat - "mass flow rate for fresh air"; - parameter Modelica.Units.SI.Temperature TemEcoHig - "the highest temeprature when the economizer is on"; - parameter Modelica.Units.SI.Temperature TemEcoLow - "the lowest temeprature when the economizer is on"; - parameter Real MixingBoxDamMin "the minimum damper postion"; - parameter Real MixingBox_k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time MixingBox_Ti(min=Modelica.Constants.small)= - 0.5 "Time constant of Integrator block"; - - parameter Real Fan_k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Fan_Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - parameter Modelica.Units.SI.Time waitTime(min=0) = 0 - "Wait time before transition fires"; - parameter Real Fan_SpeRat - "Speed ratio"; - parameter Integer numTemp(min=1) = 1 - "The size of the temeprature vector"; - parameter Real HydEff[:] "Hydraulic efficiency"; - parameter Real MotEff[:] "Motor efficiency"; - parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] - "Volume flow rate curve"; - parameter Modelica.Units.SI.Pressure SupPreCur[:] "Supply Fan Pressure curve"; - parameter Modelica.Units.SI.Pressure RetPreCur[:] "Return Fan Pressure curve"; - - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor - retFan( - redeclare package Medium = MediumAir, - HydEff=HydEff, - MotEff=MotEff, - VolFloCur=VolFloCur, - TimCon=1, - PreCur=RetPreCur) - annotation (Placement(transformation(extent={{-10,-90},{-30,-70}}))); - - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.VAVSupFan - supFan( - redeclare package Medium = MediumAir, - TimCon=1, - k=Fan_k, - Ti=Fan_Ti, - waitTime=waitTime, - SpeRat=Fan_SpeRat, - numTemp=numTemp, - HydEff=HydEff, - MotEff=MotEff, - VolFloCur=VolFloCur, - PreCur=SupPreCur) - annotation (Placement(transformation(extent={{18,-10},{38,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package - Medium = MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.CoolingCoil - cooCoi( - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat, - mWatFloRat=mWatFloRat, - PreDroAir=PreDroCoiAir, - PreDroWat=PreDroWat, - k=Coi_k, - Ti=Coi_Ti, - UA=UA*1.2*eps) - annotation (Placement(transformation(extent={{-2,-2},{-20,18}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox.MixingBoxWithControl - mixBox( - mTotAirFloRat=mAirFloRat, - redeclare package Medium = MediumAir, - PreDro=PreDroMixingBoxAir, - mFreAirFloRat=mFreAirFloRat, - TemHig=TemEcoHig, - TemLow=TemEcoLow, - DamMin=MixingBoxDamMin, - k=MixingBox_k, - Ti=MixingBox_Ti) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-60,0}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = MediumWat) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{10,90},{30,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = MediumWat) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-50,90},{-30,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Exh_Air(redeclare package - Medium = MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-112,-10},{-92,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_Fre_Air(redeclare package - Medium = MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package - Medium = MediumAir) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - Modelica.Blocks.Interfaces.BooleanInput On - annotation (Placement(transformation(extent={{-120,-110},{-100,-90}}))); - Modelica.Blocks.Interfaces.RealInput disTSet - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,-30},{-100,-10}}))); - Modelica.Blocks.Interfaces.RealInput pSet - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,-70},{-100,-50}}))); - Modelica.Blocks.Interfaces.RealInput pMea - "Connector of measurement input signal" annotation (Placement( - transformation(extent={{-120,84},{-100,104}}))); - Modelica.Blocks.Interfaces.RealInput cooTSet[numTemp] - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,30},{-100,50}}))); - Modelica.Blocks.Interfaces.RealInput zonT[numTemp] - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,-50},{-100,-30}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTDisAir(redeclare package - Medium = MediumAir, m_flow_nominal=mAirFloRat) - annotation (Placement(transformation(extent={{72,-10},{92,10}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=100000) - annotation (Placement(transformation(extent={{40,66},{60,86}}))); - Modelica.Blocks.Math.Add add(k2=-1) - annotation (Placement(transformation(extent={{50,40},{30,60}}))); - Modelica.Blocks.Interfaces.RealInput heaTSet[numTemp] - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,70},{-100,90}}))); - Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=true) - annotation (Placement(transformation(extent={{-34,-58},{-14,-38}}))); - Modelica.Blocks.Interfaces.RealInput TOut "outdoor air temperature" - annotation (Placement(transformation(extent={{-120,-90},{-100,-70}}))); - Modelica.Blocks.Interfaces.RealOutput TSupAir( - final unit="K", - final displayUnit="degC", - final quantity="ThermodynamicTemperature") - "AHU supply air temperature" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTMixAir(redeclare package - Medium = MediumAir, m_flow_nominal=mAirFloRat) - annotation (Placement(transformation(extent={{-44,-10},{-24,10}}))); - Modelica.Blocks.Interfaces.RealOutput TMixAir( - final unit="K", - final displayUnit="degC", - final quantity="ThermodynamicTemperature") "Mixing air temperature" - annotation (Placement(transformation(extent={{100,18},{120,38}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTDisAir1(redeclare - package Medium = MediumAir, m_flow_nominal=mAirFloRat) - annotation (Placement(transformation(extent={{72,-90},{92,-70}}))); - Modelica.Blocks.Interfaces.RealOutput TRetAir "AHU return air temperature" - annotation (Placement(transformation(extent={{100,-64},{120,-44}}))); - Buildings.Fluid.Sensors.VolumeFlowRate senVolFloSupAir( - redeclare package Medium = MediumAir, - m_flow_nominal=mAirFloRat, - tau=1) annotation (Placement(transformation(extent={{44,-10},{64,10}}))); - Modelica.Blocks.Interfaces.RealOutput V_flowSupAir( - final min=0, - final unit = "m3/s", - final quantity = "VolumeFlowRate") "Supply air volume flow rate" - annotation (Placement(transformation(extent={{100,6},{120,26}}))); - Buildings.Fluid.Sensors.VolumeFlowRate senVolFloSupAir1( - redeclare package Medium = MediumAir, - m_flow_nominal=mAirFloRat, - tau=1) annotation (Placement(transformation(extent={{34,-90},{54,-70}}))); - Modelica.Blocks.Interfaces.RealOutput V_flowRetAir - "Return air volume flow rate " - annotation (Placement(transformation(extent={{100,-76},{120,-56}}))); - Modelica.Blocks.Sources.RealExpression yDamOutAirMea(y=mixBox.mixBox.valFre.y) - annotation (Placement(transformation(extent={{40,84},{60,104}}))); - Modelica.Blocks.Interfaces.RealOutput yDamOutAir( - final min=0, - final max=1, - final unit="1") - "AHU OA damper position measurement" - annotation (Placement(transformation(extent={{100,84},{120,104}}))); - Modelica.Blocks.Sources.RealExpression PFanTot(y=supFan.P + retFan.P) - annotation (Placement(transformation(extent={{-34,-42},{-14,-22}}))); - Modelica.Blocks.Interfaces.RealOutput PFan "Total fan power" - annotation (Placement(transformation(extent={{100,-38},{120,-18}}))); - Modelica.Blocks.Interfaces.RealOutput TSupCHW( - final unit="K", - final displayUnit="degC", - final quantity="ThermodynamicTemperature") - "AHU supply chilled water temperature" - annotation (Placement(transformation(extent={{100,70},{120,90}}))); - Modelica.Blocks.Interfaces.RealOutput TRetCHW( - final unit="K", - final displayUnit="degC", - final quantity="ThermodynamicTemperature") - "AHU return chilled water temperature" - annotation (Placement(transformation(extent={{100,-24},{120,-4}}))); - Modelica.Blocks.Sources.RealExpression TSupCHWMea(y=cooCoi.coi.TEntWat.T) - annotation (Placement(transformation(extent={{72,70},{92,90}}))); - Modelica.Blocks.Sources.RealExpression TRetCHWMea(y=cooCoi.coi.TLeaWat.T) - annotation (Placement(transformation(extent={{72,-24},{92,-4}}))); - Modelica.Blocks.Sources.RealExpression yCooValMea(y=cooCoi.val.y) - annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); - Modelica.Blocks.Interfaces.RealOutput yCooVal - "AHU cooling coil valve position measurement" annotation (Placement( - transformation(extent={{100,-50},{120,-30}}))); - Buildings.Fluid.Sensors.VolumeFlowRate senVolFloOutAir( - redeclare package Medium = MediumAir, - m_flow_nominal=mAirFloRat, - tau=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={-80,30}))); - Modelica.Blocks.Interfaces.RealOutput V_flowOutAir( - final min=0, - final unit="m3/s", - final quantity="VolumeFlowRate") "Outdoor air volume flow rate" - annotation (Placement(transformation(extent={{100,50},{120,70}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeRetFan( - description="AHU return fan speed control signal", u( - min=0, - max=1, - unit="1")) - annotation (Placement(transformation(extent={{48,-56},{64,-40}}))); - equation - connect(cooCoi.port_b_Air, supFan.port_a) annotation (Line( - points={{-1.82,0},{18,0}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.TMix, disTSet) annotation (Line(points={{-60,-12},{-60,-20}, - {-110,-20}}, color={0,0,127})); - connect(cooCoi.SetPoi, disTSet) annotation (Line(points={{-0.2,6},{6, - 6},{6,-20},{-110,-20}}, color={0,0,127})); - connect(supFan.T, zonT) annotation (Line(points={{16,-6},{16,-40},{-110, - -40}}, color={0,0,127})); - connect(supFan.pSet, pSet) annotation (Line(points={{16,2},{12,2},{12, - -60},{-110,-60}}, color={0,0,127})); - connect(port_Exh_Air, mixBox.port_Exh) annotation (Line( - points={{-102,0},{-82,0},{-82,-6},{-70,-6}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.port_Ret, retFan.port_b) annotation (Line( - points={{-50,-5.8},{-42,-5.8},{-42,-80},{-30,-80}}, - color={0,140,72}, - thickness=0.5)); - connect(port_b_Air, senTDisAir.port_b) annotation (Line( - points={{100,0},{92,0}}, - color={0,127,255}, - thickness=1)); - connect(pMea, add.u1) annotation (Line(points={{-110,94},{-20,94},{-20, - 68},{68,68},{68,56},{52,56}}, color={0,0,127})); - connect(realExpression.y, add.u2) annotation (Line( - points={{61,76},{80,76},{80,44},{52,44}}, - color={0,0,127})); - connect(add.y, supFan.pMea) annotation (Line(points={{29,50},{10,50}, - {10,-10},{16,-10}}, color={0,0,127})); - connect(supFan.heaTSet, heaTSet) annotation (Line(points={{16,10},{12, - 10},{12,80},{-110,80}}, color={0,0,127})); - connect(supFan.cooTSet, cooTSet) annotation (Line(points={{16,-2},{-46, - -2},{-46,40},{-110,40}}, color={0,0,127})); - connect(booleanExpression.y, cooCoi.On) annotation (Line(points={{-13, - -48},{8,-48},{8,12},{-0.2,12}}, color={255,0,255})); - connect(mixBox.TOut, TOut) annotation (Line(points={{-54,-12},{-54,-80}, - {-110,-80}}, color={0,0,127})); - connect(On, mixBox.On) annotation (Line(points={{-110,-100},{-68,-100}, - {-68,-12}}, color={255,0,255})); - connect(On, supFan.On) annotation (Line(points={{-110,-100},{4,-100},{4,6},{16, - 6}}, color={255,0,255})); - connect(senTDisAir.T, TSupAir) annotation (Line(points={{82,11},{82, - 40},{110,40}}, color={0,0,127})); - connect(senTMixAir.port_b, cooCoi.port_a_Air) annotation (Line( - points={{-24,0},{-20,0}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.port_Sup, senTMixAir.port_a) annotation (Line( - points={{-49.8,6},{-48,6},{-48,0},{-44,0}}, - color={0,140,72}, - thickness=0.5)); - connect(senTMixAir.T, TMixAir) annotation (Line(points={{-34,11},{-34, - 28},{110,28}}, color={0,0,127})); - connect(senTDisAir1.T, TRetAir) annotation (Line(points={{82,-69},{82, - -54},{110,-54}}, color={0,0,127})); - connect(senVolFloSupAir.port_b, senTDisAir.port_a) - annotation (Line(points={{64,0},{72,0}}, color={0,127,255})); - connect(senVolFloSupAir.port_a, supFan.port_b) - annotation (Line(points={{44,0},{38,0}}, color={0,127,255})); - connect(senVolFloSupAir.V_flow, V_flowSupAir) annotation (Line(points={{54,11}, - {56,11},{56,16},{110,16}}, color={0,0,127})); - connect(senVolFloSupAir1.port_b, senTDisAir1.port_a) - annotation (Line(points={{54,-80},{72,-80}}, color={0,127,255})); - connect(senTDisAir1.port_b, port_a_Air) - annotation (Line(points={{92,-80},{100,-80}}, color={0,127,255})); - connect(senVolFloSupAir1.port_a, retFan.port_a) - annotation (Line(points={{34,-80},{-10,-80}}, color={0,127,255})); - connect(senVolFloSupAir1.V_flow, V_flowRetAir) - annotation (Line(points={{44,-69},{44,-66},{110,-66}}, color={0,0,127})); - connect(yDamOutAirMea.y, yDamOutAir) - annotation (Line(points={{61,94},{110,94}}, color={0,0,127})); - connect(PFanTot.y, PFan) annotation (Line(points={{-13,-32},{44,-32}, - {44,-28},{110,-28}}, - color={0,0,127})); - connect(cooCoi.port_a_Wat, port_a_Wat) annotation (Line( - points={{-2,16},{20,16},{20,100}}, - color={0,127,255}, - thickness=1)); - connect(cooCoi.port_b_Wat, port_b_Wat) annotation (Line( - points={{-20,16},{-40,16},{-40,100}}, - color={0,127,255}, - thickness=1)); - connect(TSupCHWMea.y, TSupCHW) - annotation (Line(points={{93,80},{110,80}}, color={0,0,127})); - connect(TRetCHWMea.y, TRetCHW) - annotation (Line(points={{93,-14},{110,-14}}, color={0,0,127})); - connect(yCooValMea.y, yCooVal) - annotation (Line(points={{91,-40},{110,-40}}, color={0,0,127})); - connect(senVolFloOutAir.port_b, mixBox.port_Fre) annotation (Line( - points={{-80,20},{-80,6},{-70,6}}, color={0,127,255})); - connect(senVolFloOutAir.port_a, port_Fre_Air) annotation (Line(points= - {{-80,40},{-80,60},{-100,60}}, color={0,127,255})); - connect(senVolFloOutAir.V_flow, V_flowOutAir) annotation (Line(points= - {{-69,30},{80,30},{80,60},{110,60}}, color={0,0,127})); - connect(supFan.yRet, oveSpeRetFan.u) annotation (Line(points={{39, - -8.2},{42,-8.2},{42,-48},{46.4,-48}}, color={0,0,127})); - connect(oveSpeRetFan.y, retFan.u) annotation (Line(points={{64.8,-48}, - {72,-48},{72,-74},{-9,-74}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line(points={{-80,-80},{90,-80}}, color={255,170,170}, - thickness=0.5), - Line(points={{-80,0},{-80,-80}}, color={255,170,170}, - thickness=0.5), - Line(points={{-92,0},{-80,0}}, color={255,170,170}, - thickness=0.5), - Line(points={{-90,60},{-60,60}}, color={0,255,255}, - thickness=0.5), - Line(points={{-60,60},{-60,0}}, color={0,255,255}, - thickness=0.5), - Line(points={{-60,0},{-70,0}}, color={0,255,255}, - thickness=0.5), - Line(points={{-80,0},{-70,0}}, color={255,170,170}), - Line(points={{-40,90},{-40,20}}, color={0,0,255}, - thickness=1), - Rectangle( - extent={{-30,28},{12,-10}}, - lineColor={0,255,255}, - lineThickness=0.5, - fillColor={170,255,255}, - fillPattern=FillPattern.Solid), - Line(points={{20,90},{20,20}}, color={0,0,255}, - thickness=1), - Rectangle(extent={{-100,100},{100,-100}}, pattern=LinePattern.None), - Line(points={{20,20},{-40,20}}, color={0,0,255}, - thickness=1), - Line(points={{-60,0},{100,0}}, color={0,255,255}, - thickness=0.5), - Text( - extent={{-156,-148},{144,-108}}, - textString="%name", - textColor={0,0,255})}), Diagram( - coordinateSystem(preserveAspectRatio=false), graphics={ - Text( - extent={{-146,300},{154,340}}, - textString="%name", - textColor={0,0,255})}), - Documentation(info=" -

There are two fans (i.e., one supply fan, and one return fan) in the AHU system. Only a cooling coil is installed in the AHU.

-

-

Supply fan speed is controlled by a PI controller to maintain duct static pressure (DSP) at setpoint when the fan is proven ON. -Cooling coil valve position is controlled by a PI controller to maintain the AHU supply air temperature at setpoint.

-

In the mixing box of the AHU, an economizer is implemented to use the outdoor air to meet the cooling load when outdoor conditions are favorable. -Outdoor air damper position is controlled by a PI controller to maintain the mixed air temperature at setpoint. It takes the mixed and outdoor air temperature measurements, as well as the mixed air temperature setpoints as inputs. It takes the outdoor air damper position as the output. The return air damper are interlocked with the outdoor air damper while exhausted air damper share the same opening position with the outdoor air damper. On top of that, an economizer control based on the fixed dry-bulb outdoor air temperature-based is adopted. The economizer higher temperature limit is set as 21 degC according to ASHRAE 90.1-2019 for Climate Zone 5A.

-

See the model -MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.VAVSupFan for a description of the supply fan model.

-

See the model -MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor for a description of the return fan model.

-

See the model -MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.CoolingCoil for a description of the cooling coil model.

-

See the model -MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox.MixingBoxWithControl for a description of the mixing box model.

-", revisions = " - -")); - end DuaFanAirHanUnit; - - package BaseClasses - - model OccupancyMode "Occupied mdoe controller" - - parameter Real start_time; - parameter Real end_time; - - Modelica.Blocks.Sources.BooleanExpression - booleanExpression(y=(mod(time,86400) > start_time*3600) and (mod(time,86400) < end_time*3600)) - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - Modelica.Blocks.Interfaces.BooleanOutput Occ annotation (Placement(transformation(extent={{100,-20},{140,20}}))); - equation - connect(booleanExpression.y, Occ) annotation (Line(points={{9,0},{120,0}}, color={255,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-42,38},{44,-46}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.None, - textString="Occ"), - Text( - extent={{-152,104},{148,144}}, - textString="%name", - textColor={0,0,255})}), - Diagram(coordinateSystem(preserveAspectRatio=false))); - end OccupancyMode; - - model ZoneSetpoint - "Zone air temperature setPoint controller based on the occupancy signal" - parameter Integer n=2 "dimenison of the setpoint vector"; - parameter Real setpoint_on[n] "the values of setpoint during 'on' period"; - parameter Real setpoint_off[n] "the values of setpoint during 'off' period"; - - Modelica.Blocks.Sources.RealExpression realExpression[n](y=noEvent(if Occ then setpoint_on else setpoint_off)) - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - Modelica.Blocks.Interfaces.BooleanInput Occ - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealOutput SetPoi[n] - annotation (Placement(transformation(extent={{100,-20},{140,20}}))); - equation - connect(realExpression.y, SetPoi) annotation (Line(points={{9,0},{120,0}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-42,38},{44,-46}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.None, - textString="SetPo"), - Text( - extent={{-154,102},{146,142}}, - textString="%name", - textColor={0,0,255})}), - Diagram(coordinateSystem(preserveAspectRatio=false))); - end ZoneSetpoint; - - end BaseClasses; - end AirHandlingUnit; - - package Coil "\"Component used for modelling water coils\"" - - model HeatingCoil - extends MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WatCoil; - parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 - "Heat exchanger effectiveness"; - - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.DryCoil coi( - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat, - mWatFloRat=mWatFloRat, - PreDroAir(displayUnit="Pa") = PreDroAir, - PreDroWat(displayUnit="Pa") = 0, - eps=eps) annotation (Placement(transformation(extent={{-18,-34},{20, - 8}}))); - equation - connect(coi.port_a_Wat, port_a_Wat) annotation (Line( - points={{-18,-0.4},{-40,-0.4},{-40,0},{-60,0},{-60,80},{-100,80}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_b_Wat, val.port_a) annotation (Line( - points={{20,-0.4},{80,-0.4},{80,36}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_a_Air, port_a_Air) annotation (Line( - points={{20,-25.6},{30,-25.6},{30,-26},{40,-26},{40,-80},{100,-80}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_b_Air, port_b_Air) annotation (Line( - points={{-18,-25.6},{-58,-25.6},{-58,-80},{-102,-80}}, - color={0,127,255}, - thickness=1)); - connect(coi.TAirLea,pI.mea) annotation (Line( - points={{21.9,-17.2},{58,-17.2},{58,-60},{-52,-60},{-52,14},{-42, - 14}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Icon(graphics={ - Line( - points={{-90,80},{-40,80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,80},{90,80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{-40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,40},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,-80},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,80},{-40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-10,50},{44,8}}, - lineColor={0,0,127}, - lineThickness=0.5, - textString="+"), - Line( - points={{-92,-80},{-40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,-80},{90,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,80},{40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{32,72},{48,72}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{30,46},{50,46}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{32,72},{50,46}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{30,46},{48,72}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-148,102},{152,142}}, - textString="%name", - textColor={0,0,255})})); - end HeatingCoil; - - model CoolingCoil "The model of the cooling coil" - extends MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WatCoil(val( - dpValve_nominal=PreDroWat), pI(reverseActing=false, conPID(y_reset=1))); - parameter Real UA "Rated heat exchange coefficients"; - - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WetCoil coi( - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat, - mWatFloRat=mWatFloRat, - PreDroAir(displayUnit="Pa") = PreDroAir, - PreDroWat(displayUnit="Pa") = 0, - UA=UA) annotation (Placement(transformation(extent={{-18,-34},{20,8}}))); - equation - connect(coi.port_a_Wat, port_a_Wat) annotation (Line( - points={{-18,-0.4},{-40,-0.4},{-40,0},{-60,0},{-60,80},{-100,80}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_b_Wat, val.port_a) annotation (Line( - points={{20,-0.4},{80,-0.4},{80,36}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_a_Air, port_a_Air) annotation (Line( - points={{20,-25.6},{30,-25.6},{30,-26},{40,-26},{40,-80},{100,-80}}, - color={0,127,255}, - thickness=1)); - connect(coi.port_b_Air, port_b_Air) annotation (Line( - points={{-18,-25.6},{-58,-25.6},{-58,-80},{-102,-80}}, - color={0,127,255}, - thickness=1)); - connect(coi.TAirLea,pI.mea) annotation (Line( - points={{21.9,-17.2},{58,-17.2},{58,-60},{-52,-60},{-52,14},{-42,14}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Icon(graphics={ - Line( - points={{-90,80},{-40,80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,80},{90,80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{-40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,40},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,-80},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,80},{-40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{40,-80}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-10,50},{44,8}}, - lineColor={0,0,127}, - lineThickness=0.5, - textString="-"), - Line( - points={{-92,-80},{-40,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,-80},{90,-80}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,40},{40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,80},{40,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{32,72},{48,72}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{30,46},{50,46}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{32,72},{50,46}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{30,46},{48,72}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-148,104},{152,144}}, - textString="%name", - textColor={0,0,255})})); - end CoolingCoil; - - package BaseClasses - model WetCoil - replaceable package MediumAir = - Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - replaceable package MediumWat = - Modelica.Media.Interfaces.PartialMedium "Medium for the water"; - parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.MassFlowRate mWatFloRat - "mass flow rate for water"; - parameter Modelica.Units.SI.Pressure PreDroAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroWat - "Pressure drop in the water side"; - parameter Real UA "Rated heat exchange coefficients"; - - Buildings.Fluid.HeatExchangers.WetCoilCounterFlow cooCoi(redeclare - package Medium1 = - MediumWat, redeclare package Medium2 = MediumAir, - m1_flow_nominal=mWatFloRat, - m2_flow_nominal=mAirFloRat, - dp1_nominal=PreDroWat, - dp2_nominal=PreDroAir, - UA_nominal=UA, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) - annotation (Placement(transformation(extent={{-14,-10},{6,10}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TEntWat(redeclare package - Medium = MediumWat) annotation (Placement(transformation(extent= - {{-74,-4},{-54,16}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TLeaWat(redeclare package - Medium = MediumWat) - annotation (Placement(transformation(extent={{62,-4},{82,16}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,50},{110,70}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TEntAir(redeclare package - Medium = MediumAir) annotation (Placement(transformation(extent= - {{50,-70},{30,-50}}))); - Modelica.Fluid.Sensors.MassFlowRate m_flowWat(redeclare package - Medium = - MediumWat) - annotation (Placement(transformation(extent={{32,-4},{52,16}}))); - Modelica.Fluid.Sensors.Pressure pWatEnt(redeclare package Medium = - MediumWat) - annotation (Placement(transformation(extent={{-20,6},{-40,26}}))); - Modelica.Fluid.Sensors.Pressure pWatLea(redeclare package Medium = - MediumWat) - annotation (Placement(transformation(extent={{32,6},{12,26}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package - Medium = - MediumAir) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Sensors.MassFlowRate m_flowAir(redeclare package - Medium = - MediumAir) - annotation (Placement(transformation(extent={{-40,-70},{-60,-50}}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TLeaAir( - redeclare package Medium = MediumAir, m_flow_nominal=mAirFloRat) - annotation (Placement(transformation(extent={{-68,-70},{-88,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package - Medium = - MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Sensors.Pressure pAirLea(redeclare package Medium = - MediumAir) annotation (Placement(transformation(extent={{-30, - -46},{-50,-26}}))); - Modelica.Fluid.Sensors.Pressure pAirEnt(redeclare package Medium = - MediumAir) annotation (Placement(transformation(extent={{50,-44}, - {30,-24}}))); - Modelica.Blocks.Interfaces.RealOutput TAirLea - "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{100,-30},{120,-10}}))); - equation - connect(cooCoi.port_a1, TEntWat.port_b) annotation (Line( - points={{-14,6},{-40,6},{-54,6}}, - color={0,127,255}, - thickness=1)); - connect(TEntWat.port_a, port_a_Wat) annotation (Line( - points={{-74,6},{-88,6},{-88,60},{-100,60}}, - color={0,127,255}, - thickness=1)); - connect(TLeaWat.port_b, port_b_Wat) annotation (Line( - points={{82,6},{90,6},{90,60},{100,60}}, - color={0,127,255}, - thickness=1)); - connect(cooCoi.port_b1,m_flowWat. port_a) annotation (Line( - points={{6,6},{32,6}}, - color={0,127,255}, - thickness=1)); - connect(m_flowWat.port_b, TLeaWat.port_a) annotation (Line( - points={{52,6},{52,6},{62,6}}, - color={0,127,255}, - thickness=1)); - connect(pWatEnt.port, TEntWat.port_b) annotation (Line( - points={{-30,6},{-30,6},{-40,6},{-54,6}}, - color={0,127,255}, - thickness=1)); - connect(pWatLea.port, m_flowWat.port_a) annotation (Line( - points={{22,6},{22,6},{32,6}}, - color={0,127,255}, - thickness=1)); - connect(TEntAir.port_b, cooCoi.port_a2) annotation (Line( - points={{30,-60},{20,-60},{20,-6},{6,-6}}, - color={0,127,255}, - thickness=1)); - connect(TEntAir.port_a, port_a_Air) annotation (Line( - points={{50,-60},{100,-60}}, - color={0,127,255}, - thickness=1)); - connect(m_flowAir.port_a, cooCoi.port_b2) annotation (Line( - points={{-40,-60},{-20,-60},{-20,-6},{-14,-6}}, - color={0,127,255}, - thickness=1)); - connect(TLeaAir.port_a, m_flowAir.port_b) annotation (Line( - points={{-68,-60},{-60,-60}}, - color={0,127,255}, - thickness=1)); - connect(TLeaAir.port_b, port_b_Air) annotation (Line( - points={{-88,-60},{-100,-60}}, - color={0,127,255}, - thickness=1)); - connect(pAirLea.port, cooCoi.port_b2) annotation (Line( - points={{-40,-46},{-20,-46},{-20,-6},{-14,-6}}, - color={0,127,255}, - thickness=1)); - connect(pAirEnt.port, cooCoi.port_a2) annotation (Line( - points={{40,-44},{40,-46},{20,-46},{20,-6},{6,-6}}, - color={0,127,255}, - thickness=1)); - connect(TLeaAir.T, TAirLea) annotation (Line( - points={{-78,-49},{-78,-20},{110,-20}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(cooCoi.port_a1, pWatEnt.port) - annotation (Line(points={{-14,6},{-30,6}}, color={0,127,255})); - connect(cooCoi.port_b1, pWatLea.port) - annotation (Line(points={{6,6},{22,6}}, color={0,127,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line( - points={{-90,60},{-40,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-76,60}}, - color={0,0,127}, - pattern=LinePattern.Dash), - Line( - points={{40,60},{90,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{-40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,-60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{40,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-10,30},{44,-12}}, - lineColor={0,0,127}, - lineThickness=0.5, - textString="-"), - Line( - points={{-90,-60},{-40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,-60},{90,-60}}, - color={0,0,127}, - thickness=0.5)}), Diagram( - coordinateSystem(preserveAspectRatio=false))); - end WetCoil; - - model DryCoil - parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 - "Heat exchanger effectiveness"; - replaceable package MediumAir = - Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - replaceable package MediumWat = - Modelica.Media.Interfaces.PartialMedium "Medium for the water"; - parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.MassFlowRate mWatFloRat - "mass flow rate for water"; - parameter Modelica.Units.SI.Pressure PreDroAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroWat - "Pressure drop in the water side"; - - Buildings.Fluid.HeatExchangers.ConstantEffectiveness dryCoi( - redeclare package Medium1 = MediumWat, - redeclare package Medium2 = MediumAir, - m1_flow_nominal=mWatFloRat, - m2_flow_nominal=mAirFloRat, - dp1_nominal=PreDroWat, - dp2_nominal=PreDroAir, - eps=eps) - annotation (Placement(transformation(extent={{-14,-10},{6,10}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temEntWat(redeclare package - Medium = - MediumWat) - annotation (Placement(transformation(extent={{-74,-4},{-54,16}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temLeaWat(redeclare package - Medium = - MediumWat) - annotation (Placement(transformation(extent={{62,-4},{82,16}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temEntAir(redeclare package - Medium = - MediumAir) - annotation (Placement(transformation(extent={{50,-70},{30,-50}}))); - Modelica.Fluid.Sensors.MassFlowRate masFloWat(redeclare package - Medium = - MediumWat) - annotation (Placement(transformation(extent={{32,-4},{52,16}}))); - Modelica.Fluid.Sensors.Pressure preWatEnt(redeclare package Medium = - MediumWat) - annotation (Placement(transformation(extent={{-20,6},{-40,26}}))); - Modelica.Fluid.Sensors.Pressure preWatLea(redeclare package Medium = - MediumWat) - annotation (Placement(transformation(extent={{32,6},{12,26}}))); - Modelica.Fluid.Sensors.MassFlowRate masFloAir(redeclare package - Medium = - MediumAir) - annotation (Placement(transformation(extent={{-40,-70},{-60,-50}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temLeaAir(redeclare package - Medium = - MediumAir) - annotation (Placement(transformation(extent={{-68,-70},{-88,-50}}))); - Modelica.Fluid.Sensors.Pressure preAirLea(redeclare package Medium = - MediumAir) - annotation (Placement(transformation(extent={{-30,-46},{-50,-26}}))); - Modelica.Fluid.Sensors.Pressure preAirEnt(redeclare package Medium = - MediumAir) - annotation (Placement(transformation(extent={{50,-44},{30,-24}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,50},{110,70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package - Medium = - MediumAir) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package - Medium = - MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Blocks.Interfaces.RealOutput TAirLea - "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{100,-30},{120,-10}}))); - - equation - connect(dryCoi.port_a1, temEntWat.port_b) annotation (Line( - points={{-14,6},{-40,6},{-54,6}}, - color={0,127,255}, - thickness=1)); - connect(temEntWat.port_a,port_a_Wat) annotation (Line( - points={{-74,6},{-88,6},{-88,60},{-100,60}}, - color={0,127,255}, - thickness=1)); - connect(temLeaWat.port_b,port_b_Wat) annotation (Line( - points={{82,6},{90,6},{90,60},{100,60}}, - color={0,127,255}, - thickness=1)); - connect(dryCoi.port_b1, masFloWat.port_a) annotation (Line( - points={{6,6},{32,6}}, - color={0,127,255}, - thickness=1)); - connect(masFloWat.port_b,temLeaWat. port_a) annotation (Line( - points={{52,6},{52,6},{62,6}}, - color={0,127,255}, - thickness=1)); - connect(preWatEnt.port,temEntWat. port_b) annotation (Line( - points={{-30,6},{-30,6},{-40,6},{-54,6}}, - color={0,127,255}, - thickness=1)); - connect(preWatLea.port,masFloWat. port_a) annotation (Line( - points={{22,6},{22,6},{32,6}}, - color={0,127,255}, - thickness=1)); - connect(temEntAir.port_b, dryCoi.port_a2) annotation (Line( - points={{30,-60},{20,-60},{20,-6},{6,-6}}, - color={0,140,72}, - thickness=0.5)); - connect(temEntAir.port_a,port_a_Air) annotation (Line( - points={{50,-60},{100,-60}}, - color={0,140,72}, - thickness=0.5)); - connect(masFloAir.port_a, dryCoi.port_b2) annotation (Line( - points={{-40,-60},{-20,-60},{-20,-6},{-14,-6}}, - color={0,140,72}, - thickness=0.5)); - connect(temLeaAir.port_a, masFloAir.port_b) annotation (Line( - points={{-68,-60},{-60,-60}}, - color={0,140,72}, - thickness=0.5)); - connect(temLeaAir.port_b,port_b_Air) annotation (Line( - points={{-88,-60},{-100,-60}}, - color={0,140,72}, - thickness=0.5)); - connect(preAirLea.port, dryCoi.port_b2) annotation (Line( - points={{-40,-46},{-20,-46},{-20,-6},{-14,-6}}, - color={0,140,72}, - thickness=0.5)); - connect(preAirEnt.port, dryCoi.port_a2) annotation (Line( - points={{40,-44},{40,-46},{20,-46},{20,-6},{6,-6}}, - color={0,140,72}, - thickness=0.5)); - connect(temLeaAir.T,TAirLea) annotation (Line( - points={{-78,-49},{-78,-20},{110,-20}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(dryCoi.port_a1, preWatEnt.port) - annotation (Line(points={{-14,6},{-30,6}}, color={0,127,255})); - connect(dryCoi.port_b1, preWatLea.port) - annotation (Line(points={{6,6},{22,6}}, color={0,127,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line( - points={{-90,60},{-40,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,60},{90,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{-40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,-60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{40,60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-40,60},{40,-60}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-46,-16},{8,-58}}, - lineColor={0,0,127}, - lineThickness=0.5, - textString="-"), - Line( - points={{-90,-60},{-40,-60}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{40,-60},{90,-60}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-10,50},{44,8}}, - lineColor={0,0,127}, - lineThickness=0.5, - textString="+")}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end DryCoil; - - partial model WatCoil - import BuildingControlEmulator = - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; - replaceable package MediumAir = - Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - replaceable package MediumWat = - Modelica.Media.Interfaces.PartialMedium "Medium for the water"; - parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.MassFlowRate mWatFloRat - "mass flow rate for water"; - parameter Modelica.Units.SI.Pressure PreDroAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroWat - "Pressure drop in the water side"; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package - Medium = MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-112,-90},{-92,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package - Medium = MediumAir) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = MediumWat) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,70},{110,90}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = MediumWat) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,70},{-90,90}}))); - replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( - redeclare package Medium = MediumWat, - m_flow_nominal=mWatFloRat, - dpValve_nominal=PreDroWat) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={80,46}))); - BuildingControlEmulator.conPI pI(k=k, Ti=Ti) - annotation (Placement(transformation(extent={{-40,10},{-20,30}}))); - Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); - Modelica.Blocks.Interfaces.RealInput SetPoi "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); - Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ - 120) "Ramp limiter for water coil control signal" - annotation (Placement(transformation(extent={{30,36},{50,56}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite yCoo(description= - "Cooling coil valve control signal for AHU", u( - unit="1", - min=0, - max=1)) "Cooling coil control signal" - annotation (Placement(transformation(extent={{-4,36},{16,56}}))); - equation - connect(val.port_b, port_b_Wat) annotation (Line( - points={{80,56},{80,80},{100,80}}, - color={0,127,255}, - thickness=1)); - connect(pI.On, On) - annotation (Line( - points={{-42,26},{-42,26},{-52,26},{-80,26},{-80,40},{-120,40}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(pI.set, SetPoi) annotation (Line( - points={{-42,20},{-42,20},{-80,20},{-80,-20},{-120,-20}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(ramLim.y, val.y) annotation (Line(points={{52,46},{68,46}}, - color={0,0,127})); - connect(yCoo.y, ramLim.u) - annotation (Line(points={{17,46},{28,46}}, color={0,0,127})); - connect(yCoo.u, pI.y) annotation (Line(points={{-6,46},{-14,46},{ - -14,20},{-19,20}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); - end WatCoil; - - end BaseClasses; - - end Coil; - - package MixingBox - - model MixingBoxWithControl "The model of the mixing box" - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "medium for the fluid"; - parameter Modelica.Units.SI.Pressure PreDro "pressure drop in the air side"; - parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat - "mass flow rate for fresh air"; - parameter Modelica.Units.SI.MassFlowRate mTotAirFloRat - "mass flow rate for water"; - parameter Modelica.Units.SI.Temperature TemHig - "highest temeprature when the economizer is on"; - parameter Modelica.Units.SI.Temperature TemLow - "lowest temeprature when the economizer is on"; - parameter Real DamMin "minimum damper postion"; - parameter Real k(min=0, unit="1") = 1 "gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "time constant of Integrator block"; - BaseClasses.MixingBox mixBox( - redeclare package Medium = Medium, - PreDro=PreDro, - mFreAirFloRat=mFreAirFloRat, - mTotAirFloRat=mTotAirFloRat) - annotation (Placement(transformation(extent={{-10,-24},{26,0}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Exh(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-70,90},{-50,110}}), - iconTransformation(extent={{-70,90},{-50,110}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_Fre(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{50,90},{70,110}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_Ret(redeclare package Medium = Medium) - "First port, typically inlet" annotation (Placement(transformation(extent={{-68, - -110},{-48,-90}}), iconTransformation(extent={{-68,-110},{-48,-90}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Sup(redeclare package Medium = Medium) - "Second port, typically outlet" annotation (Placement(transformation(extent={{50,-112},{70,-92}}))); - Control.ecoCon ecoCon( - TemHig=TemHig, - TemLow=TemLow, - DamMin=DamMin, - k=k, - Ti=Ti) annotation (Placement(transformation(extent={{-70,30},{-50,50}}))); - Modelica.Blocks.Interfaces.RealInput TMix - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput TOut - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - equation - connect(mixBox.port_Exh, port_Exh) annotation (Line( - points={{-4.6,0},{-4.6,60},{-60,60},{-60,100}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.port_Fre, port_Fre) annotation (Line( - points={{18.8,0},{18.8,60},{60,60},{60,100}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.port_Ret, port_Ret) - annotation (Line( - points={{-4.6,-24},{-4.6,-58},{-58,-58},{-58,-100}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.port_Sup, port_Sup) - annotation (Line( - points={{18.8,-24},{20,-24},{20,-58},{60,-58},{60,-102}}, - color={0,140,72}, - thickness=0.5)); - connect(mixBox.T, ecoCon.Mea) - annotation (Line( - points={{27.8,-17.04},{38,-17.04},{38,22},{-78,22},{-78,32},{-72,32}}, - color={0,0,127})); - connect(ecoCon.TMix, TMix) annotation (Line( - points={{-72,40},{-92,40},{-92,0},{-120,0}}, - color={0,0,127})); - connect(ecoCon.On, On) annotation (Line( - points={{-72,48},{-90,48},{-90,80},{-120,80}}, - color={255,0,255})); - connect(ecoCon.TOut,TOut) annotation (Line( - points={{-72,36},{-80,36},{-80,-60},{-120,-60}}, - color={0,0,127})); - connect(ecoCon.y,mixBox.damPos) annotation (Line(points={{-49,40},{-46, - 40},{-46,-12},{-13.6,-12}}, - color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line( - points={{-60,90},{-60,-94}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,92},{60,-92}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,0},{-60,0}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-60,72},{-60,32}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-68,64},{-52,64}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-70,38},{-50,38}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-68,64},{-50,38}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-70,38},{-52,64}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,74},{60,34}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{52,66},{68,66}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{50,40},{70,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{52,66},{70,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{50,40},{68,66}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-148,112},{152,152}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end MixingBoxWithControl; - - package BaseClasses - - model MixingBox - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; - parameter Modelica.Units.SI.Pressure PreDro "Pressure drop in the air side"; - parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat - "mass flow rate for fresh air"; - parameter Modelica.Units.SI.MassFlowRate mTotAirFloRat - "mass flow rate for water"; - - Buildings.Fluid.FixedResistances.Junction jun( - energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, - redeclare package Medium = Medium, - from_dp=false, - m_flow_nominal={mTotAirFloRat,mFreAirFloRat,-mTotAirFloRat + mFreAirFloRat}, - dp_nominal={PreDro/4,PreDro/4,PreDro/4}, - linearized=true) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=90, - origin={-70,-12}))); - - Buildings.Fluid.FixedResistances.Junction jun1( - energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, - redeclare package Medium = Medium, - from_dp=false, - m_flow_nominal={mFreAirFloRat,mTotAirFloRat,mTotAirFloRat - mFreAirFloRat}, - dp_nominal={PreDro/4,PreDro/4,PreDro/4}, - linearized=true) - annotation (Placement(transformation(extent={{10,10},{-10,-10}}, - rotation=90, - origin={60,-12}))); - - Modelica.Fluid.Interfaces.FluidPort_a port_Ret(redeclare package - Medium = Medium) - "First port, typically inlet" annotation (Placement(transformation(extent={{-80,-110},{-60,-90}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Sup(redeclare package - Medium = Medium) - "Second port, typically outlet" annotation (Placement(transformation(extent={{50,-110},{70,-90}}))); - replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valExh( - redeclare package Medium = Medium, - m_flow_nominal=mFreAirFloRat, - dpValve_nominal=PreDro/2) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-70,58}))); - replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valFre( - redeclare package Medium = Medium, - m_flow_nominal=mFreAirFloRat, - dpValve_nominal=PreDro/2) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={60,54}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Exh(redeclare package - Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-80,90},{-60,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_Fre(redeclare package - Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{50,90},{70,110}}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TOutSen( - redeclare package Medium = Medium, m_flow_nominal=mFreAirFloRat) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={60,82}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TMix( - redeclare package Medium = Medium, m_flow_nominal=mTotAirFloRat) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={60,-42}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TRet(redeclare package - Medium = Medium) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-70,-50}))); - Modelica.Fluid.Sensors.MassFlowRate m_flowAir(redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=90, - origin={60,20}))); - Modelica.Blocks.Interfaces.RealInput damPos "Actuator position (0: closed, 1: open)" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Fluid.Sensors.MassFlowRate m_flowSupAir(redeclare package - Medium = Medium) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={60,-72}))); - Modelica.Blocks.Interfaces.RealOutput T "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{100,-52},{120,-32}}))); - Modelica.Blocks.Interfaces.RealOutput TOut "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{100,72},{120,92}}))); - replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valRet( - redeclare package Medium = Medium, - dpValve_nominal=PreDro/2, - m_flow_nominal=mTotAirFloRat - mFreAirFloRat) - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={0,-12}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=1 -damPos) - annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite yOA(description= - "Outside air damper position setpoint for AHU", u( - unit="1", - min=0, - max=1)) "Outside air damper position setpoint" - annotation (Placement(transformation(extent={{0,44},{20,64}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite yRet(description= - "Return air damper position setpoint for AHU", u( - unit="1", - min=0, - max=1)) "Return air damper position setpoint" - annotation (Placement(transformation(extent={{-28,10},{-8,30}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite yEA(description= - "Exhaust air damper position setpoint for AHU", u( - unit="1", - min=0, - max=1)) "Exhaust air damper position setpoint" annotation ( - Placement(transformation(extent={{-48,80},{-28,100}}))); - equation - connect(valExh.port_a, jun.port_2) - annotation (Line( - points={{-70,48},{-70,-2}}, - color={0,127,255}, - thickness=1)); - connect(valExh.port_b, port_Exh) - annotation (Line( - points={{-70,68},{-70,100}}, - color={0,127,255}, - thickness=1)); - connect(port_Fre, TOutSen.port_a) annotation (Line( - points={{60,100},{60,100},{60,92}}, - color={0,127,255}, - thickness=1)); - connect(jun1.port_2, TMix.port_a) annotation (Line( - points={{60,-22},{60,-28},{60,-32}}, - color={0,127,255}, - thickness=1)); - connect(jun.port_1, TRet.port_b) annotation (Line( - points={{-70,-22},{-70,-32},{-70,-40}}, - color={0,127,255}, - thickness=1)); - connect(TRet.port_a, port_Ret) annotation (Line( - points={{-70,-60},{-70,-80},{-70,-100}}, - color={0,127,255}, - thickness=1)); - connect(m_flowAir.port_b, jun1.port_1) annotation (Line( - points={{60,10},{60,4},{60,-2}}, - color={0,127,255}, - thickness=1)); - connect(port_Fre, port_Fre) annotation (Line(points={{60,100},{60,104},{56,104},{60,104},{60,100}}, - color={0,127,255})); - connect(port_Sup, m_flowSupAir.port_b) annotation (Line( - points={{60,-100},{60,-92},{60,-82}}, - color={0,127,255}, - thickness=1)); - connect(m_flowSupAir.port_a, TMix.port_b) annotation (Line( - points={{60,-62},{60,-62},{60,-52}}, - color={0,127,255}, - thickness=1)); - connect(TMix.T, T) annotation (Line( - points={{71,-42},{110,-42}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(TOutSen.T, TOut) annotation (Line( - points={{71,82},{110,82}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(TOutSen.port_b, valFre.port_a) annotation (Line( - points={{60,72},{60,64}}, - color={0,127,255}, - thickness=1)); - connect(valFre.port_b,m_flowAir. port_a) - annotation (Line( - points={{60,44},{60,44},{60,30}}, - color={0,127,255}, - thickness=0.5)); - connect(jun.port_3, valRet.port_a) annotation (Line( - points={{-60,-12},{-10,-12}}, - color={0,127,255}, - thickness=1)); - connect(valRet.port_b, jun1.port_3) annotation (Line( - points={{10,-12},{50,-12}}, - color={0,127,255}, - thickness=1)); - connect(yOA.y, valFre.y) - annotation (Line(points={{21,54},{48,54}}, color={0,0,127})); - connect(yOA.u,damPos) annotation (Line(points={{-2,54},{-40,54},{ - -40,32},{-84,32},{-84,0},{-120,0}}, color={0,0,127})); - connect(realExpression.y, yRet.u) - annotation (Line(points={{-39,20},{-30,20}}, color={0,0,127})); - connect(yRet.y, valRet.y) annotation (Line(points={{-7,20},{0,20},{ - 0,-1.77636e-15}}, color={0,0,127})); - connect(damPos, yEA.u) annotation (Line(points={{-120,0},{-92,0},{ - -92,90},{-50,90}}, color={0,0,127})); - connect(yEA.y, valExh.y) annotation (Line(points={{-27,90},{-18,90}, - {-18,76},{-88,76},{-88,58},{-82,58}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line( - points={{-70,92},{-70,-92}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,92},{60,-92}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,0},{-70,0}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-70,72},{-70,32}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-78,64},{-62,64}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-80,38},{-60,38}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-78,64},{-60,38}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{-80,38},{-62,64}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{60,74},{60,34}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{52,66},{68,66}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{50,40},{70,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{52,66},{70,40}}, - color={0,0,127}, - thickness=0.5), - Line( - points={{50,40},{68,66}}, - color={0,0,127}, - thickness=0.5), - Text( - extent={{-152,108},{148,148}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end MixingBox; - - end BaseClasses; - - package Control - - model ecoCon - import BuildingControlEmulator = - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; - parameter Modelica.Units.SI.Temperature TemHig - "the highest temeprature when the economizer is on"; - parameter Modelica.Units.SI.Temperature TemLow - "the lowest temeprature when the economizer is on"; - parameter Real DamMin "the minimum damper postion"; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - - BuildingControlEmulator.conPI pI( - k=k, - Ti=Ti, - reverseActing=false, - conPID(y_reset=1)) - annotation (Placement(transformation(extent={{10,2},{30,22}}))); - Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput TMix - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealInput Mea "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Sources.BooleanExpression integerExpression(y=(TOut <= TemHig) - and (TOut > TemLow)) annotation (Placement(transformation(extent={{-80,30}, - {-60,50}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=DamMin) annotation (Placement(transformation(extent={{10,-30},{30,-10}}))); - Modelica.Blocks.Math.Max max annotation (Placement(transformation(extent={{52,-10},{72,10}}))); - Modelica.Blocks.Interfaces.RealOutput y "Connector of Real output signal" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.RealInput TOut - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); - Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ - 120) "Ramp limiter for fan control signal" - annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); - Buildings.Controls.OBC.CDL.Continuous.Limiter lim(uMax=1, uMin=0) - annotation (Placement(transformation(extent={{68,-60},{88,-40}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swi - annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); - Modelica.Blocks.Sources.RealExpression realExpression1(y=DamMin) - annotation (Placement(transformation(extent={{-34,-68},{-14,-48}}))); - equation - connect(pI.set, TMix) annotation (Line( - points={{8,12},{8,10},{-60,10},{-60,0},{-120,0}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(pI.mea, Mea) annotation (Line( - points={{8,6},{8,4},{-40,4},{-40,-80},{-120,-80}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(integerExpression.y, pI.On) annotation (Line(points={{-59,40},{-59,40}, - {0,40},{0,18},{8,18}}, color={255,0,255})); - connect(pI.y, max.u1) annotation (Line(points={{31,12},{40,12},{40,6},{50,6}}, color={0,0,127})); - connect(max.u2, realExpression.y) annotation (Line(points={{50,-6},{40,-6},{40,-20},{31,-20}}, color={0,0,127})); - connect(ramLim.y, lim.u) - annotation (Line(points={{62,-50},{66,-50}}, color={0,0,127})); - connect(swi.y, ramLim.u) - annotation (Line(points={{22,-50},{38,-50}}, color={0,0,127})); - connect(On, swi.u2) annotation (Line(points={{-120,80},{-20,80},{-20,-50},{-2, - -50}}, color={255,0,255})); - connect(max.y, swi.u1) annotation (Line(points={{73,0},{88,0},{88,-28},{-12, - -28},{-12,-42},{-2,-42}}, color={0,0,127})); - connect(realExpression1.y, swi.u3) - annotation (Line(points={{-13,-58},{-2,-58}}, color={0,0,127})); - connect(lim.y, y) annotation (Line(points={{90,-50},{96,-50},{96,0},{110,0}}, - color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-34,26},{38,-34}}, - lineColor={0,127,255}, - lineThickness=1, - textString="Eco"), - Text( - extent={{-156,112},{144,152}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end ecoCon; - end Control; - - end MixingBox; - - package ZoneTerminal - - model FiveZoneDuctNetwork - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - parameter Modelica.Units.SI.Pressure PreDroMai1 - "Pressure drop 1 across the duct"; - - parameter Modelica.Units.SI.Pressure PreDroMai2 - "Pressure drop 2 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreDroMai3 - "Pressure drop 3 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreDroMai4 - "Pressure drop 4 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreDroBra1 - "Pressure drop 1 across the duct branch 1"; - - parameter Modelica.Units.SI.Pressure PreDroBra2 - "Pressure drop 1 across the duct branch 2"; - - parameter Modelica.Units.SI.Pressure PreDroBra3 - "Pressure drop 1 across the duct branch 3"; - - parameter Modelica.Units.SI.Pressure PreDroBra4 - "Pressure drop 1 across the duct branch 4"; - - parameter Modelica.Units.SI.Pressure PreDroBra5 - "Pressure drop 1 across the duct branch 5"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat1 - "mass flow rate for the first branch1"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat2 - "mass flow rate for the first branch2"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat3 - "mass flow rate for the first branch3"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat4 - "mass flow rate for the first branch4"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat5 - "mass flow rate for the first branch5"; - - Buildings.Fluid.FixedResistances.Junction junSup1( - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={mFloRat1 + mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat2-mFloRat3-mFloRat4 - mFloRat5,- - mFloRat1}, redeclare package Medium = Medium, - dp_nominal={PreDroMai1/2,PreDroMai2/2,PreDroBra1/2}) - annotation (Placement(transformation(extent={{-90,30},{-70,50}}))); - Buildings.Fluid.FixedResistances.Junction junRet1(redeclare package - Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat1-mFloRat2-mFloRat3- - mFloRat4 - mFloRat5,mFloRat1}, - dp_nominal={PreDroMai2/2,PreDroMai1/2,PreDroBra1/2}) - annotation (Placement(transformation(extent={{-70,-70},{-90,-50}}))); - Buildings.Fluid.FixedResistances.Junction junRet2( redeclare package - Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat3 + mFloRat4 + mFloRat5,-mFloRat2-mFloRat3- - mFloRat4 - mFloRat5,mFloRat2}, - dp_nominal={PreDroMai3/2,PreDroMai2/2,PreDroBra2/2}) - annotation (Placement(transformation(extent={{-30,-70},{-50,-50}}))); - Buildings.Fluid.FixedResistances.Junction junSup2( - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat3-mFloRat4 - mFloRat5,- - mFloRat2}, redeclare package Medium = Medium, - dp_nominal={PreDroMai2/2,PreDroMai3/2,PreDroBra2/2}) - annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); - Buildings.Fluid.FixedResistances.Junction junSup3( - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={mFloRat3 + mFloRat4 + mFloRat5,-mFloRat4 - mFloRat5,- - mFloRat3}, redeclare package Medium = Medium, - dp_nominal={PreDroMai3/2,PreDroMai4/2,PreDroBra3/2}) - annotation (Placement(transformation(extent={{-10,30},{10,50}}))); - Buildings.Fluid.FixedResistances.Junction junRet3(redeclare package - Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat4 + mFloRat5,-mFloRat3- - mFloRat4 - mFloRat5,mFloRat3}, - dp_nominal={PreDroMai4/2,PreDroMai3/2,PreDroBra3/2}) - annotation (Placement(transformation(extent={{10,-50},{-10,-70}}))); - Buildings.Fluid.FixedResistances.Junction junSup4( - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - m_flow_nominal={mFloRat4 + mFloRat5,-mFloRat5,-mFloRat4}, redeclare - package Medium = - Medium, - dp_nominal={PreDroMai4/2,PreDroBra5/2,PreDroBra4/2}) - annotation (Placement(transformation(extent={{30,30},{50,50}}))); - Buildings.Fluid.FixedResistances.Junction junRet4(redeclare package - Medium = Medium, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat5,-mFloRat4 - mFloRat5, - mFloRat4}, - dp_nominal={PreDroBra5/2,PreDroMai4/2,PreDroBra4/2}) - annotation (Placement(transformation(extent={{50,-70},{30,-50}}))); - - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = - Medium) "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = - Medium) "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); - replaceable Buildings.Fluid.Sensors.Pressure senRelPre(redeclare - package Medium = Medium) - annotation (Placement(transformation(extent={{34,70}, - {14,90}}))); - Modelica.Fluid.Interfaces.FluidPorts_b ports_b[5](redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{90,6},{110,86}}))); - Modelica.Fluid.Interfaces.FluidPorts_a ports_a[5](redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{90,-102},{110,-22}}))); - Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - equation - connect(junSup1.port_2, junSup2.port_1) annotation (Line( - points={{-70,40},{-62,40},{-50,40}}, - color={0,127,255}, - thickness=1)); - connect(junSup2.port_2, junSup3.port_1) annotation (Line( - points={{-30,40},{-30,40},{-10,40}}, - color={0,127,255}, - thickness=1)); - connect(junSup3.port_2, junSup4.port_1) annotation (Line( - points={{10,40},{10,40},{30,40}}, - color={0,127,255}, - thickness=1)); - connect(junRet4.port_2, junRet3.port_1) annotation (Line( - points={{30,-60},{10,-60}}, - color={0,127,255}, - thickness=1)); - connect(junRet3.port_2, junRet2.port_1) - annotation (Line( - points={{-10,-60},{-10,-60},{-30,-60}}, - color={0,127,255}, - thickness=1)); - connect(junRet2.port_2, junRet1.port_1) - annotation (Line( - points={{-50,-60},{-50,-60},{-70,-60}}, - color={0,127,255}, - thickness=1)); - connect(junRet1.port_2, port_b) annotation (Line( - points={{-90,-60},{-100,-60}}, - color={0,127,255}, - thickness=1)); - connect(junSup1.port_1, port_a) annotation (Line( - points={{-90,40},{-100,40}}, - color={0,127,255}, - thickness=1)); - - connect(ports_b, ports_b) annotation (Line(points={{100,46},{100,46}}, color={0,127,255})); - connect(junSup4.port_3, ports_b[4]) - annotation (Line( - points={{40,30},{40,16},{60,16},{60,62},{100,62}}, - color={0,127,255}, - thickness=1)); - connect(junSup3.port_3, ports_b[3]) - annotation (Line( - points={{0,30},{0,12},{78,12},{78,46},{100,46}}, - color={0,127,255}, - thickness=1)); - connect(junSup2.port_3, ports_b[2]) - annotation (Line( - points={{-40,30},{-40,30},{-40,8},{84,8},{84,30},{100,30}}, - color={0,127,255}, - thickness=1)); - connect(junSup1.port_3, ports_b[1]) - annotation (Line( - points={{-80,30},{-80,30},{-80,0},{90,0},{90,14},{100,14}}, - color={0,127,255}, - thickness=1)); - connect(junRet4.port_1, ports_a[5]) - annotation (Line( - points={{50,-60},{70,-60},{70,-34},{70,-30},{100,-30}}, - color={0,127,255}, - thickness=1)); - connect(junRet4.port_3, ports_a[4]) - annotation (Line( - points={{40,-70},{40,-70},{70,-70},{86,-70},{86,-46},{100,-46}}, - color={0,127,255}, - thickness=1)); - connect(junRet2.port_3, ports_a[2]) - annotation (Line( - points={{-40,-70},{-40,-86},{100,-86},{100,-78}}, - color={0,127,255}, - thickness=1)); - connect(junRet1.port_3, ports_a[1]) - annotation (Line( - points={{-80,-70},{-80,-70},{-80,-94},{96,-94},{100,-94}}, - color={0,127,255}, - thickness=1)); - connect(junRet3.port_3, ports_a[3]) - annotation (Line( - points={{0,-50},{0,-38},{82,-38},{82,-62},{100,-62}}, - color={0,127,255}, - thickness=1)); - connect(senRelPre.port, junSup4.port_2) annotation (Line( - points={{24,70},{24,60},{56,60},{56,40},{50,40}}, - color={0,127,255}, - thickness=1)); - connect(junSup4.port_2, ports_b[5]) annotation (Line( - points={{50,40},{54,40},{56,40},{56,82},{100,82},{100,78}}, - color={0,127,255}, - thickness=1)); - connect(senRelPre.p, p) annotation (Line( - points={{13,80},{-20,80},{-20,-20},{96,-20},{96,0},{110,0}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line(points={{-90,40},{80,40}}, color={0,127,255}), - Line(points={{-90,-60},{80,-60}}, color={0,127,255}), - Line(points={{80,40},{80,-60}}, color={0,127,255}), - Line(points={{50,40},{50,-60}}, color={0,127,255}), - Line(points={{20,40},{20,-60}}, color={0,127,255}), - Line(points={{-10,40},{-10,-60}}, color={0,127,255}), - Line(points={{-40,40},{-40,-60}}, color={0,127,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end FiveZoneDuctNetwork; - - model FiveZoneVAV "Thermal zones, VAV terminals, and duct network" - replaceable package MediumAir = Modelica.Media.Interfaces.PartialMedium - "medium for the air"; - - replaceable package MediumWat = Modelica.Media.Interfaces.PartialMedium - "medium for the water"; - - parameter Modelica.Units.SI.Pressure PreAirDroMai1 - "pressure drop 1 across the duct"; - - parameter Modelica.Units.SI.Pressure PreAirDroMai2 - "Pressure drop 2 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreAirDroMai3 - "Pressure drop 3 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreAirDroMai4 - "Pressure drop 4 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreAirDroBra1 - "Pressure drop 1 across the duct branch 1"; - - parameter Modelica.Units.SI.Pressure PreAirDroBra2 - "Pressure drop 1 across the duct branch 2"; - - parameter Modelica.Units.SI.Pressure PreAirDroBra3 - "Pressure drop 1 across the duct branch 3"; - - parameter Modelica.Units.SI.Pressure PreAirDroBra4 - "Pressure drop 1 across the duct branch 4"; - - parameter Modelica.Units.SI.Pressure PreAirDroBra5 - "Pressure drop 1 across the duct branch 5"; - - parameter Modelica.Units.SI.Pressure PreWatDroMai1 - "Pressure drop 1 across the pipe"; - - parameter Modelica.Units.SI.Pressure PreWatDroMai2 - "Pressure drop 2 across the main pipe"; - - parameter Modelica.Units.SI.Pressure PreWatDroMai3 - "Pressure drop 3 across the main pipe"; - - parameter Modelica.Units.SI.Pressure PreWatDroMai4 - "Pressure drop 4 across the main pipe"; - - parameter Modelica.Units.SI.Pressure PreWatDroBra1 - "Pressure drop 1 across the pipe branch 1"; - - parameter Modelica.Units.SI.Pressure PreWatDroBra2 - "Pressure drop 1 across the pipe branch 2"; - - parameter Modelica.Units.SI.Pressure PreWatDroBra3 - "Pressure drop 1 across the pipe branch 3"; - - parameter Modelica.Units.SI.Pressure PreWatDroBra4 - "Pressure drop 1 across the pipe branch 4"; - - parameter Modelica.Units.SI.Pressure PreWatDroBra5 - "Pressure drop 1 across the pipe branch 5"; - - parameter Modelica.Units.SI.MassFlowRate mAirFloRat1 - "mass flow rate for vav 1"; - - parameter Modelica.Units.SI.MassFlowRate mAirFloRat2 - "mass flow rate for vav 2"; - - parameter Modelica.Units.SI.MassFlowRate mAirFloRat3 - "mass flow rate for vav 3"; - - parameter Modelica.Units.SI.MassFlowRate mAirFloRat4 - "mass flow rate for vav 4"; - - parameter Modelica.Units.SI.MassFlowRate mAirFloRat5 - "mass flow rate for vav 5"; - - parameter Modelica.Units.SI.MassFlowRate mWatFloRat1 - "mass flow rate for vav 1"; - - parameter Modelica.Units.SI.MassFlowRate mWatFloRat2 - "mass flow rate for vav 2"; - - parameter Modelica.Units.SI.MassFlowRate mWatFloRat3 - "mass flow rate for vav 3"; - - parameter Modelica.Units.SI.MassFlowRate mWatFloRat4 - "mass flow rate for vav 4"; - - parameter Modelica.Units.SI.MassFlowRate mWatFloRat5 - "mass flow rate for vav 5"; - - parameter Modelica.Units.SI.Pressure PreDroAir1 - "Pressure drop in the air side of vav 1"; - parameter Modelica.Units.SI.Pressure PreDroWat1 - "Pressure drop in the water side of vav 1"; - parameter Modelica.Units.SI.Efficiency eps1(max=1) = 0.8 - "Heat exchanger effectiveness of vav 1"; - - parameter Modelica.Units.SI.Pressure PreDroAir2 - "Pressure drop in the air side of vav 2"; - parameter Modelica.Units.SI.Pressure PreDroWat2 - "Pressure drop in the water side of vav 2"; - parameter Modelica.Units.SI.Efficiency eps2(max=1) = 0.8 - "Heat exchanger effectiveness of vav 2"; - - parameter Modelica.Units.SI.Pressure PreDroAir3 - "Pressure drop in the air side of vav 3"; - parameter Modelica.Units.SI.Pressure PreDroWat3 - "Pressure drop in the water side of vav 3"; - parameter Modelica.Units.SI.Efficiency eps3(max=1) = 0.8 - "Heat exchanger effectiveness of vav 3"; - - parameter Modelica.Units.SI.Pressure PreDroAir4 - "Pressure drop in the air side of vav 4"; - parameter Modelica.Units.SI.Pressure PreDroWat4 - "Pressure drop in the water side of vav 4"; - parameter Modelica.Units.SI.Efficiency eps4(max=1) = 0.8 - "Heat exchanger effectiveness of vav 4"; - - parameter Modelica.Units.SI.Pressure PreDroAir5 - "Pressure drop in the air side of vav 1"; - parameter Modelica.Units.SI.Pressure PreDroWat5 - "Pressure drop in the water side of vav 1"; - parameter Modelica.Units.SI.Efficiency eps5(max=1) = 0.8 - "Heat exchanger effectiveness of vav 5"; - - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.FiveZoneDuctNetwork - ReheatWatNet( - redeclare package Medium = MediumWat, - PreDroMai1=PreWatDroMai1, - PreDroMai2=PreWatDroMai2, - PreDroMai3=PreWatDroMai3, - PreDroMai4=PreWatDroMai4, - PreDroBra1=PreWatDroBra1, - PreDroBra2=PreWatDroBra2, - PreDroBra3=PreWatDroBra3, - PreDroBra4=PreWatDroBra4, - PreDroBra5=PreWatDroBra5, - mFloRat1=mWatFloRat1, - mFloRat2=mWatFloRat2, - mFloRat3=mWatFloRat3, - mFloRat4=mWatFloRat4, - mFloRat5=mWatFloRat5) - annotation (Placement(transformation(extent={{-76,64},{-46,30}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.FiveZoneDuctNetwork - AirNetWor( - redeclare package Medium = MediumAir, - PreDroMai1=PreAirDroMai1, - PreDroMai2=PreAirDroMai2, - PreDroMai3=PreAirDroMai3, - PreDroMai4=PreAirDroMai4, - mFloRat1=mAirFloRat1, - mFloRat2=mAirFloRat2, - mFloRat3=mAirFloRat3, - mFloRat4=mAirFloRat4, - mFloRat5=mAirFloRat5, - PreDroBra1=PreAirDroBra1, - PreDroBra2=PreAirDroBra2, - PreDroBra3=PreAirDroBra3, - PreDroBra4=PreAirDroBra4, - PreDroBra5=PreAirDroBra5) - annotation (Placement(transformation(extent={{-74,-52},{-44,-18}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal - vAV1( - zonNam="cor", - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat1, - mWatFloRat=mWatFloRat1, - PreDroAir=PreDroAir1, - PreDroWat=PreDroWat1, - eps=eps1) - annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); - Buildings.Fluid.MixingVolumes.MixingVolume vol[5]( - redeclare package Medium = MediumAir, - each energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - each nPorts=10, - m_flow_nominal={mAirFloRat1,mAirFloRat2,mAirFloRat3,mAirFloRat4,mAirFloRat5}, - each V=10) annotation (Placement(transformation(extent={{70,-70},{90,-50}}))); - Buildings.HeatTransfer.Sources.PrescribedHeatFlow fixedHeatFlow[5] - annotation (Placement(transformation(extent={{-40,-90},{-20,-70}}))); - Modelica.Blocks.Interfaces.RealInput Q_flow[5] - annotation (Placement(transformation(extent={{-120,-90},{-100,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = - MediumWat) "Second port, typically outlet" - annotation (Placement(transformation(extent={{30,90},{50,110}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = - MediumWat) "Second port, typically outlet" - annotation (Placement(transformation(extent={{-50,90},{-30,110}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package - Medium = - MediumAir) - "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package - Medium = - MediumAir) - "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Blocks.Interfaces.RealInput airFloRatSet[5] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-120,76},{-100,96}}))); - Modelica.Blocks.Interfaces.RealInput yVal[5] - "Actuator position (0: closed, 1: open)" - annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); - Modelica.Blocks.Interfaces.BooleanInput On[5] - annotation (Placement(transformation(extent={{-120,-22},{-100,-2}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TZonSen[5](redeclare package - Medium = MediumAir) - annotation (Placement(transformation(extent={{138,-68},{118,-48}}))); - Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" annotation ( - Placement(transformation(extent={{200,-22},{220,-2}}), - iconTransformation(extent={{100,-100},{120,-80}}))); - Modelica.Blocks.Interfaces.RealOutput TZon[5] - "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{200,70},{220,90}}), - iconTransformation(extent={{100,50},{120,70}}))); - - Modelica.Blocks.Interfaces.RealOutput yDam[5] - "Control signal for terminal box damper" - annotation (Placement(transformation(extent={{200,44},{220,64}}), - iconTransformation(extent={{100,20},{120,40}}))); - Modelica.Blocks.Sources.RealExpression yDamMea[5](y={vAV1.dam.y,vAV2.dam.y, - vAV3.dam.y,vAV4.dam.y,vAV5.dam.y}) - annotation (Placement(transformation(extent={{170,44},{190,64}}), - iconTransformation(extent={{100,70},{120,90}}))); - Modelica.Blocks.Interfaces.RealOutput yReaHea[5] - "Control signal for terminal box reheat" - annotation (Placement(transformation(extent={{200,18},{220,38}}), - iconTransformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Sources.RealExpression yReaValMea[5](y={vAV1.rehVal.y, - vAV2.rehVal.y,vAV3.rehVal.y,vAV4.rehVal.y,vAV5.rehVal.y}) - annotation (Placement(transformation(extent={{170,18},{190,38}}))); - - Modelica.Blocks.Sources.RealExpression TZonAir[5](y=vol.heatPort.T) - annotation (Placement(transformation(extent={{170,70},{190,90}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal - vAV2( - zonNam="sou", - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat2, - mWatFloRat=mWatFloRat2, - PreDroAir=PreDroAir2, - PreDroWat=PreDroWat2, - eps=eps2) - annotation (Placement(transformation(extent={{30,-2},{50,18}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal - vAV3( - zonNam="eas", - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat3, - mWatFloRat=mWatFloRat3, - PreDroAir=PreDroAir3, - PreDroWat=PreDroWat3, - eps=eps3) - annotation (Placement(transformation(extent={{72,-2},{92,18}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal - vAV4( - zonNam="nor", - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat4, - mWatFloRat=mWatFloRat4, - PreDroAir=PreDroAir4, - PreDroWat=PreDroWat4, - eps=eps4) - annotation (Placement(transformation(extent={{118,-2},{138,18}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal - vAV5( - zonNam="wes", - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat5, - mWatFloRat=mWatFloRat5, - PreDroAir=PreDroAir5, - PreDroWat=PreDroWat5, - eps=eps5) - annotation (Placement(transformation(extent={{158,-2},{178,18}}))); - - Modelica.Blocks.Interfaces.RealInput yCoo[5] - "Cooling PID signal measurement" - annotation (Placement(transformation(extent={{-120,16},{-100,36}}))); - Modelica.Blocks.Interfaces.RealInput yHea[5] - "Heating PID signal measurement" - annotation (Placement(transformation(extent={{-120,-4},{-100,16}}))); - Modelica.Blocks.Sources.RealExpression Vflow_setMea[5](y={vAV1.airFloRatSet - *vAV1.mAirFloRat/1.2,vAV2.airFloRatSet*vAV2.mAirFloRat/1.2,vAV3.airFloRatSet - *vAV3.mAirFloRat/1.2,vAV4.airFloRatSet*vAV4.mAirFloRat/1.2,vAV5.airFloRatSet - *vAV5.mAirFloRat/1.2}) - "VAV terminal airflow setpoint measurement" - annotation (Placement(transformation(extent={{170,-50},{190,-30}}))); - Modelica.Blocks.Interfaces.RealOutput Vflow_set[5] - "VAV terminal airflow setpoint" annotation (Placement(transformation( - extent={{200,-50},{220,-30}}), iconTransformation(extent={{100, - -40},{120,-20}}))); - Modelica.Blocks.Sources.RealExpression Vflow_Mea[5](y={vAV1.m_flow.m_flow - /1.2,vAV2.m_flow.m_flow/1.2,vAV3.m_flow.m_flow/1.2,vAV4.m_flow.m_flow - /1.2,vAV5.m_flow.m_flow/1.2}) "VAV terminal airflow measurement" - annotation (Placement(transformation(extent={{170,-70},{190,-50}}))); - Modelica.Blocks.Interfaces.RealOutput Vflow[5] "VAV terminal airflow" - annotation (Placement(transformation(extent={{200,-70},{220,-50}}), - iconTransformation(extent={{100,-70},{120,-50}}))); - Modelica.Blocks.Interfaces.RealOutput TSup[5] - "VAV supply air temperature" annotation (Placement(transformation( - extent={{200,-94},{220,-74}}), iconTransformation(extent={{100, - 80},{120,100}}))); - Modelica.Blocks.Sources.RealExpression TSupMea[5](y={vAV1.TAirLea,vAV2.TAirLea, - vAV3.TAirLea,vAV4.TAirLea,vAV5.TAirLea}) - annotation (Placement(transformation(extent={{170,-94},{190,-74}}))); - - equation - - connect(fixedHeatFlow.port, vol.heatPort) annotation (Line(points={{-20,-80},{ - 30,-80},{30,-60},{70,-60}}, - color={191,0,0})); - connect(fixedHeatFlow.Q_flow, Q_flow) - annotation (Line(points={{-40,-80},{-110,-80}}, color={0,0,127}, - pattern=LinePattern.Dash)); - - connect(vAV1.port_b, vol[1].ports[1]) - annotation (Line(points={{10,8},{14,8},{14, - -78},{76,-78},{76,-74},{76.4,-74},{76.4,-70}}, - color={0,140,72}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV2.port_b, vol[2].ports[1]) - annotation (Line(points={{50,8},{60,8},{60, - -78},{76,-78},{76,-74},{76.4,-74},{76.4,-70}}, - color={0,140,72}, - thickness=0.5, pattern=LinePattern.Dash)); - connect(vAV3.port_b, vol[3].ports[1]) - annotation (Line(points={{92,8},{100,8},{ - 100,-78},{80,-78},{80,-70},{76.4,-70}}, - color={0,140,72}, - thickness=0.5, pattern=LinePattern.Dash)); - connect(vAV4.port_b, vol[4].ports[1]) - annotation (Line(points={{138,8},{150,8}, - {150,-78},{80,-78},{80,-70},{76.4,-70}}, - color={0,140,72}, - thickness=0.5, pattern=LinePattern.Dash)); - connect(vAV5.port_b, vol[5].ports[1]) - annotation (Line(points={{178,8},{188,8}, - {188,-78},{80,-78},{80,-70},{76.4,-70}}, - color={0,140,72}, - thickness=0.5, pattern=LinePattern.Dash)); - - for i in 1:5 loop - connect(TZonSen[i].port_b, AirNetWor.ports_a[i]); - connect(TZonSen[i].port_a, vol[i].ports[2]); - end for; - - connect(ReheatWatNet.port_b, port_b_Wat) annotation (Line( - points={{-76,57.2},{-74,57.2},{-74,72},{40,72},{40,100}}, - color={255,0,0}, - thickness=1)); - connect(ReheatWatNet.port_a, port_a_Wat) annotation (Line( - points={{-76,40.2},{-76,40.2},{-76,40},{-82,40},{-82,76},{-40,76},{ - -40,100}}, - color={255,0,0}, - thickness=1)); - connect(AirNetWor.port_a, port_a_Air) - annotation (Line(points={{-74,-28.2},{-88,-28.2},{-88,40},{-100,40}}, color={0,140,72}, - thickness=0.5)); - - connect(AirNetWor.port_b, port_b_Air) - annotation (Line(points={{-74,-45.2},{-80,-45.2},{-80,-60},{-100,-60}}, color={0,140,72}, - thickness=0.5)); - - connect(AirNetWor.p, p) annotation (Line( - points={{-42.5,-35},{-8,-35},{-8,-12},{210,-12}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(TZonAir.y, TZon) annotation (Line( - points={{191,80},{210,80}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(On[2], vAV2.On) annotation (Line(points={{-110,-16},{18,-16},{ - 18,0},{29,0}}, - color={255,0,255})); - connect(On[3], vAV3.On) annotation (Line(points={{-110,-12},{-72,-12},{ - -72,-8},{56,-8},{56,0},{71,0}}, - color={255,0,255})); - connect(On[4], vAV4.On) annotation (Line(points={{-110,-8},{-72,-8},{ - -72,-10},{100,-10},{100,0},{117,0}}, - color={255,0,255})); - connect(On[5], vAV5.On) annotation (Line(points={{-110,-4},{-72,-4},{ - -72,-10},{148,-10},{148,0},{157,0}}, - color={255,0,255})); - connect(On[1], vAV1.On) annotation (Line(points={{-110,-20},{-72,-20},{ - -72,0},{-11,0}}, - color={255,0,255})); - connect(yVal[1], vAV1.yVal) annotation (Line(points={{-110,52},{-34,52},{-34,12}, - {-11,12}}, color={0,0,127})); - connect(yVal[2], vAV2.yVal) annotation (Line(points={{-110,56},{20,56},{20,12}, - {29,12}}, color={0,0,127})); - connect(yVal[3], vAV3.yVal) annotation (Line(points={{-110,60},{64,60},{64,12}, - {71,12}}, color={0,0,127})); - connect(yVal[4], vAV4.yVal) annotation (Line(points={{-110,64},{110,64},{110,12}, - {117,12}}, color={0,0,127})); - connect(yVal[5], vAV5.yVal) annotation (Line(points={{-110,68},{-4,68},{-4,62}, - {150,62},{150,12},{157,12}}, color={0,0,127})); - connect(airFloRatSet[1], vAV1.airFloRatSet) annotation (Line(points={{-110, - 78},{-30,78},{-30,16},{-11,16}}, color={0,0,127})); - connect(airFloRatSet[2], vAV2.airFloRatSet) annotation (Line(points={{-110, - 82},{18,82},{18,16},{29,16}}, color={0,0,127})); - connect(airFloRatSet[3], vAV3.airFloRatSet) annotation (Line(points={{-110, - 86},{62,86},{62,16},{71,16}}, color={0,0,127})); - connect(airFloRatSet[4], vAV4.airFloRatSet) annotation (Line(points={{-110, - 90},{108,90},{108,16},{117,16}}, color={0,0,127})); - connect(airFloRatSet[5], vAV5.airFloRatSet) annotation (Line(points={{-110, - 94},{148,94},{148,16},{157,16}}, color={0,0,127})); - connect(vAV1.port_a_Wat, ReheatWatNet.ports_b[1]) annotation (Line( - points={{-8,18},{-10,18},{-10,44.62},{-46,44.62}}, - color={238,46,47}, - thickness=0.5)); - connect(vAV2.port_a_Wat, ReheatWatNet.ports_b[2]) annotation (Line( - points={{32,18},{32,38},{-46,38},{-46,41.9}}, - color={238,46,47}, - thickness=0.5)); - connect(vAV3.port_a_Wat, ReheatWatNet.ports_b[3]) annotation (Line( - points={{74,18},{74,32},{-46,32},{-46,39.18}}, - color={238,46,47}, - thickness=0.5)); - connect(vAV4.port_a_Wat, ReheatWatNet.ports_b[4]) annotation (Line( - points={{120,18},{118,18},{118,36.46},{-46,36.46}}, - color={238,46,47}, - thickness=0.5)); - connect(vAV5.port_a_Wat, ReheatWatNet.ports_b[5]) annotation (Line( - points={{160,18},{162,18},{162,33.74},{-46,33.74}}, - color={238,46,47}, - thickness=0.5)); - connect(vAV1.port_b_Wat, ReheatWatNet.ports_a[1]) annotation (Line( - points={{-2,18},{-2,62.98},{-46,62.98}}, - color={238,46,47}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV2.port_b_Wat, ReheatWatNet.ports_a[2]) annotation (Line( - points={{38,18},{40,18},{40,60.26},{-46,60.26}}, - color={238,46,47}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV3.port_b_Wat, ReheatWatNet.ports_a[3]) annotation (Line( - points={{80,18},{80,54},{-46,54},{-46,57.54}}, - color={238,46,47}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV4.port_b_Wat, ReheatWatNet.ports_a[4]) annotation (Line( - points={{126,18},{126,54.82},{-46,54.82}}, - color={238,46,47}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV5.port_b_Wat, ReheatWatNet.ports_a[5]) annotation (Line( - points={{166,18},{166,52},{-46,52},{-46,52.1}}, - color={238,46,47}, - thickness=0.5, - pattern=LinePattern.Dash)); - connect(vAV1.port_a, AirNetWor.ports_b[1]) annotation (Line( - points={{-10,8},{-28,8},{-28,-32.62},{-44,-32.62}}, - color={0,127,0}, - thickness=0.5)); - connect(vAV2.port_a, AirNetWor.ports_b[2]) annotation (Line( - points={{30,8},{16,8},{16,-30},{-16,-30},{-16,-29.9},{-44,-29.9}}, - color={0,127,0}, - thickness=0.5)); - connect(vAV3.port_a, AirNetWor.ports_b[3]) annotation (Line( - points={{72,8},{58,8},{58,-28},{-44,-28},{-44,-27.18}}, - color={0,127,0}, - thickness=0.5)); - connect(vAV4.port_a, AirNetWor.ports_b[4]) annotation (Line( - points={{118,8},{108,8},{108,-24.46},{-44,-24.46}}, - color={0,127,0}, - thickness=0.5)); - connect(vAV5.port_a, AirNetWor.ports_b[5]) annotation (Line( - points={{158,8},{146,8},{146,-21.74},{-44,-21.74}}, - color={0,127,0}, - thickness=0.5)); - - connect(yDamMea.y, yDam) annotation (Line(points={{191,54},{210,54}}, - color={0,0,127})); - connect(yReaValMea.y, yReaHea) - annotation (Line(points={{191,28},{210,28}}, color={0,0,127})); - connect(Vflow_setMea.y, Vflow_set) - annotation (Line(points={{191,-40},{210,-40}}, color={0,0,127})); - connect(Vflow_Mea.y, Vflow) - annotation (Line(points={{191,-60},{210,-60}}, color={0,0,127})); - connect(TSupMea.y, TSup) - annotation (Line(points={{191,-84},{210,-84}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line(points={{-90,40},{80,40}}, color={0,127,255}), - Line(points={{-90,-60},{80,-60}}, color={0,127,255}), - Line(points={{80,40},{80,-60}}, color={0,127,255}), - Line(points={{50,40},{50,-60}}, color={0,127,255}), - Line(points={{20,40},{20,-60}}, color={0,127,255}), - Line(points={{-10,40},{-10,-60}}, color={0,127,255}), - Line(points={{-40,40},{-40,-60}}, color={0,127,255}), - Rectangle( - extent={{-46,0},{-34,-20}}, - lineColor={28,108,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-16,0},{-4,-20}}, - lineColor={28,108,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{14,0},{26,-20}}, - lineColor={28,108,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{44,0},{56,-20}}, - lineColor={28,108,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{74,0},{86,-20}}, - lineColor={28,108,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Line(points={{-40,90},{-40,60}}, color={255,0,0}), - Line(points={{-60,60},{-40,60}}, color={255,0,0}), - Line(points={{-60,60},{-60,-12}}, color={255,0,0}), - Line(points={{64,20},{-60,20}}, color={255,0,0}), - Line(points={{-24,20},{-24,-12}}, color={255,0,0}), - Line(points={{6,20},{6,-12}}, color={255,0,0}), - Line(points={{36,20},{36,-12}}, color={255,0,0}), - Line(points={{64,20},{64,-12}}, color={255,0,0}), - Line(points={{-60,-12},{-46,-12}}, color={255,0,0}), - Line(points={{-24,-12},{-16,-12}}, color={255,0,0}), - Line(points={{6,-12},{14,-12}}, color={255,0,0}), - Line(points={{36,-12},{44,-12}}, color={255,0,0}), - Line(points={{64,-12},{74,-12}}, color={255,0,0}), - Line(points={{90,-32},{-36,-32}}, color={255,0,0}), - Line(points={{-36,-20},{-36,-32}}, color={255,0,0}), - Line(points={{-6,-20},{-6,-32}}, color={255,0,0}), - Line(points={{24,-20},{24,-32}}, color={255,0,0}), - Line(points={{54,-20},{54,-32}}, color={255,0,0}), - Line(points={{84,-20},{84,-32}}, color={255,0,0}), - Line(points={{90,60},{90,-32}}, color={255,0,0}), - Line(points={{40,60},{90,60}}, color={255,0,0}), - Line(points={{40,90},{40,60}}, color={255,0,0}), - Text( - extent={{-148,-110},{152,-70}}, - textColor={0,0,255}, - textString="%name")}), - Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {200,100}})), - Documentation(info=" -

A hot water reheat coil is installed in each VAV terminal. The components and control systems of the VAV is shown in the figure below:

-

-

The controller for terminal VAV box is based on the "single maximum VAV reheat control logic".

- -

VAV damper position is controlled by a PI controller to maintain the air flow rate at setpoint. Heating coil valve position is controlled by a PI controller to maintain the supply air temperature at setpoint.

-

See the model -MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal for a description of the VAV terminal model.

-", revisions = " - -")); - end FiveZoneVAV; - - model VAVTerminal "The model of the VAV terminals" - parameter String zonNam "Zone designation, required if KPIs is AirZoneTemperature, - RadiativeZoneTemperature, OperativeZoneTemperature, RelativeHumidity, - or CO2Concentration"; - replaceable package MediumAir = - Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - replaceable package MediumWat = - Modelica.Media.Interfaces.PartialMedium "Medium for the water"; - parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.MassFlowRate mWatFloRat "mass flow rate for air"; - parameter Modelica.Units.SI.Pressure PreDroAir - "Pressure drop in the air side"; - parameter Modelica.Units.SI.Pressure PreDroWat - "Pressure drop in the water side"; - parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 - "Heat exchanger effectiveness"; - - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage dam( - redeclare package Medium = MediumAir, - m_flow_nominal=mAirFloRat, - dpValve_nominal=PreDroAir, - riseTime=15, - y_start=0.3) annotation (Placement(transformation(extent={{-12,-10}, - {8,10}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TEnt(redeclare package Medium = - MediumAir) annotation (Placement(transformation(extent= - {{-88,-10},{-68,10}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort TLea( - redeclare package Medium = MediumAir, - m_flow_nominal=mAirFloRat, - tau=1, - transferHeat=true) - annotation (Placement(transformation(extent={{26,10},{46,-10}}))); - Modelica.Fluid.Sensors.MassFlowRate m_flow(redeclare package Medium = - MediumAir) - annotation (Placement(transformation(extent={{56,-10},{76,10}}))); - Modelica.Fluid.Sensors.Pressure pEnt(redeclare package Medium = - MediumAir) annotation (Placement(transformation(extent={{-16, - -20},{-36,-40}}))); - Modelica.Fluid.Sensors.Pressure pLea(redeclare package Medium = - MediumAir) annotation (Placement(transformation(extent={{30,-20}, - {10,-40}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = - MediumAir) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = - MediumAir) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Coil.BaseClasses.DryCoil heaCoil( - redeclare package MediumAir = MediumAir, - redeclare package MediumWat = MediumWat, - mAirFloRat=mAirFloRat, - mWatFloRat=mWatFloRat, - PreDroWat=0, - eps=eps, - PreDroAir=0) - annotation (Placement(transformation(extent={{-40,-4},{-60,16}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-90,90},{-70,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package - Medium = - MediumWat) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-30,90},{-10,110}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI - pI( - yMin=0.3, - k=0.02, - Ti=120) - annotation (Placement(transformation(extent={{10,70},{30,90}}))); - Modelica.Blocks.Math.Gain gain(k=1/mAirFloRat/1.25) - annotation (Placement(transformation( - extent={{4,-4},{-4,4}}, - rotation=-90, - origin={66,24}))); - Modelica.Blocks.Interfaces.RealInput airFloRatSet - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-120,70},{-100,90}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage rehVal( - redeclare package Medium = MediumWat, - m_flow_nominal=mWatFloRat, - dpValve_nominal=PreDroWat, - y_start=0.01) annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=-90, - origin={-20,42}))); - Modelica.Blocks.Interfaces.RealInput yVal - "Actuator position (0: closed, 1: open)" - annotation (Placement(transformation(extent={{-120,30},{-100,50}}))); - Modelica.Blocks.Interfaces.RealOutput TAirLea - "Temperature of the passing fluid" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); - Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-120,-90},{-100,-70}}))); - Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=true) - annotation (Placement(transformation(extent={{-60,76},{-40,96}}))); - ReadOverwrite.WriteZoneLoc oveZonLoc(zonNam=zonNam) - annotation (Placement(transformation(extent={{-68,40},{-48,60}}))); - equation - connect(TEnt.port_a, port_a) annotation (Line( - points={{-88,0},{-88,0},{-100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(dam.port_b, TLea.port_a) annotation (Line( - points={{8,0},{26,0}}, - color={0,140,72}, - thickness=0.5)); - connect(TLea.port_b, m_flow.port_a) annotation (Line( - points={{46,0},{56,0}}, - color={0,140,72}, - thickness=0.5)); - connect(pLea.port, TLea.port_a) annotation (Line( - points={{20,-20},{20,0},{26,0}}, - color={0,140,72}, - thickness=0.5)); - connect(pEnt.port, dam.port_a) annotation (Line( - points={{-26,-20},{-26,0},{-12,0}}, - color={0,140,72}, - thickness=0.5)); - connect(m_flow.m_flow, gain.u) annotation (Line( - points={{66,11},{66,19.2}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(gain.y,pI.mea) annotation (Line( - points={{66,28.4},{66,52},{0,52},{0,74},{8,74}}, - color={0,0,127})); - connect(pI.set, airFloRatSet) - annotation (Line(points={{8,80},{-110,80}}, color={0,0,127})); - connect(rehVal.port_b, port_b_Wat) annotation (Line( - points={{-20,52},{-20,100}}, - color={255,0,0}, - thickness=1)); - connect(heaCoil.port_a_Air, TEnt.port_b) annotation (Line( - points={{-60,0},{-64,0},{-68,0}}, - color={0,140,72}, - thickness=0.5)); - connect(heaCoil.port_b_Air,dam. port_a) - annotation (Line(points={{-40,0},{-26,0},{-12,0}}, - color={0,140,72}, - thickness=0.5)); - connect(rehVal.port_a, heaCoil.port_b_Wat) annotation (Line( - points={{-20,32},{-22,32},{-22,28},{-60,28},{-60,12}}, - color={255,0,0}, - thickness=1)); - connect(heaCoil.port_a_Wat, port_a_Wat) annotation (Line( - points={{-40,12},{-40,36},{-80,36},{-80,100}}, - color={255,0,0}, - thickness=1)); - connect(booleanExpression.y, pI.On) annotation (Line( - points={{-39,86},{8,86}}, - color={255,0,255})); - connect(TLea.T, TAirLea) annotation (Line(points={{36,-11},{36,-60}, - {110,-60}}, color={0,0,127})); - connect(m_flow.port_b, port_b) annotation (Line( - points={{76,0},{88,0},{88,0},{100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(oveZonLoc.yReaHea_out, rehVal.y) annotation (Line(points={{-47,46}, - {-40,46},{-40,42},{-32,42}}, color={0,0,127})); - connect(yVal, oveZonLoc.yReaHea_in) annotation (Line(points={{-110,40}, - {-90,40},{-90,46},{-70,46}}, - color={0,0,127})); - connect(pI.y, oveZonLoc.yDam_in) annotation (Line(points={{31,80},{34, - 80},{34,68},{-78,68},{-78,54},{-70,54}}, - color={0,0,127})); - connect(oveZonLoc.yDam_out,dam. y) - annotation (Line(points={{-47,54},{-2,54},{-2,12}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{102,-100}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-90,0},{90,0}}, - color={255,255,255}, - pattern=LinePattern.Dash), - Text( - extent={{-60,58},{68,-66}}, - lineColor={0,0,0}, - pattern=LinePattern.Dash, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - textString="VAV"), - Text( - extent={{-144,118},{156,158}}, - textString="%name", - textColor={0,0,255})}), Diagram( - coordinateSystem(preserveAspectRatio=false))); - end VAVTerminal; - - package Control - - model ZonCon "Zone terminal VAV controller" - parameter Real MinFlowRateSetPoi "Minimum flow rate ratio"; - parameter Real HeatingFlowRateSetPoi "constant flow rate ratio during heating mode"; - Buildings.Controls.Continuous.LimPID cooCon( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - k=0.1, - Ti=60, - yMin=MinFlowRateSetPoi, - reverseActing=false) - annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - Buildings.Controls.Continuous.LimPID heaCon( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - Ti=60, - k=0.01, - reverseActing=true) - annotation (Placement(transformation(extent={{50,-70},{70, - -50}}))); - Modelica.Blocks.Interfaces.RealInput T - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealInput TCooSet - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput THeaSet - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Interfaces.RealOutput yAirFlowSet - "Connector of actuator output signal" annotation (Placement( - transformation(extent={{100,-30},{120,-10}}), - iconTransformation(extent={{100,-30},{120,-10}}))); - Modelica.Blocks.Interfaces.RealOutput yValPos - "Connector of actuator output signal" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}), - iconTransformation(extent={{100,-70},{120,-50}}))); - Modelica.Blocks.Logical.Switch swi - "Switch between external signal and direct feedthrough signal" - annotation (Placement(transformation(extent={{50,10},{70,30}}))); - Modelica.Blocks.Sources.Constant const(k=HeatingFlowRateSetPoi) - annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); - Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=0, uHigh=0.5) - annotation (Placement(transformation(extent={{-26,10},{-6,30}}))); - Modelica.Blocks.Math.Add add(k2=-1) - annotation (Placement(transformation(extent={{-56,10},{-36,30}}))); - Modelica.Blocks.Interfaces.RealOutput yCoo - "Connector of actuator output signal" annotation (Placement( - transformation(extent={{100,70},{120,90}}))); - Modelica.Blocks.Interfaces.RealOutput yHea - "Connector of actuator output signal" annotation (Placement( - transformation(extent={{100,30},{120,50}}))); - equation - connect(cooCon.y, swi.u1) annotation (Line(points={{11,60},{34,60}, - {34,28},{48,28}}, - color={0,0,127})); - connect(const.y, swi.u3) annotation (Line( - points={{21,-20},{34,-20},{34,12},{48,12}}, - color={0,0,127})); - connect(add.y, hysteresis.u) annotation (Line( - points={{-35,20},{-28,20}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(hysteresis.y, swi.u2) annotation (Line( - points={{-5,20},{48,20}}, - color={255,0,255})); - connect(TCooSet, cooCon.u_s) - annotation (Line(points={{-120,60},{-12,60}}, color={0,0,127})); - connect(T, add.u1) annotation (Line(points={{-120,0},{-80,0},{-80, - 26},{-58,26}}, color={0,0,127})); - connect(T, cooCon.u_m) annotation (Line(points={{-120,0},{0,0},{0, - 48}}, color={0,0,127})); - connect(T, heaCon.u_m) annotation (Line(points={{-120,0},{-40,0},{ - -40,-80},{60,-80},{60,-72}}, color={0,0,127})); - connect(THeaSet, heaCon.u_s) - annotation (Line(points={{-120,-60},{48,-60}}, color={0,0,127})); - connect(THeaSet, add.u2) annotation (Line(points={{-120,-60},{-72,-60}, - {-72,14},{-58,14}}, color={0,0,127})); - connect(heaCon.y, yValPos) - annotation (Line(points={{71,-60},{110,-60}}, color={0,0,127})); - connect(swi.y, yAirFlowSet) annotation (Line(points={{71,20},{84,20}, - {84,-20},{110,-20}}, color={0,0,127})); - connect(cooCon.y, yCoo) annotation (Line(points={{11,60},{34,60},{ - 34,80},{110,80}}, color={0,0,127})); - connect(heaCon.y, yHea) annotation (Line(points={{71,-60},{80,-60}, - {80,40},{110,40}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-154,112},{146,152}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false)), - Documentation(info=" -

This is the zone terminal VAV controller. It takes the temperature measurements and cooling/heating setpoints as inputs. It takes the zone heating/cooling mode, discharge airflow setpoint, VAV damper position as the output.

-", revisions = " - -")); - end ZonCon; - - end Control; - end ZoneTerminal; - end AirSide; - - package FlowMover "\"Component used for modelling fans and pumps\"" - model VariableSpeedMover - "The component contains both the variable speed fan/pump and the controller" - import BuildingControlEmulator = - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; - extends BaseClasses.FlowMover(withoutMotor(varSpeFloMov(riseTime=240))); - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - - BuildingControlEmulator.conPI variableSpeed - annotation (Placement(transformation(extent={{-60,44},{-40,64}}))); - Modelica.Blocks.Interfaces.RealInput SetPoi - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); - Modelica.Blocks.Interfaces.RealInput Mea - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - equation - connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( - points={{-18,0},{-60,0}}, - color={0,127,255}, - thickness=1)); - connect(temEnt.port_a, port_a) annotation (Line( - points={{-80,0},{-100,0}}, - color={0,127,255}, - thickness=1)); - connect(withoutMotor.port_b, temLea.port_a) annotation (Line( - points={{2,0},{30,0}}, - color={0,127,255}, - thickness=1)); - connect(temLea.port_b, masFloRat.port_a) annotation (Line( - points={{50,0},{60,0}}, - color={0,127,255}, - thickness=1)); - connect(masFloRat.port_b, port_b) annotation (Line( - points={{80,0},{100,0}}, - color={0,127,255}, - thickness=1)); - connect(preEnt.port, temEnt.port_b) annotation (Line( - points={{-42,-20},{-42,0},{-60,0}}, - color={0,127,255}, - thickness=1)); - connect(preLea.port, temLea.port_a) annotation (Line( - points={{20,-20},{20,0},{30,0}}, - color={0,127,255}, - thickness=1)); - connect(withoutMotor.P, P) annotation (Line( - points={{3,6},{12,6},{20,6},{20,40},{110,40}}, - color={0,0,127})); - connect(variableSpeed.y, withoutMotor.u) annotation (Line( - points={{-39,54},{-30,54},{-30,6},{-19,6}}, - color={0,0,127})); - connect(On, variableSpeed.On) annotation (Line( - points={{-120,60},{-62,60}}, - color={255,0,255})); - connect(variableSpeed.set, SetPoi) annotation (Line( - points={{-62,54},{-78,54},{-78,20},{-120,20}}, - color={0,0,127})); - connect(variableSpeed.mea, Mea) annotation (Line( - points={{-62,48},{-66,48},{-66,16},{-56,16},{-56,-60},{-120,-60}}, - color={0,0,127})); - annotation (Icon(graphics={ - Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, - 200}), - Text( - extent={{-30,24},{28,-28}}, - lineColor={28,108,200}, - textString="V")})); - end VariableSpeedMover; - - model VAVSupFan - "The AHU supply fan and the controller" - extends BaseClasses.FlowMover; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - parameter Modelica.Units.SI.Time waitTime(min=0) = 0 - "Wait time before transition fires"; - parameter Real SpeRat - "Speed ratio"; - parameter Integer numTemp(min=1) = 1 - "The size of the temeprature vector"; - Control.VAVDualFanControl varSpe( - k=k, - Ti=Ti, - waitTime=waitTime) - annotation (Placement(transformation(extent={{-60,44},{-40,64}}))); - Modelica.Blocks.Interfaces.RealInput pSet - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); - Modelica.Blocks.Interfaces.RealInput pMea - "Connector of measurement input signal" annotation (Placement( - transformation(extent={{-140,-120},{-100,-80}}))); - Modelica.Blocks.Interfaces.RealOutput yRet "Output signal connector" - annotation (Placement(transformation(extent={{100,-92},{120,-72}}))); - Control.TemperatureCheck TChe(numTemp=numTemp) - annotation (Placement(transformation(extent={{-92,-50},{-72,-30}}))); - Modelica.Blocks.Interfaces.RealInput T[numTemp] - "Connector of setpoint input signal" annotation (Placement( - transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Interfaces.RealInput cooTSet[numTemp] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); - Modelica.Blocks.Interfaces.RealInput heaTSet[numTemp] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,80},{-100,120}}))); - Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeSupFan( - description="AHU supply fan speed control signal", u( - min=0, - max=1, - unit="1")) - annotation (Placement(transformation(extent={{-26,44},{-6,64}}))); - Modelica.Blocks.Math.Gain gain(k=SpeRat) - annotation (Placement(transformation(extent={{16,50},{24,58}}))); - equation - connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( - points={{-18,0},{-60,0}}, - color={0,140,72}, - thickness=0.5)); - connect(temEnt.port_a, port_a) annotation (Line( - points={{-80,0},{-100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(withoutMotor.port_b, temLea.port_a) annotation (Line( - points={{2,0},{30,0}}, - color={0,140,72}, - thickness=0.5)); - connect(temLea.port_b, masFloRat.port_a) annotation (Line( - points={{50,0},{60,0}}, - color={0,140,72}, - thickness=0.5)); - connect(masFloRat.port_b, port_b) annotation (Line( - points={{80,0},{100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(preEnt.port, temEnt.port_b) annotation (Line( - points={{-42,-20},{-42,0},{-60,0}}, - color={0,140,72}, - thickness=0.5)); - connect(preLea.port, temLea.port_a) annotation (Line( - points={{20,-20},{20,0},{30,0}}, - color={0,140,72}, - thickness=0.5)); - connect(withoutMotor.P, P) annotation (Line( - points={{3,6},{12,6},{20,6},{20,40},{110,40}}, - color={0,0,127})); - connect(On, varSpe.On) - annotation (Line(points={{-120,60},{-62,60}}, color={255,0,255})); - connect(varSpe.SetPoi, pSet) annotation (Line(points={{-62,56},{-80,56}, - {-80,20},{-120,20}}, color={0,0,127})); - connect(varSpe.Mea, pMea) annotation (Line(points={{-62,52},{-66,52},{-66, - 16},{-56,16},{-56,-100},{-120,-100}}, color={0,0,127})); - connect(TChe.Temp, T) annotation (Line(points={{-94,-40},{-100,-40},{-100, - -60},{-120,-60}}, color={0,0,127})); - connect(TChe.On, varSpe.CyclingOn) annotation (Line(points={{-71,-40},{ - -68,-40},{-68,48},{-62,48}}, color={255,0,255})); - connect(TChe.CooSetPoi, cooTSet) annotation (Line(points={{-94,-34},{-98, - -34},{-98,-20},{-120,-20}}, color={0,0,127})); - connect(TChe.HeaSetPoi, heaTSet) annotation (Line(points={{-94,-46},{-98, - -46},{-98,-60},{-60,-60},{-60,34},{-88,34},{-88,100},{-120,100}}, - color={0,0,127})); - connect(varSpe.ySup, oveSpeSupFan.u) - annotation (Line(points={{-39,54},{-28,54}}, color={0,0,127})); - connect(oveSpeSupFan.y, withoutMotor.u) annotation (Line(points={{-5,54}, - {2,54},{2,26},{-30,26},{-30,6},{-19,6}}, color={0,0,127})); - connect(oveSpeSupFan.y, gain.u) - annotation (Line(points={{-5,54},{15.2,54}}, color={0,0,127})); - connect(gain.y, yRet) annotation (Line(points={{24.4,54},{32,54},{32, - -82},{110,-82}}, color={0,0,127})); - annotation (Icon(graphics={ - Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, - 200}), - Text( - extent={{-30,24},{28,-28}}, - lineColor={28,108,200}, - textString="V"), - Text( - extent={{-152,106},{148,146}}, - textString="%name", - textColor={0,0,255})})); - end VAVSupFan; - - package BaseClasses "\"Base classes for modelling fans or pumps\"" - partial model FlowMover - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; - parameter Real HydEff[:] "Hydraulic efficiency"; - parameter Real MotEff[:] "Motor efficiency"; - parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] - "Volume flow rate curve"; - parameter Modelica.Units.SI.Pressure PreCur[:] "Pressure curve"; - parameter Modelica.Units.SI.Time TimCon "Time constant for the fluid"; - WithoutMotor withoutMotor( - redeclare package Medium = Medium, - HydEff=HydEff, - MotEff=MotEff, - VolFloCur=VolFloCur, - PreCur=PreCur, - TimCon=TimCon) - annotation (Placement(transformation(extent={{-18,-10},{2,10}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temEnt(redeclare package - Medium = - Medium) - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort temLea(redeclare package - Medium = - Medium) - annotation (Placement(transformation(extent={{30,-10},{50,10}}))); - Modelica.Fluid.Sensors.MassFlowRate masFloRat(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{60,-10},{80,10}}))); - Modelica.Fluid.Sensors.Pressure preEnt(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-32,-20},{-52,-40}}))); - Modelica.Fluid.Sensors.Pressure preLea(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{30,-20},{10,-40}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Modelica.Blocks.Interfaces.RealOutput P "Electrical power consumed" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Modelica.Blocks.Interfaces.BooleanInput On "On-off signal" annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealOutput Rat - "Actual normalised pump speed that is used for computations" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); - equation - connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( - points={{-18,0},{-60,0}}, - color={0,127,255}, - thickness=1)); - connect(temEnt.port_a, port_a) annotation (Line( - points={{-80,0},{-100,0}}, - color={0,127,255}, - thickness=1)); - connect(withoutMotor.port_b, temLea.port_a) annotation (Line( - points={{2,0},{30,0}}, - color={0,127,255}, - thickness=1)); - connect(temLea.port_b, masFloRat.port_a) annotation (Line( - points={{50,0},{60,0}}, - color={0,127,255}, - thickness=1)); - connect(masFloRat.port_b, port_b) annotation (Line( - points={{80,0},{100,0}}, - color={0,127,255}, - thickness=1)); - connect(preEnt.port, temEnt.port_b) annotation (Line( - points={{-42,-20},{-42,0},{-60,0}}, - color={0,127,255}, - thickness=1)); - connect(preLea.port, temLea.port_a) annotation (Line( - points={{20,-20},{20,0},{30,0}}, - color={0,127,255}, - thickness=1)); - connect(withoutMotor.P, P) annotation (Line( - points={{3,6},{12,6},{20,6},{20,40},{110,40}}, - color={0,0,127})); - connect(withoutMotor.Rat, Rat) annotation (Line( - points={{3,-6},{12,-6},{12,-60},{110,-60}}, - color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, - 200}), - Ellipse( - extent={{-80,80},{80,-80}}, - lineColor={28,108,200})}), Diagram(coordinateSystem( - preserveAspectRatio=false))); - end FlowMover; - - model WithoutMotor - "Model for fans or pumps where motors are not explicitly modelled" - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; - parameter Real HydEff[:] "Hydraulic efficiency"; - parameter Real MotEff[:] "Motor efficiency"; - parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] - "Volume flow rate curve"; - parameter Modelica.Units.SI.Pressure PreCur[:] "Pressure curve"; - parameter Modelica.Units.SI.Time TimCon "Time constant for the fluid"; - Buildings.Fluid.Movers.SpeedControlled_y varSpeFloMov( - redeclare package Medium = Medium, - per( - pressure(V_flow=VolFloCur, dp=PreCur), - hydraulicEfficiency(eta=HydEff, V_flow=VolFloCur), - motorEfficiency(eta=MotEff, V_flow=VolFloCur)), - tau=TimCon, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - use_inputFilter=false) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - - Modelica.Blocks.Interfaces.RealInput u "control signal" - annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); - Modelica.Blocks.Interfaces.RealOutput P "Electrical power consumed" - annotation (Placement(transformation(extent={{100,50},{120,70}}))); - Modelica.Blocks.Interfaces.RealOutput Rat - "Actual normalised pump speed that is used for computations" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); - equation - connect(varSpeFloMov.port_a, port_a) - annotation (Line( - points={{-10,0},{-10,0},{-100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(varSpeFloMov.port_b, port_b) - annotation (Line( - points={{10,0},{56,0},{100,0}}, - color={0,140,72}, - thickness=0.5)); - connect(varSpeFloMov.P, P) annotation (Line( - points={{11,9},{40,9},{40,60},{110,60}}, - color={0,0,127})); - connect(varSpeFloMov.y_actual, Rat) annotation (Line( - points={{11,7},{40,7},{40,-60},{110,-60}}, - color={0,0,127})); - connect(u,varSpeFloMov. y) annotation (Line(points={{-110,60},{0,60}, - {0,12}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, - 200}), - Ellipse( - extent={{-80,80},{80,-80}}, - lineColor={28,108,200}), - Text( - extent={{-30,24},{28,-28}}, - lineColor={28,108,200}, - textString="NoMotor"), - Text( - extent={{-150,108},{150,148}}, - textString="%name", - textColor={0,0,255})}), Diagram( - coordinateSystem(preserveAspectRatio=false))); - end WithoutMotor; - - end BaseClasses; - - package Control - model CyclingOn - "\"Controller for constant speed fans or pumps\"" - parameter Modelica.Units.SI.Time waitTime(min=0) = 0 - "Wait time before transition fires"; - - Modelica.StateGraph.StepWithSignal On(nOut=2, nIn=1) - annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={56,-44}))); - Modelica.StateGraph.InitialStepWithSignal Off(nIn=2, nOut=1) - annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=-90, - origin={54,42}))); - inner Modelica.StateGraph.StateGraphRoot stateGraphRoot - annotation (Placement(transformation(extent={{-80,72},{-60,92}}))); - Modelica.StateGraph.TransitionWithSignal transitionWithSignal(enableTimer=true, waitTime= - waitTime) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=-90, - origin={0,-40}))); - Modelica.StateGraph.TransitionWithSignal transitionWithSignal1 annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=-90, - origin={54,0}))); - Modelica.Blocks.Interfaces.BooleanInput CyclingOn - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Logical.Not not1 - annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); - Modelica.Blocks.Interfaces.BooleanOutput OnSigOut - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput OnSigIn - annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); - Modelica.Blocks.Logical.And and1 - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - Modelica.StateGraph.TransitionWithSignal transitionWithSignal2(waitTime= - waitTime, enableTimer=false) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=-90, - origin={-22,48}))); - Modelica.Blocks.Logical.Not not2 - annotation (Placement(transformation(extent={{-60,38},{-40,58}}))); - equation - connect(transitionWithSignal.inPort, On.outPort[1]) annotation (Line( - points={{-6.66134e-016,-44},{-6.66134e-016,-80},{55.75,-80},{55.75,-54.5}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(transitionWithSignal.outPort, Off.inPort[1]) annotation (Line( - points={{2.22045e-016,-38.5},{0,-38.5},{0,60},{53.5,60},{53.5,53}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - - connect(Off.outPort[1], transitionWithSignal1.inPort) annotation (Line( - points={{54,31.5},{54,20},{54,4}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(transitionWithSignal1.outPort, On.inPort[1]) annotation (Line( - points={{54,-1.5},{54,-12},{54,-33},{56,-33}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(not1.y, transitionWithSignal.condition) annotation (Line( - points={{-39,-40},{-12,-40}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(not1.u, CyclingOn) annotation (Line( - points={{-62,-40},{-96,-40},{-96,0},{-120,0}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(On.active, OnSigOut) annotation (Line( - points={{67,-44},{67,-44},{80,-44},{80,0},{110,0}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(and1.u1, OnSigIn) annotation (Line( - points={{-62,0},{-86,0},{-86,40},{-120,40}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(and1.u2, CyclingOn) annotation (Line( - points={{-62,-8},{-90,-8},{-90,0},{-120,0}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(and1.y, transitionWithSignal1.condition) annotation (Line( - points={{-39,0},{-39,0},{-8,0},{42,0}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(transitionWithSignal2.inPort, On.outPort[2]) annotation (Line( - points={{-22,44},{-22,44},{-22,42},{-22,36},{-22,-96},{56.25,-96},{56.25, - -54.5}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(transitionWithSignal2.outPort, Off.inPort[2]) annotation (Line( - points={{-22,49.5},{-22,49.5},{-22,74},{54.5,74},{54.5,53}}, - color={0,0,0}, - pattern=LinePattern.Dash)); - connect(OnSigIn, not2.u) annotation (Line( - points={{-120,40},{-86,40},{-86,48},{-62,48}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(not2.y, transitionWithSignal2.condition) annotation (Line( - points={{-39,48},{-39,48},{-34,48}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-66,50},{62,-48}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - textString="CyclingControl"), - Text( - extent={{-154,102},{146,142}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false))); - end CyclingOn; - - model VAVDualFanControl - import BuildingControlEmulator = - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block"; - parameter Modelica.Units.SI.Time waitTime(min=0) = 0 - "Wait time before transition fires"; - - BuildingControlEmulator.FlowMover.Control.CyclingOn cyclingOn(waitTime= - waitTime) - annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); - BuildingControlEmulator.conPI variableSpeed( - yMin=0.3, - k=k, - Ti=Ti, - conPID(y_reset=1)) - annotation (Placement(transformation(extent={{-60,36},{-40,56}}))); - Modelica.Blocks.Interfaces.BooleanInput On - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput SetPoi - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); - Modelica.Blocks.Interfaces.RealInput Mea - "Connector of measurement input signal" - annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); - Modelica.Blocks.Interfaces.RealOutput ySup "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput CyclingOn - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Logical.Not not1 - annotation (Placement(transformation(extent={{-62,0},{-42,20}}))); - Buildings.Controls.OBC.CDL.Continuous.Switch swi - annotation (Placement(transformation(extent={{12,28},{32,48}}))); - Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ - 120) "Ramp limiter for fan control signal" - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); - Buildings.Controls.OBC.CDL.Continuous.Limiter lim(uMax=1, uMin=0) - annotation (Placement(transformation(extent={{66,-10},{86,10}}))); - Modelica.Blocks.Math.BooleanToReal booToRea - annotation (Placement(transformation(extent={{-20,-40},{0,-20}}))); - equation - connect(variableSpeed.On, On) annotation (Line( - points={{-62,52},{-80,52},{-80,60},{-120,60}}, - color={255,0,255})); - connect(variableSpeed.mea, Mea) annotation (Line( - points={{-62,40},{-70,40},{-70,-20},{-120,-20}}, - color={0,0,127})); - connect(cyclingOn.CyclingOn, CyclingOn) annotation (Line( - points={{-62,-30},{-80,-30},{-80,-60},{-120,-60}}, - color={255,0,255})); - connect(not1.u, On) annotation (Line( - points={{-64,10},{-80,10},{-80,60},{-120,60}}, - color={255,0,255})); - connect(not1.y, cyclingOn.OnSigIn) annotation (Line( - points={{-41,10},{-24,10},{-24,-8},{-80,-8},{-80,-26},{-62,-26}}, - color={255,0,255})); - connect(variableSpeed.y, swi.u1) - annotation (Line(points={{-39,46},{10,46}}, color={0,0,127})); - connect(ramLim.y, lim.u) - annotation (Line(points={{62,0},{64,0}}, color={0,0,127})); - connect(lim.y, ySup) annotation (Line(points={{88,0},{110,0}}, - color={0,0,127})); - connect(ramLim.u, swi.y) annotation (Line(points={{38,0},{36,0},{36, - 38},{34,38}}, color={0,0,127})); - connect(SetPoi, variableSpeed.set) annotation (Line(points={{-120,20}, - {-74,20},{-74,46},{-62,46}}, color={0,0,127})); - connect(On, swi.u2) annotation (Line(points={{-120,60},{-80,60},{-80, - 28},{-20,28},{-20,38},{10,38}}, color={255,0,255})); - connect(cyclingOn.OnSigOut, booToRea.u) - annotation (Line(points={{-39,-30},{-22,-30}}, color={255,0,255})); - connect(booToRea.y, swi.u3) annotation (Line(points={{1,-30},{6,-30},{6, - 30},{10,30}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-66,50},{62,-48}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - textString="VAVDualFanControl"), - Text( - extent={{-154,102},{146,142}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false)), - experiment( - StartTime=15638400, - StopTime=16243200, - __Dymola_NumberOfIntervals=1440, - __Dymola_Algorithm="Cvode")); - end VAVDualFanControl; - - model TemperatureCheck "\"Controller for constant speed fans or pumps\"" - parameter Integer numTemp(min=1) = 1 - "The size of the temeprature vector"; - - Modelica.Blocks.Interfaces.RealInput Temp[numTemp] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.BooleanOutput On - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.RealInput CooSetPoi[numTemp] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput HeaSetPoi[numTemp] - "Connector of setpoint input signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - parameter Modelica.Units.SI.TemperatureDifference dTCycCon = 0.2 - "Temperature difference for trigerring the cycle control"; - algorithm - for i in 1:numTemp loop - if (Temp[i] > CooSetPoi[i] + dTCycCon) or (Temp[i] < HeaSetPoi[i] - dTCycCon) then - On := true; - break; - end if; - On := false; - end for; - - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-66,50},{62,-48}}, - lineColor={0,127,255}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - textString="CyclingControl"), - Text( - extent={{-156,106},{144,146}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false))); - end TemperatureCheck; - - end Control; - - package Pump - "This package contains the modules which can be used to simulate the primary chilled water pump, the condenser water pump and the secondary chilled water pump" - - model SimPumpSystem - "This model is used to simulate the primary chilled water pump and condenser water pump system" - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium water"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[n] - "Rated mass flow rate"; - - parameter Integer n= 2 - "the number of pumps"; - parameter Real Motor_eta[n,:] "Motor efficiency"; - parameter Real Hydra_eta[n,:] "Hydraulic efficiency"; - parameter Modelica.Units.SI.PressureDifference dp_nominal - "Nominal pressure raise"; - - Buildings.Fluid.Movers.FlowControlled_m_flow - pumConSpe[n](redeclare package - Medium = Medium, - m_flow_nominal=m_flow_nominal, - per( - use_powerCharacteristic=false, - motorEfficiency(eta=Motor_eta), - hydraulicEfficiency(eta=Hydra_eta)), - dp_nominal=dp_nominal) "Constant Speed pump" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Modelica.Blocks.Interfaces.RealInput On[n] "On signal" annotation (Placement(transformation(extent={{-118,51}, - {-100,69}}))); - - Modelica.Blocks.Interfaces.RealOutput P[n] - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Modelica.Blocks.Math.Gain gain[n](k=m_flow_nominal) - annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); - - equation - - for i in 1:n loop - connect(pumConSpe[i].port_a, port_a); - connect(pumConSpe[i].port_b, port_b); - connect(pumConSpe[i].P, P[i]); - - end for; - - connect(gain.u, On) - annotation (Line( - points={{-82,60},{-109,60}}, - color={0,0,127})); - connect(gain.y, pumConSpe.m_flow_in) annotation (Line(points={{-59,60},{-28,60},{0,60},{0,12}}, color={0,0,127})); - - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Text( - extent={{-40,-102},{46,-156}}, - lineColor={0,0,255}, - textString="%name"), - Ellipse( - extent={{-20,80},{20,40}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{16,60},{-8,48},{-8,70},{16,60}}, - lineColor={0,0,255}, - smooth=Smooth.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-100,0},{-40,0},{-40,60}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-40,60},{-20,60}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-40,0},{-16,0}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-40,0},{-40,-60},{-16,-60}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{20,60},{40,60},{40,-60},{14,-60}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{40,0},{14,0}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{40,0},{90,0}}, - color={0,0,255}, - smooth=Smooth.None), - Ellipse( - extent={{-20,20},{20,-20}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-20,-40},{20,-80}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{16,0},{-8,-12},{-8,10},{16,0}}, - lineColor={0,0,255}, - smooth=Smooth.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{16,-60},{-8,-72},{-8,-50},{16,-60}}, - lineColor={0,0,255}, - smooth=Smooth.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid)}), - Documentation(revisions=" - -")); - end SimPumpSystem; - - model PumpSystem "This model is used to simulate the secondary chilled water pump" - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium water"; - parameter Integer n= 2 - "the number of pumps"; - - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[n]; - parameter Real HydEff[n,:] "Hydraulic efficiency"; - parameter Real MotEff[n,:] "Motor efficiency"; - parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[n,:] - "Volume flow rate curve"; - parameter Modelica.Units.SI.Pressure PreCur[n,:] "Pressure curve"; - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor - pum[n]( - varSpeFloMov(addPowerToMedium=false), - redeclare package Medium = Medium, - HydEff=HydEff, - MotEff=MotEff, - VolFloCur=VolFloCur, - PreCur=PreCur, - TimCon=900) - annotation (Placement(transformation(extent={{-12,-10},{10,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Modelica.Blocks.Interfaces.RealInput speSig[n] "On signal" - annotation (Placement(transformation(extent={{-118,71},{-100,89}}))); - Modelica.Blocks.Interfaces.RealOutput speRat[n] - "Speed of the pump divided by the nominal value" - annotation (Placement(transformation(extent={{100,52},{120,72}}))); - Modelica.Blocks.Interfaces.RealOutput P[n] - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val[n](redeclare - package Medium = Medium, - m_flow_nominal=m_flow_nominal, - dpValve_nominal=dpValve_nominal) - annotation (Placement(transformation(extent={{42,-10},{62,10}}))); - BaseClasses.ValCon valCon(n=n) - annotation (Placement(transformation(extent={{-10,50},{10,70}}))); - parameter Modelica.Units.SI.PressureDifference dpValve_nominal[n] - "Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint"; - equation - - for i in 1:n loop - connect(pum[i].Rat,speRat [i]); - connect(pum[i].port_a, port_a); - connect(val[i].port_b, port_b); - connect(pum[i].P, P[i]); - connect(pum[i].port_b, val[i].port_a); - end for; - - connect(pum.u,speSig) annotation (Line( - points={{-13.1,6},{-80,6},{-80,80},{-109,80}}, - color={0,0,127})); - connect(valCon.On,speSig) annotation (Line( - points={{-10.9,60},{-60,60},{-60,80},{-109,80}}, - color={0,0,127})); - connect(valCon.y, val.y) annotation (Line( - points={{10.9,60},{52,60},{52,12}}, - color={0,0,127})); - annotation (Icon(graphics={ - Text( - extent={{-152,104},{148,144}}, - textString="%name", - textColor={0,0,255}), - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)})); - end PumpSystem; - - package Control - - model SecPumCon "This model is used for secondary chilled water pump control." - parameter Real tWai = 300 "Waiting time"; - - parameter Integer n=3 - "the number of pumps"; - WaterSide.Control.PumpStageN pumSta( - tWai=tWai, - thehol_up=0.9, - n=n, - thehol_down=0.6) - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - Modelica.Blocks.Interfaces.BooleanInput On "On signal" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput sta[n] "Speeds of pumps" - annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Interfaces.RealInput dpMea "Measured pressure drop" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Math.Product product[n] - annotation (Placement(transformation(extent={{20,40},{40,60}}))); - Modelica.Blocks.Interfaces.RealOutput y[n] "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - - Modelica.Blocks.Routing.Replicator replicator(nout=n) - annotation (Placement(transformation(extent={{56,-40},{76,-20}}))); - MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI - conPI(k=0.001, Ti=60) - annotation (Placement(transformation(extent={{18,-20},{38,0}}))); - Modelica.Blocks.Interfaces.RealInput dpSet - "Static differential pressure setpoint for the secondary pump" - annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); - equation - connect(pumSta.On, On) annotation (Line(points={{-52,8},{-66,8},{-80, - 8},{-80,80},{-120,80}}, color={255,0,255})); - connect(pumSta.sta, sta) annotation (Line(points={{-52,-8},{-80,-8},{ - -80,-80},{-120,-80}}, color={0,0,127})); - connect(product.y, y) annotation (Line( - points={{41,50},{60,50},{80,50},{80,0},{110,0}}, - color={0,0,127})); - connect(pumSta.y, product.u1) annotation (Line(points={{-29,0},{0,0}, - {0,56},{18,56}}, color={0,0,127})); - connect(replicator.y, product.u2) annotation (Line( - points={{77,-30},{90,-30},{90,-12},{58,-12},{58,24},{8,24},{8,44},{18,44}}, - color={0,0,127})); - - connect(conPI.On, On) annotation (Line( - points={{16,-4},{-20,-4},{-20,80},{-120,80}}, - color={255,0,255})); - connect(conPI.y, replicator.u) annotation (Line( - points={{39,-10},{46,-10},{46,-30},{54,-30}}, - color={0,0,127})); - connect(conPI.mea, dpMea) annotation (Line(points={{16,-16},{-92,-16}, - {-92,0},{-120,0}}, color={0,0,127})); - connect(conPI.set, dpSet) annotation (Line(points={{16,-10},{-20,-10}, - {-20,-40},{-120,-40}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-156,104},{144,144}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false))); - end SecPumCon; - - end Control; - - package BaseClasses - - model ValCon - parameter Integer n= 2 - "the number of pumps"; - - Modelica.Blocks.Interfaces.RealInput On[n] "On signal" annotation (Placement(transformation(extent={{-118,-9}, - {-100,9}}))); - Modelica.Blocks.Interfaces.RealOutput y[n] "On signal" - annotation (Placement(transformation(extent={{100,-9},{118,9}}))); - - equation - - for i in 1:n loop - y[i] =noEvent(if On[i]>0.01 then 1 else 0); - end for; - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-150,102},{150,142}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem( - preserveAspectRatio=false))); - end ValCon; - end BaseClasses; - - annotation (); - end Pump; - end FlowMover; - - package WaterSide "Basic modeld" - - package Boiler - - model MultiBoilers "The boiler system with N boilers and associated local controllers." - replaceable package MediumHW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the hot water side"; - parameter Modelica.Units.SI.Pressure dPHW_nominal - "Pressure difference at the chilled water side"; - parameter Modelica.Units.SI.MassFlowRate mHW_flow_nominal[:] - "Nominal mass flow rate at the chilled water side"; - parameter Modelica.Units.SI.Temperature THW_start - "The start temperature of chilled water side"; - parameter Modelica.Units.SI.TemperatureDifference dTHW_nominal - "Temperature difference between the outlet and inlet of the module"; - parameter Real eta[n,:] "Fan efficiency"; - Modelica.Blocks.Interfaces.RealInput On[n](min=0,max=1) "On signal" annotation (Placement(transformation(extent={{-118, - -31},{-100,-49}}))); - Modelica.Blocks.Interfaces.RealInput THWSet - "Temperature setpoint of the chilled water" - annotation (Placement(transformation(extent={{-118,31},{-100,49}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_HW(redeclare package - Medium = - MediumHW) - "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}), - iconTransformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_HW(redeclare package - Medium = - MediumHW) - "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,70},{110,90}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTHWEntChi( - allowFlowReversal=true, - redeclare package Medium = MediumHW, - m_flow_nominal=sum(mHW_flow_nominal)) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={50,80}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTHWLeaChi( - allowFlowReversal=true, - redeclare package Medium = MediumHW, - m_flow_nominal=sum(mHW_flow_nominal), - T_start=THW_start) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={52,-80}))); - Modelica.Blocks.Interfaces.RealOutput Rat[n] "compressor speed ratio" - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Boiler boi[n]( - redeclare package MediumHW = MediumHW, - dPHW_nominal=dPHW_nominal, - mHW_flow_nominal=mHW_flow_nominal, - dTHW_nominal=dTHW_nominal, - eta=eta, - each boi(T_nominal(displayUnit="K")), - THW=THW_start, - GaiPi=1, - tIntPi=60) - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - parameter Integer n - "Number of boilers"; - - equation - connect(senTHWEntChi.port_a, port_a_HW) annotation (Line( - points={{60,80},{100,80}}, - color={255,0,0}, - thickness=1)); - connect(senTHWLeaChi.port_b, port_b_HW) annotation (Line( - points={{62,-80},{100,-80}}, - color={255,0,0}, - thickness=1)); - connect(port_b_HW, port_b_HW) annotation (Line( - points={{100,-80},{100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - for i in 1:n loop - connect(boi[i].port_a_HW, senTHWEntChi.port_b); - connect(boi[i].port_b_CHW, senTHWLeaChi.port_a); - connect(boi[i].THWSet, THWSet); - connect(boi[i].On, On[i]); - end for; - connect(On, Rat) annotation (Line(points={{-109,-40},{110,-40}}, color={0,0,127})); - - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-28,80},{26,40}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-28,-40},{26,-80}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Line( - points={{40,-80},{102,-80}}, - color={255,0,0}), - Line( - points={{40,-80},{40,50},{26,50}}, - color={255,0,0}), - Line( - points={{26,-70},{40,-70}}, - color={255,0,0}), - Line( - points={{26,-48},{60,-48},{60,80}}, - color={255,0,0}), - Line( - points={{100,80},{60,80}}, - color={255,0,0}), - Line( - points={{26,72},{60,72}}, - color={255,0,0}), - Ellipse( - extent={{20,56},{30,44}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{22,54},{28,46}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,-64},{30,-76}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{22,-66},{28,-74}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,78},{30,66}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,-44},{30,-56}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-154,104},{146,144}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end MultiBoilers; - - model Boiler "Boiler" - replaceable package MediumHW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the hot water side"; - parameter Modelica.Units.SI.Pressure dPHW_nominal - "Pressure difference at the chilled water side"; - parameter Modelica.Units.SI.MassFlowRate mHW_flow_nominal - "Nominal mass flow rate at the chilled water side"; - parameter Modelica.Units.SI.Temperature THW - "The start temperature of chilled water side"; - parameter Modelica.Units.SI.TemperatureDifference dTHW_nominal - "Temperature difference between the outlet and inlet of the module"; - parameter Real GaiPi "Gain of the component PI controller"; - parameter Real tIntPi "Integration time of the component PI controller"; - parameter Real eta[:] "Fan efficiency"; - - BaseClasses.BoilerPolynomial boi( - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - redeclare package Medium = MediumHW, - m_flow_nominal=mHW_flow_nominal, - T_nominal=THW, - effCur=Buildings.Fluid.Types.EfficiencyCurves.Polynomial, - Q_flow_nominal=dTHW_nominal*mHW_flow_nominal*4200, - a=eta, - fue=Buildings.Fluid.Data.Fuels.NaturalGasLowerHeatingValue(), - dp_nominal=0) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={0,-38}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package - Medium = - MediumHW) - "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_HW(redeclare package - Medium = - MediumHW) - "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,70},{110,90}}), - iconTransformation(extent={{90,70},{110,90}}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTHWLea( - redeclare package Medium = MediumHW, - m_flow_nominal=mHW_flow_nominal, - T_start=THW) annotation (Placement(transformation(extent={{20,-90},{40,-70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCHW( - redeclare package Medium = MediumHW, - m_flow_nominal=mHW_flow_nominal, - dpValve_nominal=dPHW_nominal) - annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); - Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) - "True to enable compressor to operate, or false to disable the operation of the compressor" - annotation (Placement(transformation(extent={{-118,-50},{-100,-30}}), - iconTransformation(extent={{-140,-70},{-100,-30}}))); - Modelica.Blocks.Interfaces.RealInput THWSet - "Temperature setpoint of chilled water" annotation (Placement( - transformation(extent={{-118,30},{-100,50}}), iconTransformation(extent= - {{-140,10},{-100,50}}))); - - Buildings.Fluid.Sensors.TemperatureTwoPort senTHWEnt( - allowFlowReversal=true, - redeclare package Medium = MediumHW, - m_flow_nominal=mHW_flow_nominal) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={30,0}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloHW(redeclare package - Medium = - MediumHW) - annotation (Placement(transformation(extent={{72,-10},{54,10}}))); - Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = - MediumHW) - annotation (Placement(transformation(extent={{2,10},{22,30}}))); - Buildings.Fluid.Sensors.Pressure senPreHWLea(redeclare package Medium = - MediumHW) - annotation (Placement(transformation(extent={{78,-50},{98,-30}}))); - Modelica.Blocks.Math.RealToBoolean realToBoolean - annotation (Placement(transformation(extent={{-70,-18},{-54,-2}}))); - .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI - conPI(Ti=2400, k=1) - annotation (Placement(transformation(extent={{-64,30},{-44,50}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=boi.T) - annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); - equation - connect(senTHWLea.port_b, valCHW.port_a) - annotation (Line( - points={{40,-80},{60,-80}}, - color={255,0,0}, - thickness=1)); - connect(valCHW.port_b, port_b_CHW) annotation (Line( - points={{80,-80},{100,-80}}, - color={255,0,0}, - thickness=1)); - connect(senPreHWLea.port, port_b_CHW) annotation (Line( - points={{88,-50},{88,-50},{88,-80},{100,-80}}, - color={255,0,0}, - thickness=1)); - connect(senMasFloHW.port_b, senTHWEnt.port_a) annotation (Line( - points={{54,0},{47,0},{40,0}}, - color={255,0,0}, - thickness=1)); - connect(senMasFloHW.port_a, port_a_HW) annotation (Line( - points={{72,0},{80,0},{80,80},{100,80}}, - color={255,0,0}, - thickness=1)); - connect(senTHWEnt.port_b, boi.port_a) annotation (Line( - points={{20,0},{0,0},{0,-28}}, - color={255,0,0}, - thickness=1)); - connect(boi.port_b, senTHWLea.port_a) - annotation (Line( - points={{0,-48},{0,-80},{20,-80}}, - color={255,0,0}, - thickness=1)); - connect(senPreCWEnt.port, boi.port_a) annotation (Line( - points={{12,10},{12,0},{0,0},{0,-28},{6.10623e-016,-28}}, - color={255,0,0}, - thickness=1)); - connect(On, valCHW.y) annotation (Line( - points={{-109,-40},{-44,-40},{-44,-24},{70,-24},{70,-68}}, - color={0,0,127})); - - connect(realToBoolean.u, valCHW.y) annotation (Line( - points={{-71.6,-10},{-80,-10},{-80,-40},{-44,-40},{-44,-24},{70,-24},{70,-68}}, - color={0,0,127})); - connect(realToBoolean.y, conPI.On) annotation (Line( - points={{-53.2,-10},{-40,-10},{-40,10},{-80,10},{-80,46},{-66,46}}, - color={255,0,255})); - connect(conPI.set, THWSet) - annotation (Line(points={{-66,40},{-109,40}}, color={0,0,127})); - connect(conPI.y, boi.y) - annotation (Line( - points={{-43,40},{-8,40},{-8,-26}}, - color={0,0,127})); - connect(realExpression.y,conPI.mea) annotation (Line( - points={{-49,-30},{-30,-30},{-30,22},{-76,22},{-76,34},{-66,34}}, - color={0,0,127})); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Rectangle( - extent={{-54,50},{60,32}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-52,-50},{62,-68}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{0,72},{100,82}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-32,-10},{-42,-22},{-22,-22},{-32,-10}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-32,-10},{-42,0},{-22,0},{-32,-10}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-34,32},{-30,0}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-34,-22},{-30,-50}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{34,32},{38,-50}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{14,10},{58,-32}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{36,10},{18,-22},{54,-22},{36,10}}, - lineColor={255,170,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{0,-86},{100,-76}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid), - Text( - extent={{-152,106},{148,146}}, - textString="%name", - textColor={0,0,255})}), - Documentation(revisions=" - -")); - end Boiler; - - package BaseClasses - - model BoilerPolynomial - "Boiler with efficiency curve described by a polynomial of the temperature" - extends Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger( - redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol, - show_T=true, - final tau=VWat*rho_default/m_flow_nominal); - - parameter Modelica.Units.SI.Power Q_flow_nominal "Nominal heating power"; - parameter Modelica.Units.SI.Temperature T_nominal=353.15 - "Temperature used to compute nominal efficiency (only used if efficiency curve depends on temperature)"; - // Assumptions - parameter Buildings.Fluid.Types.EfficiencyCurves effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant - "Curve used to compute the efficiency"; - parameter Real a[:] = {0.9} "Coefficients for efficiency curve"; - - parameter Buildings.Fluid.Data.Fuels.Generic fue "Fuel type" - annotation (choicesAllMatching = true); - parameter Modelica.Units.SI.Efficiency eps(max=1) = 1 - "Heat exchanger effectiveness"; - parameter Modelica.Units.SI.ThermalConductance UA=0.05*Q_flow_nominal/30 - "Overall UA value"; - parameter Modelica.Units.SI.Volume VWat=1.5E-6*Q_flow_nominal - "Water volume of boiler" annotation (Dialog(tab="Dynamics", enable=not ( - energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); - parameter Modelica.Units.SI.Mass mDry=1.5E-3*Q_flow_nominal - "Mass of boiler that will be lumped to water heat capacity" annotation ( - Dialog(tab="Dynamics", enable=not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); - - Modelica.Units.SI.Efficiency eta=if effCur == Buildings.Fluid.Types.EfficiencyCurves.Constant - then a[1] elseif effCur == Buildings.Fluid.Types.EfficiencyCurves.Polynomial - then Buildings.Utilities.Math.Functions.polynomial(a=a, x=y) elseif - effCur == Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then - Buildings.Utilities.Math.Functions.quadraticLinear( - a=aQuaLin, - x1=y, - x2=T) else 0 "Boiler efficiency"; - Modelica.Units.SI.Power QFue_flow=y*Q_flow_nominal/eta_nominal - "Heat released by fuel"; - Modelica.Units.SI.Power QWat_flow=eta*QFue_flow*eps - "Heat transfer from gas into water"; - Modelica.Units.SI.MassFlowRate mFue_flow=QFue_flow/fue.h - "Fuel mass flow rate"; - Modelica.Units.SI.VolumeFlowRate VFue_flow=mFue_flow/fue.d - "Fuel volume flow rate"; - - Modelica.Blocks.Interfaces.RealInput y(min=0, max=1) "Part load ratio" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - - Modelica.Blocks.Interfaces.RealOutput T(final quantity="ThermodynamicTemperature", - final unit = "K", displayUnit = "degC", min=0) - annotation (Placement(transformation(extent={{100,70},{120,90}}))); - - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort - "Heat port, can be used to connect to ambient" - annotation (Placement(transformation(extent={{-10,62}, {10,82}}))); - Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapDry( - C=500*mDry, - T(start=T_start)) if not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) - "heat capacity of boiler metal" - annotation (Placement(transformation(extent={{-80,12},{-60,32}}))); - - protected - parameter Real eta_nominal(fixed=false) "Boiler efficiency at nominal condition"; - parameter Real aQuaLin[6] = if size(a, 1) == 6 then a else fill(0, 6) - "Auxiliary variable for efficiency curve because quadraticLinear requires exactly 6 elements"; - - Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo - annotation (Placement(transformation(extent={{-43,-40},{-23,-20}}))); - Modelica.Blocks.Sources.RealExpression Q_flow_in(y=QWat_flow) - annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); - Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temSen - "Temperature of fluid" - annotation (Placement(transformation(extent={{0,30},{20,50}}))); - - Modelica.Thermal.HeatTransfer.Components.ThermalConductor UAOve(G=UA) - "Overall thermal conductance (if heatPort is connected)" - annotation (Placement(transformation(extent={{-48,10},{-28,30}}))); - - initial equation - if effCur == Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then - assert(size(a, 1) == 6, - "The boiler has the efficiency curve set to 'Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear', - and hence the parameter 'a' must have exactly 6 elements. - However, only " + String(size(a, 1)) + " elements were provided."); - end if; - - if effCur ==Buildings.Fluid.Types.EfficiencyCurves.Constant then - eta_nominal = a[1]; - elseif effCur ==Buildings.Fluid.Types.EfficiencyCurves.Polynomial then - eta_nominal = Buildings.Utilities.Math.Functions.polynomial( - a=a, x=1); - elseif effCur ==Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then - // For this efficiency curve, a must have 6 elements. - eta_nominal = Buildings.Utilities.Math.Functions.quadraticLinear( - a=aQuaLin, x1=1, x2=T_nominal); - else - eta_nominal = 999; - end if; - - equation - - assert(eta > 0.001, "Efficiency curve is wrong."); - - connect(UAOve.port_b, vol.heatPort) annotation (Line( - points={{-28,20},{-22,20},{-22,-10},{-9,-10}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(UAOve.port_a, heatPort) annotation (Line( - points={{-48,20},{-52,20},{-52,60},{0,60},{0,72}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(heaCapDry.port, vol.heatPort) annotation (Line( - points={{-70,12},{-70,-10},{-9,-10}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(temSen.T, T) annotation (Line( - points={{21,40},{60,40},{60,80},{110,80}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(preHeaFlo.port, vol.heatPort) annotation (Line( - points={{-23,-30},{-15,-30},{-15,-10},{-9,-10}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(Q_flow_in.y,preHeaFlo. Q_flow) annotation (Line( - points={{-59,-30},{-43,-30}}, - color={0,0,127}, - smooth=Smooth.None)); - connect(vol.heatPort, temSen.port) annotation (Line( - points={{-9,-10},{-16,-10},{-16,40},{0,40}}, - color={191,0,0}, - smooth=Smooth.None)); - annotation ( Icon(graphics={ - Polygon( - points={{0,-34},{-12,-52},{14,-52},{0,-34}}, - pattern=LinePattern.None, - smooth=Smooth.None, - fillColor={255,255,0}, - fillPattern=FillPattern.Solid, - lineColor={0,0,0}), - Line( - points={{-100,80},{-80,80},{-80,-44},{-6,-44}}, - smooth=Smooth.None), - Line( - points={{100,80},{80,80},{80,4}}, - color={0,0,127}, - smooth=Smooth.None), - Text( - extent={{160,144},{40,94}}, - lineColor={0,0,0}, - textString=DynamicSelect("T", String(T-273.15, format=".1f"))), - Text( - extent={{-38,146},{-158,96}}, - lineColor={0,0,0}, - textString=DynamicSelect("y", String(y, format=".2f")))}), - defaultComponentName="boi", - Documentation(info=" -

-This is a model of a boiler whose efficiency is described -by a polynomial. -The heat input into the medium is

-

- Q̇ = y Q̇0 η ⁄ η0 -

-

-where -y ∈ [0, 1] is the control signal, -0 is the nominal power, -η is the efficiency at the current operating point, and -η0 is the efficiency at y=1 and -nominal temperature T=T0 as specified by the parameter -T_nominal. -

-

-The parameter effCur determines what polynomial is used -to compute the efficiency, which is defined as -

-

- η = Q̇ ⁄ Q̇f, -

-

-where - is the heat transferred to the working fluid (typically water or air), and -f is the heat of combustion released by the fuel. -

-

-The following polynomials can be selected to compute the efficiency: -

- - - - - - - - - - - - - - - - - -
Parameter effCurEfficiency curve
Buildings.Fluid.Types.EfficiencyCurves.Constantη = a1
Buildings.Fluid.Types.EfficiencyCurves.Polynomialη = a1 + a2 y + a3 y2 + ...
Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinearη = a1 + a2 y - + a3 y2 - + (a4 + a5 y - + a6 y2) T -
- -

-where T is the boiler outlet temperature in Kelvin. -For effCur = Buildings.Fluid.Types.EfficiencyCurves.Polynomial, -an arbitrary number of polynomial coefficients can be specified. -

-

-The parameter Q_flow_nominal is the power transferred to the fluid -for y=1 and, if the efficiency depends on temperature, -for T=T0. -

-

-The fuel mass flow rate and volume flow rate are computed as

-

- ṁf = Q̇f ⁄ hf -

-

and

-

- V̇f = ṁf ⁄ ρf, -

-

-where the fuel heating value -hf and the fuel mass density -ρf are obtained from the -parameter fue. -Note that if η is the efficiency relative to the lower heating value, -then the fuel properties also need to be used for the lower heating value. -

- -

-Optionally, the port heatPort can be connected to a heat port -outside of this model to impose a boundary condition in order to -model heat losses to the ambient. When using this heatPort, -make sure that the efficiency curve effCur -does not already account for this heat loss. -

- -

-On the Assumptions tag, the model can be parameterized to compute a transient -or steady-state response. -The transient response of the boiler is computed using a first -order differential equation to compute the boiler's water and metal temperature, -which are lumped into one state. The boiler outlet temperature is equal to this water temperature. -

- -", revisions=" - -")); - end BoilerPolynomial; - end BaseClasses; - end Boiler; - - package Chiller - "This package contains the modules which can be used to simulate the chillers" - - model MultiChillers - "The chiller system with N chillers and associated local controllers " - replaceable package MediumCHW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the chilled water side"; - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the condenser water side"; - parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per[n] - "Performance data" annotation (choicesAllMatching=true, Placement( - transformation(extent={{-10,70},{10,90}}))); - parameter Modelica.Units.SI.Pressure dPCHW_nominal - "Pressure difference at the chilled water side"; - parameter Modelica.Units.SI.Pressure dPCW_nominal - "Pressure difference at the condenser water wide"; - parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal[:] - "Nominal mass flow rate at the chilled water side"; - parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[:] - "Nominal mass flow rate at the condenser water wide"; - parameter Modelica.Units.SI.Temperature TCW_start - "The start temperature of condenser water side"; - parameter Modelica.Units.SI.Temperature TCHW_start - "The start temperature of chilled water side"; - - parameter Integer n - "the number of chillers"; - Modelica.Blocks.Interfaces.RealInput On[n](min=0,max=1) "On signal" annotation (Placement(transformation(extent={{-118, - -31},{-100,-49}}))); - Modelica.Blocks.Interfaces.RealInput TCHWSet - "Temperature setpoint of the chilled water" - annotation (Placement(transformation(extent={{-118,31},{-100,49}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package - Medium = MediumCW) - "Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{-110,-90},{-90,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package - Medium = MediumCW) - "Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{-110,70},{-90,90}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package - Medium = MediumCHW) - "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}), - iconTransformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_CHW(redeclare package - Medium = MediumCHW) - "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,70},{110,90}}))); - Modelica.Blocks.Interfaces.RealOutput P[n] - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWEntChi( - redeclare package Medium = MediumCHW, - allowFlowReversal=true, - m_flow_nominal=sum(mCHW_flow_nominal)) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={50,80}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLeaChi( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - m_flow_nominal=sum(mCW_flow_nominal)) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={-82,80}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWLeaChi( - allowFlowReversal=true, - redeclare package Medium = MediumCHW, - T_start=TCHW_start, - m_flow_nominal=sum(mCHW_flow_nominal)) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={52,-80}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEntChi( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - T_start=TCW_start, - m_flow_nominal=sum(mCW_flow_nominal)) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,-80}))); - replaceable ChillerTSet ch[n]( - redeclare package MediumCHW = MediumCHW, - redeclare package MediumCW = MediumCW, - dPCHW_nominal=dPCHW_nominal, - dPCW_nominal=dPCW_nominal, - mCHW_flow_nominal=mCHW_flow_nominal, - mCW_flow_nominal=mCW_flow_nominal, - TCW_start=TCW_start, - TCHW_start=TCHW_start, - per=per) constrainedby ChillerTSet( - redeclare package MediumCHW = MediumCHW, - redeclare package MediumCW = MediumCW, - dPCHW_nominal=dPCHW_nominal, - dPCW_nominal=dPCW_nominal, - mCHW_flow_nominal=mCHW_flow_nominal, - mCW_flow_nominal=mCW_flow_nominal, - TCW_start=TCW_start, - TCHW_start=TCHW_start, - per=per) - annotation (Placement(transformation(extent={{-10,-8},{10,12}}))); - - Modelica.Blocks.Interfaces.RealOutput Rat[n] "compressor speed ratio" - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloCHW(redeclare package - Medium = - MediumCHW) - annotation (Placement(transformation(extent={{70,-90},{88,-70}}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package - Medium = - MediumCHW) - annotation (Placement(transformation(extent={{-46,70},{-64,90}}))); - equation - connect(port_b_CW, port_b_CW) annotation (Line( - points={{-100,80},{-100,80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(port_a_CW, port_a_CW) annotation (Line( - points={{-100,-80},{-100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senTCHWEntChi.port_a, port_a_CHW) annotation (Line( - points={{60,80},{100,80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(port_b_CW, senTCWLeaChi.port_b) annotation (Line( - points={{-100,80},{-92,80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senTCWEntChi.port_a, port_a_CW) annotation (Line( - points={{-80,-80},{-100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(port_b_CHW, port_b_CHW) annotation (Line( - points={{100,-80},{98,-80},{98,-80},{100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senTCWLeaChi.port_a, senMasFloCW.port_b) annotation (Line( - points={{-72,80},{-64,80}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCHW.port_b, port_b_CHW) annotation (Line( - points={{88,-80},{94,-80},{100,-80}}, - color={0,127,255}, - thickness=1)); - connect(senTCHWLeaChi.port_b, senMasFloCHW.port_a) annotation (Line( - points={{62,-80},{66,-80},{70,-80}}, - color={0,127,255}, - thickness=1)); - connect(ch.On, On) annotation (Line( - points={{-12,-3},{-60,-3},{-60,-40},{-109,-40}}, - color={0,0,127})); - connect(On, Rat) annotation (Line( - points={{-109,-40},{110,-40}}, - color={0,0,127})); - - for i in 1:n loop - connect(ch[i].TCHWSet, TCHWSet); - connect(ch[i].port_a_CW, senTCWEntChi.port_b); - connect(ch[i].port_b_CHW, senTCHWLeaChi.port_a); - connect(ch[i].port_b_CW, senMasFloCW.port_a); - connect(ch[i].port_a_CHW, senTCHWEntChi.port_b); - connect(ch[i].P, P[i]); - end for; - - annotation (Documentation(info=" -

This model is to simulate the chiller system which consists of three chillers and associated local controllers.

-", revisions=" - -"), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, - {100,100}})), - Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, - 100}}), graphics={ - Text( - extent={{-44,-142},{50,-110}}, - lineColor={0,0,255}, - textString="%name"), - Rectangle( - extent={{-28,80},{26,40}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-28,20},{26,-20}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-28,-40},{26,-80}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Line( - points={{-60,12},{-28,12}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-28,-50},{-60,-50},{-60,80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-90,-80},{-40,-80},{-40,50},{-34,50},{-28,50}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-28,-10},{-40,-10}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-28,-70},{-40,-70}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{40,-80},{102,-80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{40,-80},{40,50},{26,50}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{26,-12},{40,-12}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{26,-70},{40,-70}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{26,12},{60,12}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{26,-48},{60,-48},{60,80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-100,80},{-60,80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-28,70},{-60,70}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{100,80},{60,80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{26,72},{60,72}}, - color={0,0,255}, - smooth=Smooth.None), - Ellipse( - extent={{-32,76},{-22,64}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-30,74},{-24,66}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-32,18},{-22,6}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-30,16},{-24,8}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-32,-44},{-22,-56}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-30,-46},{-24,-54}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,56},{30,44}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{22,54},{28,46}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,-6},{30,-18}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{22,-8},{28,-16}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,-64},{30,-76}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{22,-66},{28,-74}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,78},{30,66}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,18},{30,6}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{20,-44},{30,-56}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-32,56},{-22,44}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-32,-4},{-22,-16}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-32,-64},{-22,-76}}, - lineColor={0,0,255}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-158,104},{142,144}}, - textString="%name", - textColor={0,0,255})})); - end MultiChillers; - - model ChillerTSet "Chiller" - replaceable package MediumCHW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the chilled water side"; - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the condenser water side"; - parameter Modelica.Units.SI.Pressure dPCHW_nominal - "Pressure difference at the chilled water side"; - parameter Modelica.Units.SI.Pressure dPCW_nominal - "Pressure difference at the condenser water wide"; - parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal - "Nominal mass flow rate at the chilled water side"; - parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal - "Nominal mass flow rate at the condenser water wide"; - parameter Modelica.Units.SI.Temperature TCW_start - "The start temperature of condenser water side"; - parameter Modelica.Units.SI.Temperature TCHW_start - "The start temperature of chilled water side"; - - parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per - "Performance data" - annotation (choicesAllMatching = true, - Placement(transformation(extent={{40,80},{60,100}}))); - - Buildings.Fluid.Chillers.ElectricEIR chi( - redeclare package Medium1 = MediumCW, - redeclare package Medium2 = MediumCHW, - m1_flow_nominal=mCW_flow_nominal, - m2_flow_nominal=mCHW_flow_nominal, - dp1_nominal=0, - dp2_nominal=0, - allowFlowReversal1=true, - allowFlowReversal2=true, - tau1=300, - tau2=300, - T1_start=TCW_start, - T2_start=TCHW_start, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - per=per) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={0,-42}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package - Medium = - MediumCW) - "Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{-110,-90},{-90,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package - Medium = - MediumCW) - "Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)" - annotation (Placement(transformation(extent={{-110,70},{-90,90}}), - iconTransformation(extent={{-110,70},{-90,90}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package - Medium = - MediumCHW) - "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_CHW(redeclare package - Medium = - MediumCHW) - "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" - annotation (Placement(transformation(extent={{90,70},{110,90}}), - iconTransformation(extent={{90,70},{110,90}}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWLea( - redeclare package Medium = MediumCHW, - m_flow_nominal=mCHW_flow_nominal, - T_start=TCHW_start) - annotation (Placement(transformation(extent={{20,-90},{40,-70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCW( - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal, - allowFlowReversal=false, - dpValve_nominal=dPCW_nominal) - annotation (Placement(transformation(extent={{-60,90},{-80,70}}))); - Buildings.Fluid.Actuators.Valves.TwoWayLinear valCHW( - redeclare package Medium = MediumCHW, - m_flow_nominal=mCHW_flow_nominal, - dpValve_nominal=dPCHW_nominal) - annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); - Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) - "True to enable compressor to operate, or false to disable the operation of the compressor" - annotation (Placement(transformation(extent={{-118,-50},{-100,-30}}), - iconTransformation(extent={{-140,-70},{-100,-30}}))); - Modelica.Blocks.Interfaces.RealInput TCHWSet - "Temperature setpoint of chilled water" - annotation (Placement(transformation(extent={{-118,30},{-100,50}}), - iconTransformation(extent={{-140,10},{-100,50}}))); - Modelica.Blocks.Interfaces.RealOutput P - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,30},{120,50}}), - iconTransformation(extent={{100,30},{120,50}}))); - - Modelica.Blocks.Math.RealToBoolean realToBoolean - annotation (Placement(transformation(extent={{-56,-66},{-42,-52}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLea( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={-40,0}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEnt( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-40,-80}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWEnt( - allowFlowReversal=true, - redeclare package Medium = MediumCHW, - m_flow_nominal=mCHW_flow_nominal) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=0, - origin={30,0}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloCHW(redeclare package - Medium = - MediumCHW) - annotation (Placement(transformation(extent={{72,-10},{54,10}}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package - Medium = - MediumCHW) - annotation (Placement(transformation(extent={{-78,-90},{-60,-70}}))); - Buildings.Fluid.Sensors.Pressure senPreCHWEnt(redeclare package Medium = - MediumCHW) - annotation (Placement(transformation(extent={{2,10},{22,30}}))); - Buildings.Fluid.Sensors.Pressure senPreCHWLea(redeclare package Medium = - MediumCHW) - annotation (Placement(transformation(extent={{78,-50},{98,-30}}))); - Buildings.Fluid.Sensors.Pressure senPreCWLea(redeclare package - Medium = - MediumCHW) - annotation (Placement(transformation(extent={{-76,68},{-96,48}}))); - Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = - MediumCHW) - annotation (Placement(transformation(extent={{-96,-70},{-76,-50}}))); - - equation - connect(chi.port_b2, senTCHWLea.port_a) annotation (Line( - points={{6,-52},{6,-80},{20,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(chi.P, P) annotation (Line( - points={{-9,-31},{-9,40},{110,40}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(senTCHWLea.port_b, valCHW.port_a) annotation (Line( - points={{40,-80},{60,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(valCHW.port_b, port_b_CHW) annotation (Line( - points={{80,-80},{100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(valCW.port_b, port_b_CW) annotation (Line( - points={{-80,80},{-100,80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(realToBoolean.y, chi.on) annotation (Line( - points={{-41.3,-59},{-3,-59},{-3,-54}}, - color={255,0,255}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(On, valCW.y) annotation (Line( - points={{-109,-40},{-90,-40},{-70,-40},{-70,-26},{-70,-26},{-70,68}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(valCHW.y, valCW.y) annotation (Line( - points={{70,-68},{70,-26},{-70,-26},{-70,68}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(realToBoolean.u, valCW.y) annotation (Line( - points={{-57.4,-59},{-70,-59},{-70,-40},{-70,-26},{-70,68}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(chi.port_b1, senTCWLea.port_a) annotation (Line( - points={{-6,-32},{-6,0},{-30,0}}, - color={0,127,255}, - thickness=1)); - connect(senTCWLea.port_b, valCW.port_a) annotation (Line( - points={{-50,0},{-50,0},{-54,0},{-54,80},{-60,80}}, - color={0,127,255}, - thickness=1)); - connect(senTCWEnt.port_b, chi.port_a1) annotation (Line( - points={{-30,-80},{-6,-80},{-6,-52}}, - color={0,127,255}, - thickness=1)); - connect(senTCHWEnt.port_b, chi.port_a2) annotation (Line( - points={{20,0},{6,0},{6,-32}}, - color={0,127,255}, - thickness=1)); - connect(senPreCHWEnt.port, chi.port_a2) annotation (Line( - points={{12,10},{12,0},{6,0},{6,-32}}, - color={0,127,255}, - thickness=1)); - connect(senPreCHWLea.port, port_b_CHW) annotation (Line( - points={{88,-50},{88,-50},{88,-80},{100,-80}}, - color={0,127,255}, - thickness=1)); - connect(senPreCWLea.port, port_b_CW) annotation (Line( - points={{-86,68},{-86,80},{-100,80}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCHW.port_b, senTCHWEnt.port_a) annotation (Line( - points={{54,0},{47,0},{40,0}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCHW.port_a, port_a_CHW) annotation (Line( - points={{72,0},{80,0},{80,80},{100,80}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCW.port_b, senTCWEnt.port_a) annotation (Line( - points={{-60,-80},{-55,-80},{-50,-80}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCW.port_a, port_a_CW) annotation (Line( - points={{-78,-80},{-100,-80}}, - color={0,127,255}, - thickness=1)); - connect(senPreCWEnt.port, port_a_CW) annotation (Line( - points={{-86,-70},{-86,-80},{-100,-80}}, - color={0,127,255}, - thickness=1)); - connect(TCHWSet, chi.TSet) annotation (Line( - points={{-109,40},{-16,40},{-16,-62},{3,-62},{3,-54}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Rectangle( - extent={{-101,82},{100,72}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-95,-76},{106,-86}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-54,50},{60,32}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-52,-50},{62,-68}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-101,82},{100,72}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{0,72},{100,82}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-95,-76},{106,-86}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-102,-86},{-2,-76}}, - lineColor={0,0,127}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-32,-10},{-42,-22},{-22,-22},{-32,-10}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-32,-10},{-42,0},{-22,0},{-32,-10}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-34,32},{-30,0}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-34,-22},{-30,-50}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{34,32},{38,-50}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{14,10},{58,-32}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{36,10},{18,-22},{54,-22},{36,10}}, - lineColor={0,128,255}, - fillColor={170,170,255}, - fillPattern=FillPattern.Solid)}), - Documentation(revisions=" - -")); - end ChillerTSet; - - package BaseClasses - model ElectricEIR "Electric chiller based on the DOE-2.1 model" - extends PartialElectric( - final QEva_flow_nominal=per.QEva_flow_nominal, - final COP_nominal=per.COP_nominal, - final PLRMax=per.PLRMax, - final PLRMinUnl=per.PLRMinUnl, - final PLRMin=per.PLRMin, - final etaMotor=per.etaMotor, - final mEva_flow_nominal=per.mEva_flow_nominal, - final mCon_flow_nominal=per.mCon_flow_nominal, - final TEvaLvg_nominal=per.TEvaLvg_nominal); - - parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per - "Performance data" - annotation (choicesAllMatching = true, - Placement(transformation(extent={{40,80},{60,100}}))); - - protected - final parameter Modelica.Units.NonSI.Temperature_degC TConEnt_nominal_degC= - Modelica.Units.Conversions.to_degC(per.TConEnt_nominal) - "Temperature of fluid entering condenser at nominal condition"; - - Modelica.Units.NonSI.Temperature_degC TConEnt_degC - "Temperature of fluid entering condenser"; - initial equation - // Verify correctness of performance curves, and write warning if error is bigger than 10% - Buildings.Fluid.Chillers.BaseClasses.warnIfPerformanceOutOfBounds( - Buildings.Utilities.Math.Functions.biquadratic(a=per.capFunT, - x1=TEvaLvg_nominal_degC, x2=TConEnt_nominal_degC), - "Capacity as function of temperature ", - "per.capFunT"); - equation - TConEnt_degC=Modelica.Units.Conversions.to_degC(TConEnt); - - if on then - // Compute the chiller capacity fraction, using a biquadratic curve. - // Since the regression for capacity can have negative values (for unreasonable temperatures), - // we constrain its return value to be non-negative. This prevents the solver to pick the - // unrealistic solution. - capFunT = Buildings.Utilities.Math.Functions.smoothMax( - x1 = 1E-6, - x2 = Buildings.Utilities.Math.Functions.biquadratic(a=per.capFunT, x1=TEvaLvg_degC, x2=TConEnt_degC), - deltaX = 1E-7); - /* assert(capFunT > 0.1, "Error: Received capFunT = " + String(capFunT) + ".\n" - + "Coefficient for polynomial seem to be not valid for the encountered temperature range.\n" - + "Temperatures are TConEnt_degC = " + String(TConEnt_degC) + " degC\n" - + " TEvaLvg_degC = " + String(TEvaLvg_degC) + " degC"); -*/ - // Chiller energy input ratio biquadratic curve. - EIRFunT = Buildings.Utilities.Math.Functions.biquadratic(a=per.EIRFunT, x1=TEvaLvg_degC, x2=TConEnt_degC); - // Chiller energy input ratio quadratic curve - EIRFunPLR = per.EIRFunPLR[1]+per.EIRFunPLR[2]*PLR2+per.EIRFunPLR[3]*PLR2^2; - else - capFunT = 0; - EIRFunT = 0; - EIRFunPLR = 0; - end if; - - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), - graphics={ - Rectangle( - extent={{-99,-54},{102,-66}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-100,-66},{0,-54}}, - lineColor={0,0,127}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-104,66},{98,54}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-2,54},{98,66}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-44,52},{-40,12}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-56,70},{58,52}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-42,2},{-52,12},{-32,12},{-42,2}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-42,2},{-52,-10},{-32,-10},{-42,2}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-44,-10},{-40,-50}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{38,52},{42,-50}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-56,-50},{58,-68}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{18,24},{62,-18}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{40,24},{22,-8},{58,-8},{40,24}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)}), - defaultComponentName="chi", - Documentation(info=" -

-Model of an electric chiller, based on the DOE-2.1 chiller model and -the EnergyPlus chiller model Chiller:Electric:EIR. -

-

This model uses three functions to predict capacity and power consumption: -

- -

-These curves are stored in the data record per and are available from - -Buildings.Fluid.Chillers.Data.ElectricEIR. -Additional performance curves can be developed using -two available techniques (Hydeman and Gillespie, 2002). The first technique is called the -Least-squares Linear Regression method and is used when sufficient performance data exist -to employ standard least-square linear regression techniques. The second technique is called -Reference Curve Method and is used when insufficient performance data exist to apply linear -regression techniques. A detailed description of both techniques can be found in -Hydeman and Gillespie (2002). -

-

-The model takes as an input the set point for the leaving chilled water temperature, -which is met if the chiller has sufficient capacity. -Thus, the model has a built-in, ideal temperature control. -The model has three tests on the part load ratio and the cycling ratio: -

-
    -
  1. -The test
    -  PLR1 =min(QEva_flow_set/QEva_flow_ava, per.PLRMax);
    -
    -ensures that the chiller capacity does not exceed the chiller capacity specified -by the parameter per.PLRMax. -
  2. -
  3. -The test
    -  CR = min(PLR1/per.PRLMin, 1.0);
    -
    -computes a cycling ratio. This ratio expresses the fraction of time -that a chiller would run if it were to cycle because its load is smaller than the -minimal load at which it can operate. -Note that this model continuously operates even if the part load ratio is below the minimum part load ratio. -Its leaving evaporator and condenser temperature can therefore be considered as an -average temperature between the modes where the compressor is off and on. -
  4. -
  5. -The test
    -  PLR2 = max(per.PLRMinUnl, PLR1);
    -
    -computes the part load ratio of the compressor. -The assumption is that for a part load ratio below per.PLRMinUnl, -the chiller uses hot gas bypass to reduce the capacity, while the compressor -power draw does not change. -
  6. -
-

-The electric power only contains the power for the compressor, but not any power for pumps or fans. -

-

-The model can be parametrized to compute a transient -or steady-state response. -The transient response of the boiler is computed using a first -order differential equation for the evaporator and condenser fluid volumes. -The chiller outlet temperatures are equal to the temperatures of these lumped volumes. -

-

References

- -", - revisions=" - -")); - end ElectricEIR; - - partial model PartialElectric "Partial model for electric chiller" - extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger( - m1_flow_nominal = mCon_flow_nominal, - m2_flow_nominal = mEva_flow_nominal, - T1_start = 273.15+25, - T2_start = 273.15+5, - redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol2( - V=m2_flow_nominal*tau2/rho2_nominal, - nPorts=2, - final prescribedHeatFlowRate=true), - vol1( - final prescribedHeatFlowRate=true)); - - Modelica.Blocks.Interfaces.BooleanInput on - "Set to true to enable compressor, or false to disable compressor" - annotation (Placement(transformation(extent={{-140,10},{-100,50}}), - iconTransformation(extent={{-140,10},{-100,50}}))); - Modelica.Blocks.Interfaces.RealInput y "Cooling power output ratio" annotation ( - Placement(transformation(extent={{-140,-50},{-100,-10}}), - iconTransformation(extent={{-140,-50},{-100,-10}}))); - - Modelica.Units.SI.Temperature TEvaEnt "Evaporator entering temperature"; - Modelica.Units.SI.Temperature TEvaLvg "Evaporator leaving temperature"; - Modelica.Units.SI.Temperature TConEnt "Condenser entering temperature"; - Modelica.Units.SI.Temperature TConLvg "Condenser leaving temperature"; - - Modelica.Units.SI.Efficiency COP "Coefficient of performance"; - Modelica.Units.SI.HeatFlowRate QCon_flow "Condenser heat input"; - Modelica.Units.SI.HeatFlowRate QEva_flow "Evaporator heat input"; - Modelica.Blocks.Interfaces.RealOutput P(final quantity="Power", unit="W") - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,80},{120,100}}), - iconTransformation(extent={{100,80},{120,100}}))); - - Real capFunT(min=0, unit="1") - "Cooling capacity factor function of temperature curve"; - Modelica.Units.SI.Efficiency EIRFunT - "Power input to cooling capacity ratio function of temperature curve"; - Modelica.Units.SI.Efficiency EIRFunPLR - "Power input to cooling capacity ratio function of part load ratio"; - Real PLR1(min=0, unit="1") "Part load ratio"; - Real PLR2(min=0, unit="1") "Part load ratio"; - Real CR(min=0, unit="1") "Cycling ratio"; - parameter Modelica.Units.SI.Efficiency epsEva(max=1) = 1 - "Heat exchanger effectiveness at evaporator"; - - parameter Modelica.Units.SI.Efficiency epsCon(max=1) = 1 - "Heat exchanger effectiveness at condenser"; - - protected - Modelica.Units.SI.HeatFlowRate QEva_flow_ava(nominal=QEva_flow_nominal, start= - QEva_flow_nominal) "Cooling capacity available at evaporator"; - Modelica.Units.SI.HeatFlowRate QEva_flow_set(nominal=QEva_flow_nominal, start= - QEva_flow_nominal) - "Cooling capacity required to cool to set point temperature"; - - // Performance data - parameter Modelica.Units.SI.HeatFlowRate QEva_flow_nominal(max=0) - "Reference capacity (negative number)"; - parameter Modelica.Units.SI.Efficiency COP_nominal - "Reference coefficient of performance"; - parameter Real PLRMax(min=0, unit="1") "Maximum part load ratio"; - parameter Real PLRMinUnl(min=0, unit="1") "Minimum part unload ratio"; - parameter Real PLRMin(min=0, unit="1") "Minimum part load ratio"; - parameter Modelica.Units.SI.Efficiency etaMotor(max=1) - "Fraction of compressor motor heat entering refrigerant"; - parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal - "Nominal mass flow at evaporator"; - parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal - "Nominal mass flow at condenser"; - - parameter Modelica.Units.SI.Temperature TEvaLvg_nominal - "Temperature of fluid leaving evaporator at nominal condition"; - - final parameter Modelica.Units.NonSI.Temperature_degC TEvaLvg_nominal_degC= - Modelica.Units.Conversions.to_degC(TEvaLvg_nominal) - "Temperature of fluid leaving evaporator at nominal condition"; - Modelica.Units.NonSI.Temperature_degC TEvaLvg_degC - "Temperature of fluid leaving evaporator"; - parameter Modelica.Units.SI.HeatFlowRate Q_flow_small=QEva_flow_nominal*1E-9 - "Small value for heat flow rate or power, used to avoid division by zero"; - Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloEva - "Prescribed heat flow rate" - annotation (Placement(transformation(extent={{-39,-50},{-19,-30}}))); - Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloCon - "Prescribed heat flow rate" - annotation (Placement(transformation(extent={{-39,30},{-19,50}}))); - Modelica.Blocks.Sources.RealExpression QEva_flow_in(y=QEva_flow) - "Evaporator heat flow rate" - annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); - Modelica.Blocks.Sources.RealExpression QCon_flow_in(y=QCon_flow) - "Condenser heat flow rate" - annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); - - initial equation - assert(QEva_flow_nominal < 0, "Parameter QEva_flow_nominal must be smaller than zero."); - assert(Q_flow_small < 0, "Parameter Q_flow_small must be smaller than zero."); - assert(PLRMinUnl >= PLRMin, "Parameter PLRMinUnl must be bigger or equal to PLRMin"); - assert(PLRMax > PLRMinUnl, "Parameter PLRMax must be bigger than PLRMinUnl"); - equation - // Condenser temperatures - TConEnt = Medium1.temperature(Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow))); - TConLvg = vol1.heatPort.T; - // Evaporator temperatures - TEvaEnt = Medium2.temperature(Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow))); - TEvaLvg = vol2.heatPort.T; - TEvaLvg_degC=Modelica.Units.Conversions.to_degC(TEvaLvg); - - if on then - // Available cooling capacity - QEva_flow_ava = QEva_flow_nominal*capFunT; - // Cooling capacity is controlled to be output - QEva_flow_set = y*QEva_flow_ava; - - // Part load ratio - PLR1 = Buildings.Utilities.Math.Functions.smoothMin( - x1 = QEva_flow_set/(QEva_flow_ava+Q_flow_small), - x2 = PLRMax, - deltaX=PLRMax/100); - // PLR2 is the compressor part load ratio. The lower bound PLRMinUnl is - // since for PLR11465. - -
  • -March 12, 2015, by Michael Wetter:
    -Refactored model to make it once continuously differentiable. -This is for issue 373. -
  • -
  • -Jan. 10, 2011, by Michael Wetter:
    -Added input signal to switch chiller off, and changed base class to use a dynamic model. -The change of the base class was required to improve the robustness of the model when the control -is switched on again. -
  • -
  • -Sep. 8, 2010, by Michael Wetter:
    -Revised model and included it in the Buildings library. -
  • -
  • -October 13, 2008, by Brandon Hencey:
    -First implementation. -
  • - -")); - end PartialElectric; - end BaseClasses; - annotation (); - end Chiller; - - package CoolingTower - "This package contains the modules which can be used to simulate the cooling towers" - - model MultiCoolingTowers - "This model is designed to simulate the cooling tower systwm with N towers" - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the condenser water side"; - parameter Modelica.Units.SI.Power P_nominal[n] - "Nominal cooling tower power (at y=1)"; - parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal - "Temperature difference between the outlet and inlet of the tower "; - parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal - "Nominal approach temperature"; - parameter Modelica.Units.SI.Temperature TWetBul_nominal - "Nominal wet bulb temperature"; - parameter Modelica.Units.SI.Pressure dP_nominal - "Pressure difference between the outlet and inlet of the tower "; - parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[n] - "Nominal mass flow rate at condenser water wide"; - parameter Real GaiPi "Gain of the tower PI controller"; - parameter Real tIntPi "Integration time of the tower PI controller"; - parameter Real v_flow_rate[n,:] "Air volume flow rate ratio"; - parameter Real eta[n,:] "Fan efficiency"; - parameter Modelica.Units.SI.Temperature TCW_start - "The start temperature of condenser water side"; - - parameter Integer n - "the number of cooling towers"; - Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package - Medium = MediumCW) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package - Medium = MediumCW) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Modelica.Blocks.Interfaces.RealInput TWetBul - "Entering air wet bulb temperature" - annotation (Placement(transformation(extent={{-118,-69},{-100,-51}}))); - Modelica.Blocks.Interfaces.RealInput TCWSet - "Temperature set point of the condenser water" - annotation (Placement(transformation(extent={{-118,70},{-100,88}}))); - VSDCoolingTower ct[n]( - redeclare package MediumCW = MediumCW, - P_nominal=P_nominal, - dTCW_nominal=dTCW_nominal, - dTApp_nominal=dTApp_nominal, - TWetBul_nominal=TWetBul_nominal, - dP_nominal=dP_nominal, - mCW_flow_nominal=mCW_flow_nominal, - GaiPi=GaiPi, - tIntPi=tIntPi, - eta=eta, - TCW_start=TCW_start, - v_flow_rate=v_flow_rate, - conPI(reverseActing=false)) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Blocks.Interfaces.RealInput On[n] - "Temperature set point of the condenser water" - annotation (Placement(transformation(extent={{-118,30},{-100,48}}))); - Modelica.Blocks.Interfaces.RealOutput P[n] - "Electric power consumed by compressor" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - equation - - for i in 1:n loop - connect(ct[i].port_a_CW, port_a_CW); - connect(ct[i].port_b_CW, port_b_CW); - connect(ct[i].TSet, TCWSet); - connect(TWetBul, ct[i].TWetBul); - connect(ct[i].P, P[i]); - end for; - - connect(ct.On, On) annotation (Line( - points={{-12,4},{-60,4},{-60,39},{-109,39}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Rectangle( - extent={{-14,68},{14,40}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-10,76},{10,68}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-10,72},{-2,70}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{2,72},{10,70}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-8,60},{-10,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-8,60},{-6,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,60},{-2,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,60},{2,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,60},{6,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,60},{10,54}}, - color={255,0,0}, - smooth=Smooth.None), - Rectangle( - extent={{-14,8},{14,-20}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-10,16},{10,8}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-10,12},{-2,10}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{2,12},{10,10}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-8,0},{-10,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-8,0},{-6,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,0},{-2,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,0},{2,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,0},{6,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,0},{10,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Rectangle( - extent={{-14,-52},{14,-80}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-10,-44},{10,-52}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-10,-48},{-2,-50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{2,-48},{10,-50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-8,-60},{-10,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-8,-60},{-6,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,-60},{-2,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,-60},{2,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,-60},{6,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{8,-60},{10,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-100,0},{-40,0},{-40,60},{8,60}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-40,0},{8,0}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-40,0},{-40,-60},{8,-60}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{14,40},{40,40},{40,0},{90,0}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{14,-20},{40,-20},{40,0}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{14,-80},{40,-80},{40,-20}}, - color={0,0,255}, - smooth=Smooth.None)}), - Documentation(revisions=" - -")); - end MultiCoolingTowers; - - model CoolingTowersWithBypass - "This model is designed to simulate the cooling tower system with N way bypass valve" - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium condenser water side"; - parameter Modelica.Units.SI.Temperature TCWLowSet - "The lower temperatre limit of condenser water entering the chiller plant"; - parameter Modelica.Units.SI.Power P_nominal[n] "Nominal tower power (at y=1)"; - parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal - "Temperature difference between the outlet and inlet of the tower"; - parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal - "Nominal approach temperature"; - parameter Modelica.Units.SI.Temperature TWetBul_nominal - "Nominal wet bulb temperature"; - parameter Modelica.Units.SI.Pressure dP_nominal - "Pressure difference between the outlet and inlet of the tower "; - parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[:] - "Nominal mass flow rate at condenser water wide"; - parameter Real v_flow_rate[n,:] "Air volume flow rate ratio"; - parameter Real eta[n,:] "Fan efficiency"; - parameter Modelica.Units.SI.Pressure dPByp_nominal - "Pressure difference between the outlet and inlet of the bypass valve "; - parameter Modelica.Units.SI.Temperature TCW_start - "The start temperature of condenser water side"; - parameter Integer n - "the number of cooling towers"; - replaceable MultiCoolingTowers mulCooTowSys( - redeclare package MediumCW = MediumCW, - P_nominal=P_nominal, - dTCW_nominal=dTCW_nominal, - dP_nominal=dP_nominal, - mCW_flow_nominal=mCW_flow_nominal, - v_flow_rate=v_flow_rate, - TCW_start=TCW_start, - dTApp_nominal=dTApp_nominal, - TWetBul_nominal=TWetBul_nominal, - eta=eta, - n=n, - GaiPi=1, - tIntPi=60) - annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}))); - Bypass byp( - redeclare package MediumCW = MediumCW, - dPByp_nominal=dPByp_nominal, - m_flow_nominal=sum(mCW_flow_nominal)) - annotation (Placement(transformation(extent={{0,-20},{20,0}}))); - Modelica.Blocks.Interfaces.RealInput On[n] "On signal" - annotation (Placement(transformation(extent={{-118,51},{-100,69}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{90,50},{110,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEntChi( - redeclare package Medium = MediumCW, - T_start=TCW_start, - m_flow_nominal=sum(mCW_flow_nominal)) - annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); - Modelica.Blocks.Interfaces.RealInput TWetBul - "Entering air wet bulb temperature" - annotation (Placement(transformation(extent={{-118,-69},{-100,-51}}))); - Modelica.Blocks.Interfaces.RealInput TCWSet - "Temperature set point of the condenser water" - annotation (Placement(transformation(extent={{-118,-9},{-100,9}}))); - - .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI - conPI(k=1, Ti=60) - annotation (Placement(transformation(extent={{-40,38},{-20,58}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=TCWLowSet) - annotation (Placement(transformation(extent={{-74,10},{-54,30}}))); - Modelica.Blocks.Sources.BooleanExpression realExpression1(y=true) - annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); - equation - connect(mulCooTowSys.port_b_CW, byp.port_a2) annotation (Line( - points={{-20,-30},{-8,-30},{-8,-14},{0,-14}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(byp.port_b1, mulCooTowSys.port_a_CW) annotation (Line( - points={{0,-6},{-60,-6},{-60,-30},{-40,-30}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(byp.port_a1, port_a) annotation (Line( - points={{20,-6},{40,-6},{40,60},{100,60}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(byp.port_b2, senTCWEntChi.port_a) annotation (Line( - points={{20,-14},{40,-14},{40,-80},{60,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senTCWEntChi.port_b, port_b) annotation (Line( - points={{80,-80},{100,-80}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(mulCooTowSys.TWetBul, TWetBul) annotation (Line( - points={{-40.9,-36},{-80,-36},{-80,-60},{-109,-60}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(mulCooTowSys.TCWSet, TCWSet) annotation (Line( - points={{-40.9,-22.1},{-72,-22.1},{-72,0},{-109,0}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(conPI.y, byp.yBypVal) annotation (Line( - points={{-19,48},{0,48},{0,22},{-20,22},{-20,-2},{-2,-2}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(senTCWEntChi.T,conPI.mea) annotation (Line( - points={{70,-69},{70,70},{-58,70},{-58,42},{-42,42}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(realExpression.y, conPI.set) annotation (Line( - points={{-53,20},{-48,20},{-48,48},{-42,48}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(realExpression1.y, conPI.On) annotation (Line( - points={{-59,80},{-50,80},{-50,54},{-42,54}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(On, mulCooTowSys.On) annotation (Line( - points={{-109,60},{-94,60},{-80,60},{-80,-26.1},{-40.9,-26.1}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Text( - extent={{-42,-144},{52,-112}}, - lineColor={0,0,255}, - textString="%name"), - Rectangle( - extent={{-40,68},{-12,40}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-36,76},{-16,68}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-36,72},{-28,70}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-24,72},{-16,70}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-34,60},{-36,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-34,60},{-32,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,60},{-28,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,60},{-24,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,60},{-20,54}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,60},{-16,54}}, - color={255,0,0}, - smooth=Smooth.None), - Rectangle( - extent={{-40,8},{-12,-20}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-36,16},{-16,8}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-36,12},{-28,10}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-24,12},{-16,10}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-34,0},{-36,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-34,0},{-32,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,0},{-28,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,0},{-24,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,0},{-20,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,0},{-16,-6}}, - color={255,0,0}, - smooth=Smooth.None), - Rectangle( - extent={{-40,-52},{-12,-80}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-36,-44},{-16,-52}}, - lineColor={95,95,95}, - fillColor={95,95,95}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-36,-48},{-28,-50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-24,-48},{-16,-50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-34,-60},{-36,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-34,-60},{-32,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,-60},{-28,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-26,-60},{-24,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,-60},{-20,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-18,-60},{-16,-66}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{60,60},{60,-60}}, - color={0,0,255}, - smooth=Smooth.None), - Polygon( - points={{60,0},{50,10},{70,10},{60,0}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{60,0},{50,-12},{70,-12},{60,0}}, - lineColor={0,0,0}, - smooth=Smooth.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Line( - points={{90,60},{100,60},{-34,60}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,60},{0,0},{-34,0}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{0,0},{0,-60},{-34,-60}}, - color={255,0,0}, - smooth=Smooth.None), - Line( - points={{-12,40},{10,40},{10,-80},{60,-80},{60,-60}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{100,-80},{60,-80}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-12,-20},{10,-20}}, - color={0,0,255}, - smooth=Smooth.None), - Line( - points={{-12,-80},{10,-80}}, - color={0,0,255}, - smooth=Smooth.None)}), - Documentation(revisions=" - -")); - end CoolingTowersWithBypass; - - model VSDCoolingTower "the cooling tower" - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium in the condenser water side"; - parameter Modelica.Units.SI.Power P_nominal - "Nominal cooling tower component power (at y=1)"; - parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal - "Temperature difference between the outlet and inlet of the module"; - parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal - "Nominal approach temperature"; - parameter Modelica.Units.SI.Temperature TWetBul_nominal - "Nominal wet bulb temperature"; - parameter Modelica.Units.SI.Pressure dP_nominal - "Pressure difference between the outlet and inlet of the module "; - parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal - "Nominal mass flow rate"; - parameter Real GaiPi "Gain of the component PI controller"; - parameter Real tIntPi "Integration time of the component PI controller"; - parameter Real v_flow_rate[:] "Volume flow rate ratio"; - parameter Real eta[:] "Fan efficiency"; - parameter Modelica.Units.SI.Temperature TCW_start - "The start temperature of condenser water side"; - BaseClasses.YorkCalc yorkCalc( - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal, - dp_nominal=0, - TRan_nominal=dTCW_nominal, - TAirInWB_nominal=TWetBul_nominal, - TApp_nominal=dTApp_nominal, - fraPFan_nominal=P_nominal/mCW_flow_nominal, - T_start=TCW_start, - fanRelPow(r_V=v_flow_rate, r_P=eta)) - annotation (Placement(transformation(extent={{0,-10},{20,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package - Medium = - MediumCW) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{90,-10},{110,10}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package - Medium = - MediumCW) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); - Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal, - dpValve_nominal=dP_nominal) - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI - conPI(k=GaiPi, Ti=tIntPi) - annotation (Placement(transformation(extent={{-30,72},{-10,92}}))); - Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) "On signal" - annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); - Modelica.Blocks.Interfaces.RealInput TSet - "Temperature setpoint of the condenser water" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput TWetBul - "Entering air wet bulb temperature" - annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=yorkCalc.PFan) annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); - Modelica.Blocks.Interfaces.RealOutput P "Power of the cooling tower module" - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEnt( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-78,0}))); - replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLea( - allowFlowReversal=true, - redeclare package Medium = MediumCW, - m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={44,0}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package - Medium = - MediumCW) - annotation (Placement(transformation(extent={{60,-10},{78,10}}))); - Buildings.Fluid.Sensors.Pressure senPreCWLea(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{94,-16},{74,-36}}))); - Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{-22,-16},{-42,-36}}))); - Modelica.Blocks.Math.RealToBoolean realToBoolean - annotation (Placement(transformation(extent={{-86,20},{-72,34}}))); - equation - connect(yorkCalc.port_a, val.port_b) annotation (Line( - points={{0,0},{-40,0}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(yorkCalc.TAir, TWetBul) annotation (Line( - points={{-2,4},{-20,4},{-20,-40},{-120,-40}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(realExpression.y, P) annotation (Line( - points={{21,-40},{110,-40}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(val.port_a, senTCWEnt.port_b) annotation (Line( - points={{-60,0},{-68,0}}, - color={0,127,255}, - thickness=1)); - connect(senTCWEnt.port_a, port_a_CW) annotation (Line( - points={{-88,0},{-100,0}}, - color={0,127,255}, - thickness=1)); - connect(yorkCalc.port_b, senTCWLea.port_a) annotation (Line( - points={{20,0},{34,0}}, - color={0,127,255}, - thickness=1)); - connect(senTCWLea.port_b, senMasFloCW.port_a) annotation (Line( - points={{54,0},{56,0},{60,0}}, - color={0,127,255}, - thickness=1)); - connect(senMasFloCW.port_b, port_b_CW) annotation (Line( - points={{78,0},{100,0}}, - color={0,127,255}, - thickness=1)); - connect(senPreCWLea.port, port_b_CW) annotation (Line( - points={{84,-16},{84,0},{100,0}}, - color={0,127,255}, - thickness=1)); - connect(senPreCWEnt.port, val.port_b) annotation (Line( - points={{-32,-16},{-32,-16},{-32,0},{-40,0}}, - color={0,127,255}, - thickness=1)); - connect(realToBoolean.u, On) annotation (Line( - points={{-87.4,27},{-92,27},{-92,40},{-120,40}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(realToBoolean.y, conPI.On) annotation (Line( - points={{-71.3,27},{-54,27},{-54,88},{-32,88}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(conPI.set, TSet) annotation (Line( - points={{-32,82},{-76,82},{-76,80},{-120,80}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(senTCWLea.T,conPI.mea) annotation (Line( - points={{44,11},{44,11},{44,40},{-44,40},{-44,76},{-32,76}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(conPI.y, yorkCalc.y) annotation (Line( - points={{-9,82},{12,82},{12,22},{-20,22},{-20,8},{-2,8}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(val.y, On) annotation (Line( - points={{-50,12},{-50,40},{-120,40}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-52,34},{58,-34}}, - lineColor={0,0,255}, - textString="CoolingTower"), - Text( - extent={{-44,-146},{50,-114}}, - lineColor={0,0,255}, - textString="%name")})); - end VSDCoolingTower; - - model Bypass "Three way bypass valve" - replaceable package MediumCW = - Modelica.Media.Interfaces.PartialMedium - "Medium condenser water side"; - parameter Modelica.Units.SI.Pressure dPByp_nominal - "Pressure difference between the outlet and inlet of the valve "; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal - "Nominal mass flow rate"; - Modelica.Fluid.Interfaces.FluidPort_a port_a1(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{90,30},{110,50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b2(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{90,-50},{110,-30}}))); - Modelica.Blocks.Interfaces.RealInput yBypVal "(0: closed, 1: open)" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloTow(redeclare package - Medium = MediumCW) - annotation (Placement(transformation(extent={{-60,30},{-80,50}}))); - Modelica.Blocks.Interfaces.RealOutput m_flow - "Mass flow rate through the cooling towers" - annotation (Placement(transformation(extent={{100,70},{120,90}}))); - Buildings.Fluid.Sensors.MassFlowRate senMasFloByp(redeclare package - Medium = MediumCW) annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={0,-20}))); - Modelica.Blocks.Interfaces.RealOutput m_flow_bypass - "Mass flow rate through the bypass " - annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a2(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{-110,-50},{-90,-30}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b1(redeclare package Medium = - MediumCW) - annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); - replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valByp( - redeclare package Medium = MediumCW, - m_flow_nominal=m_flow_nominal, - dpValve_nominal=dPByp_nominal) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={0,10}))); - equation - connect(port_a2, port_b2) annotation (Line( - points={{-100,-40},{100,-40}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(valByp.port_b, senMasFloByp.port_a) annotation (Line( - points={{0,0},{0,-10}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senMasFloByp.port_b, port_b2) annotation (Line( - points={{0,-30},{0,-40},{100,-40}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senMasFloTow.port_b, port_b1) annotation (Line( - points={{-80,40},{-100,40}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(senMasFloByp.m_flow, m_flow_bypass) annotation (Line( - points={{11,-20},{60,-20},{60,-80},{110,-80}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(senMasFloTow.m_flow, m_flow) annotation (Line( - points={{-70,51},{-70,60},{80,60},{80,80},{110,80}}, - color={0,0,127}, - smooth=Smooth.None, - pattern=LinePattern.Dash)); - connect(senMasFloTow.port_a, port_a1) annotation (Line( - points={{-60,40},{100,40}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(valByp.port_a, port_a1) annotation (Line( - points={{0,20},{0,40},{100,40}}, - color={0,127,255}, - smooth=Smooth.None, - thickness=1)); - connect(valByp.y, yBypVal) annotation (Line( - points={{-12,10},{-40,10},{-40,80},{-120,80}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-50,32},{56,-32}}, - lineColor={0,0,255}, - textString="BypassValve"), - Text( - extent={{-44,-142},{50,-110}}, - lineColor={0,0,255}, - textString="%name")})); - end Bypass; - - package BaseClasses - model YorkCalc - "Cooling tower with variable speed using the York calculation for the approach temperature" - extends - Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTower; - parameter Modelica.Units.SI.Efficiency eps( - min=0.1, - max=1) = 1 "Heat exchanger effectiveness"; - import cha = - Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.Characteristics; - - parameter Modelica.Units.SI.Temperature TAirInWB_nominal=273.15 + 25.55 - "Design inlet air wet bulb temperature" - annotation (Dialog(group="Nominal condition")); - parameter Modelica.Units.SI.TemperatureDifference TApp_nominal(displayUnit= - "K") = 3.89 "Design approach temperature" - annotation (Dialog(group="Nominal condition")); - parameter Modelica.Units.SI.TemperatureDifference TRan_nominal(displayUnit= - "K") = 5.56 "Design range temperature (water in - water out)" - annotation (Dialog(group="Nominal condition")); - parameter Real fraPFan_nominal(unit="W/(kg/s)") = 275/0.15 - "Fan power divided by water mass flow rate at design condition" - annotation(Dialog(group="Fan")); - parameter Modelica.Units.SI.Power PFan_nominal=fraPFan_nominal*m_flow_nominal - "Fan power" annotation (Dialog(group="Fan")); - - replaceable parameter cha.fan fanRelPow( - r_V = {0, 0.1, 0.3, 0.6, 1}, - r_P = {0, 0.1^3, 0.3^3, 0.6^3, 1}) - constrainedby cha.fan - "Fan relative power consumption as a function of control signal, fanRelPow=P(y)/P(y=1)" - annotation ( - choicesAllMatching=true, - Placement(transformation(extent={{60,60},{80,80}})), - Dialog(group="Fan")); - - parameter Real yMin(min=0.01, max=1, unit="1") = 0.3 - "Minimum control signal until fan is switched off (used for smoothing between forced and free convection regime)" - annotation(Dialog(group="Fan")); - - parameter Real fraFreCon(min=0, max=1) = 0.125 - "Fraction of tower capacity in free convection regime"; - - Modelica.Blocks.Interfaces.RealInput y(unit="1") "Fan control signal" - annotation (Placement(transformation( - extent={{-140,60},{-100,100}}))); - - Modelica.Blocks.Interfaces.RealInput TAir( - min=0, - unit="K", - displayUnit="degC") - "Entering air wet bulb temperature" - annotation (Placement(transformation( - extent={{-140,20},{-100,60}}))); - - Modelica.Blocks.Interfaces.RealOutput PFan( - final quantity="Power", - final unit="W")= - Buildings.Utilities.Math.Functions.spliceFunction( - pos=cha.normalizedPower(per=fanRelPow, r_V=y, d=fanRelPowDer) * PFan_nominal, - neg=0, - x=y-yMin+yMin/20, - deltax=yMin/20) - "Electric power consumed by fan" - annotation (Placement(transformation(extent={{100,70},{120,90}}), - iconTransformation(extent={{100,70},{120,90}}))); - - Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.BoundsYorkCalc bou - "Bounds for correlation"; - - Modelica.Units.SI.TemperatureDifference TRan(displayUnit="K") = T_a - T_b - "Range temperature"; - Modelica.Units.SI.TemperatureDifference TAppAct(displayUnit="K")= - Buildings.Utilities.Math.Functions.spliceFunction( - pos=TAppCor, - neg=TAppFreCon, - x=y - yMin + yMin/20, - deltax=yMin/20) "Approach temperature difference"; - Modelica.Units.SI.MassFraction FRWat=m_flow/mWat_flow_nominal - "Ratio actual over design water mass flow ratio"; - Modelica.Units.SI.MassFraction FRAir=y - "Ratio actual over design air mass flow ratio"; - - protected - package Water = Buildings.Media.Water "Medium package for water"; - parameter Real FRWat0(min=0, start=1, fixed=false) - "Ratio actual over design water mass flow ratio at nominal condition"; - parameter Modelica.Units.SI.Temperature TWatIn0(fixed=false) - "Water inlet temperature at nominal condition"; - parameter Modelica.Units.SI.Temperature TWatOut_nominal(fixed=false) - "Water outlet temperature at nominal condition"; - parameter Modelica.Units.SI.MassFlowRate mWat_flow_nominal( - min=0, - start=m_flow_nominal, - fixed=false) "Nominal water mass flow rate"; - - Modelica.Units.SI.TemperatureDifference dTMax(displayUnit="K") = T_a - TAir - "Maximum possible temperature difference"; - Modelica.Units.SI.TemperatureDifference TAppCor( - min=0, - displayUnit="K")= - Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( - TRan=TRan, - TWetBul=TAir, - FRWat=FRWat, - FRAir=Buildings.Utilities.Math.Functions.smoothMax( - x1=FRWat/bou.liqGasRat_max, - x2=FRAir, - deltaX=0.01)) "Approach temperature for forced convection"; - Modelica.Units.SI.TemperatureDifference TAppFreCon( - min=0, - displayUnit="K") = (1 - fraFreCon)*dTMax + fraFreCon* - Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( - TRan=TRan, - TWetBul=TAir, - FRWat=FRWat, - FRAir=1) "Approach temperature for free convection"; - - final parameter Real fanRelPowDer[size(fanRelPow.r_V,1)](each fixed=false) - "Coefficients for fan relative power consumption as a function of control signal"; - - Modelica.Units.SI.Temperature T_a "Temperature in port_a"; - Modelica.Units.SI.Temperature T_b "Temperature in port_b"; - - Modelica.Blocks.Sources.RealExpression QWat_flow( - y = eps*m_flow*( - Medium.specificEnthalpy(Medium.setState_pTX( - p=port_b.p, - T=TAir + TAppAct, - X=inStream(port_b.Xi_outflow))) - - inStream(port_a.h_outflow))) - "Heat input into water" - annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); - initial equation - TWatOut_nominal = TAirInWB_nominal + TApp_nominal; - TRan_nominal = TWatIn0 - TWatOut_nominal; // by definition of the range temp. - TApp_nominal = Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( - TRan=TRan_nominal, TWetBul=TAirInWB_nominal, - FRWat=FRWat0, FRAir=1); // this will be solved for FRWat0 - mWat_flow_nominal = m_flow_nominal/FRWat0; - - // Derivatives for spline that interpolates the fan relative power - fanRelPowDer = Buildings.Utilities.Math.Functions.splineDerivatives( - x=fanRelPow.r_V, - y=fanRelPow.r_P, - ensureMonotonicity=Buildings.Utilities.Math.Functions.isMonotonic(x=fanRelPow.r_P, - strict=false)); - // Check validity of relative fan power consumption at y=yMin and y=1 - assert(cha.normalizedPower(per=fanRelPow, r_V=yMin, d=fanRelPowDer) > -1E-4, - "The fan relative power consumption must be non-negative for y=0." - + "\n Obtained fanRelPow(0) = " + String(cha.normalizedPower(per=fanRelPow, r_V=yMin, d=fanRelPowDer)) - + "\n You need to choose different values for the parameter fanRelPow."); - assert(abs(1-cha.normalizedPower(per=fanRelPow, r_V=1, d=fanRelPowDer))<1E-4, "The fan relative power consumption must be one for y=1." - + "\n Obtained fanRelPow(1) = " + String(cha.normalizedPower(per=fanRelPow, r_V=1, d=fanRelPowDer)) - + "\n You need to choose different values for the parameter fanRelPow." - + "\n To increase the fan power, change fraPFan_nominal or PFan_nominal."); - - // Check that a medium is used that has the same definition of enthalpy vs. temperature. - // This is needed because below, T_a=Water.temperature needed to be hard-coded to use - // Water.* instead of Medium.* in the function calls due to a bug in OpenModelica. - assert(abs(Medium.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default) - - Water.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default)) < 1E-5 and - abs(Medium.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default) - - Water.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default)) < 1E-5, - "The selected medium has an enthalpy computation that is not consistent - with the one in Buildings.Media.Water - Use a different medium, such as Buildings.Media.Water."); - equation - // States at the inlet and outlet - - if allowFlowReversal then - if homotopyInitialization then - T_a=Water.temperature(Water.setState_phX(p=port_a.p, - h=homotopy(actual=actualStream(port_a.h_outflow), - simplified=inStream(port_a.h_outflow)), - X=homotopy(actual=actualStream(port_a.Xi_outflow), - simplified=inStream(port_a.Xi_outflow)))); - T_b=Water.temperature(Water.setState_phX(p=port_b.p, - h=homotopy(actual=actualStream(port_b.h_outflow), - simplified=port_b.h_outflow), - X=homotopy(actual=actualStream(port_b.Xi_outflow), - simplified=port_b.Xi_outflow))); - - else - T_a=Water.temperature(Water.setState_phX(p=port_a.p, - h=actualStream(port_a.h_outflow), - X=actualStream(port_a.Xi_outflow))); - T_b=Water.temperature(Water.setState_phX(p=port_b.p, - h=actualStream(port_b.h_outflow), - X=actualStream(port_b.Xi_outflow))); - end if; // homotopyInitialization - - else // reverse flow not allowed - T_a=Water.temperature(Water.setState_phX(p=port_a.p, - h=inStream(port_a.h_outflow), - X=inStream(port_a.Xi_outflow))); - T_b=Water.temperature(Water.setState_phX(p=port_b.p, - h=inStream(port_b.h_outflow), - X=inStream(port_b.Xi_outflow))); - end if; - - connect(QWat_flow.y, preHea.Q_flow) - annotation (Line(points={{-59,-60},{-40,-60}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), graphics={ - Text( - extent={{-104,70},{-70,32}}, - lineColor={0,0,127}, - textString="TWB"), - Text( - extent={{-50,4},{42,-110}}, - lineColor={255,255,255}, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid, - textString="York"), - Rectangle( - extent={{-100,81},{-70,78}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{78,-58},{102,-62}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{78,-60},{82,-4}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{70,-58},{104,-96}}, - lineColor={0,0,127}, - textString="TLvg"), - Rectangle( - extent={{70,56},{82,52}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{78,54},{82,80}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{64,114},{98,76}}, - lineColor={0,0,127}, - textString="PFan"), - Ellipse( - extent={{0,62},{54,50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-54,62},{0,50}}, - lineColor={255,255,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{78,82},{100,78}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{-98,100},{-86,84}}, - lineColor={0,0,127}, - textString="y")}), - Documentation(info=" -

    -Model for a steady-state or dynamic cooling tower with variable speed fan using the York calculation for the -approach temperature at off-design conditions. -

    -

    Thermal performance

    -

    -To compute the thermal performance, this model takes as parameters -the approach temperature, the range temperature and the inlet air wet bulb temperature -at the design condition. Since the design mass flow rate (of the chiller condenser loop) -is also a parameter, these parameters define the rejected heat. -

    -

    -For off-design conditions, the model uses the actual range temperature and a polynomial -to compute the approach temperature for free convection and for forced convection, i.e., -with the fan operating. The polynomial is valid for a York cooling tower. -If the fan input signal y is below the minimum fan revolution yMin, -then the cooling tower operates in free convection mode, otherwise it operates in -the forced convection mode. -For numerical reasons, this transition occurs in the range of y ∈ [0.9*yMin, yMin]. -

    -

    Fan power consumption

    -

    -The fan power consumption at the design condition can be specified as follows: -

    - -

    -In the forced convection mode, the actual fan power is -computed as PFan=fanRelPow(y) * PFan_nominal, where -the default value for the fan relative power consumption at part load is -fanRelPow(y)=y3. -In the free convection mode, the fan power consumption is zero. -For numerical reasons, the transition of fan power from the part load mode -to zero power consumption in the free convection mode occurs in the range -y ∈ [0.9*yMin, yMin]. -
    -To change the fan relative power consumption at part load in the forced convection mode, -points of fan controls signal and associated relative power consumption can be specified. -In between these points, the values are interpolated using cubic splines. -

    -

    Comparison the cooling tower model of EnergyPlus

    -

    -This model is similar to the model Cooling Tower:Variable Speed that -is implemented in the EnergyPlus building energy simulation program version 6.0. -The main differences are -

    -
      -
    1. -Not implemented are the basin heater power consumption, and -the make-up water usage. -
    2. -
    3. -The model has no built-in control to switch individual cells of the tower on or off. -To switch cells on or off, use multiple instances of this model, and use your own -control law to compute the input signal y. -
    4. -
    -

    Assumptions and limitations

    -

    -This model requires a medium that has the same computation of the enthalpy as - -Buildings.Media.Water, -which computes -

    -

    - h = cp (T-T0), -

    -

    -where -h is the enthalpy, -cp = 4184 J/(kg K) is the specific heat capacity, -T is the temperature in Kelvin and -T0 = 273.15 Kelvin. -If this is not the case, the simulation will stop with an error message. -The reason for this limitation is that as of January 2015, OpenModelica -failed to translate the model if Medium.temperature() is used -instead of -Water.temperature(). -

    -

    References

    -

    -EnergyPlus 2.0.0 Engineering Reference, April 9, 2007. -

    -", revisions=" - -")); - end YorkCalc; - end BaseClasses; - end CoolingTower; - - package Control "Basic control models for waterside system" - - model PlantStageCondition - "Stage checking for N chillers or N boilers" - - parameter Real thehol[n-1] - "Threshold"; - - parameter Real Cap[n] - "Normal Cooling Capacity"; - - parameter Integer n=3 - "Number of chillers"; - - Real PLR - "Part load ratio"; - Real cap_avi - "Available cooling capacity"; - - Modelica.Blocks.Interfaces.RealInput Loa "Load signal" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput Status[n] "Status signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Interfaces.BooleanOutput On[n] "Staging up signal" - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Modelica.Blocks.Interfaces.BooleanOutput Off[n] "Staging down signal" - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Modelica.Blocks.Interfaces.BooleanInput OnSin "On signal" - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - - algorithm - cap_avi :=0; - for i in 1:n loop - cap_avi :=cap_avi + Status[i]*Cap[i]; - end for; - if cap_avi>0.01 then - PLR:=Loa/cap_avi; - else - PLR:=0; - end if; - On[1] :=OnSin; - Off[1] :=not OnSin; - - for i in 2:n loop - On[i] :=PLR > thehol[i - 1] and Status[i - 1] > 0; - end for; - - for i in 2:n loop - Off[i] :=PLR*(sum(Status)/(sum(Status) - 1 + 0.0001)) < thehol[i - 1] - and Status[i] > 0; - end for; - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-56,42},{58,-42}}, - lineColor={0,0,255}, - textString="StageCheck"), - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name")}), - Documentation(revisions=" - -")); - end PlantStageCondition; - - model PlantStageN "Combined stage controller for N chillers or N boilers" - parameter Real tWai "Waiting time"; - - parameter Real thehol[n-1] "Threshold"; - - parameter Real Cap[n] "Rated Plant Capacity"; - - parameter Integer n=3 - "the number of chillers"; - - Modelica.Blocks.Interfaces.RealOutput y[n]( each start=0) - "Output of stage control" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput - On "On signal" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput sta[n] "Compressor speed ratio" - annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Interfaces.RealInput loa - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - PlantStageCondition plantNStageCondition( - thehol=thehol, - n=n, - Cap=Cap) annotation (Placement(transformation(extent={{-60,-16},{ - -40,4}}))); - BaseClasses.StageN nSta(tWai=tWai, n=n) - annotation (Placement(transformation(extent={{-8,-18},{12,2}}))); - equation - - for i in 1:n loop - y[i] =if i <= integer(nSta.y) then 1 else 0; - end for; - - connect(plantNStageCondition.OnSin, On) annotation (Line( - points={{-62,-6},{-80,-6},{-80,80},{-120,80}}, - color={255,0,255})); - connect(plantNStageCondition.Loa,loa) annotation (Line( - points={{-62,0},{-120,0}}, - color={0,0,127})); - connect(plantNStageCondition.Status, sta) annotation (Line(points={{-62, - -12},{-80,-12},{-80,-80},{-120,-80}}, color={0,0,127})); - connect(plantNStageCondition.Off, nSta.Off) annotation (Line(points={ - {-39,-10},{-24,-10},{-24,-14},{-10,-14}}, color={255,0,255})); - connect(plantNStageCondition.On, nSta.On) - annotation (Line(points={{-39,-2},{-10,-2}}, color={255,0,255})); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-56,42},{58,-42}}, - lineColor={0,0,255}, - textString="ChiSta"), - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Text( - extent={{-152,106},{148,146}}, - textString="%name", - textColor={0,0,255})}), - Documentation(revisions=" - -")); - end PlantStageN; - - model PumpStageCondition "Stage checking for N pumps" - - parameter Real thehol_up "Threshold for staging up"; - - parameter Real thehol_down "Threshold for staging down"; - - parameter Integer n=3 - "the number of chillers"; - - Modelica.Blocks.Interfaces.RealInput Status[n] "On signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Interfaces.BooleanOutput On[n] - annotation (Placement(transformation(extent={{100,30},{120,50}}))); - Modelica.Blocks.Interfaces.BooleanOutput Off[n] - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Modelica.Blocks.Interfaces.BooleanInput OnSin "On signal" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - equation - - On[1] = OnSin; - Off[1] = not OnSin; - for i in 2:n loop - On[i] = Status[i-1]>thehol_up and Status[i-1]>0; - end for; - - for i in 2:n loop - Off[i] = Status[i]0; - end for; - - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-56,42},{58,-42}}, - lineColor={0,0,255}, - textString="StageCheck"), - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Text( - extent={{-152,104},{148,144}}, - textString="%name", - textColor={0,0,255})}), - Documentation(revisions=" - -")); - end PumpStageCondition; - - model PumpStageN "Combined stage controller for N pumps" - parameter Real tWai "Waiting time"; - - parameter Real thehol_up = 0.9 "Threshold for staging up"; - - parameter Real thehol_down = 0.6 "Threshold for staging down"; - - parameter Integer n=3 - "the number of pumps"; - - Modelica.Blocks.Interfaces.RealOutput y[n] - "Output of stage control" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput - On "On signal" - annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); - Modelica.Blocks.Interfaces.RealInput sta[n] "Compressor speed ratio" - annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); - PumpStageCondition pumNStaCon( - n=n, - thehol_up=thehol_up, - thehol_down=thehol_down) - annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - BaseClasses.StageN pumNSta(tWai=tWai, n=n) - annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); - equation - - for i in 1:n loop - y[i]=if i > pumNSta.y then 0 else 1; - - end for; - - connect(pumNStaCon.OnSin, On) annotation (Line(points={{-62,6},{-80,6}, - {-80,80},{-120,80}}, color={255,0,255})); - connect(pumNStaCon.Status, sta) annotation (Line(points={{-62,-6},{-80, - -6},{-80,-80},{-120,-80}}, color={0,0,127})); - connect(pumNStaCon.Off, pumNSta.Off) annotation (Line(points={{-39,-4}, - {-20,-4},{-20,-6},{-10,-6}}, color={255,0,255})); - connect(pumNStaCon.On, pumNSta.On) annotation (Line(points={{-39,4},{ - -20,4},{-20,6},{-10,6}}, color={255,0,255})); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-54,42},{60,-42}}, - lineColor={0,0,255}, - textString="PumSta"), - Text( - extent={{-154,102},{146,142}}, - textString="%name", - textColor={0,0,255})}), - Documentation(revisions=" - -")); - end PumpStageN; - - package BaseClasses - - block MultiSwitch - "Set Real expression that is associated with the first active input signal" - - input Real expr[nu]=fill(0.0, nu) - "y = if u[i] then expr[i] else y_default (time varying)" - annotation (Dialog); - parameter Real y_default=0.0 - "Default value of output y if all u[i] = false"; - - parameter Integer nu(min=0) = 0 "Number of input connections" - annotation (Dialog(connectorSizing=true), HideResult=true); - parameter Integer precision(min=0) = 3 - "Number of significant digits to be shown in dynamic diagram layer for y" - annotation (Dialog(tab="Advanced")); - - Modelica.Blocks.Interfaces.BooleanVectorInput u[nu] - "Set y = expr[i], if u[i] = true" - annotation (Placement(transformation(extent={{-110,30},{-90,-30}}))); - Modelica.Blocks.Interfaces.RealOutput y "Output depending on expression" - annotation (Placement(transformation(extent={{300,-10},{320,10}}))); - - protected - Integer firstActiveIndex; - - equation - firstActiveIndex = Modelica.Math.BooleanVectors.firstTrueIndex(u); - y = if firstActiveIndex == 0 then y_default else expr[firstActiveIndex]; - annotation ( - defaultComponentName="multiSwitch1", - Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{300, - 100}}), graphics={ - Rectangle( - extent={{-100,-51},{300,50}}, - lineThickness=5.0, - lineColor={0,0,0}, - fillColor={170,213,255}, - fillPattern=FillPattern.Solid, - borderPattern=BorderPattern.Raised), - Text( - extent={{-86,16},{295,-17}}, - lineColor={0,0,0}, - fillColor={255,246,238}, - fillPattern=FillPattern.Solid, - textString="%expr"), - Text( - extent={{310,-25},{410,-45}}, - lineColor={0,0,0}, - textString=DynamicSelect(" ", String( - y, - minimumLength=1, - significantDigits=precision))), - Text( - extent={{-100,-60},{300,-90}}, - lineColor={0,0,0}, - textString="else: %y_default"), - Text( - extent={{-100,100},{300,60}}, - textString="%name", - lineColor={0,0,255})}), - Documentation(info=" -

    -This block has a vector of Boolean input signals u[nu] and a vector of -(time varying) Real expressions expr[nu]. The output signal y is -set to expr[i], if i is the first element in the input vector u that is true. If all input signals are -false, y is set to parameter \"y_default\". -

    - -
    -  // Conceptual equation (not valid Modelica)
    -  i = 'first element of u[:] that is true';
    -  y = if i==0 then y_default else expr[i];
    -
    - -

    -The input connector is a vector of Boolean input signals. -When a connection line is drawn, the dimension of the input -vector is enlarged by one and the connection is automatically -connected to this new free index (thanks to the -connectorSizing annotation). -

    - -

    -The usage is demonstrated, e.g., in example -Modelica.Blocks.Examples.RealNetwork1. -

    - -")); - end MultiSwitch; - - model StageN "Stage controller for N states" - parameter Real tWai "Waiting time"; - - parameter Integer n=3 - "the number of chillers"; - - Modelica.StateGraph.InitialStepWithSignal - AllOff( - nOut=1, nIn=1) - "Both of the two compressors are off" - annotation (Placement(transformation(extent={{-10,10},{10,-10}}, - rotation=-90, - origin={0,72}))); - Modelica.Blocks.Interfaces.BooleanInput On[n] "On signal" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.StateGraph.StepWithSignal iOn[n-1](nIn=2, nOut=2) annotation ( - Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={0,2}))); - Modelica.StateGraph.TransitionWithSignal - Off2One annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-50,44}))); - Modelica.StateGraph.TransitionWithSignal - One2Off annotation ( - Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=90, - origin={52,48}))); - Modelica.StateGraph.StepWithSignal nOn(nOut=1, nIn=1) - annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={0,-80}))); - Modelica.StateGraph.TransitionWithSignal - nmin12n( - enableTimer=true, - waitTime=tWai) annotation ( - Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-50,-54}))); - Modelica.StateGraph.TransitionWithSignal - N2Nmin1( - waitTime=tWai, - enableTimer=true) annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=90, - origin={40,-60}))); - inner Modelica.StateGraph.StateGraphRoot stateGraphRoot - annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); - BaseClasses.MultiSwitch - multiSwitch(nu=n+1, expr=linspace( - 0, - n, - n + 1)) - annotation (Placement(transformation(extent={{76,-26},{92,-6}}))); - Modelica.StateGraph.TransitionWithSignal - imin12i[n - 2]( - enableTimer=true, - waitTime=tWai) annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-50,0}))); - Modelica.StateGraph.TransitionWithSignal - i2imin1[n - 2]( - waitTime=tWai, - enableTimer=true) annotation (Placement( - transformation( - extent={{-10,10},{10,-10}}, - rotation=90, - origin={66,0}))); - Modelica.Blocks.Interfaces.BooleanInput Off[n] "On signal" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); - Modelica.Blocks.Interfaces.RealOutput y "Output depending on expression" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - equation - - connect(AllOff.outPort[1], Off2One.inPort) annotation (Line(points={{0,61.5},{ - 0,61.5},{0,54},{0,52},{-50,52},{-50,48}}, color={0,0,0})); - connect(nmin12n.outPort, nOn.inPort[1]) annotation (Line(points={{-50,-55.5},{ - -50,-62},{0,-62},{0,-66},{6.66134e-016,-66},{6.66134e-016,-69}}, - color={0,0,0})); - connect(nOn.outPort[1], N2Nmin1.inPort) annotation (Line(points={{-6.66134e-016, - -90.5},{-6.66134e-016,-98},{40,-98},{40,-64}}, - color={0,0,0})); - connect(One2Off.outPort, AllOff.inPort[1]) annotation (Line(points={{52,49.5}, - {52,49.5},{52,86},{52,88},{1.9984e-015,88},{1.9984e-015,83}}, color={ - 0,0,0})); - - connect(Off2One.outPort, iOn[1].inPort[1]) annotation (Line(points={{-50,42.5}, - {-50,42.5},{-50,26},{-0.5,26},{-0.5,13}}, color={0,0,0})); - connect(iOn[1].outPort[2], One2Off.inPort) annotation (Line(points={{0.25, - -8.5},{2,-8.5},{2,-20},{52,-20},{52,44}}, - color={0,0,0})); - connect(nmin12n.inPort, iOn[n-1].outPort[1]) annotation (Line(points={{-50,-50}, - {-50,-40},{-0.25,-40},{-0.25,-8.5}}, color={0,0,0})); - - connect(AllOff.active, multiSwitch.u[1]); - for i in 1:n-1 loop - connect(iOn[i].active, multiSwitch.u[i + 1]); - end for; - connect(nOn.active, multiSwitch.u[n + 1]); - - connect(Off2One.condition, On[1]); - for i in 1:n-2 loop - connect(imin12i[i].condition, On[i+1]); - end for; - connect(nmin12n.condition, On[n]); - - connect(One2Off.condition, Off[1]); - for i in 1:n-2 loop - connect(i2imin1[i].condition, Off[i+1]); - end for; - connect(N2Nmin1.condition, Off[n]); - for i in 1:n-2 loop - connect(iOn[i].outPort[1], imin12i[i].inPort); - connect(imin12i[i].outPort, iOn[i+1].inPort[1]); - connect(i2imin1[i].inPort, iOn[i+1].outPort[2]); - connect(i2imin1[i].outPort, iOn[i].inPort[2]); - end for; - - connect(N2Nmin1.outPort, iOn[n-1].inPort[2]) annotation (Line(points={{40, - -58.5},{40,-58.5},{40,16},{0.5,16},{0.5,13}}, - color={0,0,0})); - connect(multiSwitch.y, y) annotation (Line( - points={{92.4,-16},{96,-16},{98,-16},{98,0},{110,0}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,255}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-56,42},{58,-42}}, - lineColor={0,0,255}, - textString="CompressorStage"), - Text( - extent={{-44,-144},{50,-112}}, - lineColor={0,0,255}, - textString="%name"), - Text( - extent={{-150,106},{150,146}}, - textString="%name", - textColor={0,0,255})}), - Documentation(revisions=" - -")); - end StageN; - end BaseClasses; - - end Control; - - package Network - - model PipeNetwork "Water distribution network" - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the air"; - parameter Modelica.Units.SI.Pressure PreDroMai1 - "Pressure drop 1 across the duct"; - - parameter Modelica.Units.SI.Pressure PreDroMai2 - "Pressure drop 2 across the main duct"; - - parameter Modelica.Units.SI.Pressure PreDroBra1 - "Pressure drop 1 across the duct branch 1"; - - parameter Modelica.Units.SI.Pressure PreDroBra2 - "Pressure drop 1 across the duct branch 2"; - - parameter Modelica.Units.SI.Pressure PreDroBra3 - "Pressure drop 1 across the duct branch 3"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat1 - "mass flow rate for the first branch1"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat2 - "mass flow rate for the first branch2"; - - parameter Modelica.Units.SI.MassFlowRate mFloRat3 - "mass flow rate for the first branch3"; - - Buildings.Fluid.FixedResistances.Junction junSup1(m_flow_nominal={mFloRat1 + mFloRat2 + mFloRat3,-mFloRat2-mFloRat3,- - mFloRat1}, redeclare package Medium = Medium, - dp_nominal={PreDroMai1/2,PreDroMai2/2,PreDroBra1/2}) - annotation (Placement(transformation(extent={{-90,30},{-70,50}}))); - Buildings.Fluid.FixedResistances.Junction junRet1(redeclare package - Medium = Medium, m_flow_nominal={mFloRat2 + mFloRat3,-mFloRat1-mFloRat2-mFloRat3,mFloRat1}, - dp_nominal={PreDroMai2/2,PreDroMai1/2,PreDroBra1/2}) - annotation (Placement(transformation(extent={{-70,-70},{-90,-50}}))); - Buildings.Fluid.FixedResistances.Junction junRet2( redeclare package - Medium = Medium, m_flow_nominal={mFloRat3,-mFloRat2-mFloRat3,mFloRat2}, - dp_nominal={PreDroBra3/2,PreDroMai2/2,PreDroBra2/2}) - annotation (Placement(transformation(extent={{10,-70},{-10,-50}}))); - Buildings.Fluid.FixedResistances.Junction junSup2(m_flow_nominal={mFloRat2 + mFloRat3,-mFloRat3,- - mFloRat2}, redeclare package Medium = Medium, - dp_nominal={PreDroMai2/2,PreDroBra3/2,PreDroBra2/2}) - annotation (Placement(transformation(extent={{-10,30},{10,50}}))); - - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = - Medium) "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = - Medium) "Second port, typically outlet" - annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); - Buildings.Fluid.Sensors.RelativePressure senRelPre(redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{-80,-26},{-60,-6}}))); - Modelica.Fluid.Interfaces.FluidPorts_b ports_b[3](redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{90,6},{110,86}}))); - Modelica.Fluid.Interfaces.FluidPorts_a ports_a[3](redeclare package - Medium = Medium) - annotation (Placement(transformation(extent={{90,-102},{110,-22}}))); - Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - equation - connect(junSup1.port_2, junSup2.port_1) annotation (Line( - points={{-70,40},{-10,40}}, - color={0,127,255}, - thickness=1)); - connect(junRet2.port_2, junRet1.port_1) - annotation (Line( - points={{-10,-60},{-10,-60},{-70,-60}}, - color={0,127,255}, - thickness=1)); - connect(junRet1.port_2, port_b) annotation (Line( - points={{-90,-60},{-100,-60}}, - color={0,127,255}, - thickness=1)); - connect(junSup1.port_1, port_a) annotation (Line( - points={{-90,40},{-100,40}}, - color={0,127,255}, - thickness=1)); - - connect(ports_b, ports_b) annotation (Line(points={{100,46},{100,46}}, color={0,127,255})); - connect(junSup2.port_3, ports_b[2]) - annotation (Line( - points={{0,30},{0,30},{0,8},{84,8},{84,46},{100,46}}, - color={0,127,255}, - thickness=1)); - connect(junSup1.port_3, ports_b[1]) - annotation (Line( - points={{-80,30},{-80,30},{-80,0},{90,0},{90,19.3333},{100,19.3333}}, - color={0,127,255}, - thickness=1)); - connect(junRet2.port_3, ports_a[2]) - annotation (Line( - points={{0,-70},{0,-86},{100,-86},{100,-62}}, - color={0,127,255}, - thickness=1)); - connect(junRet1.port_3, ports_a[1]) - annotation (Line( - points={{-80,-70},{-80,-70},{-80,-94},{100,-94},{100,-88.6667}}, - color={0,127,255}, - thickness=1)); - connect(junSup2.port_2, ports_b[3]) - annotation (Line( - points={{10,40},{100,40},{100,72.6667}}, - color={0,127,255}, - thickness=1)); - connect(junRet2.port_1, ports_a[3]) - annotation (Line( - points={{10,-60},{100,-60},{100,-35.3333}}, - color={0,127,255}, - thickness=1)); - connect(senRelPre.port_a, port_a) annotation (Line(points={{-80,-16},{-94,-16},{-94,40},{-100,40}}, color={0,127, - 255})); - connect(senRelPre.port_b, port_b) - annotation (Line(points={{-60,-16},{-48,-16},{-48,-40},{-94,-40},{-94,-60},{-100,-60}}, color={0,127, - 255})); - connect(senRelPre.p_rel, p) annotation (Line( - points={{-70,-25},{-70,-34},{90,-34},{90,0},{110,0}}, - color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Line(points={{-90,40},{80,40}}, color={0,127,255}), - Line(points={{-90,-60},{80,-60}}, color={0,127,255}), - Line(points={{80,40},{80,-60}}, color={0,127,255}), - Line(points={{50,40},{50,-60}}, color={0,127,255}), - Line(points={{20,40},{20,-60}}, color={0,127,255}), - Text( - extent={{-148,106},{152,146}}, - textString="%name", - textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); - end PipeNetwork; - end Network; - annotation (Documentation(info=" -

    This package contains component models that are used to construct the chillers with two compressors.

    -")); - end WaterSide; -annotation (Documentation(info=" -

    This package contains component models with controls for the large office testcase.

    -")); -end Component; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/BaseClasses.mo new file mode 100644 index 000000000..1499d8adf --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/BaseClasses.mo @@ -0,0 +1,65 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.AirHandlingUnit; +package BaseClasses + + model OccupancyMode "Occupied mdoe controller" + + parameter Real start_time; + parameter Real end_time; + + Modelica.Blocks.Sources.BooleanExpression + booleanExpression(y=(mod(time,86400) > start_time*3600) and (mod(time,86400) < end_time*3600)) + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + Modelica.Blocks.Interfaces.BooleanOutput Occ annotation (Placement(transformation(extent={{100,-20},{140,20}}))); + equation + connect(booleanExpression.y, Occ) annotation (Line(points={{9,0},{120,0}}, color={255,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-42,38},{44,-46}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.None, + textString="Occ"), + Text( + extent={{-152,104},{148,144}}, + textString="%name", + textColor={0,0,255})}), + Diagram(coordinateSystem(preserveAspectRatio=false))); + end OccupancyMode; + + model ZoneSetpoint + "Zone air temperature setPoint controller based on the occupancy signal" + parameter Integer n=2 "dimenison of the setpoint vector"; + parameter Real setpoint_on[n] "the values of setpoint during 'on' period"; + parameter Real setpoint_off[n] "the values of setpoint during 'off' period"; + + Modelica.Blocks.Sources.RealExpression realExpression[n](y=noEvent(if Occ then setpoint_on else setpoint_off)) + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + Modelica.Blocks.Interfaces.BooleanInput Occ + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealOutput SetPoi[n] + annotation (Placement(transformation(extent={{100,-20},{140,20}}))); + equation + connect(realExpression.y, SetPoi) annotation (Line(points={{9,0},{120,0}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-42,38},{44,-46}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.None, + textString="SetPo"), + Text( + extent={{-154,102},{146,142}}, + textString="%name", + textColor={0,0,255})}), + Diagram(coordinateSystem(preserveAspectRatio=false))); + end ZoneSetpoint; + +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/DuaFanAirHanUnit.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/DuaFanAirHanUnit.mo new file mode 100644 index 000000000..af443e8d6 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/DuaFanAirHanUnit.mo @@ -0,0 +1,500 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.AirHandlingUnit; +model DuaFanAirHanUnit "AHU with supply/return fans and cooling coil." + + replaceable package MediumAir = + Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + replaceable package MediumWat = + Modelica.Media.Interfaces.PartialMedium "Medium for the water"; + parameter Real UA "Rated heat exchange coefficients"; + parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.MassFlowRate mWatFloRat + "mass flow rate for water"; + parameter Modelica.Units.SI.Pressure PreDroCoiAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroMixingBoxAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroWat + "Pressure drop in the water side"; + parameter Real Coi_k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Coi_Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + parameter Modelica.Units.SI.Efficiency eps(max=1) = 1 + "Heat exchanger effectiveness"; + + parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat + "mass flow rate for fresh air"; + parameter Modelica.Units.SI.Temperature TemEcoHig + "the highest temeprature when the economizer is on"; + parameter Modelica.Units.SI.Temperature TemEcoLow + "the lowest temeprature when the economizer is on"; + parameter Real MixingBoxDamMin "the minimum damper postion"; + parameter Real MixingBox_k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time MixingBox_Ti(min=Modelica.Constants.small)= + 0.5 "Time constant of Integrator block"; + + parameter Real Fan_k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Fan_Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + parameter Modelica.Units.SI.Time waitTime(min=0) = 0 + "Wait time before transition fires"; + parameter Real Fan_SpeRat + "Speed ratio"; + parameter Integer numTemp(min=1) = 1 + "The size of the temeprature vector"; + parameter Real HydEff[:] "Hydraulic efficiency"; + parameter Real MotEff[:] "Motor efficiency"; + parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] + "Volume flow rate curve"; + parameter Modelica.Units.SI.Pressure SupPreCur[:] "Supply Fan Pressure curve"; + parameter Modelica.Units.SI.Pressure RetPreCur[:] "Return Fan Pressure curve"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor + retFan( + redeclare package Medium = MediumAir, + HydEff=HydEff, + MotEff=MotEff, + VolFloCur=VolFloCur, + TimCon=1, + PreCur=RetPreCur) + annotation (Placement(transformation(extent={{-10,-90},{-30,-70}}))); + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.VAVSupFan + supFan( + redeclare package Medium = MediumAir, + TimCon=1, + k=Fan_k, + Ti=Fan_Ti, + waitTime=waitTime, + SpeRat=Fan_SpeRat, + numTemp=numTemp, + HydEff=HydEff, + MotEff=MotEff, + VolFloCur=VolFloCur, + PreCur=SupPreCur) + annotation (Placement(transformation(extent={{18,-10},{38,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package + Medium = MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.CoolingCoil + cooCoi( + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat, + mWatFloRat=mWatFloRat, + PreDroAir=PreDroCoiAir, + PreDroWat=PreDroWat, + k=Coi_k, + Ti=Coi_Ti, + UA=UA*1.2*eps) + annotation (Placement(transformation(extent={{-2,-2},{-20,18}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox.MixingBoxWithControl + mixBox( + mTotAirFloRat=mAirFloRat, + redeclare package Medium = MediumAir, + PreDro=PreDroMixingBoxAir, + mFreAirFloRat=mFreAirFloRat, + TemHig=TemEcoHig, + TemLow=TemEcoLow, + DamMin=MixingBoxDamMin, + k=MixingBox_k, + Ti=MixingBox_Ti) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-60,0}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = MediumWat) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{10,90},{30,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = MediumWat) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-50,90},{-30,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Exh_Air(redeclare package + Medium = MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-112,-10},{-92,10}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_Fre_Air(redeclare package + Medium = MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package + Medium = MediumAir) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); + Modelica.Blocks.Interfaces.BooleanInput On + annotation (Placement(transformation(extent={{-120,-110},{-100,-90}}))); + Modelica.Blocks.Interfaces.RealInput disTSet + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,-30},{-100,-10}}))); + Modelica.Blocks.Interfaces.RealInput pSet + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,-70},{-100,-50}}))); + Modelica.Blocks.Interfaces.RealInput pMea + "Connector of measurement input signal" annotation (Placement( + transformation(extent={{-120,84},{-100,104}}))); + Modelica.Blocks.Interfaces.RealInput cooTSet[numTemp] + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,30},{-100,50}}))); + Modelica.Blocks.Interfaces.RealInput zonT[numTemp] + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,-50},{-100,-30}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTDisAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + annotation (Placement(transformation(extent={{76,-6},{88,6}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=100000) + annotation (Placement(transformation(extent={{40,66},{60,86}}))); + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{50,40},{30,60}}))); + Modelica.Blocks.Interfaces.RealInput heaTSet[numTemp] + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,70},{-100,90}}))); + Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=true) + annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); + Modelica.Blocks.Interfaces.RealInput TOut "outdoor air temperature" + annotation (Placement(transformation(extent={{-120,-90},{-100,-70}}))); + Modelica.Blocks.Interfaces.RealOutput TSupAir( + final unit="K", + final displayUnit="degC", + final quantity="ThermodynamicTemperature") + "AHU supply air temperature" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTMixAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + annotation (Placement(transformation(extent={{-44,-10},{-24,10}}))); + Modelica.Blocks.Interfaces.RealOutput TMixAir( + final unit="K", + final displayUnit="degC", + final quantity="ThermodynamicTemperature") "Mixing air temperature" + annotation (Placement(transformation(extent={{100,18},{120,38}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTRetAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + annotation (Placement(transformation(extent={{86,-88},{70,-72}}))); + Modelica.Blocks.Interfaces.RealOutput TRetAir "AHU return air temperature" + annotation (Placement(transformation(extent={{100,-64},{120,-44}}))); + Buildings.Fluid.Sensors.VolumeFlowRate senVolFloSupAir( + redeclare package Medium = MediumAir, + m_flow_nominal=mAirFloRat, + tau=1) annotation (Placement(transformation(extent={{60,-6},{72,6}}))); + Modelica.Blocks.Interfaces.RealOutput V_flowSupAir( + final min=0, + final unit = "m3/s", + final quantity = "VolumeFlowRate") "Supply air volume flow rate" + annotation (Placement(transformation(extent={{100,6},{120,26}}))); + Buildings.Fluid.Sensors.VolumeFlowRate senVolFloRetAir( + redeclare package Medium = MediumAir, + m_flow_nominal=mAirFloRat, + tau=1) + annotation (Placement(transformation(extent={{54,-88},{38,-72}}))); + Modelica.Blocks.Interfaces.RealOutput V_flowRetAir + "Return air volume flow rate " + annotation (Placement(transformation(extent={{100,-76},{120,-56}}))); + Modelica.Blocks.Sources.RealExpression yDamOutAirMea(y=mixBox.mixBox.valFre.y) + annotation (Placement(transformation(extent={{40,84},{60,104}}))); + Modelica.Blocks.Interfaces.RealOutput yDamOutAir( + final min=0, + final max=1, + final unit="1") + "AHU OA damper position measurement" + annotation (Placement(transformation(extent={{100,84},{120,104}}))); + Modelica.Blocks.Sources.RealExpression PFanTot(y=supFan.P + retFan.P) + annotation (Placement(transformation(extent={{-34,-42},{-14,-22}}))); + Modelica.Blocks.Interfaces.RealOutput PFan "Total fan power" + annotation (Placement(transformation(extent={{100,-38},{120,-18}}))); + Modelica.Blocks.Interfaces.RealOutput TSupCHW( + final unit="K", + final displayUnit="degC", + final quantity="ThermodynamicTemperature") + "AHU supply chilled water temperature" + annotation (Placement(transformation(extent={{100,70},{120,90}}))); + Modelica.Blocks.Interfaces.RealOutput TRetCHW( + final unit="K", + final displayUnit="degC", + final quantity="ThermodynamicTemperature") + "AHU return chilled water temperature" + annotation (Placement(transformation(extent={{100,-24},{120,-4}}))); + Modelica.Blocks.Sources.RealExpression TSupCHWMea(y=cooCoi.coi.TEntWat.T) + annotation (Placement(transformation(extent={{72,70},{92,90}}))); + Modelica.Blocks.Sources.RealExpression TRetCHWMea(y=cooCoi.coi.TLeaWat.T) + annotation (Placement(transformation(extent={{70,-32},{90,-12}}))); + Modelica.Blocks.Sources.RealExpression yCooValMea(y=cooCoi.val.y) + annotation (Placement(transformation(extent={{70,-50},{90,-30}}))); + Modelica.Blocks.Interfaces.RealOutput yCooVal + "AHU cooling coil valve position measurement" annotation (Placement( + transformation(extent={{100,-50},{120,-30}}))); + Buildings.Fluid.Sensors.VolumeFlowRate senVolFloOutAir( + redeclare package Medium = MediumAir, + m_flow_nominal=mAirFloRat, + tau=1) annotation (Placement(transformation( + extent={{-8,-8},{8,8}}, + rotation=-90, + origin={-80,28}))); + Modelica.Blocks.Interfaces.RealOutput V_flowOutAir( + final min=0, + final unit="m3/s", + final quantity="VolumeFlowRate") "Outdoor air volume flow rate" + annotation (Placement(transformation(extent={{100,50},{120,70}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeRetFan( + description="AHU return fan speed control signal", u( + min=0, + max=1, + unit="1")) + annotation (Placement(transformation(extent={{48,-56},{64,-40}}))); + Buildings.Fluid.Sensors.TraceSubstancesTwoPort senCO2RetAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + "Sensor at AHU return air" + annotation (Placement(transformation(extent={{24,-72},{8,-88}}))); + Buildings.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra(each + MMMea=Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) + "Conversion from mass fraction CO2 to volume fraction CO2" + annotation (Placement(transformation(extent={{24,-106},{36,-94}}))); + Modelica.Blocks.Math.Gain gaiPPM(k=1e6) "Convert mass fraction to PPM" + annotation (Placement(transformation(extent={{60,-106},{72,-94}}))); + Modelica.Blocks.Interfaces.RealOutput CO2_AHURetAir + "AHU return air CO2 volume fraction PPM" annotation (Placement( + transformation(extent={{100,-110},{120,-90}}), iconTransformation( + extent={{100,-110},{120,-90}}))); + Buildings.Fluid.Sensors.TraceSubstancesTwoPort senCO2FreAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + "Sensor at AHU fresh air" annotation (Placement(transformation( + extent={{8,8},{-8,-8}}, + rotation=90, + origin={-80,50}))); + Buildings.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra1(each + MMMea=Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) + "Conversion from mass fraction CO2 to volume fraction CO2" + annotation (Placement(transformation(extent={{24,-126},{36,-114}}))); + Modelica.Blocks.Math.Gain gaiPPM1(k=1e6) "Convert mass fraction to PPM" + annotation (Placement(transformation(extent={{60,-126},{72,-114}}))); + Modelica.Blocks.Interfaces.RealOutput CO2_AHUFreAir + "AHU fresh air CO2 volume fraction PPM" annotation (Placement( + transformation(extent={{100,-130},{120,-110}}), + iconTransformation(extent={{100,-120},{120,-100}}))); + Buildings.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra2(each + MMMea=Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) + "Conversion from mass fraction CO2 to volume fraction CO2" + annotation (Placement(transformation(extent={{24,-144},{36,-132}}))); + Modelica.Blocks.Math.Gain gaiPPM2(k=1e6) "Convert mass fraction to PPM" + annotation (Placement(transformation(extent={{60,-144},{72,-132}}))); + Modelica.Blocks.Interfaces.RealOutput CO2_AHUSupAir + "AHU supply air CO2 volume fraction PPM" annotation (Placement( + transformation(extent={{100,-148},{120,-128}}), + iconTransformation(extent={{100,-132},{120,-112}}))); + Buildings.Fluid.Sensors.TraceSubstancesTwoPort senCO2SupAir(redeclare package + Medium = MediumAir, m_flow_nominal=mAirFloRat) + "Sensor at AHU supply air" annotation (Placement(transformation( + extent={{6,6},{-6,-6}}, + rotation=180, + origin={50,0}))); +equation + connect(cooCoi.port_b_Air, supFan.port_a) annotation (Line( + points={{-1.82,0},{18,0}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.TMix, disTSet) annotation (Line(points={{-60,-12},{-60,-20}, + {-110,-20}}, color={0,0,127})); + connect(cooCoi.SetPoi, disTSet) annotation (Line(points={{-0.2,6},{6, + 6},{6,-20},{-110,-20}}, color={0,0,127})); + connect(supFan.T, zonT) annotation (Line(points={{16,-6},{16,-40},{-110, + -40}}, color={0,0,127})); + connect(supFan.pSet, pSet) annotation (Line(points={{16,2},{12,2},{12, + -60},{-110,-60}}, color={0,0,127})); + connect(port_Exh_Air, mixBox.port_Exh) annotation (Line( + points={{-102,0},{-82,0},{-82,-6},{-70,-6}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.port_Ret, retFan.port_b) annotation (Line( + points={{-50,-5.8},{-42,-5.8},{-42,-80},{-30,-80}}, + color={0,140,72}, + thickness=0.5)); + connect(port_b_Air, senTDisAir.port_b) annotation (Line( + points={{100,0},{88,0}}, + color={0,127,255}, + thickness=1)); + connect(pMea, add.u1) annotation (Line(points={{-110,94},{-20,94},{-20, + 68},{60,68},{60,56},{52,56}}, color={0,0,127})); + connect(realExpression.y, add.u2) annotation (Line( + points={{61,76},{68,76},{68,44},{52,44}}, + color={0,0,127})); + connect(add.y, supFan.pMea) annotation (Line(points={{29,50},{10,50}, + {10,-10},{16,-10}}, color={0,0,127})); + connect(supFan.heaTSet, heaTSet) annotation (Line(points={{16,10},{12, + 10},{12,80},{-110,80}}, color={0,0,127})); + connect(supFan.cooTSet, cooTSet) annotation (Line(points={{16,-2},{-46, + -2},{-46,40},{-110,40}}, color={0,0,127})); + connect(booleanExpression.y, cooCoi.On) annotation (Line(points={{-13,-50}, + {8,-50},{8,12},{-0.2,12}}, color={255,0,255})); + connect(mixBox.TOut, TOut) annotation (Line(points={{-54,-12},{-54,-80}, + {-110,-80}}, color={0,0,127})); + connect(On, mixBox.On) annotation (Line(points={{-110,-100},{-68,-100}, + {-68,-12}}, color={255,0,255})); + connect(On, supFan.On) annotation (Line(points={{-110,-100},{4,-100},{4,6},{16, + 6}}, color={255,0,255})); + connect(senTDisAir.T, TSupAir) annotation (Line(points={{82,6.6},{82,40}, + {110,40}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senTMixAir.port_b, cooCoi.port_a_Air) annotation (Line( + points={{-24,0},{-20,0}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.port_Sup, senTMixAir.port_a) annotation (Line( + points={{-49.8,6},{-48,6},{-48,0},{-44,0}}, + color={0,140,72}, + thickness=0.5)); + connect(senTMixAir.T, TMixAir) annotation (Line(points={{-34,11},{-34, + 28},{110,28}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senTRetAir.T, TRetAir) annotation (Line(points={{78,-71.2},{78, + -54},{110,-54}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senVolFloSupAir.port_b, senTDisAir.port_a) + annotation (Line(points={{72,0},{76,0}}, color={0,127,255})); + connect(senVolFloSupAir.V_flow, V_flowSupAir) annotation (Line(points={{66,6.6}, + {66,16},{110,16}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senVolFloRetAir.V_flow, V_flowRetAir) annotation (Line(points={{46, + -71.2},{46,-66},{110,-66}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(yDamOutAirMea.y, yDamOutAir) + annotation (Line(points={{61,94},{110,94}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(PFanTot.y, PFan) annotation (Line(points={{-13,-32},{-8,-32},{ + -8,-28},{110,-28}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(cooCoi.port_a_Wat, port_a_Wat) annotation (Line( + points={{-2,16},{20,16},{20,100}}, + color={0,127,255}, + thickness=1)); + connect(cooCoi.port_b_Wat, port_b_Wat) annotation (Line( + points={{-20,16},{-40,16},{-40,100}}, + color={0,127,255}, + thickness=1)); + connect(TSupCHWMea.y, TSupCHW) + annotation (Line(points={{93,80},{110,80}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(TRetCHWMea.y, TRetCHW) + annotation (Line(points={{91,-22},{96,-22},{96,-14},{110,-14}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(yCooValMea.y, yCooVal) + annotation (Line(points={{91,-40},{110,-40}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senVolFloOutAir.port_b, mixBox.port_Fre) annotation (Line( + points={{-80,20},{-80,6},{-70,6}}, color={0,127,255})); + connect(senVolFloOutAir.V_flow, V_flowOutAir) annotation (Line(points={{-71.2, + 28},{80,28},{80,60},{110,60}}, color={0,0,127}, + pattern=LinePattern.Dash)); + connect(supFan.yRet, oveSpeRetFan.u) annotation (Line(points={{39, + -8.2},{42,-8.2},{42,-48},{46.4,-48}}, color={0,0,127})); + connect(oveSpeRetFan.y, retFan.u) annotation (Line(points={{64.8,-48},{ + 70,-48},{70,-74},{-9,-74}}, color={0,0,127})); + connect(senCO2RetAir.C, conMasVolFra.m) annotation (Line( + points={{16,-88.8},{16,-100},{23.4,-100}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(conMasVolFra.V,gaiPPM. u) + annotation (Line(points={{36.6,-100},{58.8,-100}}, color={0,0,127})); + connect(gaiPPM.y, CO2_AHURetAir) + annotation (Line(points={{72.6,-100},{110,-100}}, color={0,0,127})); + connect(port_a_Air, senTRetAir.port_a) + annotation (Line(points={{100,-80},{86,-80}}, color={0,127,255})); + connect(senTRetAir.port_b, senVolFloRetAir.port_a) + annotation (Line(points={{70,-80},{54,-80}}, color={0,127,255})); + connect(senVolFloRetAir.port_b, senCO2RetAir.port_a) + annotation (Line(points={{38,-80},{24,-80}}, color={0,127,255})); + connect(senCO2RetAir.port_b, retFan.port_a) + annotation (Line(points={{8,-80},{-10,-80}}, color={0,127,255})); + connect(port_Fre_Air, senCO2FreAir.port_a) annotation (Line(points={{ + -100,60},{-80,60},{-80,58}}, color={0,127,255})); + connect(senCO2FreAir.port_b, senVolFloOutAir.port_a) + annotation (Line(points={{-80,42},{-80,36}}, color={0,127,255})); + connect(conMasVolFra1.V, gaiPPM1.u) + annotation (Line(points={{36.6,-120},{58.8,-120}}, color={0,0,127})); + connect(gaiPPM1.y, CO2_AHUFreAir) + annotation (Line(points={{72.6,-120},{110,-120}}, color={0,0,127})); + connect(conMasVolFra2.V, gaiPPM2.u) + annotation (Line(points={{36.6,-138},{58.8,-138}}, color={0,0,127})); + connect(gaiPPM2.y, CO2_AHUSupAir) + annotation (Line(points={{72.6,-138},{110,-138}}, color={0,0,127})); + connect(senCO2FreAir.C, conMasVolFra1.m) annotation (Line( + points={{-71.2,50},{-46,50},{-46,-120},{23.4,-120}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(supFan.port_b, senCO2SupAir.port_a) + annotation (Line(points={{38,0},{44,0}}, color={0,127,255})); + connect(senCO2SupAir.port_b, senVolFloSupAir.port_a) + annotation (Line(points={{56,0},{60,0}}, color={0,127,255})); + connect(senCO2SupAir.C, conMasVolFra2.m) annotation (Line( + points={{50,6.6},{50,24},{-46,24},{-46,-138},{23.4,-138}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{ + -100,-120},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-120}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{-80,-80},{90,-80}}, color={255,170,170}, + thickness=0.5), + Line(points={{-80,0},{-80,-80}}, color={255,170,170}, + thickness=0.5), + Line(points={{-92,0},{-80,0}}, color={255,170,170}, + thickness=0.5), + Line(points={{-90,60},{-60,60}}, color={0,255,255}, + thickness=0.5), + Line(points={{-60,60},{-60,0}}, color={0,255,255}, + thickness=0.5), + Line(points={{-60,0},{-70,0}}, color={0,255,255}, + thickness=0.5), + Line(points={{-80,0},{-70,0}}, color={255,170,170}), + Line(points={{-40,90},{-40,20}}, color={0,0,255}, + thickness=1), + Rectangle( + extent={{-30,28},{12,-10}}, + lineColor={0,255,255}, + lineThickness=0.5, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid), + Line(points={{20,90},{20,20}}, color={0,0,255}, + thickness=1), + Rectangle(extent={{-100,100},{100,-100}}, pattern=LinePattern.None), + Line(points={{20,20},{-40,20}}, color={0,0,255}, + thickness=1), + Line(points={{-60,0},{100,0}}, color={0,255,255}, + thickness=0.5), + Text( + extent={{-156,-148},{144,-108}}, + textString="%name", + textColor={0,0,255})}), Diagram( + coordinateSystem(preserveAspectRatio=false, extent={{-100,-120},{ + 100,100}}), graphics={ + Text( + extent={{-146,300},{154,340}}, + textString="%name", + textColor={0,0,255})}), + Documentation(info=" +

    There are two fans (i.e., one supply fan, and one return fan) in the AHU system. Only a cooling coil is installed in the AHU.

    +

    +

    Supply fan speed is controlled by a PI controller to maintain duct static pressure (DSP) at setpoint when the fan is proven ON. +Cooling coil valve position is controlled by a PI controller to maintain the AHU supply air temperature at setpoint.

    +

    In the mixing box of the AHU, an economizer is implemented to use the outdoor air to meet the cooling load when outdoor conditions are favorable. +Outdoor air damper position is controlled by a PI controller to maintain the mixed air temperature at setpoint. It takes the mixed and outdoor air temperature measurements, as well as the mixed air temperature setpoints as inputs. It takes the outdoor air damper position as the output. The return air damper are interlocked with the outdoor air damper while exhausted air damper share the same opening position with the outdoor air damper. On top of that, an economizer control based on the fixed dry-bulb outdoor air temperature-based is adopted. The economizer higher temperature limit is set as 21 degC according to ASHRAE 90.1-2019 for Climate Zone 5A.

    +

    See the model +MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.VAVSupFan for a description of the supply fan model.

    +

    See the model +MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor for a description of the return fan model.

    +

    See the model +MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.CoolingCoil for a description of the cooling coil model.

    +

    See the model +MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox.MixingBoxWithControl for a description of the mixing box model.

    +", revisions = " + +")); +end DuaFanAirHanUnit; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.mo new file mode 100644 index 000000000..b25dbc4f2 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide; +package AirHandlingUnit + +end AirHandlingUnit; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.order new file mode 100644 index 000000000..aac7c2304 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/AirHandlingUnit/package.order @@ -0,0 +1,2 @@ +DuaFanAirHanUnit +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/BaseClasses.mo new file mode 100644 index 000000000..05996a391 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/BaseClasses.mo @@ -0,0 +1,472 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil; +package BaseClasses + model WetCoil + replaceable package MediumAir = + Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + replaceable package MediumWat = + Modelica.Media.Interfaces.PartialMedium "Medium for the water"; + parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.MassFlowRate mWatFloRat + "mass flow rate for water"; + parameter Modelica.Units.SI.Pressure PreDroAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroWat + "Pressure drop in the water side"; + parameter Real UA "Rated heat exchange coefficients"; + + Buildings.Fluid.HeatExchangers.WetCoilCounterFlow cooCoi(redeclare package + Medium1 = + MediumWat, redeclare package Medium2 = MediumAir, + m1_flow_nominal=mWatFloRat, + m2_flow_nominal=mAirFloRat, + dp1_nominal=PreDroWat, + dp2_nominal=PreDroAir, + UA_nominal=UA, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) + annotation (Placement(transformation(extent={{-14,-10},{6,10}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TEntWat(redeclare package + Medium = MediumWat) annotation (Placement(transformation(extent= + {{-74,-4},{-54,16}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TLeaWat(redeclare package + Medium = MediumWat) + annotation (Placement(transformation(extent={{62,-4},{82,16}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,50},{110,70}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TEntAir(redeclare package + Medium = MediumAir) annotation (Placement(transformation(extent= + {{50,-70},{30,-50}}))); + Modelica.Fluid.Sensors.MassFlowRate m_flowWat(redeclare package + Medium = + MediumWat) + annotation (Placement(transformation(extent={{32,-4},{52,16}}))); + Modelica.Fluid.Sensors.Pressure pWatEnt(redeclare package Medium = + MediumWat) + annotation (Placement(transformation(extent={{-20,6},{-40,26}}))); + Modelica.Fluid.Sensors.Pressure pWatLea(redeclare package Medium = + MediumWat) + annotation (Placement(transformation(extent={{32,6},{12,26}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package + Medium = + MediumAir) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Sensors.MassFlowRate m_flowAir(redeclare package + Medium = + MediumAir) + annotation (Placement(transformation(extent={{-40,-70},{-60,-50}}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TLeaAir( + redeclare package Medium = MediumAir, m_flow_nominal=mAirFloRat) + annotation (Placement(transformation(extent={{-68,-70},{-88,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package + Medium = + MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Sensors.Pressure pAirLea(redeclare package Medium = + MediumAir) annotation (Placement(transformation(extent={{-30, + -46},{-50,-26}}))); + Modelica.Fluid.Sensors.Pressure pAirEnt(redeclare package Medium = + MediumAir) annotation (Placement(transformation(extent={{50,-44}, + {30,-24}}))); + Modelica.Blocks.Interfaces.RealOutput TAirLea + "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{100,-30},{120,-10}}))); + equation + connect(cooCoi.port_a1, TEntWat.port_b) annotation (Line( + points={{-14,6},{-40,6},{-54,6}}, + color={0,127,255}, + thickness=1)); + connect(TEntWat.port_a, port_a_Wat) annotation (Line( + points={{-74,6},{-88,6},{-88,60},{-100,60}}, + color={0,127,255}, + thickness=1)); + connect(TLeaWat.port_b, port_b_Wat) annotation (Line( + points={{82,6},{90,6},{90,60},{100,60}}, + color={0,127,255}, + thickness=1)); + connect(cooCoi.port_b1,m_flowWat. port_a) annotation (Line( + points={{6,6},{32,6}}, + color={0,127,255}, + thickness=1)); + connect(m_flowWat.port_b, TLeaWat.port_a) annotation (Line( + points={{52,6},{52,6},{62,6}}, + color={0,127,255}, + thickness=1)); + connect(pWatEnt.port, TEntWat.port_b) annotation (Line( + points={{-30,6},{-30,6},{-40,6},{-54,6}}, + color={0,127,255}, + thickness=1)); + connect(pWatLea.port, m_flowWat.port_a) annotation (Line( + points={{22,6},{22,6},{32,6}}, + color={0,127,255}, + thickness=1)); + connect(TEntAir.port_b, cooCoi.port_a2) annotation (Line( + points={{30,-60},{20,-60},{20,-6},{6,-6}}, + color={0,127,255}, + thickness=1)); + connect(TEntAir.port_a, port_a_Air) annotation (Line( + points={{50,-60},{100,-60}}, + color={0,127,255}, + thickness=1)); + connect(m_flowAir.port_a, cooCoi.port_b2) annotation (Line( + points={{-40,-60},{-20,-60},{-20,-6},{-14,-6}}, + color={0,127,255}, + thickness=1)); + connect(TLeaAir.port_a, m_flowAir.port_b) annotation (Line( + points={{-68,-60},{-60,-60}}, + color={0,127,255}, + thickness=1)); + connect(TLeaAir.port_b, port_b_Air) annotation (Line( + points={{-88,-60},{-100,-60}}, + color={0,127,255}, + thickness=1)); + connect(pAirLea.port, cooCoi.port_b2) annotation (Line( + points={{-40,-46},{-20,-46},{-20,-6},{-14,-6}}, + color={0,127,255}, + thickness=1)); + connect(pAirEnt.port, cooCoi.port_a2) annotation (Line( + points={{40,-44},{40,-46},{20,-46},{20,-6},{6,-6}}, + color={0,127,255}, + thickness=1)); + connect(TLeaAir.T, TAirLea) annotation (Line( + points={{-78,-49},{-78,-20},{110,-20}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(cooCoi.port_a1, pWatEnt.port) + annotation (Line(points={{-14,6},{-30,6}}, color={0,127,255})); + connect(cooCoi.port_b1, pWatLea.port) + annotation (Line(points={{6,6},{22,6}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line( + points={{-90,60},{-40,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-76,60}}, + color={0,0,127}, + pattern=LinePattern.Dash), + Line( + points={{40,60},{90,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{-40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,-60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{40,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-10,30},{44,-12}}, + lineColor={0,0,127}, + lineThickness=0.5, + textString="-"), + Line( + points={{-90,-60},{-40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,-60},{90,-60}}, + color={0,0,127}, + thickness=0.5)}), Diagram( + coordinateSystem(preserveAspectRatio=false))); + end WetCoil; + + model DryCoil + parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 + "Heat exchanger effectiveness"; + replaceable package MediumAir = + Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + replaceable package MediumWat = + Modelica.Media.Interfaces.PartialMedium "Medium for the water"; + parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.MassFlowRate mWatFloRat + "mass flow rate for water"; + parameter Modelica.Units.SI.Pressure PreDroAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroWat + "Pressure drop in the water side"; + + Buildings.Fluid.HeatExchangers.ConstantEffectiveness dryCoi( + redeclare package Medium1 = MediumWat, + redeclare package Medium2 = MediumAir, + m1_flow_nominal=mWatFloRat, + m2_flow_nominal=mAirFloRat, + dp1_nominal=PreDroWat, + dp2_nominal=PreDroAir, + eps=eps) + annotation (Placement(transformation(extent={{-14,-10},{6,10}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temEntWat(redeclare package + Medium = + MediumWat) + annotation (Placement(transformation(extent={{-74,-4},{-54,16}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temLeaWat(redeclare package + Medium = + MediumWat) + annotation (Placement(transformation(extent={{62,-4},{82,16}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temEntAir(redeclare package + Medium = + MediumAir) + annotation (Placement(transformation(extent={{50,-70},{30,-50}}))); + Modelica.Fluid.Sensors.MassFlowRate masFloWat(redeclare package + Medium = + MediumWat) + annotation (Placement(transformation(extent={{32,-4},{52,16}}))); + Modelica.Fluid.Sensors.Pressure preWatEnt(redeclare package Medium = + MediumWat) + annotation (Placement(transformation(extent={{-20,6},{-40,26}}))); + Modelica.Fluid.Sensors.Pressure preWatLea(redeclare package Medium = + MediumWat) + annotation (Placement(transformation(extent={{32,6},{12,26}}))); + Modelica.Fluid.Sensors.MassFlowRate masFloAir(redeclare package + Medium = + MediumAir) + annotation (Placement(transformation(extent={{-40,-70},{-60,-50}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temLeaAir(redeclare package + Medium = + MediumAir) + annotation (Placement(transformation(extent={{-68,-70},{-88,-50}}))); + Modelica.Fluid.Sensors.Pressure preAirLea(redeclare package Medium = + MediumAir) + annotation (Placement(transformation(extent={{-30,-46},{-50,-26}}))); + Modelica.Fluid.Sensors.Pressure preAirEnt(redeclare package Medium = + MediumAir) + annotation (Placement(transformation(extent={{50,-44},{30,-24}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,50},{-90,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,50},{110,70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package + Medium = + MediumAir) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-70},{110,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package + Medium = + MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Blocks.Interfaces.RealOutput TAirLea + "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{100,-30},{120,-10}}))); + + equation + connect(dryCoi.port_a1, temEntWat.port_b) annotation (Line( + points={{-14,6},{-40,6},{-54,6}}, + color={0,127,255}, + thickness=1)); + connect(temEntWat.port_a,port_a_Wat) annotation (Line( + points={{-74,6},{-88,6},{-88,60},{-100,60}}, + color={0,127,255}, + thickness=1)); + connect(temLeaWat.port_b,port_b_Wat) annotation (Line( + points={{82,6},{90,6},{90,60},{100,60}}, + color={0,127,255}, + thickness=1)); + connect(dryCoi.port_b1, masFloWat.port_a) annotation (Line( + points={{6,6},{32,6}}, + color={0,127,255}, + thickness=1)); + connect(masFloWat.port_b,temLeaWat. port_a) annotation (Line( + points={{52,6},{52,6},{62,6}}, + color={0,127,255}, + thickness=1)); + connect(preWatEnt.port,temEntWat. port_b) annotation (Line( + points={{-30,6},{-30,6},{-40,6},{-54,6}}, + color={0,127,255}, + thickness=1)); + connect(preWatLea.port,masFloWat. port_a) annotation (Line( + points={{22,6},{22,6},{32,6}}, + color={0,127,255}, + thickness=1)); + connect(temEntAir.port_b, dryCoi.port_a2) annotation (Line( + points={{30,-60},{20,-60},{20,-6},{6,-6}}, + color={0,140,72}, + thickness=0.5)); + connect(temEntAir.port_a,port_a_Air) annotation (Line( + points={{50,-60},{100,-60}}, + color={0,140,72}, + thickness=0.5)); + connect(masFloAir.port_a, dryCoi.port_b2) annotation (Line( + points={{-40,-60},{-20,-60},{-20,-6},{-14,-6}}, + color={0,140,72}, + thickness=0.5)); + connect(temLeaAir.port_a, masFloAir.port_b) annotation (Line( + points={{-68,-60},{-60,-60}}, + color={0,140,72}, + thickness=0.5)); + connect(temLeaAir.port_b,port_b_Air) annotation (Line( + points={{-88,-60},{-100,-60}}, + color={0,140,72}, + thickness=0.5)); + connect(preAirLea.port, dryCoi.port_b2) annotation (Line( + points={{-40,-46},{-20,-46},{-20,-6},{-14,-6}}, + color={0,140,72}, + thickness=0.5)); + connect(preAirEnt.port, dryCoi.port_a2) annotation (Line( + points={{40,-44},{40,-46},{20,-46},{20,-6},{6,-6}}, + color={0,140,72}, + thickness=0.5)); + connect(temLeaAir.T,TAirLea) annotation (Line( + points={{-78,-49},{-78,-20},{110,-20}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(dryCoi.port_a1, preWatEnt.port) + annotation (Line(points={{-14,6},{-30,6}}, color={0,127,255})); + connect(dryCoi.port_b1, preWatLea.port) + annotation (Line(points={{6,6},{22,6}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line( + points={{-90,60},{-40,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,60},{90,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{-40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,-60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{40,60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,60},{40,-60}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-46,-16},{8,-58}}, + lineColor={0,0,127}, + lineThickness=0.5, + textString="-"), + Line( + points={{-90,-60},{-40,-60}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,-60},{90,-60}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-10,50},{44,8}}, + lineColor={0,0,127}, + lineThickness=0.5, + textString="+")}), Diagram(coordinateSystem(preserveAspectRatio=false))); + end DryCoil; + + partial model WatCoil + import BuildingControlEmulator = + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; + replaceable package MediumAir = + Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + replaceable package MediumWat = + Modelica.Media.Interfaces.PartialMedium "Medium for the water"; + parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.MassFlowRate mWatFloRat + "mass flow rate for water"; + parameter Modelica.Units.SI.Pressure PreDroAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroWat + "Pressure drop in the water side"; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package + Medium = MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-112,-90},{-92,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package + Medium = MediumAir) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = MediumWat) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,70},{110,90}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = MediumWat) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,70},{-90,90}}))); + replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( + redeclare package Medium = MediumWat, + m_flow_nominal=mWatFloRat, + dpValve_nominal=PreDroWat) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={80,46}))); + BuildingControlEmulator.conPI pI(k=k, Ti=Ti) + annotation (Placement(transformation(extent={{-40,10},{-20,30}}))); + Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); + Modelica.Blocks.Interfaces.RealInput SetPoi "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); + Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ + 120) "Ramp limiter for water coil control signal" + annotation (Placement(transformation(extent={{30,36},{50,56}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite yCoo(description= + "Cooling coil valve control signal for AHU", u( + unit="1", + min=0, + max=1)) "Cooling coil control signal" + annotation (Placement(transformation(extent={{-4,36},{16,56}}))); + equation + connect(val.port_b, port_b_Wat) annotation (Line( + points={{80,56},{80,80},{100,80}}, + color={0,127,255}, + thickness=1)); + connect(pI.On, On) + annotation (Line( + points={{-42,26},{-42,26},{-52,26},{-80,26},{-80,40},{-120,40}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(pI.set, SetPoi) annotation (Line( + points={{-42,20},{-42,20},{-80,20},{-80,-20},{-120,-20}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(ramLim.y, val.y) annotation (Line(points={{52,46},{68,46}}, + color={0,0,127})); + connect(yCoo.y, ramLim.u) + annotation (Line(points={{17,46},{28,46}}, color={0,0,127})); + connect(yCoo.u, pI.y) annotation (Line(points={{-6,46},{-14,46},{ + -14,20},{-19,20}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); + end WatCoil; + +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/CoolingCoil.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/CoolingCoil.mo new file mode 100644 index 000000000..02cf55cfc --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/CoolingCoil.mo @@ -0,0 +1,106 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil; +model CoolingCoil "The model of the cooling coil" + extends MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WatCoil(val( + dpValve_nominal=PreDroWat), pI(reverseActing=false, conPID(y_reset=1))); + parameter Real UA "Rated heat exchange coefficients"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WetCoil coi( + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat, + mWatFloRat=mWatFloRat, + PreDroAir(displayUnit="Pa") = PreDroAir, + PreDroWat(displayUnit="Pa") = 0, + UA=UA) annotation (Placement(transformation(extent={{-18,-34},{20,8}}))); +equation + connect(coi.port_a_Wat, port_a_Wat) annotation (Line( + points={{-18,-0.4},{-40,-0.4},{-40,0},{-60,0},{-60,80},{-100,80}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_b_Wat, val.port_a) annotation (Line( + points={{20,-0.4},{80,-0.4},{80,36}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_a_Air, port_a_Air) annotation (Line( + points={{20,-25.6},{30,-25.6},{30,-26},{40,-26},{40,-80},{100,-80}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_b_Air, port_b_Air) annotation (Line( + points={{-18,-25.6},{-58,-25.6},{-58,-80},{-102,-80}}, + color={0,127,255}, + thickness=1)); + connect(coi.TAirLea,pI.mea) annotation (Line( + points={{21.9,-17.2},{58,-17.2},{58,-60},{-52,-60},{-52,14},{-42,14}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Icon(graphics={ + Line( + points={{-90,80},{-40,80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,80},{90,80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{-40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,40},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,-80},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,80},{-40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-10,50},{44,8}}, + lineColor={0,0,127}, + lineThickness=0.5, + textString="-"), + Line( + points={{-92,-80},{-40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,-80},{90,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,80},{40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{32,72},{48,72}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{30,46},{50,46}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{32,72},{50,46}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{30,46},{48,72}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-148,104},{152,144}}, + textString="%name", + textColor={0,0,255})})); +end CoolingCoil; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/HeatingCoil.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/HeatingCoil.mo new file mode 100644 index 000000000..e491ecb00 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/HeatingCoil.mo @@ -0,0 +1,108 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil; +model HeatingCoil + extends MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.WatCoil; + parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 + "Heat exchanger effectiveness"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.Coil.BaseClasses.DryCoil coi( + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat, + mWatFloRat=mWatFloRat, + PreDroAir(displayUnit="Pa") = PreDroAir, + PreDroWat(displayUnit="Pa") = 0, + eps=eps) annotation (Placement(transformation(extent={{-18,-34},{20, + 8}}))); +equation + connect(coi.port_a_Wat, port_a_Wat) annotation (Line( + points={{-18,-0.4},{-40,-0.4},{-40,0},{-60,0},{-60,80},{-100,80}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_b_Wat, val.port_a) annotation (Line( + points={{20,-0.4},{80,-0.4},{80,36}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_a_Air, port_a_Air) annotation (Line( + points={{20,-25.6},{30,-25.6},{30,-26},{40,-26},{40,-80},{100,-80}}, + color={0,127,255}, + thickness=1)); + connect(coi.port_b_Air, port_b_Air) annotation (Line( + points={{-18,-25.6},{-58,-25.6},{-58,-80},{-102,-80}}, + color={0,127,255}, + thickness=1)); + connect(coi.TAirLea,pI.mea) annotation (Line( + points={{21.9,-17.2},{58,-17.2},{58,-60},{-52,-60},{-52,14},{-42, + 14}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Icon(graphics={ + Line( + points={{-90,80},{-40,80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,80},{90,80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{-40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,40},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,-80},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,80},{-40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{40,-80}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-10,50},{44,8}}, + lineColor={0,0,127}, + lineThickness=0.5, + textString="+"), + Line( + points={{-92,-80},{-40,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,-80},{90,-80}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-40,40},{40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{40,80},{40,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{32,72},{48,72}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{30,46},{50,46}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{32,72},{50,46}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{30,46},{48,72}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-148,102},{152,142}}, + textString="%name", + textColor={0,0,255})})); +end HeatingCoil; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.mo new file mode 100644 index 000000000..aeb5279ae --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide; +package Coil "\"Component used for modelling water coils\"" + +end Coil; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.order new file mode 100644 index 000000000..58ee546a4 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/Coil/package.order @@ -0,0 +1,3 @@ +HeatingCoil +CoolingCoil +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/BaseClasses.mo new file mode 100644 index 000000000..c50a29ad9 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/BaseClasses.mo @@ -0,0 +1,263 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox; +package BaseClasses + + model MixingBox + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; + parameter Modelica.Units.SI.Pressure PreDro "Pressure drop in the air side"; + parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat + "mass flow rate for fresh air"; + parameter Modelica.Units.SI.MassFlowRate mTotAirFloRat + "mass flow rate for water"; + + Buildings.Fluid.FixedResistances.Junction jun( + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + redeclare package Medium = Medium, + from_dp=false, + m_flow_nominal={mTotAirFloRat,mFreAirFloRat,-mTotAirFloRat + mFreAirFloRat}, + dp_nominal={PreDro/4,PreDro/4,PreDro/4}, + linearized=true) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,-12}))); + + Buildings.Fluid.FixedResistances.Junction jun1( + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + redeclare package Medium = Medium, + from_dp=false, + m_flow_nominal={mFreAirFloRat,mTotAirFloRat,mTotAirFloRat - mFreAirFloRat}, + dp_nominal={PreDro/4,PreDro/4,PreDro/4}, + linearized=true) + annotation (Placement(transformation(extent={{10,10},{-10,-10}}, + rotation=90, + origin={60,-12}))); + + Modelica.Fluid.Interfaces.FluidPort_a port_Ret(redeclare package + Medium = Medium) + "First port, typically inlet" annotation (Placement(transformation(extent={{-80,-110},{-60,-90}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Sup(redeclare package + Medium = Medium) + "Second port, typically outlet" annotation (Placement(transformation(extent={{50,-110},{70,-90}}))); + replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valExh( + redeclare package Medium = Medium, + m_flow_nominal=mFreAirFloRat, + dpValve_nominal=PreDro/2) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,58}))); + replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valFre( + redeclare package Medium = Medium, + m_flow_nominal=mFreAirFloRat, + dpValve_nominal=PreDro/2) + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={60,54}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Exh(redeclare package + Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-80,90},{-60,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Fre(redeclare package + Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{50,90},{70,110}}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TOutSen( + redeclare package Medium = Medium, m_flow_nominal=mFreAirFloRat) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,82}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort TMix( + redeclare package Medium = Medium, m_flow_nominal=mTotAirFloRat) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={60,-42}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TRet(redeclare package + Medium = Medium) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-70,-50}))); + Modelica.Fluid.Sensors.MassFlowRate m_flowAir(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, + rotation=90, + origin={60,20}))); + Modelica.Blocks.Interfaces.RealInput damPos "Actuator position (0: closed, 1: open)" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Fluid.Sensors.MassFlowRate m_flowSupAir(redeclare package + Medium = Medium) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={60,-72}))); + Modelica.Blocks.Interfaces.RealOutput T "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{100,-52},{120,-32}}))); + Modelica.Blocks.Interfaces.RealOutput TOut "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{100,72},{120,92}}))); + replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valRet( + redeclare package Medium = Medium, + dpValve_nominal=PreDro/2, + m_flow_nominal=mTotAirFloRat - mFreAirFloRat) + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={0,-12}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=1 -damPos) + annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite yOA(description= + "Outside air damper position setpoint for AHU", u( + unit="1", + min=0, + max=1)) "Outside air damper position setpoint" + annotation (Placement(transformation(extent={{0,44},{20,64}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite yRet(description= + "Return air damper position setpoint for AHU", u( + unit="1", + min=0, + max=1)) "Return air damper position setpoint" + annotation (Placement(transformation(extent={{-28,10},{-8,30}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite yEA(description= + "Exhaust air damper position setpoint for AHU", u( + unit="1", + min=0, + max=1)) "Exhaust air damper position setpoint" annotation ( + Placement(transformation(extent={{-48,80},{-28,100}}))); + equation + connect(valExh.port_a, jun.port_2) + annotation (Line( + points={{-70,48},{-70,-2}}, + color={0,127,255}, + thickness=1)); + connect(valExh.port_b, port_Exh) + annotation (Line( + points={{-70,68},{-70,100}}, + color={0,127,255}, + thickness=1)); + connect(port_Fre, TOutSen.port_a) annotation (Line( + points={{60,100},{60,100},{60,92}}, + color={0,127,255}, + thickness=1)); + connect(jun1.port_2, TMix.port_a) annotation (Line( + points={{60,-22},{60,-28},{60,-32}}, + color={0,127,255}, + thickness=1)); + connect(jun.port_1, TRet.port_b) annotation (Line( + points={{-70,-22},{-70,-32},{-70,-40}}, + color={0,127,255}, + thickness=1)); + connect(TRet.port_a, port_Ret) annotation (Line( + points={{-70,-60},{-70,-80},{-70,-100}}, + color={0,127,255}, + thickness=1)); + connect(m_flowAir.port_b, jun1.port_1) annotation (Line( + points={{60,10},{60,4},{60,-2}}, + color={0,127,255}, + thickness=1)); + connect(port_Fre, port_Fre) annotation (Line(points={{60,100},{60,104},{56,104},{60,104},{60,100}}, + color={0,127,255})); + connect(port_Sup, m_flowSupAir.port_b) annotation (Line( + points={{60,-100},{60,-92},{60,-82}}, + color={0,127,255}, + thickness=1)); + connect(m_flowSupAir.port_a, TMix.port_b) annotation (Line( + points={{60,-62},{60,-62},{60,-52}}, + color={0,127,255}, + thickness=1)); + connect(TMix.T, T) annotation (Line( + points={{71,-42},{110,-42}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(TOutSen.T, TOut) annotation (Line( + points={{71,82},{110,82}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(TOutSen.port_b, valFre.port_a) annotation (Line( + points={{60,72},{60,64}}, + color={0,127,255}, + thickness=1)); + connect(valFre.port_b,m_flowAir. port_a) + annotation (Line( + points={{60,44},{60,44},{60,30}}, + color={0,127,255}, + thickness=0.5)); + connect(jun.port_3, valRet.port_a) annotation (Line( + points={{-60,-12},{-10,-12}}, + color={0,127,255}, + thickness=1)); + connect(valRet.port_b, jun1.port_3) annotation (Line( + points={{10,-12},{50,-12}}, + color={0,127,255}, + thickness=1)); + connect(yOA.y, valFre.y) + annotation (Line(points={{21,54},{48,54}}, color={0,0,127})); + connect(yOA.u,damPos) annotation (Line(points={{-2,54},{-40,54},{ + -40,32},{-84,32},{-84,0},{-120,0}}, color={0,0,127})); + connect(realExpression.y, yRet.u) + annotation (Line(points={{-39,20},{-30,20}}, color={0,0,127})); + connect(yRet.y, valRet.y) annotation (Line(points={{-7,20},{0,20},{ + 0,-1.77636e-15}}, color={0,0,127})); + connect(damPos, yEA.u) annotation (Line(points={{-120,0},{-92,0},{ + -92,90},{-50,90}}, color={0,0,127})); + connect(yEA.y, valExh.y) annotation (Line(points={{-27,90},{-18,90}, + {-18,76},{-88,76},{-88,58},{-82,58}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line( + points={{-70,92},{-70,-92}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,92},{60,-92}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,0},{-70,0}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-70,72},{-70,32}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-78,64},{-62,64}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-80,38},{-60,38}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-78,64},{-60,38}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-80,38},{-62,64}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,74},{60,34}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{52,66},{68,66}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{50,40},{70,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{52,66},{70,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{50,40},{68,66}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-152,108},{148,148}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); + end MixingBox; + +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/Control.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/Control.mo new file mode 100644 index 000000000..1f369a8b6 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/Control.mo @@ -0,0 +1,87 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox; +package Control + + model ecoCon + import BuildingControlEmulator = + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; + parameter Modelica.Units.SI.Temperature TemHig + "the highest temeprature when the economizer is on"; + parameter Modelica.Units.SI.Temperature TemLow + "the lowest temeprature when the economizer is on"; + parameter Real DamMin "the minimum damper postion"; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + + BuildingControlEmulator.conPI pI( + k=k, + Ti=Ti, + reverseActing=false, + conPID(y_reset=1)) + annotation (Placement(transformation(extent={{10,2},{30,22}}))); + Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput TMix + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealInput Mea "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + Modelica.Blocks.Sources.BooleanExpression integerExpression(y=(TOut <= TemHig) + and (TOut > TemLow)) annotation (Placement(transformation(extent={{-80,30}, + {-60,50}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=DamMin) annotation (Placement(transformation(extent={{10,-30},{30,-10}}))); + Modelica.Blocks.Math.Max max annotation (Placement(transformation(extent={{52,-10},{72,10}}))); + Modelica.Blocks.Interfaces.RealOutput y "Connector of Real output signal" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TOut + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); + Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ + 120) "Ramp limiter for fan control signal" + annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); + Buildings.Controls.OBC.CDL.Continuous.Limiter lim(uMax=1, uMin=0) + annotation (Placement(transformation(extent={{68,-60},{88,-40}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swi + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); + Modelica.Blocks.Sources.RealExpression realExpression1(y=DamMin) + annotation (Placement(transformation(extent={{-34,-68},{-14,-48}}))); + equation + connect(pI.set, TMix) annotation (Line( + points={{8,12},{8,10},{-60,10},{-60,0},{-120,0}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(pI.mea, Mea) annotation (Line( + points={{8,6},{8,4},{-40,4},{-40,-80},{-120,-80}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(integerExpression.y, pI.On) annotation (Line(points={{-59,40},{-59,40}, + {0,40},{0,18},{8,18}}, color={255,0,255})); + connect(pI.y, max.u1) annotation (Line(points={{31,12},{40,12},{40,6},{50,6}}, color={0,0,127})); + connect(max.u2, realExpression.y) annotation (Line(points={{50,-6},{40,-6},{40,-20},{31,-20}}, color={0,0,127})); + connect(ramLim.y, lim.u) + annotation (Line(points={{62,-50},{66,-50}}, color={0,0,127})); + connect(swi.y, ramLim.u) + annotation (Line(points={{22,-50},{38,-50}}, color={0,0,127})); + connect(On, swi.u2) annotation (Line(points={{-120,80},{-20,80},{-20,-50},{-2, + -50}}, color={255,0,255})); + connect(max.y, swi.u1) annotation (Line(points={{73,0},{88,0},{88,-28},{-12, + -28},{-12,-42},{-2,-42}}, color={0,0,127})); + connect(realExpression1.y, swi.u3) + annotation (Line(points={{-13,-58},{-2,-58}}, color={0,0,127})); + connect(lim.y, y) annotation (Line(points={{90,-50},{96,-50},{96,0},{110,0}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-34,26},{38,-34}}, + lineColor={0,127,255}, + lineThickness=1, + textString="Eco"), + Text( + extent={{-156,112},{144,152}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); + end ecoCon; +end Control; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/MixingBoxWithControl.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/MixingBoxWithControl.mo new file mode 100644 index 000000000..bef77d1da --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/MixingBoxWithControl.mo @@ -0,0 +1,140 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.MixingBox; +model MixingBoxWithControl "The model of the mixing box" + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "medium for the fluid"; + parameter Modelica.Units.SI.Pressure PreDro "pressure drop in the air side"; + parameter Modelica.Units.SI.MassFlowRate mFreAirFloRat + "mass flow rate for fresh air"; + parameter Modelica.Units.SI.MassFlowRate mTotAirFloRat + "mass flow rate for water"; + parameter Modelica.Units.SI.Temperature TemHig + "highest temeprature when the economizer is on"; + parameter Modelica.Units.SI.Temperature TemLow + "lowest temeprature when the economizer is on"; + parameter Real DamMin "minimum damper postion"; + parameter Real k(min=0, unit="1") = 1 "gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "time constant of Integrator block"; + BaseClasses.MixingBox mixBox( + redeclare package Medium = Medium, + PreDro=PreDro, + mFreAirFloRat=mFreAirFloRat, + mTotAirFloRat=mTotAirFloRat) + annotation (Placement(transformation(extent={{-10,-24},{26,0}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Exh(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-70,90},{-50,110}}), + iconTransformation(extent={{-70,90},{-50,110}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_Fre(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{50,90},{70,110}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_Ret(redeclare package Medium = Medium) + "First port, typically inlet" annotation (Placement(transformation(extent={{-68, + -110},{-48,-90}}), iconTransformation(extent={{-68,-110},{-48,-90}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_Sup(redeclare package Medium = Medium) + "Second port, typically outlet" annotation (Placement(transformation(extent={{50,-112},{70,-92}}))); + Control.ecoCon ecoCon( + TemHig=TemHig, + TemLow=TemLow, + DamMin=DamMin, + k=k, + Ti=Ti) annotation (Placement(transformation(extent={{-70,30},{-50,50}}))); + Modelica.Blocks.Interfaces.RealInput TMix + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput TOut + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); +equation + connect(mixBox.port_Exh, port_Exh) annotation (Line( + points={{-4.6,0},{-4.6,60},{-60,60},{-60,100}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.port_Fre, port_Fre) annotation (Line( + points={{18.8,0},{18.8,60},{60,60},{60,100}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.port_Ret, port_Ret) + annotation (Line( + points={{-4.6,-24},{-4.6,-58},{-58,-58},{-58,-100}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.port_Sup, port_Sup) + annotation (Line( + points={{18.8,-24},{20,-24},{20,-58},{60,-58},{60,-102}}, + color={0,140,72}, + thickness=0.5)); + connect(mixBox.T, ecoCon.Mea) + annotation (Line( + points={{27.8,-17.04},{38,-17.04},{38,22},{-78,22},{-78,32},{-72,32}}, + color={0,0,127})); + connect(ecoCon.TMix, TMix) annotation (Line( + points={{-72,40},{-92,40},{-92,0},{-120,0}}, + color={0,0,127})); + connect(ecoCon.On, On) annotation (Line( + points={{-72,48},{-90,48},{-90,80},{-120,80}}, + color={255,0,255})); + connect(ecoCon.TOut,TOut) annotation (Line( + points={{-72,36},{-80,36},{-80,-60},{-120,-60}}, + color={0,0,127})); + connect(ecoCon.y,mixBox.damPos) annotation (Line(points={{-49,40},{-46, + 40},{-46,-12},{-13.6,-12}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line( + points={{-60,90},{-60,-94}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,92},{60,-92}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,0},{-60,0}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-60,72},{-60,32}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-68,64},{-52,64}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-70,38},{-50,38}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-68,64},{-50,38}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{-70,38},{-52,64}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{60,74},{60,34}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{52,66},{68,66}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{50,40},{70,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{52,66},{70,40}}, + color={0,0,127}, + thickness=0.5), + Line( + points={{50,40},{68,66}}, + color={0,0,127}, + thickness=0.5), + Text( + extent={{-148,112},{152,152}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end MixingBoxWithControl; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.mo new file mode 100644 index 000000000..ebae99d86 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide; +package MixingBox + +end MixingBox; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.order new file mode 100644 index 000000000..30be26af1 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/MixingBox/package.order @@ -0,0 +1,3 @@ +MixingBoxWithControl +BaseClasses +Control diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Control.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Control.mo new file mode 100644 index 000000000..3f3a871a4 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Control.mo @@ -0,0 +1,108 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal; +package Control + + model ZonCon "Zone terminal VAV controller" + parameter Real MinFlowRateSetPoi "Minimum flow rate ratio"; + parameter Real HeatingFlowRateSetPoi "constant flow rate ratio during heating mode"; + Buildings.Controls.Continuous.LimPID cooCon( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + k=0.1, + Ti=60, + yMin=MinFlowRateSetPoi, + reverseActing=false) + annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + Buildings.Controls.Continuous.LimPID heaCon( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + Ti=60, + k=0.01, + reverseActing=true) + annotation (Placement(transformation(extent={{50,-70},{70, + -50}}))); + Modelica.Blocks.Interfaces.RealInput T + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealInput TCooSet + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput THeaSet + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.RealOutput yAirFlowSet + "Connector of actuator output signal" annotation (Placement( + transformation(extent={{100,-30},{120,-10}}), + iconTransformation(extent={{100,-30},{120,-10}}))); + Modelica.Blocks.Interfaces.RealOutput yValPos + "Connector of actuator output signal" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}), + iconTransformation(extent={{100,-70},{120,-50}}))); + Modelica.Blocks.Logical.Switch swi + "Switch between external signal and direct feedthrough signal" + annotation (Placement(transformation(extent={{50,10},{70,30}}))); + Modelica.Blocks.Sources.Constant const(k=HeatingFlowRateSetPoi) + annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=0, uHigh=0.5) + annotation (Placement(transformation(extent={{-26,10},{-6,30}}))); + Modelica.Blocks.Math.Add add(k2=-1) + annotation (Placement(transformation(extent={{-56,10},{-36,30}}))); + Modelica.Blocks.Interfaces.RealOutput yCoo + "Connector of actuator output signal" annotation (Placement( + transformation(extent={{100,70},{120,90}}))); + Modelica.Blocks.Interfaces.RealOutput yHea + "Connector of actuator output signal" annotation (Placement( + transformation(extent={{100,30},{120,50}}))); + equation + connect(cooCon.y, swi.u1) annotation (Line(points={{11,60},{34,60}, + {34,28},{48,28}}, + color={0,0,127})); + connect(const.y, swi.u3) annotation (Line( + points={{21,-20},{34,-20},{34,12},{48,12}}, + color={0,0,127})); + connect(add.y, hysteresis.u) annotation (Line( + points={{-35,20},{-28,20}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(hysteresis.y, swi.u2) annotation (Line( + points={{-5,20},{48,20}}, + color={255,0,255})); + connect(TCooSet, cooCon.u_s) + annotation (Line(points={{-120,60},{-12,60}}, color={0,0,127})); + connect(T, add.u1) annotation (Line(points={{-120,0},{-80,0},{-80, + 26},{-58,26}}, color={0,0,127})); + connect(T, cooCon.u_m) annotation (Line(points={{-120,0},{0,0},{0, + 48}}, color={0,0,127})); + connect(T, heaCon.u_m) annotation (Line(points={{-120,0},{-40,0},{ + -40,-80},{60,-80},{60,-72}}, color={0,0,127})); + connect(THeaSet, heaCon.u_s) + annotation (Line(points={{-120,-60},{48,-60}}, color={0,0,127})); + connect(THeaSet, add.u2) annotation (Line(points={{-120,-60},{-72,-60}, + {-72,14},{-58,14}}, color={0,0,127})); + connect(heaCon.y, yValPos) + annotation (Line(points={{71,-60},{110,-60}}, color={0,0,127})); + connect(swi.y, yAirFlowSet) annotation (Line(points={{71,20},{84,20}, + {84,-20},{110,-20}}, color={0,0,127})); + connect(cooCon.y, yCoo) annotation (Line(points={{11,60},{34,60},{ + 34,80},{110,80}}, color={0,0,127})); + connect(heaCon.y, yHea) annotation (Line(points={{71,-60},{80,-60}, + {80,40},{110,40}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-154,112},{146,152}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false)), + Documentation(info=" +

    This is the zone terminal VAV controller. It takes the temperature measurements and cooling/heating setpoints as inputs. It takes the zone heating/cooling mode, discharge airflow setpoint, VAV damper position as the output.

    +", revisions = " + +")); + end ZonCon; + +end Control; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Examples.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Examples.mo new file mode 100644 index 000000000..9feccdc36 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/Examples.mo @@ -0,0 +1,260 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal; +package Examples + extends Modelica.Icons.ExamplesPackage; + model FivZonVAVCO2 + extends Modelica.Icons.Example; + //package MediumAir = Buildings.Media.Air "Medium model for air"; + package MediumAir = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Buildings library air media package with CO2"; + + package MediumWat = Buildings.Media.Water "Medium model for water"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai1=140 + "Pressure drop 1 across the duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai2=140 + "Pressure drop 2 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai3=120 + "Pressure drop 3 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai4=152 + "Pressure drop 4 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra1=0 + "Pressure drop 1 across the duct branch 1"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra2=0 + "Pressure drop 1 across the duct branch 2"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra3=0 + "Pressure drop 1 across the duct branch 3"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra4=0 + "Pressure drop 1 across the duct branch 4"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra5=0 + "Pressure drop 1 across the duct branch 5"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai1=79712*0.2 + "Pressure drop 1 across the pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai2=79712*0.2 + "Pressure drop 2 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai3=79712*0.2 + "Pressure drop 3 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai4=79712*0.2 + "Pressure drop 4 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra1=0 + "Pressure drop 1 across the pipe branch 1"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra2=0 + "Pressure drop 1 across the pipe branch 2"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra3=0 + "Pressure drop 1 across the pipe branch 3"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra4=0 + "Pressure drop 1 across the pipe branch 4"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra5=0 + "Pressure drop 1 across the pipe branch 5"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat1=10.92*1.2 + "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat2=2.25*1.2 + "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat3=1.49*1.2 + "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat4=1.9*1.2 + "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat5=1.73*1.2 + "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat1=mAirFloRat1*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat2=mAirFloRat2*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat3=mAirFloRat3*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat4=mAirFloRat4*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat5=mAirFloRat5*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.Pressure PreDroAir1=200 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat1=79712 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps1(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + parameter Modelica.Units.SI.Pressure PreDroAir2=124 + "Pressure drop in the air side of vav 2"; + parameter Modelica.Units.SI.Pressure PreDroWat2=79712 + "Pressure drop in the water side of vav 2"; + parameter Modelica.Units.SI.Efficiency eps2(max=1) = 0.8 + "Heat exchanger effectiveness of vav 2"; + + parameter Modelica.Units.SI.Pressure PreDroAir3=124 + "Pressure drop in the air side of vav 3"; + parameter Modelica.Units.SI.Pressure PreDroWat3=79712 + "Pressure drop in the water side of vav 3"; + parameter Modelica.Units.SI.Efficiency eps3(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + parameter Modelica.Units.SI.Pressure PreDroAir4=124 + "Pressure drop in the air side of vav 4"; + parameter Modelica.Units.SI.Pressure PreDroWat4=79712 + "Pressure drop in the water side of vav 4"; + parameter Modelica.Units.SI.Efficiency eps4(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + parameter Modelica.Units.SI.Pressure PreDroAir5=124 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat5=79712 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps5(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + // Initialization + parameter MediumAir.AbsolutePressure p_start = MediumAir.p_default + "Start value of zone air pressure" + annotation(Dialog(tab = "Initialization")); + parameter MediumAir.Temperature T_start=MediumAir.T_default + "Start value of zone air temperature" + annotation(Dialog(tab = "Initialization")); + parameter MediumAir.MassFraction X_start[MediumAir.nX]( + quantity=MediumAir.substanceNames) = MediumAir.X_default + "Start value of zone air mass fractions m_i/m" + annotation (Dialog(tab="Initialization", enable=Medium.nXi > 0)); + parameter MediumAir.ExtraProperty C_start[MediumAir.nC]( + quantity=MediumAir.extraPropertiesNames)=fill(0, MediumAir.nC) + "Start value of zone air trace substances" + annotation (Dialog(tab="Initialization", enable=Medium.nC > 0)); + parameter MediumAir.ExtraProperty C_nominal[MediumAir.nC]( + quantity=MediumAir.extraPropertiesNames) = fill(1E-2, MediumAir.nC) + "Nominal value of zone air trace substances. (Set to typical order of magnitude.)" + annotation (Dialog(tab="Initialization", enable=Medium.nC > 0)); + + Buildings.Fluid.Sources.Boundary_pT souAir( + p(displayUnit="Pa") = 100000 + PreAirDroMai1 + PreAirDroMai2 + PreAirDroMai3 + PreAirDroMai4 + PreAirDroBra5 + PreDroAir5, + redeclare package Medium = MediumAir, + nPorts=1, + T=286.02) annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + + Buildings.Fluid.Sources.Boundary_pT sinAir( + redeclare package Medium = MediumAir, + p(displayUnit="Pa") = 100000, + nPorts=1, + T=299.15) annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + + Modelica.Blocks.Sources.Ramp Q_flow[5](duration=86400, height=1*1000*10) + annotation (Placement(transformation(extent={{-100,-68},{-80,-48}}))); + FiveZoneVAV fivZonVAV( + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + p_start=p_start, + T_start=T_start, + X_start=X_start, + C_start=C_start, + C_nominal=C_nominal, + PreAirDroMai1=PreAirDroMai1, + PreAirDroMai2=PreAirDroMai2, + PreAirDroMai3=PreAirDroMai3, + PreAirDroMai4=PreAirDroMai4, + PreAirDroBra1=PreAirDroBra1, + PreAirDroBra2=PreAirDroBra2, + PreAirDroBra3=PreAirDroBra3, + PreAirDroBra4=PreAirDroBra4, + PreAirDroBra5=PreAirDroBra5, + PreWatDroMai1=PreWatDroMai1, + PreWatDroMai2=PreWatDroMai2, + PreWatDroMai3=PreWatDroMai3, + PreWatDroMai4=PreWatDroMai4, + PreWatDroBra1=PreWatDroBra1, + PreWatDroBra2=PreWatDroBra2, + PreWatDroBra3=PreWatDroBra3, + PreWatDroBra4=PreWatDroBra4, + PreWatDroBra5=PreWatDroBra5, + mAirFloRat1=mAirFloRat1, + mAirFloRat2=mAirFloRat2, + mAirFloRat3=mAirFloRat3, + mAirFloRat4=mAirFloRat4, + mAirFloRat5=mAirFloRat5, + mWatFloRat1=mWatFloRat1, + mWatFloRat2=mWatFloRat2, + mWatFloRat3=mWatFloRat3, + mWatFloRat4=mWatFloRat4, + mWatFloRat5=mWatFloRat5, + PreDroAir1=PreDroAir1, + PreDroWat1=PreDroWat1, + eps1=eps1, + PreDroAir2=PreDroAir2, + PreDroWat2=PreDroWat2, + eps2=eps2, + PreDroAir3=PreDroAir3, + PreDroWat3=PreDroWat3, + eps3=eps3, + PreDroAir4=PreDroAir4, + PreDroWat4=PreDroWat4, + eps4=eps4, + PreDroAir5=PreDroAir5, + PreDroWat5=PreDroWat5, + eps5=eps5) + annotation (Placement(transformation(extent={{-28,-28},{18,22}}))); + Buildings.Fluid.Sources.Boundary_pT souWat( + p(displayUnit="Pa") = 100000 + PreWatDroMai1 + PreWatDroMai2 + PreWatDroMai3 + PreWatDroMai4 + PreWatDroBra5 + PreDroWat5, + nPorts=1, + redeclare package Medium = MediumWat, + T=353.15) annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); + Buildings.Fluid.Sources.Boundary_pT sinWat( + p(displayUnit="Pa") = 100000, + nPorts=1, + redeclare package Medium = MediumWat, + T=299.15) annotation (Placement(transformation(extent={{20,70},{0,90}}))); + Modelica.Blocks.Sources.BooleanExpression booleanExpression[5](y=true) annotation (Placement(transformation(extent={{-100, + -16},{-80,4}}))); + Modelica.Blocks.Sources.Ramp airFloRat[5](duration=86400, height=1) + annotation (Placement(transformation(extent={{-100,70},{-80,90}}))); + Modelica.Blocks.Sources.Ramp yVal[5]( + duration=86400, + height=-1, + offset=1) + annotation (Placement(transformation(extent={{-100,10},{-80,30}}))); + Modelica.Blocks.Sources.Constant nPeo[5](k=20) + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + equation + + connect(fivZonVAV.port_a_Air, souAir.ports[1]) annotation (Line(points={{-28,7}, + {-74,7},{-74,50},{-80,50}}, color={0,127,255})); + connect(fivZonVAV.port_b_Air, sinAir.ports[1]) annotation (Line(points={{-28,-18}, + {-72,-18},{-72,-30},{-80,-30}}, color={0,127,255})); + connect(souWat.ports[1], fivZonVAV.port_a_Wat) annotation (Line(points={{-40,80},{-28,80},{-28,56},{-60,56},{-60, + 22},{-14.2,22}}, color={0,127,255})); + connect(sinWat.ports[1], fivZonVAV.port_b_Wat) annotation (Line(points={{0,80},{ + -10,80},{-20,80},{-20,36},{4,36},{4,22},{4.2,22}}, color={0,127,255})); + connect(Q_flow.y, fivZonVAV.Q_flow) annotation (Line(points={{-79,-58},{-40,-58}, + {-40,-21.5},{-30.3,-21.5}}, color={0,0,127})); + connect(booleanExpression.y, fivZonVAV.On) annotation (Line(points={{-79,-6},{ + -30.3,-6}}, color={255,0,255})); + connect(yVal.y, fivZonVAV.yVal) annotation (Line(points={{-79,20},{-68,20},{-68, + 12},{-30.3,12}}, color={0,0,127})); + connect(airFloRat.y, fivZonVAV.airFloRatSet) annotation (Line(points={{-79,80}, + {-66,80},{-66,18.5},{-30.3,18.5}}, color={0,0,127})); + connect(nPeo.y, fivZonVAV.nPeo) annotation (Line(points={{-79,-90},{-36,-90},{ + -36,-28},{-30.3,-28}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=259200, __Dymola_Algorithm="Dassl")); + end FivZonVAVCO2; +end Examples; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneDuctNetwork.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneDuctNetwork.mo new file mode 100644 index 000000000..9569c98c2 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneDuctNetwork.mo @@ -0,0 +1,216 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal; +model FiveZoneDuctNetwork + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + parameter Modelica.Units.SI.Pressure PreDroMai1 + "Pressure drop 1 across the duct"; + + parameter Modelica.Units.SI.Pressure PreDroMai2 + "Pressure drop 2 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreDroMai3 + "Pressure drop 3 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreDroMai4 + "Pressure drop 4 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreDroBra1 + "Pressure drop 1 across the duct branch 1"; + + parameter Modelica.Units.SI.Pressure PreDroBra2 + "Pressure drop 1 across the duct branch 2"; + + parameter Modelica.Units.SI.Pressure PreDroBra3 + "Pressure drop 1 across the duct branch 3"; + + parameter Modelica.Units.SI.Pressure PreDroBra4 + "Pressure drop 1 across the duct branch 4"; + + parameter Modelica.Units.SI.Pressure PreDroBra5 + "Pressure drop 1 across the duct branch 5"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat1 + "mass flow rate for the first branch1"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat2 + "mass flow rate for the first branch2"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat3 + "mass flow rate for the first branch3"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat4 + "mass flow rate for the first branch4"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat5 + "mass flow rate for the first branch5"; + + Buildings.Fluid.FixedResistances.Junction junSup1( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={mFloRat1 + mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat2-mFloRat3-mFloRat4 - mFloRat5,- + mFloRat1}, redeclare package Medium = Medium, + dp_nominal={PreDroMai1/2,PreDroMai2/2,PreDroBra1/2}) + annotation (Placement(transformation(extent={{-90,30},{-70,50}}))); + Buildings.Fluid.FixedResistances.Junction junRet1(redeclare package + Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat1-mFloRat2-mFloRat3- + mFloRat4 - mFloRat5,mFloRat1}, + dp_nominal={PreDroMai2/2,PreDroMai1/2,PreDroBra1/2}) + annotation (Placement(transformation(extent={{-70,-70},{-90,-50}}))); + Buildings.Fluid.FixedResistances.Junction junRet2( redeclare package + Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat3 + mFloRat4 + mFloRat5,-mFloRat2-mFloRat3- + mFloRat4 - mFloRat5,mFloRat2}, + dp_nominal={PreDroMai3/2,PreDroMai2/2,PreDroBra2/2}) + annotation (Placement(transformation(extent={{-30,-70},{-50,-50}}))); + Buildings.Fluid.FixedResistances.Junction junSup2( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={mFloRat2 + mFloRat3 + mFloRat4 + mFloRat5,-mFloRat3-mFloRat4 - mFloRat5,- + mFloRat2}, redeclare package Medium = Medium, + dp_nominal={PreDroMai2/2,PreDroMai3/2,PreDroBra2/2}) + annotation (Placement(transformation(extent={{-50,30},{-30,50}}))); + Buildings.Fluid.FixedResistances.Junction junSup3( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={mFloRat3 + mFloRat4 + mFloRat5,-mFloRat4 - mFloRat5,- + mFloRat3}, redeclare package Medium = Medium, + dp_nominal={PreDroMai3/2,PreDroMai4/2,PreDroBra3/2}) + annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + Buildings.Fluid.FixedResistances.Junction junRet3(redeclare package + Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat4 + mFloRat5,-mFloRat3- + mFloRat4 - mFloRat5,mFloRat3}, + dp_nominal={PreDroMai4/2,PreDroMai3/2,PreDroBra3/2}) + annotation (Placement(transformation(extent={{10,-50},{-10,-70}}))); + Buildings.Fluid.FixedResistances.Junction junSup4( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + m_flow_nominal={mFloRat4 + mFloRat5,-mFloRat5,-mFloRat4}, redeclare + package Medium = + Medium, + dp_nominal={PreDroMai4/2,PreDroBra5/2,PreDroBra4/2}) + annotation (Placement(transformation(extent={{30,30},{50,50}}))); + Buildings.Fluid.FixedResistances.Junction junRet4(redeclare package + Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, m_flow_nominal={mFloRat5,-mFloRat4 - mFloRat5, + mFloRat4}, + dp_nominal={PreDroBra5/2,PreDroMai4/2,PreDroBra4/2}) + annotation (Placement(transformation(extent={{50,-70},{30,-50}}))); + + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); + replaceable Buildings.Fluid.Sensors.Pressure senRelPre(redeclare + package Medium = Medium) + annotation (Placement(transformation(extent={{34,70}, + {14,90}}))); + Modelica.Fluid.Interfaces.FluidPorts_b ports_b[5](redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{90,6},{110,86}}))); + Modelica.Fluid.Interfaces.FluidPorts_a ports_a[5](redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{90,-102},{110,-22}}))); + Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +equation + connect(junSup1.port_2, junSup2.port_1) annotation (Line( + points={{-70,40},{-62,40},{-50,40}}, + color={0,127,255}, + thickness=1)); + connect(junSup2.port_2, junSup3.port_1) annotation (Line( + points={{-30,40},{-30,40},{-10,40}}, + color={0,127,255}, + thickness=1)); + connect(junSup3.port_2, junSup4.port_1) annotation (Line( + points={{10,40},{10,40},{30,40}}, + color={0,127,255}, + thickness=1)); + connect(junRet4.port_2, junRet3.port_1) annotation (Line( + points={{30,-60},{10,-60}}, + color={0,127,255}, + thickness=1)); + connect(junRet3.port_2, junRet2.port_1) + annotation (Line( + points={{-10,-60},{-10,-60},{-30,-60}}, + color={0,127,255}, + thickness=1)); + connect(junRet2.port_2, junRet1.port_1) + annotation (Line( + points={{-50,-60},{-50,-60},{-70,-60}}, + color={0,127,255}, + thickness=1)); + connect(junRet1.port_2, port_b) annotation (Line( + points={{-90,-60},{-100,-60}}, + color={0,127,255}, + thickness=1)); + connect(junSup1.port_1, port_a) annotation (Line( + points={{-90,40},{-100,40}}, + color={0,127,255}, + thickness=1)); + + connect(ports_b, ports_b) annotation (Line(points={{100,46},{100,46}}, color={0,127,255})); + connect(junSup4.port_3, ports_b[4]) + annotation (Line( + points={{40,30},{40,16},{60,16},{60,54},{100,54}}, + color={0,127,255}, + thickness=1)); + connect(junSup3.port_3, ports_b[3]) + annotation (Line( + points={{0,30},{0,12},{78,12},{78,46},{100,46}}, + color={0,127,255}, + thickness=1)); + connect(junSup2.port_3, ports_b[2]) + annotation (Line( + points={{-40,30},{-40,30},{-40,8},{84,8},{84,38},{100,38}}, + color={0,127,255}, + thickness=1)); + connect(junSup1.port_3, ports_b[1]) + annotation (Line( + points={{-80,30},{-80,30},{-80,0},{90,0},{90,30},{100,30}}, + color={0,127,255}, + thickness=1)); + connect(junRet4.port_1, ports_a[5]) + annotation (Line( + points={{50,-60},{70,-60},{70,-34},{70,-46},{100,-46}}, + color={0,127,255}, + thickness=1)); + connect(junRet4.port_3, ports_a[4]) + annotation (Line( + points={{40,-70},{40,-70},{70,-70},{86,-70},{86,-54},{100,-54}}, + color={0,127,255}, + thickness=1)); + connect(junRet2.port_3, ports_a[2]) + annotation (Line( + points={{-40,-70},{-40,-86},{100,-86},{100,-70}}, + color={0,127,255}, + thickness=1)); + connect(junRet1.port_3, ports_a[1]) + annotation (Line( + points={{-80,-70},{-80,-70},{-80,-94},{100,-94},{100,-78}}, + color={0,127,255}, + thickness=1)); + connect(junRet3.port_3, ports_a[3]) + annotation (Line( + points={{0,-50},{0,-38},{82,-38},{82,-62},{100,-62}}, + color={0,127,255}, + thickness=1)); + connect(senRelPre.port, junSup4.port_2) annotation (Line( + points={{24,70},{24,60},{56,60},{56,40},{50,40}}, + color={0,127,255}, + thickness=1)); + connect(junSup4.port_2, ports_b[5]) annotation (Line( + points={{50,40},{54,40},{56,40},{56,82},{100,82},{100,62}}, + color={0,127,255}, + thickness=1)); + connect(senRelPre.p, p) annotation (Line( + points={{13,80},{-20,80},{-20,-20},{96,-20},{96,0},{110,0}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line(points={{-90,40},{80,40}}, color={0,127,255}), + Line(points={{-90,-60},{80,-60}}, color={0,127,255}), + Line(points={{80,40},{80,-60}}, color={0,127,255}), + Line(points={{50,40},{50,-60}}, color={0,127,255}), + Line(points={{20,40},{20,-60}}, color={0,127,255}), + Line(points={{-10,40},{-10,-60}}, color={0,127,255}), + Line(points={{-40,40},{-40,-60}}, color={0,127,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end FiveZoneDuctNetwork; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneVAV.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneVAV.mo new file mode 100644 index 000000000..2df53eb98 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/FiveZoneVAV.mo @@ -0,0 +1,630 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal; +model FiveZoneVAV "Thermal zones, VAV terminals, and duct network" + replaceable package MediumAir = Modelica.Media.Interfaces.PartialMedium "medium for the air"; + + replaceable package MediumWat = Modelica.Media.Interfaces.PartialMedium "medium for the water"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai1 + "pressure drop 1 across the duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai2 + "Pressure drop 2 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai3 + "Pressure drop 3 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai4 + "Pressure drop 4 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra1 + "Pressure drop 1 across the duct branch 1"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra2 + "Pressure drop 1 across the duct branch 2"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra3 + "Pressure drop 1 across the duct branch 3"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra4 + "Pressure drop 1 across the duct branch 4"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra5 + "Pressure drop 1 across the duct branch 5"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai1 + "Pressure drop 1 across the pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai2 + "Pressure drop 2 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai3 + "Pressure drop 3 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai4 + "Pressure drop 4 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra1 + "Pressure drop 1 across the pipe branch 1"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra2 + "Pressure drop 1 across the pipe branch 2"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra3 + "Pressure drop 1 across the pipe branch 3"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra4 + "Pressure drop 1 across the pipe branch 4"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra5 + "Pressure drop 1 across the pipe branch 5"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat1 + "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat2 + "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat3 + "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat4 + "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat5 + "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat1 + "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat2 + "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat3 + "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat4 + "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat5 + "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.Pressure PreDroAir1 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat1 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps1(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + parameter Modelica.Units.SI.Pressure PreDroAir2 + "Pressure drop in the air side of vav 2"; + parameter Modelica.Units.SI.Pressure PreDroWat2 + "Pressure drop in the water side of vav 2"; + parameter Modelica.Units.SI.Efficiency eps2(max=1) = 0.8 + "Heat exchanger effectiveness of vav 2"; + + parameter Modelica.Units.SI.Pressure PreDroAir3 + "Pressure drop in the air side of vav 3"; + parameter Modelica.Units.SI.Pressure PreDroWat3 + "Pressure drop in the water side of vav 3"; + parameter Modelica.Units.SI.Efficiency eps3(max=1) = 0.8 + "Heat exchanger effectiveness of vav 3"; + + parameter Modelica.Units.SI.Pressure PreDroAir4 + "Pressure drop in the air side of vav 4"; + parameter Modelica.Units.SI.Pressure PreDroWat4 + "Pressure drop in the water side of vav 4"; + parameter Modelica.Units.SI.Efficiency eps4(max=1) = 0.8 + "Heat exchanger effectiveness of vav 4"; + + parameter Modelica.Units.SI.Pressure PreDroAir5 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat5 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps5(max=1) = 0.8 + "Heat exchanger effectiveness of vav 5"; + + parameter Modelica.Media.Interfaces.Types.AbsolutePressure p_start=p_start + "Start value of pressure"; + parameter Modelica.Media.Interfaces.Types.Temperature T_start=T_start + "Start value of temperature"; + parameter Modelica.Media.Interfaces.Types.MassFraction X_start[MediumAir.nX]=X_start + "Start value of mass fractions m_i/m"; + parameter Modelica.Media.Interfaces.Types.ExtraProperty C_start[MediumAir.nC]=C_start + "Start value of trace substances"; + parameter Modelica.Media.Interfaces.Types.ExtraProperty C_nominal[MediumAir.nC]=C_nominal + "Nominal value of trace substances. (Set to typical order of magnitude.)"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.FiveZoneDuctNetwork + ReheatWatNet( + redeclare package Medium = MediumWat, + PreDroMai1=PreWatDroMai1, + PreDroMai2=PreWatDroMai2, + PreDroMai3=PreWatDroMai3, + PreDroMai4=PreWatDroMai4, + PreDroBra1=PreWatDroBra1, + PreDroBra2=PreWatDroBra2, + PreDroBra3=PreWatDroBra3, + PreDroBra4=PreWatDroBra4, + PreDroBra5=PreWatDroBra5, + mFloRat1=mWatFloRat1, + mFloRat2=mWatFloRat2, + mFloRat3=mWatFloRat3, + mFloRat4=mWatFloRat4, + mFloRat5=mWatFloRat5) + annotation (Placement(transformation(extent={{-76,64},{-46,30}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.FiveZoneDuctNetwork + AirNetWor( + redeclare package Medium = MediumAir, + PreDroMai1=PreAirDroMai1, + PreDroMai2=PreAirDroMai2, + PreDroMai3=PreAirDroMai3, + PreDroMai4=PreAirDroMai4, + mFloRat1=mAirFloRat1, + mFloRat2=mAirFloRat2, + mFloRat3=mAirFloRat3, + mFloRat4=mAirFloRat4, + mFloRat5=mAirFloRat5, + PreDroBra1=PreAirDroBra1, + PreDroBra2=PreAirDroBra2, + PreDroBra3=PreAirDroBra3, + PreDroBra4=PreAirDroBra4, + PreDroBra5=PreAirDroBra5) + annotation (Placement(transformation(extent={{-74,-52},{-44,-18}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal + vAV1( + zonNam="cor", + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat1, + mWatFloRat=mWatFloRat1, + PreDroAir=PreDroAir1, + PreDroWat=PreDroWat1, + eps=eps1) + annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + Buildings.Fluid.MixingVolumes.MixingVolume vol[5]( + redeclare package Medium = MediumAir, + each energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial, + each p_start=p_start, + each T_start=T_start, + each X_start=X_start, + each final C_start=C_start, + each C_nominal=C_nominal, + each nPorts=3, + each V=10, + m_flow_nominal={mAirFloRat1,mAirFloRat2,mAirFloRat3,mAirFloRat4,mAirFloRat5}, + each allowFlowReversal=true, + each use_C_flow=true) + annotation (Placement(transformation(extent={{70,-70},{90,-50}}))); + + Buildings.HeatTransfer.Sources.PrescribedHeatFlow fixedHeatFlow[5] + annotation (Placement(transformation(extent={{-40,-84},{-20,-64}}))); + Modelica.Blocks.Interfaces.RealInput Q_flow[5] + annotation (Placement(transformation(extent={{-120,-84},{-100,-64}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = + MediumWat) "Second port, typically outlet" + annotation (Placement(transformation(extent={{30,90},{50,110}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = + MediumWat) "Second port, typically outlet" + annotation (Placement(transformation(extent={{-50,90},{-30,110}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Air(redeclare package + Medium = + MediumAir) + "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Air(redeclare package + Medium = + MediumAir) + "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Blocks.Interfaces.RealInput airFloRatSet[5] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-120,76},{-100,96}}))); + Modelica.Blocks.Interfaces.RealInput yVal[5] + "Actuator position (0: closed, 1: open)" + annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); + Modelica.Blocks.Interfaces.BooleanInput On[5] + annotation (Placement(transformation(extent={{-120,-22},{-100,-2}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TZonSen[5](redeclare package + Medium = MediumAir) + annotation (Placement(transformation(extent={{138,-68},{118,-48}}))); + Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" annotation ( + Placement(transformation(extent={{200,-22},{220,-2}}), + iconTransformation(extent={{100,-100},{120,-80}}))); + Modelica.Blocks.Interfaces.RealOutput TZon[5] + "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{200,70},{220,90}}), + iconTransformation(extent={{100,30},{120,50}}))); + + Modelica.Blocks.Interfaces.RealOutput yDam[5] + "Control signal for terminal box damper" + annotation (Placement(transformation(extent={{200,44},{220,64}}), + iconTransformation(extent={{100,4},{120,24}}))); + Modelica.Blocks.Sources.RealExpression yDamMea[5](y={vAV1.dam.y,vAV2.dam.y, + vAV3.dam.y,vAV4.dam.y,vAV5.dam.y}) + annotation (Placement(transformation(extent={{170,44},{190,64}}), + iconTransformation(extent={{100,70},{120,90}}))); + Modelica.Blocks.Interfaces.RealOutput yReaHea[5] + "Control signal for terminal box reheat" + annotation (Placement(transformation(extent={{200,18},{220,38}}), + iconTransformation(extent={{100,-20},{120,0}}))); + Modelica.Blocks.Sources.RealExpression yReaValMea[5](y={vAV1.rehVal.y, + vAV2.rehVal.y,vAV3.rehVal.y,vAV4.rehVal.y,vAV5.rehVal.y}) + annotation (Placement(transformation(extent={{170,18},{190,38}}))); + + Modelica.Blocks.Sources.RealExpression TZonAir[5](y=vol.heatPort.T) + annotation (Placement(transformation(extent={{170,70},{190,90}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal + vAV2( + zonNam="sou", + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat2, + mWatFloRat=mWatFloRat2, + PreDroAir=PreDroAir2, + PreDroWat=PreDroWat2, + eps=eps2) + annotation (Placement(transformation(extent={{30,-2},{50,18}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal + vAV3( + zonNam="eas", + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat3, + mWatFloRat=mWatFloRat3, + PreDroAir=PreDroAir3, + PreDroWat=PreDroWat3, + eps=eps3) + annotation (Placement(transformation(extent={{72,-2},{92,18}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal + vAV4( + zonNam="nor", + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat4, + mWatFloRat=mWatFloRat4, + PreDroAir=PreDroAir4, + PreDroWat=PreDroWat4, + eps=eps4) + annotation (Placement(transformation(extent={{118,-2},{138,18}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal + vAV5( + zonNam="wes", + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat5, + mWatFloRat=mWatFloRat5, + PreDroAir=PreDroAir5, + PreDroWat=PreDroWat5, + eps=eps5) + annotation (Placement(transformation(extent={{158,-2},{178,18}}))); + + Modelica.Blocks.Interfaces.RealInput yCoo[5] + "Cooling PID signal measurement" + annotation (Placement(transformation(extent={{-120,16},{-100,36}}))); + Modelica.Blocks.Interfaces.RealInput yHea[5] + "Heating PID signal measurement" + annotation (Placement(transformation(extent={{-120,-4},{-100,16}}))); + Modelica.Blocks.Sources.RealExpression Vflow_setMea[5](y={vAV1.airFloRatSet + *vAV1.mAirFloRat/1.2,vAV2.airFloRatSet*vAV2.mAirFloRat/1.2,vAV3.airFloRatSet + *vAV3.mAirFloRat/1.2,vAV4.airFloRatSet*vAV4.mAirFloRat/1.2,vAV5.airFloRatSet + *vAV5.mAirFloRat/1.2}) + "VAV terminal airflow setpoint measurement" + annotation (Placement(transformation(extent={{170,-50},{190,-30}}))); + Modelica.Blocks.Interfaces.RealOutput Vflow_set[5] + "VAV terminal airflow setpoint" annotation (Placement(transformation( + extent={{200,-50},{220,-30}}), iconTransformation(extent={{100,-46}, + {120,-26}}))); + Modelica.Blocks.Sources.RealExpression Vflow_Mea[5](y={vAV1.m_flow.m_flow + /1.2,vAV2.m_flow.m_flow/1.2,vAV3.m_flow.m_flow/1.2,vAV4.m_flow.m_flow + /1.2,vAV5.m_flow.m_flow/1.2}) "VAV terminal airflow measurement" + annotation (Placement(transformation(extent={{170,-70},{190,-50}}))); + Modelica.Blocks.Interfaces.RealOutput Vflow[5] "VAV terminal airflow" + annotation (Placement(transformation(extent={{200,-70},{220,-50}}), + iconTransformation(extent={{100,-72},{120,-52}}))); + Modelica.Blocks.Interfaces.RealOutput TSup[5] + "VAV supply air temperature" annotation (Placement(transformation( + extent={{200,-90},{220,-70}}), iconTransformation(extent={{100,56}, + {120,76}}))); + Modelica.Blocks.Sources.RealExpression TSupMea[5](y={vAV1.TAirLea,vAV2.TAirLea, + vAV3.TAirLea,vAV4.TAirLea,vAV5.TAirLea}) + annotation (Placement(transformation(extent={{170,-90},{190,-70}}))); + + Modelica.Blocks.Interfaces.RealInput nPeo[5] "Number of occupant" annotation ( + Placement(transformation(extent={{-120,-100},{-100,-80}}), + iconTransformation(extent={{-120,-110},{-100,-90}}))); + Modelica.Blocks.Math.Gain gaiCO2[5](each k=8.18E-6) + "CO2 emission per person" + annotation (Placement(transformation(extent={{-40,-96},{-28,-84}}))); + + Buildings.Fluid.Sensors.TraceSubstances senCO2[5](redeclare package + Medium = MediumAir, + each warnAboutOnePortConnection=false) "Sensor at volume" + annotation (Placement(transformation(extent={{82,-98},{98,-82}}))); + Buildings.Fluid.Sensors.Conversions.To_VolumeFraction conMasVolFra[5](each + MMMea=Modelica.Media.IdealGases.Common.SingleGasesData.CO2.MM) + "Conversion from mass fraction CO2 to volume fraction CO2" + annotation (Placement(transformation(extent={{104,-96},{116,-84}}))); + Modelica.Blocks.Math.Gain gaiPPM[5](k=1e6) + "Convert mass fraction to PPM" + annotation (Placement(transformation(extent={{126,-96},{138,-84}}))); + Modelica.Blocks.Interfaces.RealOutput CO2Zon[5] + "Zonal CO2 volume fraction PPM" annotation (Placement(transformation( + extent={{200,-104},{220,-84}}), iconTransformation(extent={{100, + 80},{120,100}}))); +equation + + connect(fixedHeatFlow.port, vol.heatPort) annotation (Line(points={{-20,-74},{ + 30,-74},{30,-60},{70,-60}}, + color={191,0,0})); + connect(fixedHeatFlow.Q_flow, Q_flow) + annotation (Line(points={{-40,-74},{-110,-74}}, color={0,0,127}, + pattern=LinePattern.Dash)); + + connect(vAV1.port_b, vol[1].ports[1]) + annotation (Line(points={{10,8},{ + 14,8},{14,-78},{76,-78},{76,-74},{78.6667,-74},{78.6667,-70}}, + color={0,140,72}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV2.port_b, vol[2].ports[1]) + annotation (Line(points={{50,8},{ + 60,8},{60,-78},{76,-78},{76,-74},{78.6667,-74},{78.6667,-70}}, + color={0,140,72}, + thickness=0.5, pattern=LinePattern.Dash)); + connect(vAV3.port_b, vol[3].ports[1]) + annotation (Line(points={{92,8},{ + 100,8},{100,-78},{80,-78},{80,-70},{78.6667,-70}}, + color={0,140,72}, + thickness=0.5, pattern=LinePattern.Dash)); + connect(vAV4.port_b, vol[4].ports[1]) + annotation (Line(points={{138,8},{ + 150,8},{150,-78},{80,-78},{80,-70},{78.6667,-70}}, + color={0,140,72}, + thickness=0.5, pattern=LinePattern.Dash)); + connect(vAV5.port_b, vol[5].ports[1]) + annotation (Line(points={{178,8},{ + 188,8},{188,-78},{80,-78},{80,-70},{78.6667,-70}}, + color={0,140,72}, + thickness=0.5, pattern=LinePattern.Dash)); + + for i in 1:5 loop + connect(TZonSen[i].port_b, AirNetWor.ports_a[i]); + connect(TZonSen[i].port_a, vol[i].ports[2]); + end for; + + connect(ReheatWatNet.port_b, port_b_Wat) annotation (Line( + points={{-76,57.2},{-74,57.2},{-74,72},{40,72},{40,100}}, + color={255,0,0}, + thickness=1)); + connect(ReheatWatNet.port_a, port_a_Wat) annotation (Line( + points={{-76,40.2},{-76,40.2},{-76,40},{-82,40},{-82,76},{-40,76},{ + -40,100}}, + color={255,0,0}, + thickness=1)); + connect(AirNetWor.port_a, port_a_Air) + annotation (Line(points={{-74,-28.2},{-88,-28.2},{-88,40},{-100,40}}, color={0,140,72}, + thickness=0.5)); + + connect(AirNetWor.port_b, port_b_Air) + annotation (Line(points={{-74,-45.2},{-80,-45.2},{-80,-60},{-100,-60}}, color={0,140,72}, + thickness=0.5)); + + connect(AirNetWor.p, p) annotation (Line( + points={{-42.5,-35},{-8,-35},{-8,-12},{210,-12}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(TZonAir.y, TZon) annotation (Line( + points={{191,80},{210,80}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(On[2], vAV2.On) annotation (Line(points={{-110,-14},{18,-14},{18,0},{29, + 0}}, color={255,0,255})); + connect(On[3], vAV3.On) annotation (Line(points={{-110,-12},{-72,-12},{ + -72,-8},{56,-8},{56,0},{71,0}}, + color={255,0,255})); + connect(On[4], vAV4.On) annotation (Line(points={{-110,-10},{-72,-10},{-72,-10}, + {100,-10},{100,0},{117,0}}, + color={255,0,255})); + connect(On[5], vAV5.On) annotation (Line(points={{-110,-8},{-72,-8},{-72,-10}, + {148,-10},{148,0},{157,0}}, + color={255,0,255})); + connect(On[1], vAV1.On) annotation (Line(points={{-110,-16},{-72,-16},{-72,0}, + {-11,0}}, + color={255,0,255})); + connect(yVal[1], vAV1.yVal) annotation (Line(points={{-110,56},{-34,56},{-34,12}, + {-11,12}}, color={0,0,127})); + connect(yVal[2], vAV2.yVal) annotation (Line(points={{-110,58},{20,58},{20,12}, + {29,12}}, color={0,0,127})); + connect(yVal[3], vAV3.yVal) annotation (Line(points={{-110,60},{64,60},{64,12}, + {71,12}}, color={0,0,127})); + connect(yVal[4], vAV4.yVal) annotation (Line(points={{-110,62},{110,62},{110,12}, + {117,12}}, color={0,0,127})); + connect(yVal[5], vAV5.yVal) annotation (Line(points={{-110,64},{-4,64},{-4,62}, + {150,62},{150,12},{157,12}}, color={0,0,127})); + connect(airFloRatSet[1], vAV1.airFloRatSet) annotation (Line(points={{-110,82}, + {-30,82},{-30,16},{-11,16}}, color={0,0,127})); + connect(airFloRatSet[2], vAV2.airFloRatSet) annotation (Line(points={{-110,84}, + {18,84},{18,16},{29,16}}, color={0,0,127})); + connect(airFloRatSet[3], vAV3.airFloRatSet) annotation (Line(points={{-110, + 86},{62,86},{62,16},{71,16}}, color={0,0,127})); + connect(airFloRatSet[4], vAV4.airFloRatSet) annotation (Line(points={{-110,88}, + {108,88},{108,16},{117,16}}, color={0,0,127})); + connect(airFloRatSet[5], vAV5.airFloRatSet) annotation (Line(points={{-110,90}, + {148,90},{148,16},{157,16}}, color={0,0,127})); + connect(vAV1.port_a_Wat, ReheatWatNet.ports_b[1]) annotation (Line( + points={{-8,18},{-10,18},{-10,41.9},{-46,41.9}}, + color={238,46,47}, + thickness=0.5)); + connect(vAV2.port_a_Wat, ReheatWatNet.ports_b[2]) annotation (Line( + points={{32,18},{32,38},{-46,38},{-46,40.54}}, + color={238,46,47}, + thickness=0.5)); + connect(vAV3.port_a_Wat, ReheatWatNet.ports_b[3]) annotation (Line( + points={{74,18},{74,32},{-46,32},{-46,39.18}}, + color={238,46,47}, + thickness=0.5)); + connect(vAV4.port_a_Wat, ReheatWatNet.ports_b[4]) annotation (Line( + points={{120,18},{118,18},{118,37.82},{-46,37.82}}, + color={238,46,47}, + thickness=0.5)); + connect(vAV5.port_a_Wat, ReheatWatNet.ports_b[5]) annotation (Line( + points={{160,18},{162,18},{162,36.46},{-46,36.46}}, + color={238,46,47}, + thickness=0.5)); + connect(vAV1.port_b_Wat, ReheatWatNet.ports_a[1]) annotation (Line( + points={{-2,18},{-2,60.26},{-46,60.26}}, + color={238,46,47}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV2.port_b_Wat, ReheatWatNet.ports_a[2]) annotation (Line( + points={{38,18},{40,18},{40,58.9},{-46,58.9}}, + color={238,46,47}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV3.port_b_Wat, ReheatWatNet.ports_a[3]) annotation (Line( + points={{80,18},{80,54},{-46,54},{-46,57.54}}, + color={238,46,47}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV4.port_b_Wat, ReheatWatNet.ports_a[4]) annotation (Line( + points={{126,18},{126,56.18},{-46,56.18}}, + color={238,46,47}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV5.port_b_Wat, ReheatWatNet.ports_a[5]) annotation (Line( + points={{166,18},{166,52},{-46,52},{-46,54.82}}, + color={238,46,47}, + thickness=0.5, + pattern=LinePattern.Dash)); + connect(vAV1.port_a, AirNetWor.ports_b[1]) annotation (Line( + points={{-10,8},{-28,8},{-28,-29.9},{-44,-29.9}}, + color={0,127,0}, + thickness=0.5)); + connect(vAV2.port_a, AirNetWor.ports_b[2]) annotation (Line( + points={{30,8},{16,8},{16,-30},{-16,-30},{-16,-28.54},{-44,-28.54}}, + color={0,127,0}, + thickness=0.5)); + connect(vAV3.port_a, AirNetWor.ports_b[3]) annotation (Line( + points={{72,8},{58,8},{58,-28},{-44,-28},{-44,-27.18}}, + color={0,127,0}, + thickness=0.5)); + connect(vAV4.port_a, AirNetWor.ports_b[4]) annotation (Line( + points={{118,8},{108,8},{108,-25.82},{-44,-25.82}}, + color={0,127,0}, + thickness=0.5)); + connect(vAV5.port_a, AirNetWor.ports_b[5]) annotation (Line( + points={{158,8},{146,8},{146,-24.46},{-44,-24.46}}, + color={0,127,0}, + thickness=0.5)); + + connect(yDamMea.y, yDam) annotation (Line(points={{191,54},{210,54}}, + color={0,0,127})); + connect(yReaValMea.y, yReaHea) + annotation (Line(points={{191,28},{210,28}}, color={0,0,127})); + connect(Vflow_setMea.y, Vflow_set) + annotation (Line(points={{191,-40},{210,-40}}, color={0,0,127})); + connect(Vflow_Mea.y, Vflow) + annotation (Line(points={{191,-60},{210,-60}}, color={0,0,127})); + connect(TSupMea.y, TSup) + annotation (Line(points={{191,-80},{210,-80}}, color={0,0,127})); + + connect(nPeo, gaiCO2.u) + annotation (Line(points={{-110,-90},{-41.2,-90}}, color={0,0,127})); + connect(gaiCO2.y, vol.C_flow[1]) + annotation (Line(points={{-27.4,-90},{68,-90},{68,-66}}, color={0,0,127})); + + for i in 1:5 loop + connect(senCO2[i].port, vol[i].ports[3]); + end for; + connect(senCO2.C, conMasVolFra.m) annotation (Line( + points={{98.8,-90},{103.4,-90}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(conMasVolFra.V, gaiPPM.u) + annotation (Line(points={{116.6,-90},{124.8,-90}}, color={0,0,127})); + connect(gaiPPM.y, CO2Zon) annotation (Line(points={{138.6,-90},{166,-90}, + {166,-94},{210,-94}}, color={0,0,127})); + annotation (Placement(transformation(extent={{84,-82},{100,-98}})), + Placement(transformation(extent={{122,-98},{138,-82}})), + Line(points={{100.8,-90},{121.2,-90}}, color={0,0,127}), + Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line(points={{-90,40},{80,40}}, color={0,127,255}), + Line(points={{-90,-60},{80,-60}}, color={0,127,255}), + Line(points={{80,40},{80,-60}}, color={0,127,255}), + Line(points={{50,40},{50,-60}}, color={0,127,255}), + Line(points={{20,40},{20,-60}}, color={0,127,255}), + Line(points={{-10,40},{-10,-60}}, color={0,127,255}), + Line(points={{-40,40},{-40,-60}}, color={0,127,255}), + Rectangle( + extent={{-46,0},{-34,-20}}, + lineColor={28,108,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-16,0},{-4,-20}}, + lineColor={28,108,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{14,0},{26,-20}}, + lineColor={28,108,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{44,0},{56,-20}}, + lineColor={28,108,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{74,0},{86,-20}}, + lineColor={28,108,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Line(points={{-40,90},{-40,60}}, color={255,0,0}), + Line(points={{-60,60},{-40,60}}, color={255,0,0}), + Line(points={{-60,60},{-60,-12}}, color={255,0,0}), + Line(points={{64,20},{-60,20}}, color={255,0,0}), + Line(points={{-24,20},{-24,-12}}, color={255,0,0}), + Line(points={{6,20},{6,-12}}, color={255,0,0}), + Line(points={{36,20},{36,-12}}, color={255,0,0}), + Line(points={{64,20},{64,-12}}, color={255,0,0}), + Line(points={{-60,-12},{-46,-12}}, color={255,0,0}), + Line(points={{-24,-12},{-16,-12}}, color={255,0,0}), + Line(points={{6,-12},{14,-12}}, color={255,0,0}), + Line(points={{36,-12},{44,-12}}, color={255,0,0}), + Line(points={{64,-12},{74,-12}}, color={255,0,0}), + Line(points={{90,-32},{-36,-32}}, color={255,0,0}), + Line(points={{-36,-20},{-36,-32}}, color={255,0,0}), + Line(points={{-6,-20},{-6,-32}}, color={255,0,0}), + Line(points={{24,-20},{24,-32}}, color={255,0,0}), + Line(points={{54,-20},{54,-32}}, color={255,0,0}), + Line(points={{84,-20},{84,-32}}, color={255,0,0}), + Line(points={{90,60},{90,-32}}, color={255,0,0}), + Line(points={{40,60},{90,60}}, color={255,0,0}), + Line(points={{40,90},{40,60}}, color={255,0,0}), + Text( + extent={{-148,-110},{152,-70}}, + textColor={0,0,255}, + textString="%name")}), + Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {200,100}})), + Documentation(info=" +

    A hot water reheat coil is installed in each VAV terminal. The components and control systems of the VAV is shown in the figure below:

    +

    +

    The controller for terminal VAV box is based on the "single maximum VAV reheat control logic".

    + +

    VAV damper position is controlled by a PI controller to maintain the air flow rate at setpoint. Heating coil valve position is controlled by a PI controller to maintain the supply air temperature at setpoint.

    +

    See the model +MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal.VAVTerminal for a description of the VAV terminal model.

    +", revisions = " + +")); +end FiveZoneVAV; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/VAVTerminal.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/VAVTerminal.mo new file mode 100644 index 000000000..7debf4dd9 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/VAVTerminal.mo @@ -0,0 +1,195 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide.ZoneTerminal; +model VAVTerminal "The model of the VAV terminals" + parameter String zonNam "Zone designation, required if KPIs is AirZoneTemperature, + RadiativeZoneTemperature, OperativeZoneTemperature, RelativeHumidity, + or CO2Concentration"; + replaceable package MediumAir = + Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + replaceable package MediumWat = + Modelica.Media.Interfaces.PartialMedium "Medium for the water"; + parameter Modelica.Units.SI.MassFlowRate mAirFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.MassFlowRate mWatFloRat "mass flow rate for air"; + parameter Modelica.Units.SI.Pressure PreDroAir + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroWat + "Pressure drop in the water side"; + parameter Modelica.Units.SI.Efficiency eps(max=1) = 0.8 + "Heat exchanger effectiveness"; + + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage dam( + redeclare package Medium = MediumAir, + m_flow_nominal=mAirFloRat, + dpValve_nominal=PreDroAir, + riseTime=15, + y_start=0.3) annotation (Placement(transformation(extent={{-12,-10}, + {8,10}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TEnt(redeclare package Medium = + MediumAir) annotation (Placement(transformation(extent= + {{-88,-10},{-68,10}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort TLea( + redeclare package Medium = MediumAir, + m_flow_nominal=mAirFloRat, + tau=1, + transferHeat=true) + annotation (Placement(transformation(extent={{26,10},{46,-10}}))); + Modelica.Fluid.Sensors.MassFlowRate m_flow(redeclare package Medium = + MediumAir) + annotation (Placement(transformation(extent={{56,-10},{76,10}}))); + Modelica.Fluid.Sensors.Pressure pEnt(redeclare package Medium = + MediumAir) annotation (Placement(transformation(extent={{-16, + -20},{-36,-40}}))); + Modelica.Fluid.Sensors.Pressure pLea(redeclare package Medium = + MediumAir) annotation (Placement(transformation(extent={{30,-20}, + {10,-40}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + MediumAir) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + MediumAir) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Coil.BaseClasses.DryCoil heaCoil( + redeclare package MediumAir = MediumAir, + redeclare package MediumWat = MediumWat, + mAirFloRat=mAirFloRat, + mWatFloRat=mWatFloRat, + PreDroWat=0, + eps=eps, + PreDroAir=0) + annotation (Placement(transformation(extent={{-40,-4},{-60,16}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-90,90},{-70,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_Wat(redeclare package + Medium = + MediumWat) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-30,90},{-10,110}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI + pI( + yMin=0.3, + k=0.02, + Ti=120) + annotation (Placement(transformation(extent={{10,70},{30,90}}))); + Modelica.Blocks.Math.Gain gain(k=1/mAirFloRat/1.25) + annotation (Placement(transformation( + extent={{4,-4},{-4,4}}, + rotation=-90, + origin={66,24}))); + Modelica.Blocks.Interfaces.RealInput airFloRatSet + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-120,70},{-100,90}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage rehVal( + redeclare package Medium = MediumWat, + m_flow_nominal=mWatFloRat, + dpValve_nominal=PreDroWat, + y_start=0.01) annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=-90, + origin={-20,42}))); + Modelica.Blocks.Interfaces.RealInput yVal + "Actuator position (0: closed, 1: open)" + annotation (Placement(transformation(extent={{-120,30},{-100,50}}))); + Modelica.Blocks.Interfaces.RealOutput TAirLea + "Temperature of the passing fluid" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); + Modelica.Blocks.Interfaces.BooleanInput On annotation (Placement(transformation(extent={{-120,-90},{-100,-70}}))); + Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=true) + annotation (Placement(transformation(extent={{-60,76},{-40,96}}))); + ReadOverwrite.WriteZoneLoc oveZonLoc(zonNam=zonNam) + annotation (Placement(transformation(extent={{-68,40},{-48,60}}))); +equation + connect(TEnt.port_a, port_a) annotation (Line( + points={{-88,0},{-88,0},{-100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(dam.port_b, TLea.port_a) annotation (Line( + points={{8,0},{26,0}}, + color={0,140,72}, + thickness=0.5)); + connect(TLea.port_b, m_flow.port_a) annotation (Line( + points={{46,0},{56,0}}, + color={0,140,72}, + thickness=0.5)); + connect(pLea.port, TLea.port_a) annotation (Line( + points={{20,-20},{20,0},{26,0}}, + color={0,140,72}, + thickness=0.5)); + connect(pEnt.port, dam.port_a) annotation (Line( + points={{-26,-20},{-26,0},{-12,0}}, + color={0,140,72}, + thickness=0.5)); + connect(m_flow.m_flow, gain.u) annotation (Line( + points={{66,11},{66,19.2}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(gain.y,pI.mea) annotation (Line( + points={{66,28.4},{66,52},{0,52},{0,74},{8,74}}, + color={0,0,127})); + connect(pI.set, airFloRatSet) + annotation (Line(points={{8,80},{-110,80}}, color={0,0,127})); + connect(rehVal.port_b, port_b_Wat) annotation (Line( + points={{-20,52},{-20,100}}, + color={255,0,0}, + thickness=1)); + connect(heaCoil.port_a_Air, TEnt.port_b) annotation (Line( + points={{-60,0},{-64,0},{-68,0}}, + color={0,140,72}, + thickness=0.5)); + connect(heaCoil.port_b_Air,dam. port_a) + annotation (Line(points={{-40,0},{-26,0},{-12,0}}, + color={0,140,72}, + thickness=0.5)); + connect(rehVal.port_a, heaCoil.port_b_Wat) annotation (Line( + points={{-20,32},{-22,32},{-22,28},{-60,28},{-60,12}}, + color={255,0,0}, + thickness=1)); + connect(heaCoil.port_a_Wat, port_a_Wat) annotation (Line( + points={{-40,12},{-40,36},{-80,36},{-80,100}}, + color={255,0,0}, + thickness=1)); + connect(booleanExpression.y, pI.On) annotation (Line( + points={{-39,86},{8,86}}, + color={255,0,255})); + connect(TLea.T, TAirLea) annotation (Line(points={{36,-11},{36,-60}, + {110,-60}}, color={0,0,127})); + connect(m_flow.port_b, port_b) annotation (Line( + points={{76,0},{88,0},{88,0},{100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(oveZonLoc.yReaHea_out, rehVal.y) annotation (Line(points={{-47,46}, + {-40,46},{-40,42},{-32,42}}, color={0,0,127})); + connect(yVal, oveZonLoc.yReaHea_in) annotation (Line(points={{-110,40}, + {-90,40},{-90,46},{-70,46}}, + color={0,0,127})); + connect(pI.y, oveZonLoc.yDam_in) annotation (Line(points={{31,80},{34, + 80},{34,68},{-78,68},{-78,54},{-70,54}}, + color={0,0,127})); + connect(oveZonLoc.yDam_out,dam. y) + annotation (Line(points={{-47,54},{-2,54},{-2,12}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{102,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-90,0},{90,0}}, + color={255,255,255}, + pattern=LinePattern.Dash), + Text( + extent={{-60,58},{68,-66}}, + lineColor={0,0,0}, + pattern=LinePattern.Dash, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="VAV"), + Text( + extent={{-144,118},{156,158}}, + textString="%name", + textColor={0,0,255})}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end VAVTerminal; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.mo new file mode 100644 index 000000000..dbd21ba68 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.AirSide; +package ZoneTerminal + +end ZoneTerminal; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.order new file mode 100644 index 000000000..a6c711229 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/ZoneTerminal/package.order @@ -0,0 +1,5 @@ +FiveZoneDuctNetwork +FiveZoneVAV +VAVTerminal +Control +Examples diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.mo new file mode 100644 index 000000000..3f9afece8 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; +package AirSide "\"Models for device level components\"" + +end AirSide; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.order new file mode 100644 index 000000000..184dd6684 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/AirSide/package.order @@ -0,0 +1,4 @@ +AirHandlingUnit +Coil +MixingBox +ZoneTerminal diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/FlowMover.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/FlowMover.mo new file mode 100644 index 000000000..67f08e561 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/FlowMover.mo @@ -0,0 +1,87 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses; +partial model FlowMover + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; + parameter Real HydEff[:] "Hydraulic efficiency"; + parameter Real MotEff[:] "Motor efficiency"; + parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] + "Volume flow rate curve"; + parameter Modelica.Units.SI.Pressure PreCur[:] "Pressure curve"; + parameter Modelica.Units.SI.Time TimCon "Time constant for the fluid"; + WithoutMotor withoutMotor( + redeclare package Medium = Medium, + HydEff=HydEff, + MotEff=MotEff, + VolFloCur=VolFloCur, + PreCur=PreCur, + TimCon=TimCon) + annotation (Placement(transformation(extent={{-18,-10},{2,10}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temEnt(redeclare package + Medium = + Medium) + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort temLea(redeclare package + Medium = + Medium) + annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + Modelica.Fluid.Sensors.MassFlowRate masFloRat(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + Modelica.Fluid.Sensors.Pressure preEnt(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-32,-20},{-52,-40}}))); + Modelica.Fluid.Sensors.Pressure preLea(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{30,-20},{10,-40}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Modelica.Blocks.Interfaces.RealOutput P "Electrical power consumed" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Modelica.Blocks.Interfaces.BooleanInput On "On-off signal" annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealOutput Rat + "Actual normalised pump speed that is used for computations" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); +equation + connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( + points={{-18,0},{-60,0}}, + color={0,127,255}, + thickness=1)); + connect(temEnt.port_a, port_a) annotation (Line( + points={{-80,0},{-100,0}}, + color={0,127,255}, + thickness=1)); + connect(withoutMotor.port_b, temLea.port_a) annotation (Line( + points={{2,0},{30,0}}, + color={0,127,255}, + thickness=1)); + connect(temLea.port_b, masFloRat.port_a) annotation (Line( + points={{50,0},{60,0}}, + color={0,127,255}, + thickness=1)); + connect(masFloRat.port_b, port_b) annotation (Line( + points={{80,0},{100,0}}, + color={0,127,255}, + thickness=1)); + connect(preEnt.port, temEnt.port_b) annotation (Line( + points={{-42,-20},{-42,0},{-60,0}}, + color={0,127,255}, + thickness=1)); + connect(preLea.port, temLea.port_a) annotation (Line( + points={{20,-20},{20,0},{30,0}}, + color={0,127,255}, + thickness=1)); + connect(withoutMotor.P, P) annotation (Line( + points={{3,6},{12,6},{20,6},{20,40},{110,40}}, + color={0,0,127})); + connect(withoutMotor.Rat, Rat) annotation (Line( + points={{3,-6},{12,-6},{12,-60},{110,-60}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, + 200}), + Ellipse( + extent={{-80,80},{80,-80}}, + lineColor={28,108,200})}), Diagram(coordinateSystem( + preserveAspectRatio=false))); +end FlowMover; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/WithoutMotor.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/WithoutMotor.mo new file mode 100644 index 000000000..d9c9c1e6e --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/WithoutMotor.mo @@ -0,0 +1,69 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses; +model WithoutMotor + "Model for fans or pumps where motors are not explicitly modelled" + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the fluid"; + parameter Real HydEff[:] "Hydraulic efficiency"; + parameter Real MotEff[:] "Motor efficiency"; + parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:] + "Volume flow rate curve"; + parameter Modelica.Units.SI.Pressure PreCur[:] "Pressure curve"; + parameter Modelica.Units.SI.Time TimCon "Time constant for the fluid"; + Buildings.Fluid.Movers.SpeedControlled_y varSpeFloMov( + redeclare package Medium = Medium, + per( + pressure(V_flow=VolFloCur, dp=PreCur), + hydraulicEfficiency(eta=HydEff, V_flow=VolFloCur), + motorEfficiency(eta=MotEff, V_flow=VolFloCur)), + tau=TimCon, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + use_inputFilter=false) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + + Modelica.Blocks.Interfaces.RealInput u "control signal" + annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); + Modelica.Blocks.Interfaces.RealOutput P "Electrical power consumed" + annotation (Placement(transformation(extent={{100,50},{120,70}}))); + Modelica.Blocks.Interfaces.RealOutput Rat + "Actual normalised pump speed that is used for computations" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); +equation + connect(varSpeFloMov.port_a, port_a) + annotation (Line( + points={{-10,0},{-10,0},{-100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(varSpeFloMov.port_b, port_b) + annotation (Line( + points={{10,0},{56,0},{100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(varSpeFloMov.P, P) annotation (Line( + points={{11,9},{40,9},{40,60},{110,60}}, + color={0,0,127})); + connect(varSpeFloMov.y_actual, Rat) annotation (Line( + points={{11,7},{40,7},{40,-60},{110,-60}}, + color={0,0,127})); + connect(u,varSpeFloMov. y) annotation (Line(points={{-110,60},{0,60}, + {0,12}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, + 200}), + Ellipse( + extent={{-80,80},{80,-80}}, + lineColor={28,108,200}), + Text( + extent={{-30,24},{28,-28}}, + lineColor={28,108,200}, + textString="NoMotor"), + Text( + extent={{-150,108},{150,148}}, + textString="%name", + textColor={0,0,255})}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end WithoutMotor; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.mo new file mode 100644 index 000000000..41c01abe1 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover; +package BaseClasses "\"Base classes for modelling fans or pumps\"" + +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.order new file mode 100644 index 000000000..24428c30a --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/BaseClasses/package.order @@ -0,0 +1,2 @@ +FlowMover +WithoutMotor diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/CyclingOn.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/CyclingOn.mo new file mode 100644 index 000000000..3ee4325d8 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/CyclingOn.mo @@ -0,0 +1,126 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Control; +model CyclingOn + "\"Controller for constant speed fans or pumps\"" + parameter Modelica.Units.SI.Time waitTime(min=0) = 0 + "Wait time before transition fires"; + + Modelica.StateGraph.StepWithSignal On(nOut=2, nIn=1) + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={56,-44}))); + Modelica.StateGraph.InitialStepWithSignal Off(nIn=2, nOut=1) + annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=-90, + origin={54,42}))); + inner Modelica.StateGraph.StateGraphRoot stateGraphRoot + annotation (Placement(transformation(extent={{-80,72},{-60,92}}))); + Modelica.StateGraph.TransitionWithSignal transitionWithSignal(enableTimer=true, waitTime= + waitTime) + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={0,-40}))); + Modelica.StateGraph.TransitionWithSignal transitionWithSignal1 annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={54,0}))); + Modelica.Blocks.Interfaces.BooleanInput CyclingOn + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Logical.Not not1 + annotation (Placement(transformation(extent={{-60,-50},{-40,-30}}))); + Modelica.Blocks.Interfaces.BooleanOutput OnSigOut + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput OnSigIn + annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); + Modelica.Blocks.Logical.And and1 + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + Modelica.StateGraph.TransitionWithSignal transitionWithSignal2(waitTime= + waitTime, enableTimer=false) + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=-90, + origin={-22,48}))); + Modelica.Blocks.Logical.Not not2 + annotation (Placement(transformation(extent={{-60,38},{-40,58}}))); +equation + connect(transitionWithSignal.inPort, On.outPort[1]) annotation (Line( + points={{-6.66134e-016,-44},{-6.66134e-016,-80},{55.75,-80},{55.75,-54.5}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(transitionWithSignal.outPort, Off.inPort[1]) annotation (Line( + points={{2.22045e-016,-38.5},{0,-38.5},{0,60},{53.5,60},{53.5,53}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + + connect(Off.outPort[1], transitionWithSignal1.inPort) annotation (Line( + points={{54,31.5},{54,20},{54,4}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(transitionWithSignal1.outPort, On.inPort[1]) annotation (Line( + points={{54,-1.5},{54,-12},{54,-33},{56,-33}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(not1.y, transitionWithSignal.condition) annotation (Line( + points={{-39,-40},{-12,-40}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(not1.u, CyclingOn) annotation (Line( + points={{-62,-40},{-96,-40},{-96,0},{-120,0}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(On.active, OnSigOut) annotation (Line( + points={{67,-44},{67,-44},{80,-44},{80,0},{110,0}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(and1.u1, OnSigIn) annotation (Line( + points={{-62,0},{-86,0},{-86,40},{-120,40}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(and1.u2, CyclingOn) annotation (Line( + points={{-62,-8},{-90,-8},{-90,0},{-120,0}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(and1.y, transitionWithSignal1.condition) annotation (Line( + points={{-39,0},{-39,0},{-8,0},{42,0}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(transitionWithSignal2.inPort, On.outPort[2]) annotation (Line( + points={{-22,44},{-22,44},{-22,42},{-22,36},{-22,-96},{56.25,-96},{56.25, + -54.5}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(transitionWithSignal2.outPort, Off.inPort[2]) annotation (Line( + points={{-22,49.5},{-22,49.5},{-22,74},{54.5,74},{54.5,53}}, + color={0,0,0}, + pattern=LinePattern.Dash)); + connect(OnSigIn, not2.u) annotation (Line( + points={{-120,40},{-86,40},{-86,48},{-62,48}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(not2.y, transitionWithSignal2.condition) annotation (Line( + points={{-39,48},{-39,48},{-34,48}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-66,50},{62,-48}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="CyclingControl"), + Text( + extent={{-154,102},{146,142}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false))); +end CyclingOn; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/TemperatureCheck.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/TemperatureCheck.mo new file mode 100644 index 000000000..b9cb34623 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/TemperatureCheck.mo @@ -0,0 +1,46 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Control; +model TemperatureCheck "\"Controller for constant speed fans or pumps\"" + parameter Integer numTemp(min=1) = 1 + "The size of the temeprature vector"; + + Modelica.Blocks.Interfaces.RealInput Temp[numTemp] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.BooleanOutput On + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput CooSetPoi[numTemp] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput HeaSetPoi[numTemp] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + parameter Modelica.Units.SI.TemperatureDifference dTCycCon = 0.2 + "Temperature difference for trigerring the cycle control"; +algorithm + for i in 1:numTemp loop + if (Temp[i] > CooSetPoi[i] + dTCycCon) or (Temp[i] < HeaSetPoi[i] - dTCycCon) then + On := true; + break; + end if; + On := false; + end for; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-66,50},{62,-48}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="CyclingControl"), + Text( + extent={{-156,106},{144,146}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false))); +end TemperatureCheck; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/VAVDualFanControl.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/VAVDualFanControl.mo new file mode 100644 index 000000000..84dd259d0 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/VAVDualFanControl.mo @@ -0,0 +1,98 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Control; +model VAVDualFanControl + import BuildingControlEmulator = + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + parameter Modelica.Units.SI.Time waitTime(min=0) = 0 + "Wait time before transition fires"; + + BuildingControlEmulator.FlowMover.Control.CyclingOn cyclingOn(waitTime= + waitTime) + annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); + BuildingControlEmulator.conPI variableSpeed( + yMin=0.3, + k=k, + Ti=Ti, + conPID(y_reset=1)) + annotation (Placement(transformation(extent={{-60,36},{-40,56}}))); + Modelica.Blocks.Interfaces.BooleanInput On + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput SetPoi + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); + Modelica.Blocks.Interfaces.RealInput Mea + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); + Modelica.Blocks.Interfaces.RealOutput ySup "Connector of Real output signal" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput CyclingOn + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Logical.Not not1 + annotation (Placement(transformation(extent={{-62,0},{-42,20}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swi + annotation (Placement(transformation(extent={{12,28},{32,48}}))); + Buildings.Controls.OBC.CDL.Continuous.LimitSlewRate ramLim(raisingSlewRate=1/ + 120) "Ramp limiter for fan control signal" + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + Buildings.Controls.OBC.CDL.Continuous.Limiter lim(uMax=1, uMin=0) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + Modelica.Blocks.Math.BooleanToReal booToRea + annotation (Placement(transformation(extent={{-20,-40},{0,-20}}))); +equation + connect(variableSpeed.On, On) annotation (Line( + points={{-62,52},{-80,52},{-80,60},{-120,60}}, + color={255,0,255})); + connect(variableSpeed.mea, Mea) annotation (Line( + points={{-62,40},{-70,40},{-70,-20},{-120,-20}}, + color={0,0,127})); + connect(cyclingOn.CyclingOn, CyclingOn) annotation (Line( + points={{-62,-30},{-80,-30},{-80,-60},{-120,-60}}, + color={255,0,255})); + connect(not1.u, On) annotation (Line( + points={{-64,10},{-80,10},{-80,60},{-120,60}}, + color={255,0,255})); + connect(not1.y, cyclingOn.OnSigIn) annotation (Line( + points={{-41,10},{-24,10},{-24,-8},{-80,-8},{-80,-26},{-62,-26}}, + color={255,0,255})); + connect(variableSpeed.y, swi.u1) + annotation (Line(points={{-39,46},{10,46}}, color={0,0,127})); + connect(ramLim.y, lim.u) + annotation (Line(points={{62,0},{64,0}}, color={0,0,127})); + connect(lim.y, ySup) annotation (Line(points={{88,0},{110,0}}, + color={0,0,127})); + connect(ramLim.u, swi.y) annotation (Line(points={{38,0},{36,0},{36, + 38},{34,38}}, color={0,0,127})); + connect(SetPoi, variableSpeed.set) annotation (Line(points={{-120,20}, + {-74,20},{-74,46},{-62,46}}, color={0,0,127})); + connect(On, swi.u2) annotation (Line(points={{-120,60},{-80,60},{-80, + 28},{-20,28},{-20,38},{10,38}}, color={255,0,255})); + connect(cyclingOn.OnSigOut, booToRea.u) + annotation (Line(points={{-39,-30},{-22,-30}}, color={255,0,255})); + connect(booToRea.y, swi.u3) annotation (Line(points={{1,-30},{6,-30},{6, + 30},{10,30}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-66,50},{62,-48}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="VAVDualFanControl"), + Text( + extent={{-154,102},{146,142}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false)), + experiment( + StartTime=15638400, + StopTime=16243200, + __Dymola_NumberOfIntervals=1440, + __Dymola_Algorithm="Cvode")); +end VAVDualFanControl; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.mo new file mode 100644 index 000000000..9472163bd --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover; +package Control + +end Control; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.order new file mode 100644 index 000000000..92054e20f --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Control/package.order @@ -0,0 +1,3 @@ +CyclingOn +VAVDualFanControl +TemperatureCheck diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/BaseClasses.mo new file mode 100644 index 000000000..a9e62c61b --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/BaseClasses.mo @@ -0,0 +1,30 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Pump; +package BaseClasses + + model ValCon + parameter Integer n= 2 + "the number of pumps"; + + Modelica.Blocks.Interfaces.RealInput On[n] "On signal" annotation (Placement(transformation(extent={{-118,-9}, + {-100,9}}))); + Modelica.Blocks.Interfaces.RealOutput y[n] "On signal" + annotation (Placement(transformation(extent={{100,-9},{118,9}}))); + + equation + + for i in 1:n loop + y[i] =noEvent(if On[i]>0.01 then 1 else 0); + end for; + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-150,102},{150,142}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false))); + end ValCon; +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/Control.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/Control.mo new file mode 100644 index 000000000..9d643eec0 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/Control.mo @@ -0,0 +1,71 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Pump; +package Control + + model SecPumCon "This model is used for secondary chilled water pump control." + parameter Real tWai = 300 "Waiting time"; + + parameter Integer n=3 + "the number of pumps"; + WaterSide.Control.PumpStageN pumSta( + tWai=tWai, + thehol_up=0.9, + n=n, + thehol_down=0.6) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + Modelica.Blocks.Interfaces.BooleanInput On "On signal" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput sta[n] "Speeds of pumps" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + Modelica.Blocks.Interfaces.RealInput dpMea "Measured pressure drop" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Math.Product product[n] + annotation (Placement(transformation(extent={{20,40},{40,60}}))); + Modelica.Blocks.Interfaces.RealOutput y[n] "Connector of Real output signal" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + + Modelica.Blocks.Routing.Replicator replicator(nout=n) + annotation (Placement(transformation(extent={{56,-40},{76,-20}}))); + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI + conPI(k=0.001, Ti=60) + annotation (Placement(transformation(extent={{18,-20},{38,0}}))); + Modelica.Blocks.Interfaces.RealInput dpSet + "Static differential pressure setpoint for the secondary pump" + annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); + equation + connect(pumSta.On, On) annotation (Line(points={{-52,8},{-66,8},{-80, + 8},{-80,80},{-120,80}}, color={255,0,255})); + connect(pumSta.sta, sta) annotation (Line(points={{-52,-8},{-80,-8},{ + -80,-80},{-120,-80}}, color={0,0,127})); + connect(product.y, y) annotation (Line( + points={{41,50},{60,50},{80,50},{80,0},{110,0}}, + color={0,0,127})); + connect(pumSta.y, product.u1) annotation (Line(points={{-29,0},{0,0}, + {0,56},{18,56}}, color={0,0,127})); + connect(replicator.y, product.u2) annotation (Line( + points={{77,-30},{90,-30},{90,-12},{58,-12},{58,24},{8,24},{8,44},{18,44}}, + color={0,0,127})); + + connect(conPI.On, On) annotation (Line( + points={{16,-4},{-20,-4},{-20,80},{-120,80}}, + color={255,0,255})); + connect(conPI.y, replicator.u) annotation (Line( + points={{39,-10},{46,-10},{46,-30},{54,-30}}, + color={0,0,127})); + connect(conPI.mea, dpMea) annotation (Line(points={{16,-16},{-92,-16}, + {-92,0},{-120,0}}, color={0,0,127})); + connect(conPI.set, dpSet) annotation (Line(points={{16,-10},{-20,-10}, + {-20,-40},{-120,-40}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-156,104},{144,144}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false))); + end SecPumCon; + +end Control; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/PumpSystem.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/PumpSystem.mo new file mode 100644 index 000000000..f924ca5bd --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/PumpSystem.mo @@ -0,0 +1,76 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Pump; +model PumpSystem "This model is used to simulate the secondary chilled water pump" + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium water"; + parameter Integer n= 2 + "the number of pumps"; + + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[n]; + parameter Real HydEff[n,:] "Hydraulic efficiency"; + parameter Real MotEff[n,:] "Motor efficiency"; + parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[n,:] + "Volume flow rate curve"; + parameter Modelica.Units.SI.Pressure PreCur[n,:] "Pressure curve"; + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.BaseClasses.WithoutMotor + pum[n]( + varSpeFloMov(addPowerToMedium=false), + redeclare package Medium = Medium, + HydEff=HydEff, + MotEff=MotEff, + VolFloCur=VolFloCur, + PreCur=PreCur, + TimCon=900) + annotation (Placement(transformation(extent={{-12,-10},{10,10}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Modelica.Blocks.Interfaces.RealInput speSig[n] "On signal" + annotation (Placement(transformation(extent={{-118,71},{-100,89}}))); + Modelica.Blocks.Interfaces.RealOutput speRat[n] + "Speed of the pump divided by the nominal value" + annotation (Placement(transformation(extent={{100,52},{120,72}}))); + Modelica.Blocks.Interfaces.RealOutput P[n] + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val[n](redeclare + package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dpValve_nominal=dpValve_nominal) + annotation (Placement(transformation(extent={{42,-10},{62,10}}))); + BaseClasses.ValCon valCon(n=n) + annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + parameter Modelica.Units.SI.PressureDifference dpValve_nominal[n] + "Nominal pressure drop of fully open valve, used if CvData=Buildings.Fluid.Types.CvTypes.OpPoint"; +equation + + for i in 1:n loop + connect(pum[i].Rat,speRat [i]); + connect(pum[i].port_a, port_a); + connect(val[i].port_b, port_b); + connect(pum[i].P, P[i]); + connect(pum[i].port_b, val[i].port_a); + end for; + + connect(pum.u,speSig) annotation (Line( + points={{-13.1,6},{-80,6},{-80,80},{-109,80}}, + color={0,0,127})); + connect(valCon.On,speSig) annotation (Line( + points={{-10.9,60},{-60,60},{-60,80},{-109,80}}, + color={0,0,127})); + connect(valCon.y, val.y) annotation (Line( + points={{10.9,60},{52,60},{52,12}}, + color={0,0,127})); + annotation (Icon(graphics={ + Text( + extent={{-152,104},{148,144}}, + textString="%name", + textColor={0,0,255}), + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)})); +end PumpSystem; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/SimPumpSystem.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/SimPumpSystem.mo new file mode 100644 index 000000000..b2ace3a44 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/SimPumpSystem.mo @@ -0,0 +1,132 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover.Pump; +model SimPumpSystem + "This model is used to simulate the primary chilled water pump and condenser water pump system" + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium water"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal[n] + "Rated mass flow rate"; + + parameter Integer n= 2 + "the number of pumps"; + parameter Real Motor_eta[n,:] "Motor efficiency"; + parameter Real Hydra_eta[n,:] "Hydraulic efficiency"; + parameter Modelica.Units.SI.PressureDifference dp_nominal + "Nominal pressure raise"; + + Buildings.Fluid.Movers.FlowControlled_m_flow + pumConSpe[n](redeclare package + Medium = Medium, + m_flow_nominal=m_flow_nominal, + per( + use_powerCharacteristic=false, + motorEfficiency(eta=Motor_eta), + hydraulicEfficiency(eta=Hydra_eta)), + dp_nominal=dp_nominal) "Constant Speed pump" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = Medium) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = Medium) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Modelica.Blocks.Interfaces.RealInput On[n] "On signal" annotation (Placement(transformation(extent={{-118,51}, + {-100,69}}))); + + Modelica.Blocks.Interfaces.RealOutput P[n] + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Modelica.Blocks.Math.Gain gain[n](k=m_flow_nominal) + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + +equation + + for i in 1:n loop + connect(pumConSpe[i].port_a, port_a); + connect(pumConSpe[i].port_b, port_b); + connect(pumConSpe[i].P, P[i]); + + end for; + + connect(gain.u, On) + annotation (Line( + points={{-82,60},{-109,60}}, + color={0,0,127})); + connect(gain.y, pumConSpe.m_flow_in) annotation (Line(points={{-59,60},{-28,60},{0,60},{0,12}}, color={0,0,127})); + + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-40,-102},{46,-156}}, + lineColor={0,0,255}, + textString="%name"), + Ellipse( + extent={{-20,80},{20,40}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{16,60},{-8,48},{-8,70},{16,60}}, + lineColor={0,0,255}, + smooth=Smooth.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-100,0},{-40,0},{-40,60}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-40,60},{-20,60}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-40,0},{-16,0}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-40,0},{-40,-60},{-16,-60}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{20,60},{40,60},{40,-60},{14,-60}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{40,0},{14,0}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{40,0},{90,0}}, + color={0,0,255}, + smooth=Smooth.None), + Ellipse( + extent={{-20,20},{20,-20}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-20,-40},{20,-80}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{16,0},{-8,-12},{-8,10},{16,0}}, + lineColor={0,0,255}, + smooth=Smooth.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{16,-60},{-8,-72},{-8,-50},{16,-60}}, + lineColor={0,0,255}, + smooth=Smooth.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid)}), + Documentation(revisions=" + +")); +end SimPumpSystem; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.mo new file mode 100644 index 000000000..71aa13e13 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.mo @@ -0,0 +1,5 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover; +package Pump "This package contains the modules which can be used to simulate the primary chilled water pump, the condenser water pump and the secondary chilled water pump" + +annotation (); +end Pump; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.order new file mode 100644 index 000000000..abb3b037f --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/Pump/package.order @@ -0,0 +1,4 @@ +SimPumpSystem +PumpSystem +Control +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VAVSupFan.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VAVSupFan.mo new file mode 100644 index 000000000..0f47c98dd --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VAVSupFan.mo @@ -0,0 +1,112 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover; +model VAVSupFan + "The AHU supply fan and the controller" + extends BaseClasses.FlowMover; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + parameter Modelica.Units.SI.Time waitTime(min=0) = 0 + "Wait time before transition fires"; + parameter Real SpeRat + "Speed ratio"; + parameter Integer numTemp(min=1) = 1 + "The size of the temeprature vector"; + Control.VAVDualFanControl varSpe( + k=k, + Ti=Ti, + waitTime=waitTime) + annotation (Placement(transformation(extent={{-60,44},{-40,64}}))); + Modelica.Blocks.Interfaces.RealInput pSet + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); + Modelica.Blocks.Interfaces.RealInput pMea + "Connector of measurement input signal" annotation (Placement( + transformation(extent={{-140,-120},{-100,-80}}))); + Modelica.Blocks.Interfaces.RealOutput yRet "Output signal connector" + annotation (Placement(transformation(extent={{100,-92},{120,-72}}))); + Control.TemperatureCheck TChe(numTemp=numTemp) + annotation (Placement(transformation(extent={{-92,-50},{-72,-30}}))); + Modelica.Blocks.Interfaces.RealInput T[numTemp] + "Connector of setpoint input signal" annotation (Placement( + transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.RealInput cooTSet[numTemp] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,-40},{-100,0}}))); + Modelica.Blocks.Interfaces.RealInput heaTSet[numTemp] + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,80},{-100,120}}))); + Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeSupFan( + description="AHU supply fan speed control signal", u( + min=0, + max=1, + unit="1")) + annotation (Placement(transformation(extent={{-26,44},{-6,64}}))); + Modelica.Blocks.Math.Gain gain(k=SpeRat) + annotation (Placement(transformation(extent={{16,50},{24,58}}))); +equation + connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( + points={{-18,0},{-60,0}}, + color={0,140,72}, + thickness=0.5)); + connect(temEnt.port_a, port_a) annotation (Line( + points={{-80,0},{-100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(withoutMotor.port_b, temLea.port_a) annotation (Line( + points={{2,0},{30,0}}, + color={0,140,72}, + thickness=0.5)); + connect(temLea.port_b, masFloRat.port_a) annotation (Line( + points={{50,0},{60,0}}, + color={0,140,72}, + thickness=0.5)); + connect(masFloRat.port_b, port_b) annotation (Line( + points={{80,0},{100,0}}, + color={0,140,72}, + thickness=0.5)); + connect(preEnt.port, temEnt.port_b) annotation (Line( + points={{-42,-20},{-42,0},{-60,0}}, + color={0,140,72}, + thickness=0.5)); + connect(preLea.port, temLea.port_a) annotation (Line( + points={{20,-20},{20,0},{30,0}}, + color={0,140,72}, + thickness=0.5)); + connect(withoutMotor.P, P) annotation (Line( + points={{3,6},{12,6},{20,6},{20,40},{110,40}}, + color={0,0,127})); + connect(On, varSpe.On) + annotation (Line(points={{-120,60},{-62,60}}, color={255,0,255})); + connect(varSpe.SetPoi, pSet) annotation (Line(points={{-62,56},{-80,56}, + {-80,20},{-120,20}}, color={0,0,127})); + connect(varSpe.Mea, pMea) annotation (Line(points={{-62,52},{-66,52},{-66, + 16},{-56,16},{-56,-100},{-120,-100}}, color={0,0,127})); + connect(TChe.Temp, T) annotation (Line(points={{-94,-40},{-100,-40},{-100, + -60},{-120,-60}}, color={0,0,127})); + connect(TChe.On, varSpe.CyclingOn) annotation (Line(points={{-71,-40},{ + -68,-40},{-68,48},{-62,48}}, color={255,0,255})); + connect(TChe.CooSetPoi, cooTSet) annotation (Line(points={{-94,-34},{-98, + -34},{-98,-20},{-120,-20}}, color={0,0,127})); + connect(TChe.HeaSetPoi, heaTSet) annotation (Line(points={{-94,-46},{-98, + -46},{-98,-60},{-60,-60},{-60,34},{-88,34},{-88,100},{-120,100}}, + color={0,0,127})); + connect(varSpe.ySup, oveSpeSupFan.u) + annotation (Line(points={{-39,54},{-28,54}}, color={0,0,127})); + connect(oveSpeSupFan.y, withoutMotor.u) annotation (Line(points={{-5,54}, + {2,54},{2,26},{-30,26},{-30,6},{-19,6}}, color={0,0,127})); + connect(oveSpeSupFan.y, gain.u) + annotation (Line(points={{-5,54},{15.2,54}}, color={0,0,127})); + connect(gain.y, yRet) annotation (Line(points={{24.4,54},{32,54},{32, + -82},{110,-82}}, color={0,0,127})); + annotation (Icon(graphics={ + Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, + 200}), + Text( + extent={{-30,24},{28,-28}}, + lineColor={28,108,200}, + textString="V"), + Text( + extent={{-152,106},{148,146}}, + textString="%name", + textColor={0,0,255})})); +end VAVSupFan; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VariableSpeedMover.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VariableSpeedMover.mo new file mode 100644 index 000000000..a2f831254 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/VariableSpeedMover.mo @@ -0,0 +1,70 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.FlowMover; +model VariableSpeedMover + "The component contains both the variable speed fan/pump and the controller" + import BuildingControlEmulator = + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; + extends BaseClasses.FlowMover(withoutMotor(varSpeFloMov(riseTime=240))); + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + + BuildingControlEmulator.conPI variableSpeed + annotation (Placement(transformation(extent={{-60,44},{-40,64}}))); + Modelica.Blocks.Interfaces.RealInput SetPoi + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,0},{-100,40}}))); + Modelica.Blocks.Interfaces.RealInput Mea + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); +equation + connect(withoutMotor.port_a, temEnt.port_b) annotation (Line( + points={{-18,0},{-60,0}}, + color={0,127,255}, + thickness=1)); + connect(temEnt.port_a, port_a) annotation (Line( + points={{-80,0},{-100,0}}, + color={0,127,255}, + thickness=1)); + connect(withoutMotor.port_b, temLea.port_a) annotation (Line( + points={{2,0},{30,0}}, + color={0,127,255}, + thickness=1)); + connect(temLea.port_b, masFloRat.port_a) annotation (Line( + points={{50,0},{60,0}}, + color={0,127,255}, + thickness=1)); + connect(masFloRat.port_b, port_b) annotation (Line( + points={{80,0},{100,0}}, + color={0,127,255}, + thickness=1)); + connect(preEnt.port, temEnt.port_b) annotation (Line( + points={{-42,-20},{-42,0},{-60,0}}, + color={0,127,255}, + thickness=1)); + connect(preLea.port, temLea.port_a) annotation (Line( + points={{20,-20},{20,0},{30,0}}, + color={0,127,255}, + thickness=1)); + connect(withoutMotor.P, P) annotation (Line( + points={{3,6},{12,6},{20,6},{20,40},{110,40}}, + color={0,0,127})); + connect(variableSpeed.y, withoutMotor.u) annotation (Line( + points={{-39,54},{-30,54},{-30,6},{-19,6}}, + color={0,0,127})); + connect(On, variableSpeed.On) annotation (Line( + points={{-120,60},{-62,60}}, + color={255,0,255})); + connect(variableSpeed.set, SetPoi) annotation (Line( + points={{-62,54},{-78,54},{-78,20},{-120,20}}, + color={0,0,127})); + connect(variableSpeed.mea, Mea) annotation (Line( + points={{-62,48},{-66,48},{-66,16},{-56,16},{-56,-60},{-120,-60}}, + color={0,0,127})); + annotation (Icon(graphics={ + Polygon(points={{-40,60},{-40,-60},{60,0},{-40,60}}, lineColor={28,108, + 200}), + Text( + extent={{-30,24},{28,-28}}, + lineColor={28,108,200}, + textString="V")})); +end VariableSpeedMover; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.mo new file mode 100644 index 000000000..00e9d6541 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; +package FlowMover "\"Component used for modelling fans and pumps\"" + +end FlowMover; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.order new file mode 100644 index 000000000..3ff95f4d4 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/FlowMover/package.order @@ -0,0 +1,5 @@ +VariableSpeedMover +VAVSupFan +BaseClasses +Control +Pump diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/BaseClasses.mo new file mode 100644 index 000000000..af97874dc --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/BaseClasses.mo @@ -0,0 +1,305 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Boiler; +package BaseClasses + + model BoilerPolynomial + "Boiler with efficiency curve described by a polynomial of the temperature" + extends Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger( + redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol, + show_T=true, + final tau=VWat*rho_default/m_flow_nominal); + + parameter Modelica.Units.SI.Power Q_flow_nominal "Nominal heating power"; + parameter Modelica.Units.SI.Temperature T_nominal=353.15 + "Temperature used to compute nominal efficiency (only used if efficiency curve depends on temperature)"; + // Assumptions + parameter Buildings.Fluid.Types.EfficiencyCurves effCur=Buildings.Fluid.Types.EfficiencyCurves.Constant + "Curve used to compute the efficiency"; + parameter Real a[:] = {0.9} "Coefficients for efficiency curve"; + + parameter Buildings.Fluid.Data.Fuels.Generic fue "Fuel type" + annotation (choicesAllMatching = true); + parameter Modelica.Units.SI.Efficiency eps(max=1) = 1 + "Heat exchanger effectiveness"; + parameter Modelica.Units.SI.ThermalConductance UA=0.05*Q_flow_nominal/30 + "Overall UA value"; + parameter Modelica.Units.SI.Volume VWat=1.5E-6*Q_flow_nominal + "Water volume of boiler" annotation (Dialog(tab="Dynamics", enable=not ( + energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); + parameter Modelica.Units.SI.Mass mDry=1.5E-3*Q_flow_nominal + "Mass of boiler that will be lumped to water heat capacity" annotation ( + Dialog(tab="Dynamics", enable=not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); + + Modelica.Units.SI.Efficiency eta=if effCur == Buildings.Fluid.Types.EfficiencyCurves.Constant + then a[1] elseif effCur == Buildings.Fluid.Types.EfficiencyCurves.Polynomial + then Buildings.Utilities.Math.Functions.polynomial(a=a, x=y) elseif + effCur == Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then + Buildings.Utilities.Math.Functions.quadraticLinear( + a=aQuaLin, + x1=y, + x2=T) else 0 "Boiler efficiency"; + Modelica.Units.SI.Power QFue_flow=y*Q_flow_nominal/eta_nominal + "Heat released by fuel"; + Modelica.Units.SI.Power QWat_flow=eta*QFue_flow*eps + "Heat transfer from gas into water"; + Modelica.Units.SI.MassFlowRate mFue_flow=QFue_flow/fue.h + "Fuel mass flow rate"; + Modelica.Units.SI.VolumeFlowRate VFue_flow=mFue_flow/fue.d + "Fuel volume flow rate"; + + Modelica.Blocks.Interfaces.RealInput y(min=0, max=1) "Part load ratio" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + + Modelica.Blocks.Interfaces.RealOutput T(final quantity="ThermodynamicTemperature", + final unit = "K", displayUnit = "degC", min=0) + annotation (Placement(transformation(extent={{100,70},{120,90}}))); + + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPort + "Heat port, can be used to connect to ambient" + annotation (Placement(transformation(extent={{-10,62}, {10,82}}))); + Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapDry( + C=500*mDry, + T(start=T_start)) if not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState) + "heat capacity of boiler metal" + annotation (Placement(transformation(extent={{-80,12},{-60,32}}))); + + protected + parameter Real eta_nominal(fixed=false) "Boiler efficiency at nominal condition"; + parameter Real aQuaLin[6] = if size(a, 1) == 6 then a else fill(0, 6) + "Auxiliary variable for efficiency curve because quadraticLinear requires exactly 6 elements"; + + Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFlo + annotation (Placement(transformation(extent={{-43,-40},{-23,-20}}))); + Modelica.Blocks.Sources.RealExpression Q_flow_in(y=QWat_flow) + annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); + Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor temSen + "Temperature of fluid" + annotation (Placement(transformation(extent={{0,30},{20,50}}))); + + Modelica.Thermal.HeatTransfer.Components.ThermalConductor UAOve(G=UA) + "Overall thermal conductance (if heatPort is connected)" + annotation (Placement(transformation(extent={{-48,10},{-28,30}}))); + + initial equation + if effCur == Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then + assert(size(a, 1) == 6, + "The boiler has the efficiency curve set to 'Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear', + and hence the parameter 'a' must have exactly 6 elements. + However, only " + String(size(a, 1)) + " elements were provided."); + end if; + + if effCur ==Buildings.Fluid.Types.EfficiencyCurves.Constant then + eta_nominal = a[1]; + elseif effCur ==Buildings.Fluid.Types.EfficiencyCurves.Polynomial then + eta_nominal = Buildings.Utilities.Math.Functions.polynomial( + a=a, x=1); + elseif effCur ==Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinear then + // For this efficiency curve, a must have 6 elements. + eta_nominal = Buildings.Utilities.Math.Functions.quadraticLinear( + a=aQuaLin, x1=1, x2=T_nominal); + else + eta_nominal = 999; + end if; + + equation + + assert(eta > 0.001, "Efficiency curve is wrong."); + + connect(UAOve.port_b, vol.heatPort) annotation (Line( + points={{-28,20},{-22,20},{-22,-10},{-9,-10}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(UAOve.port_a, heatPort) annotation (Line( + points={{-48,20},{-52,20},{-52,60},{0,60},{0,72}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(heaCapDry.port, vol.heatPort) annotation (Line( + points={{-70,12},{-70,-10},{-9,-10}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(temSen.T, T) annotation (Line( + points={{21,40},{60,40},{60,80},{110,80}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(preHeaFlo.port, vol.heatPort) annotation (Line( + points={{-23,-30},{-15,-30},{-15,-10},{-9,-10}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(Q_flow_in.y,preHeaFlo. Q_flow) annotation (Line( + points={{-59,-30},{-43,-30}}, + color={0,0,127}, + smooth=Smooth.None)); + connect(vol.heatPort, temSen.port) annotation (Line( + points={{-9,-10},{-16,-10},{-16,40},{0,40}}, + color={191,0,0}, + smooth=Smooth.None)); + annotation ( Icon(graphics={ + Polygon( + points={{0,-34},{-12,-52},{14,-52},{0,-34}}, + pattern=LinePattern.None, + smooth=Smooth.None, + fillColor={255,255,0}, + fillPattern=FillPattern.Solid, + lineColor={0,0,0}), + Line( + points={{-100,80},{-80,80},{-80,-44},{-6,-44}}, + smooth=Smooth.None), + Line( + points={{100,80},{80,80},{80,4}}, + color={0,0,127}, + smooth=Smooth.None), + Text( + extent={{160,144},{40,94}}, + lineColor={0,0,0}, + textString=DynamicSelect("T", String(T-273.15, format=".1f"))), + Text( + extent={{-38,146},{-158,96}}, + lineColor={0,0,0}, + textString=DynamicSelect("y", String(y, format=".2f")))}), + defaultComponentName="boi", + Documentation(info=" +

    +This is a model of a boiler whose efficiency is described +by a polynomial. +The heat input into the medium is

    +

    + Q̇ = y Q̇0 η ⁄ η0 +

    +

    +where +y ∈ [0, 1] is the control signal, +0 is the nominal power, +η is the efficiency at the current operating point, and +η0 is the efficiency at y=1 and +nominal temperature T=T0 as specified by the parameter +T_nominal. +

    +

    +The parameter effCur determines what polynomial is used +to compute the efficiency, which is defined as +

    +

    + η = Q̇ ⁄ Q̇f, +

    +

    +where + is the heat transferred to the working fluid (typically water or air), and +f is the heat of combustion released by the fuel. +

    +

    +The following polynomials can be selected to compute the efficiency: +

    + + + + + + + + + + + + + + + + + +
    Parameter effCurEfficiency curve
    Buildings.Fluid.Types.EfficiencyCurves.Constantη = a1
    Buildings.Fluid.Types.EfficiencyCurves.Polynomialη = a1 + a2 y + a3 y2 + ...
    Buildings.Fluid.Types.EfficiencyCurves.QuadraticLinearη = a1 + a2 y + + a3 y2 + + (a4 + a5 y + + a6 y2) T +
    + +

    +where T is the boiler outlet temperature in Kelvin. +For effCur = Buildings.Fluid.Types.EfficiencyCurves.Polynomial, +an arbitrary number of polynomial coefficients can be specified. +

    +

    +The parameter Q_flow_nominal is the power transferred to the fluid +for y=1 and, if the efficiency depends on temperature, +for T=T0. +

    +

    +The fuel mass flow rate and volume flow rate are computed as

    +

    + ṁf = Q̇f ⁄ hf +

    +

    and

    +

    + V̇f = ṁf ⁄ ρf, +

    +

    +where the fuel heating value +hf and the fuel mass density +ρf are obtained from the +parameter fue. +Note that if η is the efficiency relative to the lower heating value, +then the fuel properties also need to be used for the lower heating value. +

    + +

    +Optionally, the port heatPort can be connected to a heat port +outside of this model to impose a boundary condition in order to +model heat losses to the ambient. When using this heatPort, +make sure that the efficiency curve effCur +does not already account for this heat loss. +

    + +

    +On the Assumptions tag, the model can be parameterized to compute a transient +or steady-state response. +The transient response of the boiler is computed using a first +order differential equation to compute the boiler's water and metal temperature, +which are lumped into one state. The boiler outlet temperature is equal to this water temperature. +

    + +", revisions=" + +")); + end BoilerPolynomial; +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/Boiler.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/Boiler.mo new file mode 100644 index 000000000..aefb81c74 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/Boiler.mo @@ -0,0 +1,214 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Boiler; +model Boiler "Boiler" + replaceable package MediumHW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the hot water side"; + parameter Modelica.Units.SI.Pressure dPHW_nominal + "Pressure difference at the chilled water side"; + parameter Modelica.Units.SI.MassFlowRate mHW_flow_nominal + "Nominal mass flow rate at the chilled water side"; + parameter Modelica.Units.SI.Temperature THW + "The start temperature of chilled water side"; + parameter Modelica.Units.SI.TemperatureDifference dTHW_nominal + "Temperature difference between the outlet and inlet of the module"; + parameter Real GaiPi "Gain of the component PI controller"; + parameter Real tIntPi "Integration time of the component PI controller"; + parameter Real eta[:] "Fan efficiency"; + + BaseClasses.BoilerPolynomial boi( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + redeclare package Medium = MediumHW, + m_flow_nominal=mHW_flow_nominal, + T_nominal=THW, + effCur=Buildings.Fluid.Types.EfficiencyCurves.Polynomial, + Q_flow_nominal=dTHW_nominal*mHW_flow_nominal*4200, + a=eta, + fue=Buildings.Fluid.Data.Fuels.NaturalGasLowerHeatingValue(), + dp_nominal=0) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={0,-38}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package + Medium = + MediumHW) + "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_HW(redeclare package + Medium = + MediumHW) + "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,70},{110,90}}), + iconTransformation(extent={{90,70},{110,90}}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTHWLea( + redeclare package Medium = MediumHW, + m_flow_nominal=mHW_flow_nominal, + T_start=THW) annotation (Placement(transformation(extent={{20,-90},{40,-70}}))); + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCHW( + redeclare package Medium = MediumHW, + m_flow_nominal=mHW_flow_nominal, + dpValve_nominal=dPHW_nominal) + annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); + Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) + "True to enable compressor to operate, or false to disable the operation of the compressor" + annotation (Placement(transformation(extent={{-118,-50},{-100,-30}}), + iconTransformation(extent={{-140,-70},{-100,-30}}))); + Modelica.Blocks.Interfaces.RealInput THWSet + "Temperature setpoint of chilled water" annotation (Placement( + transformation(extent={{-118,30},{-100,50}}), iconTransformation(extent= + {{-140,10},{-100,50}}))); + + Buildings.Fluid.Sensors.TemperatureTwoPort senTHWEnt( + allowFlowReversal=true, + redeclare package Medium = MediumHW, + m_flow_nominal=mHW_flow_nominal) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={30,0}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloHW(redeclare package + Medium = + MediumHW) + annotation (Placement(transformation(extent={{72,-10},{54,10}}))); + Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = + MediumHW) + annotation (Placement(transformation(extent={{2,10},{22,30}}))); + Buildings.Fluid.Sensors.Pressure senPreHWLea(redeclare package Medium = + MediumHW) + annotation (Placement(transformation(extent={{78,-50},{98,-30}}))); + Modelica.Blocks.Math.RealToBoolean realToBoolean + annotation (Placement(transformation(extent={{-70,-18},{-54,-2}}))); + .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI + conPI(Ti=2400, k=1) + annotation (Placement(transformation(extent={{-64,30},{-44,50}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=boi.T) + annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); +equation + connect(senTHWLea.port_b, valCHW.port_a) + annotation (Line( + points={{40,-80},{60,-80}}, + color={255,0,0}, + thickness=1)); + connect(valCHW.port_b, port_b_CHW) annotation (Line( + points={{80,-80},{100,-80}}, + color={255,0,0}, + thickness=1)); + connect(senPreHWLea.port, port_b_CHW) annotation (Line( + points={{88,-50},{88,-50},{88,-80},{100,-80}}, + color={255,0,0}, + thickness=1)); + connect(senMasFloHW.port_b, senTHWEnt.port_a) annotation (Line( + points={{54,0},{47,0},{40,0}}, + color={255,0,0}, + thickness=1)); + connect(senMasFloHW.port_a, port_a_HW) annotation (Line( + points={{72,0},{80,0},{80,80},{100,80}}, + color={255,0,0}, + thickness=1)); + connect(senTHWEnt.port_b, boi.port_a) annotation (Line( + points={{20,0},{0,0},{0,-28}}, + color={255,0,0}, + thickness=1)); + connect(boi.port_b, senTHWLea.port_a) + annotation (Line( + points={{0,-48},{0,-80},{20,-80}}, + color={255,0,0}, + thickness=1)); + connect(senPreCWEnt.port, boi.port_a) annotation (Line( + points={{12,10},{12,0},{0,0},{0,-28},{6.10623e-016,-28}}, + color={255,0,0}, + thickness=1)); + connect(On, valCHW.y) annotation (Line( + points={{-109,-40},{-44,-40},{-44,-24},{70,-24},{70,-68}}, + color={0,0,127})); + + connect(realToBoolean.u, valCHW.y) annotation (Line( + points={{-71.6,-10},{-80,-10},{-80,-40},{-44,-40},{-44,-24},{70,-24},{70,-68}}, + color={0,0,127})); + connect(realToBoolean.y, conPI.On) annotation (Line( + points={{-53.2,-10},{-40,-10},{-40,10},{-80,10},{-80,46},{-66,46}}, + color={255,0,255})); + connect(conPI.set, THWSet) + annotation (Line(points={{-66,40},{-109,40}}, color={0,0,127})); + connect(conPI.y, boi.y) + annotation (Line( + points={{-43,40},{-8,40},{-8,-26}}, + color={0,0,127})); + connect(realExpression.y,conPI.mea) annotation (Line( + points={{-49,-30},{-30,-30},{-30,22},{-76,22},{-76,34},{-66,34}}, + color={0,0,127})); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Rectangle( + extent={{-54,50},{60,32}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-52,-50},{62,-68}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{0,72},{100,82}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-10},{-42,-22},{-22,-22},{-32,-10}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-10},{-42,0},{-22,0},{-32,-10}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-34,32},{-30,0}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-34,-22},{-30,-50}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{34,32},{38,-50}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,10},{58,-32}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{36,10},{18,-22},{54,-22},{36,10}}, + lineColor={255,170,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{0,-86},{100,-76}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Text( + extent={{-152,106},{148,146}}, + textString="%name", + textColor={0,0,255})}), + Documentation(revisions=" + +")); +end Boiler; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/MultiBoilers.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/MultiBoilers.mo new file mode 100644 index 000000000..a801a9f19 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/MultiBoilers.mo @@ -0,0 +1,149 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Boiler; +model MultiBoilers "The boiler system with N boilers and associated local controllers." + replaceable package MediumHW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the hot water side"; + parameter Modelica.Units.SI.Pressure dPHW_nominal + "Pressure difference at the chilled water side"; + parameter Modelica.Units.SI.MassFlowRate mHW_flow_nominal[:] + "Nominal mass flow rate at the chilled water side"; + parameter Modelica.Units.SI.Temperature THW_start + "The start temperature of chilled water side"; + parameter Modelica.Units.SI.TemperatureDifference dTHW_nominal + "Temperature difference between the outlet and inlet of the module"; + parameter Real eta[n,:] "Fan efficiency"; + Modelica.Blocks.Interfaces.RealInput On[n](min=0,max=1) "On signal" annotation (Placement(transformation(extent={{-118, + -31},{-100,-49}}))); + Modelica.Blocks.Interfaces.RealInput THWSet + "Temperature setpoint of the chilled water" + annotation (Placement(transformation(extent={{-118,31},{-100,49}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_HW(redeclare package + Medium = + MediumHW) + "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}), + iconTransformation(extent={{90,-90},{110,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_HW(redeclare package + Medium = + MediumHW) + "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,70},{110,90}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTHWEntChi( + allowFlowReversal=true, + redeclare package Medium = MediumHW, + m_flow_nominal=sum(mHW_flow_nominal)) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={50,80}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTHWLeaChi( + allowFlowReversal=true, + redeclare package Medium = MediumHW, + m_flow_nominal=sum(mHW_flow_nominal), + T_start=THW_start) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={52,-80}))); + Modelica.Blocks.Interfaces.RealOutput Rat[n] "compressor speed ratio" + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Boiler boi[n]( + redeclare package MediumHW = MediumHW, + dPHW_nominal=dPHW_nominal, + mHW_flow_nominal=mHW_flow_nominal, + dTHW_nominal=dTHW_nominal, + eta=eta, + each boi(T_nominal(displayUnit="K")), + THW=THW_start, + GaiPi=1, + tIntPi=60) + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + parameter Integer n + "Number of boilers"; + +equation + connect(senTHWEntChi.port_a, port_a_HW) annotation (Line( + points={{60,80},{100,80}}, + color={255,0,0}, + thickness=1)); + connect(senTHWLeaChi.port_b, port_b_HW) annotation (Line( + points={{62,-80},{100,-80}}, + color={255,0,0}, + thickness=1)); + connect(port_b_HW, port_b_HW) annotation (Line( + points={{100,-80},{100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + for i in 1:n loop + connect(boi[i].port_a_HW, senTHWEntChi.port_b); + connect(boi[i].port_b_CHW, senTHWLeaChi.port_a); + connect(boi[i].THWSet, THWSet); + connect(boi[i].On, On[i]); + end for; + connect(On, Rat) annotation (Line(points={{-109,-40},{110,-40}}, color={0,0,127})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-28,80},{26,40}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-28,-40},{26,-80}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{40,-80},{102,-80}}, + color={255,0,0}), + Line( + points={{40,-80},{40,50},{26,50}}, + color={255,0,0}), + Line( + points={{26,-70},{40,-70}}, + color={255,0,0}), + Line( + points={{26,-48},{60,-48},{60,80}}, + color={255,0,0}), + Line( + points={{100,80},{60,80}}, + color={255,0,0}), + Line( + points={{26,72},{60,72}}, + color={255,0,0}), + Ellipse( + extent={{20,56},{30,44}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{22,54},{28,46}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,-64},{30,-76}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{22,-66},{28,-74}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,78},{30,66}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,-44},{30,-56}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-154,104},{146,144}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end MultiBoilers; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.mo new file mode 100644 index 000000000..e450af15f --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide; +package Boiler + +end Boiler; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.order new file mode 100644 index 000000000..ea1c55355 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Boiler/package.order @@ -0,0 +1,3 @@ +MultiBoilers +Boiler +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/BaseClasses.mo new file mode 100644 index 000000000..dc5db93a5 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/BaseClasses.mo @@ -0,0 +1,598 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Chiller; +package BaseClasses + model ElectricEIR "Electric chiller based on the DOE-2.1 model" + extends PartialElectric( + final QEva_flow_nominal=per.QEva_flow_nominal, + final COP_nominal=per.COP_nominal, + final PLRMax=per.PLRMax, + final PLRMinUnl=per.PLRMinUnl, + final PLRMin=per.PLRMin, + final etaMotor=per.etaMotor, + final mEva_flow_nominal=per.mEva_flow_nominal, + final mCon_flow_nominal=per.mCon_flow_nominal, + final TEvaLvg_nominal=per.TEvaLvg_nominal); + + parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per + "Performance data" + annotation (choicesAllMatching = true, + Placement(transformation(extent={{40,80},{60,100}}))); + + protected + final parameter Modelica.Units.NonSI.Temperature_degC TConEnt_nominal_degC= + Modelica.Units.Conversions.to_degC(per.TConEnt_nominal) + "Temperature of fluid entering condenser at nominal condition"; + + Modelica.Units.NonSI.Temperature_degC TConEnt_degC + "Temperature of fluid entering condenser"; + initial equation + // Verify correctness of performance curves, and write warning if error is bigger than 10% + Buildings.Fluid.Chillers.BaseClasses.warnIfPerformanceOutOfBounds( + Buildings.Utilities.Math.Functions.biquadratic(a=per.capFunT, + x1=TEvaLvg_nominal_degC, x2=TConEnt_nominal_degC), + "Capacity as function of temperature ", + "per.capFunT"); + equation + TConEnt_degC=Modelica.Units.Conversions.to_degC(TConEnt); + + if on then + // Compute the chiller capacity fraction, using a biquadratic curve. + // Since the regression for capacity can have negative values (for unreasonable temperatures), + // we constrain its return value to be non-negative. This prevents the solver to pick the + // unrealistic solution. + capFunT = Buildings.Utilities.Math.Functions.smoothMax( + x1 = 1E-6, + x2 = Buildings.Utilities.Math.Functions.biquadratic(a=per.capFunT, x1=TEvaLvg_degC, x2=TConEnt_degC), + deltaX = 1E-7); + /* assert(capFunT > 0.1, "Error: Received capFunT = " + String(capFunT) + ".\n" + + "Coefficient for polynomial seem to be not valid for the encountered temperature range.\n" + + "Temperatures are TConEnt_degC = " + String(TConEnt_degC) + " degC\n" + + " TEvaLvg_degC = " + String(TEvaLvg_degC) + " degC"); +*/ + // Chiller energy input ratio biquadratic curve. + EIRFunT = Buildings.Utilities.Math.Functions.biquadratic(a=per.EIRFunT, x1=TEvaLvg_degC, x2=TConEnt_degC); + // Chiller energy input ratio quadratic curve + EIRFunPLR = per.EIRFunPLR[1]+per.EIRFunPLR[2]*PLR2+per.EIRFunPLR[3]*PLR2^2; + else + capFunT = 0; + EIRFunT = 0; + EIRFunPLR = 0; + end if; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), + graphics={ + Rectangle( + extent={{-99,-54},{102,-66}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,-66},{0,-54}}, + lineColor={0,0,127}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-104,66},{98,54}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-2,54},{98,66}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-44,52},{-40,12}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-56,70},{58,52}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-42,2},{-52,12},{-32,12},{-42,2}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-42,2},{-52,-10},{-32,-10},{-42,2}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-44,-10},{-40,-50}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{38,52},{42,-50}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-56,-50},{58,-68}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{18,24},{62,-18}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,24},{22,-8},{58,-8},{40,24}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + defaultComponentName="chi", + Documentation(info=" +

    +Model of an electric chiller, based on the DOE-2.1 chiller model and +the EnergyPlus chiller model Chiller:Electric:EIR. +

    +

    This model uses three functions to predict capacity and power consumption: +

    + +

    +These curves are stored in the data record per and are available from + +Buildings.Fluid.Chillers.Data.ElectricEIR. +Additional performance curves can be developed using +two available techniques (Hydeman and Gillespie, 2002). The first technique is called the +Least-squares Linear Regression method and is used when sufficient performance data exist +to employ standard least-square linear regression techniques. The second technique is called +Reference Curve Method and is used when insufficient performance data exist to apply linear +regression techniques. A detailed description of both techniques can be found in +Hydeman and Gillespie (2002). +

    +

    +The model takes as an input the set point for the leaving chilled water temperature, +which is met if the chiller has sufficient capacity. +Thus, the model has a built-in, ideal temperature control. +The model has three tests on the part load ratio and the cycling ratio: +

    +
      +
    1. +The test
      +  PLR1 =min(QEva_flow_set/QEva_flow_ava, per.PLRMax);
      +
      +ensures that the chiller capacity does not exceed the chiller capacity specified +by the parameter per.PLRMax. +
    2. +
    3. +The test
      +  CR = min(PLR1/per.PRLMin, 1.0);
      +
      +computes a cycling ratio. This ratio expresses the fraction of time +that a chiller would run if it were to cycle because its load is smaller than the +minimal load at which it can operate. +Note that this model continuously operates even if the part load ratio is below the minimum part load ratio. +Its leaving evaporator and condenser temperature can therefore be considered as an +average temperature between the modes where the compressor is off and on. +
    4. +
    5. +The test
      +  PLR2 = max(per.PLRMinUnl, PLR1);
      +
      +computes the part load ratio of the compressor. +The assumption is that for a part load ratio below per.PLRMinUnl, +the chiller uses hot gas bypass to reduce the capacity, while the compressor +power draw does not change. +
    6. +
    +

    +The electric power only contains the power for the compressor, but not any power for pumps or fans. +

    +

    +The model can be parametrized to compute a transient +or steady-state response. +The transient response of the boiler is computed using a first +order differential equation for the evaporator and condenser fluid volumes. +The chiller outlet temperatures are equal to the temperatures of these lumped volumes. +

    +

    References

    + +", + revisions=" + +")); + end ElectricEIR; + + partial model PartialElectric "Partial model for electric chiller" + extends Buildings.Fluid.Interfaces.FourPortHeatMassExchanger( + m1_flow_nominal = mCon_flow_nominal, + m2_flow_nominal = mEva_flow_nominal, + T1_start = 273.15+25, + T2_start = 273.15+5, + redeclare final Buildings.Fluid.MixingVolumes.MixingVolume vol2( + V=m2_flow_nominal*tau2/rho2_nominal, + nPorts=2, + final prescribedHeatFlowRate=true), + vol1( + final prescribedHeatFlowRate=true)); + + Modelica.Blocks.Interfaces.BooleanInput on + "Set to true to enable compressor, or false to disable compressor" + annotation (Placement(transformation(extent={{-140,10},{-100,50}}), + iconTransformation(extent={{-140,10},{-100,50}}))); + Modelica.Blocks.Interfaces.RealInput y "Cooling power output ratio" annotation ( + Placement(transformation(extent={{-140,-50},{-100,-10}}), + iconTransformation(extent={{-140,-50},{-100,-10}}))); + + Modelica.Units.SI.Temperature TEvaEnt "Evaporator entering temperature"; + Modelica.Units.SI.Temperature TEvaLvg "Evaporator leaving temperature"; + Modelica.Units.SI.Temperature TConEnt "Condenser entering temperature"; + Modelica.Units.SI.Temperature TConLvg "Condenser leaving temperature"; + + Modelica.Units.SI.Efficiency COP "Coefficient of performance"; + Modelica.Units.SI.HeatFlowRate QCon_flow "Condenser heat input"; + Modelica.Units.SI.HeatFlowRate QEva_flow "Evaporator heat input"; + Modelica.Blocks.Interfaces.RealOutput P(final quantity="Power", unit="W") + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,80},{120,100}}), + iconTransformation(extent={{100,80},{120,100}}))); + + Real capFunT(min=0, unit="1") + "Cooling capacity factor function of temperature curve"; + Modelica.Units.SI.Efficiency EIRFunT + "Power input to cooling capacity ratio function of temperature curve"; + Modelica.Units.SI.Efficiency EIRFunPLR + "Power input to cooling capacity ratio function of part load ratio"; + Real PLR1(min=0, unit="1") "Part load ratio"; + Real PLR2(min=0, unit="1") "Part load ratio"; + Real CR(min=0, unit="1") "Cycling ratio"; + parameter Modelica.Units.SI.Efficiency epsEva(max=1) = 1 + "Heat exchanger effectiveness at evaporator"; + + parameter Modelica.Units.SI.Efficiency epsCon(max=1) = 1 + "Heat exchanger effectiveness at condenser"; + + protected + Modelica.Units.SI.HeatFlowRate QEva_flow_ava(nominal=QEva_flow_nominal, start= + QEva_flow_nominal) "Cooling capacity available at evaporator"; + Modelica.Units.SI.HeatFlowRate QEva_flow_set(nominal=QEva_flow_nominal, start= + QEva_flow_nominal) + "Cooling capacity required to cool to set point temperature"; + + // Performance data + parameter Modelica.Units.SI.HeatFlowRate QEva_flow_nominal(max=0) + "Reference capacity (negative number)"; + parameter Modelica.Units.SI.Efficiency COP_nominal + "Reference coefficient of performance"; + parameter Real PLRMax(min=0, unit="1") "Maximum part load ratio"; + parameter Real PLRMinUnl(min=0, unit="1") "Minimum part unload ratio"; + parameter Real PLRMin(min=0, unit="1") "Minimum part load ratio"; + parameter Modelica.Units.SI.Efficiency etaMotor(max=1) + "Fraction of compressor motor heat entering refrigerant"; + parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal + "Nominal mass flow at evaporator"; + parameter Modelica.Units.SI.MassFlowRate mCon_flow_nominal + "Nominal mass flow at condenser"; + + parameter Modelica.Units.SI.Temperature TEvaLvg_nominal + "Temperature of fluid leaving evaporator at nominal condition"; + + final parameter Modelica.Units.NonSI.Temperature_degC TEvaLvg_nominal_degC= + Modelica.Units.Conversions.to_degC(TEvaLvg_nominal) + "Temperature of fluid leaving evaporator at nominal condition"; + Modelica.Units.NonSI.Temperature_degC TEvaLvg_degC + "Temperature of fluid leaving evaporator"; + parameter Modelica.Units.SI.HeatFlowRate Q_flow_small=QEva_flow_nominal*1E-9 + "Small value for heat flow rate or power, used to avoid division by zero"; + Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloEva + "Prescribed heat flow rate" + annotation (Placement(transformation(extent={{-39,-50},{-19,-30}}))); + Buildings.HeatTransfer.Sources.PrescribedHeatFlow preHeaFloCon + "Prescribed heat flow rate" + annotation (Placement(transformation(extent={{-39,30},{-19,50}}))); + Modelica.Blocks.Sources.RealExpression QEva_flow_in(y=QEva_flow) + "Evaporator heat flow rate" + annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}))); + Modelica.Blocks.Sources.RealExpression QCon_flow_in(y=QCon_flow) + "Condenser heat flow rate" + annotation (Placement(transformation(extent={{-80,30},{-60,50}}))); + + initial equation + assert(QEva_flow_nominal < 0, "Parameter QEva_flow_nominal must be smaller than zero."); + assert(Q_flow_small < 0, "Parameter Q_flow_small must be smaller than zero."); + assert(PLRMinUnl >= PLRMin, "Parameter PLRMinUnl must be bigger or equal to PLRMin"); + assert(PLRMax > PLRMinUnl, "Parameter PLRMax must be bigger than PLRMinUnl"); + equation + // Condenser temperatures + TConEnt = Medium1.temperature(Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow))); + TConLvg = vol1.heatPort.T; + // Evaporator temperatures + TEvaEnt = Medium2.temperature(Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow))); + TEvaLvg = vol2.heatPort.T; + TEvaLvg_degC=Modelica.Units.Conversions.to_degC(TEvaLvg); + + if on then + // Available cooling capacity + QEva_flow_ava = QEva_flow_nominal*capFunT; + // Cooling capacity is controlled to be output + QEva_flow_set = y*QEva_flow_ava; + + // Part load ratio + PLR1 = Buildings.Utilities.Math.Functions.smoothMin( + x1 = QEva_flow_set/(QEva_flow_ava+Q_flow_small), + x2 = PLRMax, + deltaX=PLRMax/100); + // PLR2 is the compressor part load ratio. The lower bound PLRMinUnl is + // since for PLR11465. + +
  • +March 12, 2015, by Michael Wetter:
    +Refactored model to make it once continuously differentiable. +This is for issue 373. +
  • +
  • +Jan. 10, 2011, by Michael Wetter:
    +Added input signal to switch chiller off, and changed base class to use a dynamic model. +The change of the base class was required to improve the robustness of the model when the control +is switched on again. +
  • +
  • +Sep. 8, 2010, by Michael Wetter:
    +Revised model and included it in the Buildings library. +
  • +
  • +October 13, 2008, by Brandon Hencey:
    +First implementation. +
  • + +")); + end PartialElectric; +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/ChillerTSet.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/ChillerTSet.mo new file mode 100644 index 000000000..986eb554d --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/ChillerTSet.mo @@ -0,0 +1,332 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Chiller; +model ChillerTSet "Chiller" + replaceable package MediumCHW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the chilled water side"; + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the condenser water side"; + parameter Modelica.Units.SI.Pressure dPCHW_nominal + "Pressure difference at the chilled water side"; + parameter Modelica.Units.SI.Pressure dPCW_nominal + "Pressure difference at the condenser water wide"; + parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal + "Nominal mass flow rate at the chilled water side"; + parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal + "Nominal mass flow rate at the condenser water wide"; + parameter Modelica.Units.SI.Temperature TCW_start + "The start temperature of condenser water side"; + parameter Modelica.Units.SI.Temperature TCHW_start + "The start temperature of chilled water side"; + + parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per + "Performance data" + annotation (choicesAllMatching = true, + Placement(transformation(extent={{40,80},{60,100}}))); + + Buildings.Fluid.Chillers.ElectricEIR chi( + redeclare package Medium1 = MediumCW, + redeclare package Medium2 = MediumCHW, + m1_flow_nominal=mCW_flow_nominal, + m2_flow_nominal=mCHW_flow_nominal, + dp1_nominal=0, + dp2_nominal=0, + allowFlowReversal1=true, + allowFlowReversal2=true, + tau1=300, + tau2=300, + T1_start=TCW_start, + T2_start=TCHW_start, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + per=per) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-42}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package + Medium = + MediumCW) + "Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)" + annotation (Placement(transformation(extent={{-110,-90},{-90,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package + Medium = + MediumCW) + "Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)" + annotation (Placement(transformation(extent={{-110,70},{-90,90}}), + iconTransformation(extent={{-110,70},{-90,90}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package + Medium = + MediumCHW) + "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_CHW(redeclare package + Medium = + MediumCHW) + "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,70},{110,90}}), + iconTransformation(extent={{90,70},{110,90}}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWLea( + redeclare package Medium = MediumCHW, + m_flow_nominal=mCHW_flow_nominal, + T_start=TCHW_start) + annotation (Placement(transformation(extent={{20,-90},{40,-70}}))); + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCW( + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal, + allowFlowReversal=false, + dpValve_nominal=dPCW_nominal) + annotation (Placement(transformation(extent={{-60,90},{-80,70}}))); + Buildings.Fluid.Actuators.Valves.TwoWayLinear valCHW( + redeclare package Medium = MediumCHW, + m_flow_nominal=mCHW_flow_nominal, + dpValve_nominal=dPCHW_nominal) + annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); + Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) + "True to enable compressor to operate, or false to disable the operation of the compressor" + annotation (Placement(transformation(extent={{-118,-50},{-100,-30}}), + iconTransformation(extent={{-140,-70},{-100,-30}}))); + Modelica.Blocks.Interfaces.RealInput TCHWSet + "Temperature setpoint of chilled water" + annotation (Placement(transformation(extent={{-118,30},{-100,50}}), + iconTransformation(extent={{-140,10},{-100,50}}))); + Modelica.Blocks.Interfaces.RealOutput P + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,30},{120,50}}), + iconTransformation(extent={{100,30},{120,50}}))); + + Modelica.Blocks.Math.RealToBoolean realToBoolean + annotation (Placement(transformation(extent={{-56,-66},{-42,-52}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLea( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={-40,0}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEnt( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-40,-80}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWEnt( + allowFlowReversal=true, + redeclare package Medium = MediumCHW, + m_flow_nominal=mCHW_flow_nominal) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={30,0}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloCHW(redeclare package + Medium = + MediumCHW) + annotation (Placement(transformation(extent={{72,-10},{54,10}}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package + Medium = + MediumCHW) + annotation (Placement(transformation(extent={{-78,-90},{-60,-70}}))); + Buildings.Fluid.Sensors.Pressure senPreCHWEnt(redeclare package Medium = + MediumCHW) + annotation (Placement(transformation(extent={{2,10},{22,30}}))); + Buildings.Fluid.Sensors.Pressure senPreCHWLea(redeclare package Medium = + MediumCHW) + annotation (Placement(transformation(extent={{78,-50},{98,-30}}))); + Buildings.Fluid.Sensors.Pressure senPreCWLea(redeclare package + Medium = + MediumCHW) + annotation (Placement(transformation(extent={{-76,68},{-96,48}}))); + Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = + MediumCHW) + annotation (Placement(transformation(extent={{-96,-70},{-76,-50}}))); + +equation + connect(chi.port_b2, senTCHWLea.port_a) annotation (Line( + points={{6,-52},{6,-80},{20,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(chi.P, P) annotation (Line( + points={{-9,-31},{-9,40},{110,40}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(senTCHWLea.port_b, valCHW.port_a) annotation (Line( + points={{40,-80},{60,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(valCHW.port_b, port_b_CHW) annotation (Line( + points={{80,-80},{100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(valCW.port_b, port_b_CW) annotation (Line( + points={{-80,80},{-100,80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(realToBoolean.y, chi.on) annotation (Line( + points={{-41.3,-59},{-3,-59},{-3,-54}}, + color={255,0,255}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(On, valCW.y) annotation (Line( + points={{-109,-40},{-90,-40},{-70,-40},{-70,-26},{-70,-26},{-70,68}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(valCHW.y, valCW.y) annotation (Line( + points={{70,-68},{70,-26},{-70,-26},{-70,68}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(realToBoolean.u, valCW.y) annotation (Line( + points={{-57.4,-59},{-70,-59},{-70,-40},{-70,-26},{-70,68}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(chi.port_b1, senTCWLea.port_a) annotation (Line( + points={{-6,-32},{-6,0},{-30,0}}, + color={0,127,255}, + thickness=1)); + connect(senTCWLea.port_b, valCW.port_a) annotation (Line( + points={{-50,0},{-50,0},{-54,0},{-54,80},{-60,80}}, + color={0,127,255}, + thickness=1)); + connect(senTCWEnt.port_b, chi.port_a1) annotation (Line( + points={{-30,-80},{-6,-80},{-6,-52}}, + color={0,127,255}, + thickness=1)); + connect(senTCHWEnt.port_b, chi.port_a2) annotation (Line( + points={{20,0},{6,0},{6,-32}}, + color={0,127,255}, + thickness=1)); + connect(senPreCHWEnt.port, chi.port_a2) annotation (Line( + points={{12,10},{12,0},{6,0},{6,-32}}, + color={0,127,255}, + thickness=1)); + connect(senPreCHWLea.port, port_b_CHW) annotation (Line( + points={{88,-50},{88,-50},{88,-80},{100,-80}}, + color={0,127,255}, + thickness=1)); + connect(senPreCWLea.port, port_b_CW) annotation (Line( + points={{-86,68},{-86,80},{-100,80}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCHW.port_b, senTCHWEnt.port_a) annotation (Line( + points={{54,0},{47,0},{40,0}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCHW.port_a, port_a_CHW) annotation (Line( + points={{72,0},{80,0},{80,80},{100,80}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCW.port_b, senTCWEnt.port_a) annotation (Line( + points={{-60,-80},{-55,-80},{-50,-80}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCW.port_a, port_a_CW) annotation (Line( + points={{-78,-80},{-100,-80}}, + color={0,127,255}, + thickness=1)); + connect(senPreCWEnt.port, port_a_CW) annotation (Line( + points={{-86,-70},{-86,-80},{-100,-80}}, + color={0,127,255}, + thickness=1)); + connect(TCHWSet, chi.TSet) annotation (Line( + points={{-109,40},{-16,40},{-16,-62},{3,-62},{3,-54}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Rectangle( + extent={{-101,82},{100,72}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-95,-76},{106,-86}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-54,50},{60,32}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-52,-50},{62,-68}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-101,82},{100,72}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{0,72},{100,82}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-95,-76},{106,-86}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-102,-86},{-2,-76}}, + lineColor={0,0,127}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-10},{-42,-22},{-22,-22},{-32,-10}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-32,-10},{-42,0},{-22,0},{-32,-10}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-34,32},{-30,0}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-34,-22},{-30,-50}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{34,32},{38,-50}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{14,10},{58,-32}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{36,10},{18,-22},{54,-22},{36,10}}, + lineColor={0,128,255}, + fillColor={170,170,255}, + fillPattern=FillPattern.Solid)}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end ChillerTSet; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/MultiChillers.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/MultiChillers.mo new file mode 100644 index 000000000..4b434f0e6 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/MultiChillers.mo @@ -0,0 +1,366 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Chiller; +model MultiChillers + "The chiller system with N chillers and associated local controllers " + replaceable package MediumCHW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the chilled water side"; + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the condenser water side"; + parameter Buildings.Fluid.Chillers.Data.ElectricEIR.Generic per[n] + "Performance data" annotation (choicesAllMatching=true, Placement( + transformation(extent={{-10,70},{10,90}}))); + parameter Modelica.Units.SI.Pressure dPCHW_nominal + "Pressure difference at the chilled water side"; + parameter Modelica.Units.SI.Pressure dPCW_nominal + "Pressure difference at the condenser water wide"; + parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal[:] + "Nominal mass flow rate at the chilled water side"; + parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[:] + "Nominal mass flow rate at the condenser water wide"; + parameter Modelica.Units.SI.Temperature TCW_start + "The start temperature of condenser water side"; + parameter Modelica.Units.SI.Temperature TCHW_start + "The start temperature of chilled water side"; + + parameter Integer n + "the number of chillers"; + Modelica.Blocks.Interfaces.RealInput On[n](min=0,max=1) "On signal" annotation (Placement(transformation(extent={{-118, + -31},{-100,-49}}))); + Modelica.Blocks.Interfaces.RealInput TCHWSet + "Temperature setpoint of the chilled water" + annotation (Placement(transformation(extent={{-118,31},{-100,49}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package + Medium = MediumCW) + "Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)" + annotation (Placement(transformation(extent={{-110,-90},{-90,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package + Medium = MediumCW) + "Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)" + annotation (Placement(transformation(extent={{-110,70},{-90,90}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CHW(redeclare package + Medium = MediumCHW) + "Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,-90},{110,-70}}), + iconTransformation(extent={{90,-90},{110,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_CHW(redeclare package + Medium = MediumCHW) + "Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)" + annotation (Placement(transformation(extent={{90,70},{110,90}}))); + Modelica.Blocks.Interfaces.RealOutput P[n] + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWEntChi( + redeclare package Medium = MediumCHW, + allowFlowReversal=true, + m_flow_nominal=sum(mCHW_flow_nominal)) + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={50,80}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLeaChi( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + m_flow_nominal=sum(mCW_flow_nominal)) + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={-82,80}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCHWLeaChi( + allowFlowReversal=true, + redeclare package Medium = MediumCHW, + T_start=TCHW_start, + m_flow_nominal=sum(mCHW_flow_nominal)) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={52,-80}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEntChi( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + T_start=TCW_start, + m_flow_nominal=sum(mCW_flow_nominal)) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,-80}))); + replaceable ChillerTSet ch[n]( + redeclare package MediumCHW = MediumCHW, + redeclare package MediumCW = MediumCW, + dPCHW_nominal=dPCHW_nominal, + dPCW_nominal=dPCW_nominal, + mCHW_flow_nominal=mCHW_flow_nominal, + mCW_flow_nominal=mCW_flow_nominal, + TCW_start=TCW_start, + TCHW_start=TCHW_start, + per=per) constrainedby ChillerTSet( + redeclare package MediumCHW = MediumCHW, + redeclare package MediumCW = MediumCW, + dPCHW_nominal=dPCHW_nominal, + dPCW_nominal=dPCW_nominal, + mCHW_flow_nominal=mCHW_flow_nominal, + mCW_flow_nominal=mCW_flow_nominal, + TCW_start=TCW_start, + TCHW_start=TCHW_start, + per=per) + annotation (Placement(transformation(extent={{-10,-8},{10,12}}))); + + Modelica.Blocks.Interfaces.RealOutput Rat[n] "compressor speed ratio" + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloCHW(redeclare package + Medium = + MediumCHW) + annotation (Placement(transformation(extent={{70,-90},{88,-70}}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package + Medium = + MediumCHW) + annotation (Placement(transformation(extent={{-46,70},{-64,90}}))); +equation + connect(port_b_CW, port_b_CW) annotation (Line( + points={{-100,80},{-100,80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(port_a_CW, port_a_CW) annotation (Line( + points={{-100,-80},{-100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senTCHWEntChi.port_a, port_a_CHW) annotation (Line( + points={{60,80},{100,80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(port_b_CW, senTCWLeaChi.port_b) annotation (Line( + points={{-100,80},{-92,80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senTCWEntChi.port_a, port_a_CW) annotation (Line( + points={{-80,-80},{-100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(port_b_CHW, port_b_CHW) annotation (Line( + points={{100,-80},{98,-80},{98,-80},{100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senTCWLeaChi.port_a, senMasFloCW.port_b) annotation (Line( + points={{-72,80},{-64,80}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCHW.port_b, port_b_CHW) annotation (Line( + points={{88,-80},{94,-80},{100,-80}}, + color={0,127,255}, + thickness=1)); + connect(senTCHWLeaChi.port_b, senMasFloCHW.port_a) annotation (Line( + points={{62,-80},{66,-80},{70,-80}}, + color={0,127,255}, + thickness=1)); + connect(ch.On, On) annotation (Line( + points={{-12,-3},{-60,-3},{-60,-40},{-109,-40}}, + color={0,0,127})); + connect(On, Rat) annotation (Line( + points={{-109,-40},{110,-40}}, + color={0,0,127})); + + for i in 1:n loop + connect(ch[i].TCHWSet, TCHWSet); + connect(ch[i].port_a_CW, senTCWEntChi.port_b); + connect(ch[i].port_b_CHW, senTCHWLeaChi.port_a); + connect(ch[i].port_b_CW, senMasFloCW.port_a); + connect(ch[i].port_a_CHW, senTCHWEntChi.port_b); + connect(ch[i].P, P[i]); + end for; + + annotation (Documentation(info=" +

    This model is to simulate the chiller system which consists of three chillers and associated local controllers.

    +", revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +"), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100}, + {100,100}})), + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={ + Text( + extent={{-44,-142},{50,-110}}, + lineColor={0,0,255}, + textString="%name"), + Rectangle( + extent={{-28,80},{26,40}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-28,20},{26,-20}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-28,-40},{26,-80}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Line( + points={{-60,12},{-28,12}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-28,-50},{-60,-50},{-60,80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-90,-80},{-40,-80},{-40,50},{-34,50},{-28,50}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-28,-10},{-40,-10}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-28,-70},{-40,-70}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{40,-80},{102,-80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{40,-80},{40,50},{26,50}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{26,-12},{40,-12}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{26,-70},{40,-70}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{26,12},{60,12}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{26,-48},{60,-48},{60,80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-100,80},{-60,80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-28,70},{-60,70}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{100,80},{60,80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{26,72},{60,72}}, + color={0,0,255}, + smooth=Smooth.None), + Ellipse( + extent={{-32,76},{-22,64}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-30,74},{-24,66}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-32,18},{-22,6}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-30,16},{-24,8}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-32,-44},{-22,-56}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-30,-46},{-24,-54}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,56},{30,44}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{22,54},{28,46}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,-6},{30,-18}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{22,-8},{28,-16}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,-64},{30,-76}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{22,-66},{28,-74}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,78},{30,66}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,18},{30,6}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{20,-44},{30,-56}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-32,56},{-22,44}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-32,-4},{-22,-16}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-32,-64},{-22,-76}}, + lineColor={0,0,255}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-158,104},{142,144}}, + textString="%name", + textColor={0,0,255})})); +end MultiChillers; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.mo new file mode 100644 index 000000000..3cbe2a963 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.mo @@ -0,0 +1,5 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide; +package Chiller "This package contains the modules which can be used to simulate the chillers" + +annotation (); +end Chiller; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.order new file mode 100644 index 000000000..973e51b39 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Chiller/package.order @@ -0,0 +1,3 @@ +MultiChillers +ChillerTSet +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/BaseClasses.mo new file mode 100644 index 000000000..b41775885 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/BaseClasses.mo @@ -0,0 +1,257 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Control; +package BaseClasses + + block MultiSwitch + "Set Real expression that is associated with the first active input signal" + + input Real expr[nu]=fill(0.0, nu) + "y = if u[i] then expr[i] else y_default (time varying)" + annotation (Dialog); + parameter Real y_default=0.0 + "Default value of output y if all u[i] = false"; + + parameter Integer nu(min=0) = 0 "Number of input connections" + annotation (Dialog(connectorSizing=true), HideResult=true); + parameter Integer precision(min=0) = 3 + "Number of significant digits to be shown in dynamic diagram layer for y" + annotation (Dialog(tab="Advanced")); + + Modelica.Blocks.Interfaces.BooleanVectorInput u[nu] + "Set y = expr[i], if u[i] = true" + annotation (Placement(transformation(extent={{-110,30},{-90,-30}}))); + Modelica.Blocks.Interfaces.RealOutput y "Output depending on expression" + annotation (Placement(transformation(extent={{300,-10},{320,10}}))); + + protected + Integer firstActiveIndex; + + equation + firstActiveIndex = Modelica.Math.BooleanVectors.firstTrueIndex(u); + y = if firstActiveIndex == 0 then y_default else expr[firstActiveIndex]; + annotation ( + defaultComponentName="multiSwitch1", + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{300, + 100}}), graphics={ + Rectangle( + extent={{-100,-51},{300,50}}, + lineThickness=5.0, + lineColor={0,0,0}, + fillColor={170,213,255}, + fillPattern=FillPattern.Solid, + borderPattern=BorderPattern.Raised), + Text( + extent={{-86,16},{295,-17}}, + lineColor={0,0,0}, + fillColor={255,246,238}, + fillPattern=FillPattern.Solid, + textString="%expr"), + Text( + extent={{310,-25},{410,-45}}, + lineColor={0,0,0}, + textString=DynamicSelect(" ", String( + y, + minimumLength=1, + significantDigits=precision))), + Text( + extent={{-100,-60},{300,-90}}, + lineColor={0,0,0}, + textString="else: %y_default"), + Text( + extent={{-100,100},{300,60}}, + textString="%name", + lineColor={0,0,255})}), + Documentation(info=" +

    +This block has a vector of Boolean input signals u[nu] and a vector of +(time varying) Real expressions expr[nu]. The output signal y is +set to expr[i], if i is the first element in the input vector u that is true. If all input signals are +false, y is set to parameter \"y_default\". +

    + +
    +  // Conceptual equation (not valid Modelica)
    +  i = 'first element of u[:] that is true';
    +  y = if i==0 then y_default else expr[i];
    +
    + +

    +The input connector is a vector of Boolean input signals. +When a connection line is drawn, the dimension of the input +vector is enlarged by one and the connection is automatically +connected to this new free index (thanks to the +connectorSizing annotation). +

    + +

    +The usage is demonstrated, e.g., in example +Modelica.Blocks.Examples.RealNetwork1. +

    + +")); + end MultiSwitch; + + model StageN "Stage controller for N states" + parameter Real tWai "Waiting time"; + + parameter Integer n=3 + "the number of chillers"; + + Modelica.StateGraph.InitialStepWithSignal + AllOff( + nOut=1, nIn=1) + "Both of the two compressors are off" + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=-90, + origin={0,72}))); + Modelica.Blocks.Interfaces.BooleanInput On[n] "On signal" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.StateGraph.StepWithSignal iOn[n-1](nIn=2, nOut=2) annotation ( + Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={0,2}))); + Modelica.StateGraph.TransitionWithSignal + Off2One annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-50,44}))); + Modelica.StateGraph.TransitionWithSignal + One2Off annotation ( + Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=90, + origin={52,48}))); + Modelica.StateGraph.StepWithSignal nOn(nOut=1, nIn=1) + annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={0,-80}))); + Modelica.StateGraph.TransitionWithSignal + nmin12n( + enableTimer=true, + waitTime=tWai) annotation ( + Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-50,-54}))); + Modelica.StateGraph.TransitionWithSignal + N2Nmin1( + waitTime=tWai, + enableTimer=true) annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=90, + origin={40,-60}))); + inner Modelica.StateGraph.StateGraphRoot stateGraphRoot + annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); + BaseClasses.MultiSwitch + multiSwitch(nu=n+1, expr=linspace( + 0, + n, + n + 1)) + annotation (Placement(transformation(extent={{76,-26},{92,-6}}))); + Modelica.StateGraph.TransitionWithSignal + imin12i[n - 2]( + enableTimer=true, + waitTime=tWai) annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-50,0}))); + Modelica.StateGraph.TransitionWithSignal + i2imin1[n - 2]( + waitTime=tWai, + enableTimer=true) annotation (Placement( + transformation( + extent={{-10,10},{10,-10}}, + rotation=90, + origin={66,0}))); + Modelica.Blocks.Interfaces.BooleanInput Off[n] "On signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.RealOutput y "Output depending on expression" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + equation + + connect(AllOff.outPort[1], Off2One.inPort) annotation (Line(points={{0,61.5},{ + 0,61.5},{0,54},{0,52},{-50,52},{-50,48}}, color={0,0,0})); + connect(nmin12n.outPort, nOn.inPort[1]) annotation (Line(points={{-50,-55.5},{ + -50,-62},{0,-62},{0,-66},{6.66134e-016,-66},{6.66134e-016,-69}}, + color={0,0,0})); + connect(nOn.outPort[1], N2Nmin1.inPort) annotation (Line(points={{-6.66134e-016, + -90.5},{-6.66134e-016,-98},{40,-98},{40,-64}}, + color={0,0,0})); + connect(One2Off.outPort, AllOff.inPort[1]) annotation (Line(points={{52,49.5}, + {52,49.5},{52,86},{52,88},{1.9984e-015,88},{1.9984e-015,83}}, color={ + 0,0,0})); + + connect(Off2One.outPort, iOn[1].inPort[1]) annotation (Line(points={{-50,42.5}, + {-50,42.5},{-50,26},{-0.5,26},{-0.5,13}}, color={0,0,0})); + connect(iOn[1].outPort[2], One2Off.inPort) annotation (Line(points={{0.25, + -8.5},{2,-8.5},{2,-20},{52,-20},{52,44}}, + color={0,0,0})); + connect(nmin12n.inPort, iOn[n-1].outPort[1]) annotation (Line(points={{-50,-50}, + {-50,-40},{-0.25,-40},{-0.25,-8.5}}, color={0,0,0})); + + connect(AllOff.active, multiSwitch.u[1]); + for i in 1:n-1 loop + connect(iOn[i].active, multiSwitch.u[i + 1]); + end for; + connect(nOn.active, multiSwitch.u[n + 1]); + + connect(Off2One.condition, On[1]); + for i in 1:n-2 loop + connect(imin12i[i].condition, On[i+1]); + end for; + connect(nmin12n.condition, On[n]); + + connect(One2Off.condition, Off[1]); + for i in 1:n-2 loop + connect(i2imin1[i].condition, Off[i+1]); + end for; + connect(N2Nmin1.condition, Off[n]); + for i in 1:n-2 loop + connect(iOn[i].outPort[1], imin12i[i].inPort); + connect(imin12i[i].outPort, iOn[i+1].inPort[1]); + connect(i2imin1[i].inPort, iOn[i+1].outPort[2]); + connect(i2imin1[i].outPort, iOn[i].inPort[2]); + end for; + + connect(N2Nmin1.outPort, iOn[n-1].inPort[2]) annotation (Line(points={{40, + -58.5},{40,-58.5},{40,16},{0.5,16},{0.5,13}}, + color={0,0,0})); + connect(multiSwitch.y, y) annotation (Line( + points={{92.4,-16},{96,-16},{98,-16},{98,0},{110,0}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-56,42},{58,-42}}, + lineColor={0,0,255}, + textString="CompressorStage"), + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Text( + extent={{-150,106},{150,146}}, + textString="%name", + textColor={0,0,255})}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); + end StageN; +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageCondition.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageCondition.mo new file mode 100644 index 000000000..2c3621b9e --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageCondition.mo @@ -0,0 +1,75 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Control; +model PlantStageCondition + "Stage checking for N chillers or N boilers" + + parameter Real thehol[n-1] + "Threshold"; + + parameter Real Cap[n] + "Normal Cooling Capacity"; + + parameter Integer n=3 + "Number of chillers"; + + Real PLR + "Part load ratio"; + Real cap_avi + "Available cooling capacity"; + + Modelica.Blocks.Interfaces.RealInput Loa "Load signal" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput Status[n] "Status signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.BooleanOutput On[n] "Staging up signal" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Modelica.Blocks.Interfaces.BooleanOutput Off[n] "Staging down signal" + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Modelica.Blocks.Interfaces.BooleanInput OnSin "On signal" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + +algorithm + cap_avi :=0; + for i in 1:n loop + cap_avi :=cap_avi + Status[i]*Cap[i]; + end for; + if cap_avi>0.01 then + PLR:=Loa/cap_avi; + else + PLR:=0; + end if; + On[1] :=OnSin; + Off[1] :=not OnSin; + + for i in 2:n loop + On[i] :=PLR > thehol[i - 1] and Status[i - 1] > 0; + end for; + + for i in 2:n loop + Off[i] :=PLR*(sum(Status)/(sum(Status) - 1 + 0.0001)) < thehol[i - 1] + and Status[i] > 0; + end for; + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-56,42},{58,-42}}, + lineColor={0,0,255}, + textString="StageCheck"), + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name")}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end PlantStageCondition; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageN.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageN.mo new file mode 100644 index 000000000..5f9a10d9c --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PlantStageN.mo @@ -0,0 +1,75 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Control; +model PlantStageN "Combined stage controller for N chillers or N boilers" + parameter Real tWai "Waiting time"; + + parameter Real thehol[n-1] "Threshold"; + + parameter Real Cap[n] "Rated Plant Capacity"; + + parameter Integer n=3 + "the number of chillers"; + + Modelica.Blocks.Interfaces.RealOutput y[n]( each start=0) + "Output of stage control" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput + On "On signal" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput sta[n] "Compressor speed ratio" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + Modelica.Blocks.Interfaces.RealInput loa + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + PlantStageCondition plantNStageCondition( + thehol=thehol, + n=n, + Cap=Cap) annotation (Placement(transformation(extent={{-60,-16},{ + -40,4}}))); + BaseClasses.StageN nSta(tWai=tWai, n=n) + annotation (Placement(transformation(extent={{-8,-18},{12,2}}))); +equation + + for i in 1:n loop + y[i] =if i <= integer(nSta.y) then 1 else 0; + end for; + + connect(plantNStageCondition.OnSin, On) annotation (Line( + points={{-62,-6},{-80,-6},{-80,80},{-120,80}}, + color={255,0,255})); + connect(plantNStageCondition.Loa,loa) annotation (Line( + points={{-62,0},{-120,0}}, + color={0,0,127})); + connect(plantNStageCondition.Status, sta) annotation (Line(points={{-62, + -12},{-80,-12},{-80,-80},{-120,-80}}, color={0,0,127})); + connect(plantNStageCondition.Off, nSta.Off) annotation (Line(points={ + {-39,-10},{-24,-10},{-24,-14},{-10,-14}}, color={255,0,255})); + connect(plantNStageCondition.On, nSta.On) + annotation (Line(points={{-39,-2},{-10,-2}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-56,42},{58,-42}}, + lineColor={0,0,255}, + textString="ChiSta"), + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Text( + extent={{-152,106},{148,146}}, + textString="%name", + textColor={0,0,255})}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end PlantStageN; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageCondition.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageCondition.mo new file mode 100644 index 000000000..146c9a280 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageCondition.mo @@ -0,0 +1,59 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Control; +model PumpStageCondition "Stage checking for N pumps" + + parameter Real thehol_up "Threshold for staging up"; + + parameter Real thehol_down "Threshold for staging down"; + + parameter Integer n=3 + "the number of chillers"; + + Modelica.Blocks.Interfaces.RealInput Status[n] "On signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.BooleanOutput On[n] + annotation (Placement(transformation(extent={{100,30},{120,50}}))); + Modelica.Blocks.Interfaces.BooleanOutput Off[n] + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Modelica.Blocks.Interfaces.BooleanInput OnSin "On signal" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); +equation + + On[1] = OnSin; + Off[1] = not OnSin; + for i in 2:n loop + On[i] = Status[i-1]>thehol_up and Status[i-1]>0; + end for; + + for i in 2:n loop + Off[i] = Status[i]0; + end for; + + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-56,42},{58,-42}}, + lineColor={0,0,255}, + textString="StageCheck"), + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Text( + extent={{-152,104},{148,144}}, + textString="%name", + textColor={0,0,255})}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end PumpStageCondition; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageN.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageN.mo new file mode 100644 index 000000000..2328edc9c --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/PumpStageN.mo @@ -0,0 +1,66 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Control; +model PumpStageN "Combined stage controller for N pumps" + parameter Real tWai "Waiting time"; + + parameter Real thehol_up = 0.9 "Threshold for staging up"; + + parameter Real thehol_down = 0.6 "Threshold for staging down"; + + parameter Integer n=3 + "the number of pumps"; + + Modelica.Blocks.Interfaces.RealOutput y[n] + "Output of stage control" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput + On "On signal" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput sta[n] "Compressor speed ratio" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + PumpStageCondition pumNStaCon( + n=n, + thehol_up=thehol_up, + thehol_down=thehol_down) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + BaseClasses.StageN pumNSta(tWai=tWai, n=n) + annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); +equation + + for i in 1:n loop + y[i]=if i > pumNSta.y then 0 else 1; + + end for; + + connect(pumNStaCon.OnSin, On) annotation (Line(points={{-62,6},{-80,6}, + {-80,80},{-120,80}}, color={255,0,255})); + connect(pumNStaCon.Status, sta) annotation (Line(points={{-62,-6},{-80, + -6},{-80,-80},{-120,-80}}, color={0,0,127})); + connect(pumNStaCon.Off, pumNSta.Off) annotation (Line(points={{-39,-4}, + {-20,-4},{-20,-6},{-10,-6}}, color={255,0,255})); + connect(pumNStaCon.On, pumNSta.On) annotation (Line(points={{-39,4},{ + -20,4},{-20,6},{-10,6}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-54,42},{60,-42}}, + lineColor={0,0,255}, + textString="PumSta"), + Text( + extent={{-154,102},{146,142}}, + textString="%name", + textColor={0,0,255})}), + Documentation(revisions=" +
      +
    • +March 19, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end PumpStageN; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.mo new file mode 100644 index 000000000..34da5abb9 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide; +package Control "Basic control models for waterside system" + +end Control; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.order new file mode 100644 index 000000000..7df0347fd --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Control/package.order @@ -0,0 +1,5 @@ +PlantStageCondition +PlantStageN +PumpStageCondition +PumpStageN +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/BaseClasses.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/BaseClasses.mo new file mode 100644 index 000000000..9c61ea40e --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/BaseClasses.mo @@ -0,0 +1,448 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.CoolingTower; +package BaseClasses + model YorkCalc + "Cooling tower with variable speed using the York calculation for the approach temperature" + extends + Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.CoolingTower; + parameter Modelica.Units.SI.Efficiency eps( + min=0.1, + max=1) = 1 "Heat exchanger effectiveness"; + import cha = + Buildings.Fluid.HeatExchangers.CoolingTowers.BaseClasses.Characteristics; + + parameter Modelica.Units.SI.Temperature TAirInWB_nominal=273.15 + 25.55 + "Design inlet air wet bulb temperature" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.TemperatureDifference TApp_nominal(displayUnit= + "K") = 3.89 "Design approach temperature" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.TemperatureDifference TRan_nominal(displayUnit= + "K") = 5.56 "Design range temperature (water in - water out)" + annotation (Dialog(group="Nominal condition")); + parameter Real fraPFan_nominal(unit="W/(kg/s)") = 275/0.15 + "Fan power divided by water mass flow rate at design condition" + annotation(Dialog(group="Fan")); + parameter Modelica.Units.SI.Power PFan_nominal=fraPFan_nominal*m_flow_nominal + "Fan power" annotation (Dialog(group="Fan")); + + replaceable parameter cha.fan fanRelPow( + r_V = {0, 0.1, 0.3, 0.6, 1}, + r_P = {0, 0.1^3, 0.3^3, 0.6^3, 1}) + constrainedby cha.fan + "Fan relative power consumption as a function of control signal, fanRelPow=P(y)/P(y=1)" + annotation ( + choicesAllMatching=true, + Placement(transformation(extent={{60,60},{80,80}})), + Dialog(group="Fan")); + + parameter Real yMin(min=0.01, max=1, unit="1") = 0.3 + "Minimum control signal until fan is switched off (used for smoothing between forced and free convection regime)" + annotation(Dialog(group="Fan")); + + parameter Real fraFreCon(min=0, max=1) = 0.125 + "Fraction of tower capacity in free convection regime"; + + Modelica.Blocks.Interfaces.RealInput y(unit="1") "Fan control signal" + annotation (Placement(transformation( + extent={{-140,60},{-100,100}}))); + + Modelica.Blocks.Interfaces.RealInput TAir( + min=0, + unit="K", + displayUnit="degC") + "Entering air wet bulb temperature" + annotation (Placement(transformation( + extent={{-140,20},{-100,60}}))); + + Modelica.Blocks.Interfaces.RealOutput PFan( + final quantity="Power", + final unit="W")= + Buildings.Utilities.Math.Functions.spliceFunction( + pos=cha.normalizedPower(per=fanRelPow, r_V=y, d=fanRelPowDer) * PFan_nominal, + neg=0, + x=y-yMin+yMin/20, + deltax=yMin/20) + "Electric power consumed by fan" + annotation (Placement(transformation(extent={{100,70},{120,90}}), + iconTransformation(extent={{100,70},{120,90}}))); + + Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.BoundsYorkCalc bou + "Bounds for correlation"; + + Modelica.Units.SI.TemperatureDifference TRan(displayUnit="K") = T_a - T_b + "Range temperature"; + Modelica.Units.SI.TemperatureDifference TAppAct(displayUnit="K")= + Buildings.Utilities.Math.Functions.spliceFunction( + pos=TAppCor, + neg=TAppFreCon, + x=y - yMin + yMin/20, + deltax=yMin/20) "Approach temperature difference"; + Modelica.Units.SI.MassFraction FRWat=m_flow/mWat_flow_nominal + "Ratio actual over design water mass flow ratio"; + Modelica.Units.SI.MassFraction FRAir=y + "Ratio actual over design air mass flow ratio"; + + protected + package Water = Buildings.Media.Water "Medium package for water"; + parameter Real FRWat0(min=0, start=1, fixed=false) + "Ratio actual over design water mass flow ratio at nominal condition"; + parameter Modelica.Units.SI.Temperature TWatIn0(fixed=false) + "Water inlet temperature at nominal condition"; + parameter Modelica.Units.SI.Temperature TWatOut_nominal(fixed=false) + "Water outlet temperature at nominal condition"; + parameter Modelica.Units.SI.MassFlowRate mWat_flow_nominal( + min=0, + start=m_flow_nominal, + fixed=false) "Nominal water mass flow rate"; + + Modelica.Units.SI.TemperatureDifference dTMax(displayUnit="K") = T_a - TAir + "Maximum possible temperature difference"; + Modelica.Units.SI.TemperatureDifference TAppCor( + min=0, + displayUnit="K")= + Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( + TRan=TRan, + TWetBul=TAir, + FRWat=FRWat, + FRAir=Buildings.Utilities.Math.Functions.smoothMax( + x1=FRWat/bou.liqGasRat_max, + x2=FRAir, + deltaX=0.01)) "Approach temperature for forced convection"; + Modelica.Units.SI.TemperatureDifference TAppFreCon( + min=0, + displayUnit="K") = (1 - fraFreCon)*dTMax + fraFreCon* + Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( + TRan=TRan, + TWetBul=TAir, + FRWat=FRWat, + FRAir=1) "Approach temperature for free convection"; + + final parameter Real fanRelPowDer[size(fanRelPow.r_V,1)](each fixed=false) + "Coefficients for fan relative power consumption as a function of control signal"; + + Modelica.Units.SI.Temperature T_a "Temperature in port_a"; + Modelica.Units.SI.Temperature T_b "Temperature in port_b"; + + Modelica.Blocks.Sources.RealExpression QWat_flow( + y = eps*m_flow*( + Medium.specificEnthalpy(Medium.setState_pTX( + p=port_b.p, + T=TAir + TAppAct, + X=inStream(port_b.Xi_outflow))) - + inStream(port_a.h_outflow))) + "Heat input into water" + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); + initial equation + TWatOut_nominal = TAirInWB_nominal + TApp_nominal; + TRan_nominal = TWatIn0 - TWatOut_nominal; // by definition of the range temp. + TApp_nominal = Buildings.Fluid.HeatExchangers.CoolingTowers.Correlations.yorkCalc( + TRan=TRan_nominal, TWetBul=TAirInWB_nominal, + FRWat=FRWat0, FRAir=1); // this will be solved for FRWat0 + mWat_flow_nominal = m_flow_nominal/FRWat0; + + // Derivatives for spline that interpolates the fan relative power + fanRelPowDer = Buildings.Utilities.Math.Functions.splineDerivatives( + x=fanRelPow.r_V, + y=fanRelPow.r_P, + ensureMonotonicity=Buildings.Utilities.Math.Functions.isMonotonic(x=fanRelPow.r_P, + strict=false)); + // Check validity of relative fan power consumption at y=yMin and y=1 + assert(cha.normalizedPower(per=fanRelPow, r_V=yMin, d=fanRelPowDer) > -1E-4, + "The fan relative power consumption must be non-negative for y=0." + + "\n Obtained fanRelPow(0) = " + String(cha.normalizedPower(per=fanRelPow, r_V=yMin, d=fanRelPowDer)) + + "\n You need to choose different values for the parameter fanRelPow."); + assert(abs(1-cha.normalizedPower(per=fanRelPow, r_V=1, d=fanRelPowDer))<1E-4, "The fan relative power consumption must be one for y=1." + + "\n Obtained fanRelPow(1) = " + String(cha.normalizedPower(per=fanRelPow, r_V=1, d=fanRelPowDer)) + + "\n You need to choose different values for the parameter fanRelPow." + + "\n To increase the fan power, change fraPFan_nominal or PFan_nominal."); + + // Check that a medium is used that has the same definition of enthalpy vs. temperature. + // This is needed because below, T_a=Water.temperature needed to be hard-coded to use + // Water.* instead of Medium.* in the function calls due to a bug in OpenModelica. + assert(abs(Medium.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default) - + Water.specificEnthalpy_pTX(p=101325, T=273.15, X=Medium.X_default)) < 1E-5 and + abs(Medium.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default) - + Water.specificEnthalpy_pTX(p=101325, T=293.15, X=Medium.X_default)) < 1E-5, + "The selected medium has an enthalpy computation that is not consistent + with the one in Buildings.Media.Water + Use a different medium, such as Buildings.Media.Water."); + equation + // States at the inlet and outlet + + if allowFlowReversal then + if homotopyInitialization then + T_a=Water.temperature(Water.setState_phX(p=port_a.p, + h=homotopy(actual=actualStream(port_a.h_outflow), + simplified=inStream(port_a.h_outflow)), + X=homotopy(actual=actualStream(port_a.Xi_outflow), + simplified=inStream(port_a.Xi_outflow)))); + T_b=Water.temperature(Water.setState_phX(p=port_b.p, + h=homotopy(actual=actualStream(port_b.h_outflow), + simplified=port_b.h_outflow), + X=homotopy(actual=actualStream(port_b.Xi_outflow), + simplified=port_b.Xi_outflow))); + + else + T_a=Water.temperature(Water.setState_phX(p=port_a.p, + h=actualStream(port_a.h_outflow), + X=actualStream(port_a.Xi_outflow))); + T_b=Water.temperature(Water.setState_phX(p=port_b.p, + h=actualStream(port_b.h_outflow), + X=actualStream(port_b.Xi_outflow))); + end if; // homotopyInitialization + + else // reverse flow not allowed + T_a=Water.temperature(Water.setState_phX(p=port_a.p, + h=inStream(port_a.h_outflow), + X=inStream(port_a.Xi_outflow))); + T_b=Water.temperature(Water.setState_phX(p=port_b.p, + h=inStream(port_b.h_outflow), + X=inStream(port_b.Xi_outflow))); + end if; + + connect(QWat_flow.y, preHea.Q_flow) + annotation (Line(points={{-59,-60},{-40,-60}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Text( + extent={{-104,70},{-70,32}}, + lineColor={0,0,127}, + textString="TWB"), + Text( + extent={{-50,4},{42,-110}}, + lineColor={255,255,255}, + fillColor={0,127,0}, + fillPattern=FillPattern.Solid, + textString="York"), + Rectangle( + extent={{-100,81},{-70,78}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,-58},{102,-62}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,-60},{82,-4}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Text( + extent={{70,-58},{104,-96}}, + lineColor={0,0,127}, + textString="TLvg"), + Rectangle( + extent={{70,56},{82,52}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,54},{82,80}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Text( + extent={{64,114},{98,76}}, + lineColor={0,0,127}, + textString="PFan"), + Ellipse( + extent={{0,62},{54,50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-54,62},{0,50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{78,82},{100,78}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Text( + extent={{-98,100},{-86,84}}, + lineColor={0,0,127}, + textString="y")}), + Documentation(info=" +

    +Model for a steady-state or dynamic cooling tower with variable speed fan using the York calculation for the +approach temperature at off-design conditions. +

    +

    Thermal performance

    +

    +To compute the thermal performance, this model takes as parameters +the approach temperature, the range temperature and the inlet air wet bulb temperature +at the design condition. Since the design mass flow rate (of the chiller condenser loop) +is also a parameter, these parameters define the rejected heat. +

    +

    +For off-design conditions, the model uses the actual range temperature and a polynomial +to compute the approach temperature for free convection and for forced convection, i.e., +with the fan operating. The polynomial is valid for a York cooling tower. +If the fan input signal y is below the minimum fan revolution yMin, +then the cooling tower operates in free convection mode, otherwise it operates in +the forced convection mode. +For numerical reasons, this transition occurs in the range of y ∈ [0.9*yMin, yMin]. +

    +

    Fan power consumption

    +

    +The fan power consumption at the design condition can be specified as follows: +

    +
      +
    • +The parameter fraPFan_nominal can be used to specify at the +nominal conditions the fan power divided by the water flow rate. The default value is +275 Watts for a water flow rate of 0.15 kg/s. +
    • +
    • +The parameter PFan_nominal can be set to the fan power at nominal conditions. +If a user does not set this parameter, then the fan power will be +PFan_nominal = fraPFan_nominal * m_flow_nominal, where m_flow_nominal +is the nominal water flow rate. +
    • +
    +

    +In the forced convection mode, the actual fan power is +computed as PFan=fanRelPow(y) * PFan_nominal, where +the default value for the fan relative power consumption at part load is +fanRelPow(y)=y3. +In the free convection mode, the fan power consumption is zero. +For numerical reasons, the transition of fan power from the part load mode +to zero power consumption in the free convection mode occurs in the range +y ∈ [0.9*yMin, yMin]. +
    +To change the fan relative power consumption at part load in the forced convection mode, +points of fan controls signal and associated relative power consumption can be specified. +In between these points, the values are interpolated using cubic splines. +

    +

    Comparison the cooling tower model of EnergyPlus

    +

    +This model is similar to the model Cooling Tower:Variable Speed that +is implemented in the EnergyPlus building energy simulation program version 6.0. +The main differences are +

    +
      +
    1. +Not implemented are the basin heater power consumption, and +the make-up water usage. +
    2. +
    3. +The model has no built-in control to switch individual cells of the tower on or off. +To switch cells on or off, use multiple instances of this model, and use your own +control law to compute the input signal y. +
    4. +
    +

    Assumptions and limitations

    +

    +This model requires a medium that has the same computation of the enthalpy as + +Buildings.Media.Water, +which computes +

    +

    + h = cp (T-T0), +

    +

    +where +h is the enthalpy, +cp = 4184 J/(kg K) is the specific heat capacity, +T is the temperature in Kelvin and +T0 = 273.15 Kelvin. +If this is not the case, the simulation will stop with an error message. +The reason for this limitation is that as of January 2015, OpenModelica +failed to translate the model if Medium.temperature() is used +instead of +Water.temperature(). +

    +

    References

    +

    +EnergyPlus 2.0.0 Engineering Reference, April 9, 2007. +

    +", revisions=" +
      +
    • +January 16, 2020, by Michael Wetter:
      +Refactored model to avoid mixing textual equations and connect statements. +
    • +
    • +December, 22, 2019, by Kathryn Hinkelman:
      +Corrected fan power consumption.
      +This is for + +issue 1691. +
    • +
    • +November 3, 2016, by Michael Wetter:
      +Corrected wrong type for FRWat0, as this variable +can take on values that are bigger than 1.
      +This is for +issue 567. +
    • +
    • +January 2, 2015, by Michael Wetter:
      +Replaced Medium.temperature() with +Water.temperature() in order for the model +to work with OpenModelica. +Added an assert that stops the simulation if +an incompatible medium is used. +
    • +
    • +November 13, 2014, by Michael Wetter:
      +Added missing each keyword for fanRelPowDer. +Added regularization in computation of TAppCor. +Removed intermediate states with temperatures. +
    • +
    • +May 30, 2014, by Michael Wetter:
      +Removed undesirable annotation Evaluate=true. +
    • +
    • +October 9, 2013, by Michael Wetter:
      +Simplified the implementation for the situation if +allowReverseFlow=false. +Avoided the use of the conditionally enabled variables sta_a and +sta_b as this was not proper use of the Modelica syntax. +
    • +
    • +September 29, 2011, by Michael Wetter:
      +Revised model to use cubic spline interpolation instead of a polynomial. +
    • +
    • +July 12, 2011, by Michael Wetter:
      +Introduced common base class for +Buildings.Fluid.HeatExchangers.CoolingTowers.YorkCalc +and +Buildings.Fluid.HeatExchangers.CoolingTowers.FixedApproach +so that they can be used as replaceable models. +
    • +
    • +May 12, 2011, by Michael Wetter:
      +Added binding equations for Q_flow and mXi_flow. +
    • +
    • +March 8, 2011, by Michael Wetter:
      +Removed base class and unused variables. +
    • +
    • +February 25, 2011, by Michael Wetter:
      +Revised implementation to facilitate scaling the model to different nominal sizes. +Removed parameter mWat_flow_nominal since it is equal to m_flow_nominal, +which is the water flow rate from the chiller condenser loop. +
    • +
    • +May 16, 2008, by Michael Wetter:
      +First implementation. +
    • +
    +")); + end YorkCalc; +end BaseClasses; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/Bypass.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/Bypass.mo new file mode 100644 index 000000000..f1b4f0703 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/Bypass.mo @@ -0,0 +1,106 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.CoolingTower; +model Bypass "Three way bypass valve" + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium condenser water side"; + parameter Modelica.Units.SI.Pressure dPByp_nominal + "Pressure difference between the outlet and inlet of the valve "; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal + "Nominal mass flow rate"; + Modelica.Fluid.Interfaces.FluidPort_a port_a1(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{90,30},{110,50}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b2(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{90,-50},{110,-30}}))); + Modelica.Blocks.Interfaces.RealInput yBypVal "(0: closed, 1: open)" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloTow(redeclare package + Medium = MediumCW) + annotation (Placement(transformation(extent={{-60,30},{-80,50}}))); + Modelica.Blocks.Interfaces.RealOutput m_flow + "Mass flow rate through the cooling towers" + annotation (Placement(transformation(extent={{100,70},{120,90}}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloByp(redeclare package + Medium = MediumCW) annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={0,-20}))); + Modelica.Blocks.Interfaces.RealOutput m_flow_bypass + "Mass flow rate through the bypass " + annotation (Placement(transformation(extent={{100,-90},{120,-70}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a2(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{-110,-50},{-90,-30}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b1(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); + replaceable Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valByp( + redeclare package Medium = MediumCW, + m_flow_nominal=m_flow_nominal, + dpValve_nominal=dPByp_nominal) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={0,10}))); +equation + connect(port_a2, port_b2) annotation (Line( + points={{-100,-40},{100,-40}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(valByp.port_b, senMasFloByp.port_a) annotation (Line( + points={{0,0},{0,-10}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senMasFloByp.port_b, port_b2) annotation (Line( + points={{0,-30},{0,-40},{100,-40}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senMasFloTow.port_b, port_b1) annotation (Line( + points={{-80,40},{-100,40}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senMasFloByp.m_flow, m_flow_bypass) annotation (Line( + points={{11,-20},{60,-20},{60,-80},{110,-80}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(senMasFloTow.m_flow, m_flow) annotation (Line( + points={{-70,51},{-70,60},{80,60},{80,80},{110,80}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(senMasFloTow.port_a, port_a1) annotation (Line( + points={{-60,40},{100,40}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(valByp.port_a, port_a1) annotation (Line( + points={{0,20},{0,40},{100,40}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(valByp.y, yBypVal) annotation (Line( + points={{-12,10},{-40,10},{-40,80},{-120,80}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-50,32},{56,-32}}, + lineColor={0,0,255}, + textString="BypassValve"), + Text( + extent={{-44,-142},{50,-110}}, + lineColor={0,0,255}, + textString="%name")})); +end Bypass; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/CoolingTowersWithBypass.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/CoolingTowersWithBypass.mo new file mode 100644 index 000000000..0174e2d57 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/CoolingTowersWithBypass.mo @@ -0,0 +1,322 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.CoolingTower; +model CoolingTowersWithBypass + "This model is designed to simulate the cooling tower system with N way bypass valve" + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium condenser water side"; + parameter Modelica.Units.SI.Temperature TCWLowSet + "The lower temperatre limit of condenser water entering the chiller plant"; + parameter Modelica.Units.SI.Power P_nominal[n] "Nominal tower power (at y=1)"; + parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal + "Temperature difference between the outlet and inlet of the tower"; + parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal + "Nominal approach temperature"; + parameter Modelica.Units.SI.Temperature TWetBul_nominal + "Nominal wet bulb temperature"; + parameter Modelica.Units.SI.Pressure dP_nominal + "Pressure difference between the outlet and inlet of the tower "; + parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[:] + "Nominal mass flow rate at condenser water wide"; + parameter Real v_flow_rate[n,:] "Air volume flow rate ratio"; + parameter Real eta[n,:] "Fan efficiency"; + parameter Modelica.Units.SI.Pressure dPByp_nominal + "Pressure difference between the outlet and inlet of the bypass valve "; + parameter Modelica.Units.SI.Temperature TCW_start + "The start temperature of condenser water side"; + parameter Integer n + "the number of cooling towers"; + replaceable MultiCoolingTowers mulCooTowSys( + redeclare package MediumCW = MediumCW, + P_nominal=P_nominal, + dTCW_nominal=dTCW_nominal, + dP_nominal=dP_nominal, + mCW_flow_nominal=mCW_flow_nominal, + v_flow_rate=v_flow_rate, + TCW_start=TCW_start, + dTApp_nominal=dTApp_nominal, + TWetBul_nominal=TWetBul_nominal, + eta=eta, + n=n, + GaiPi=1, + tIntPi=60) + annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}))); + Bypass byp( + redeclare package MediumCW = MediumCW, + dPByp_nominal=dPByp_nominal, + m_flow_nominal=sum(mCW_flow_nominal)) + annotation (Placement(transformation(extent={{0,-20},{20,0}}))); + Modelica.Blocks.Interfaces.RealInput On[n] "On signal" + annotation (Placement(transformation(extent={{-118,51},{-100,69}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{90,50},{110,70}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEntChi( + redeclare package Medium = MediumCW, + T_start=TCW_start, + m_flow_nominal=sum(mCW_flow_nominal)) + annotation (Placement(transformation(extent={{60,-90},{80,-70}}))); + Modelica.Blocks.Interfaces.RealInput TWetBul + "Entering air wet bulb temperature" + annotation (Placement(transformation(extent={{-118,-69},{-100,-51}}))); + Modelica.Blocks.Interfaces.RealInput TCWSet + "Temperature set point of the condenser water" + annotation (Placement(transformation(extent={{-118,-9},{-100,9}}))); + + .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI + conPI(k=1, Ti=60) + annotation (Placement(transformation(extent={{-40,38},{-20,58}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=TCWLowSet) + annotation (Placement(transformation(extent={{-74,10},{-54,30}}))); + Modelica.Blocks.Sources.BooleanExpression realExpression1(y=true) + annotation (Placement(transformation(extent={{-80,70},{-60,90}}))); +equation + connect(mulCooTowSys.port_b_CW, byp.port_a2) annotation (Line( + points={{-20,-30},{-8,-30},{-8,-14},{0,-14}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(byp.port_b1, mulCooTowSys.port_a_CW) annotation (Line( + points={{0,-6},{-60,-6},{-60,-30},{-40,-30}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(byp.port_a1, port_a) annotation (Line( + points={{20,-6},{40,-6},{40,60},{100,60}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(byp.port_b2, senTCWEntChi.port_a) annotation (Line( + points={{20,-14},{40,-14},{40,-80},{60,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(senTCWEntChi.port_b, port_b) annotation (Line( + points={{80,-80},{100,-80}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(mulCooTowSys.TWetBul, TWetBul) annotation (Line( + points={{-40.9,-36},{-80,-36},{-80,-60},{-109,-60}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(mulCooTowSys.TCWSet, TCWSet) annotation (Line( + points={{-40.9,-22.1},{-72,-22.1},{-72,0},{-109,0}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(conPI.y, byp.yBypVal) annotation (Line( + points={{-19,48},{0,48},{0,22},{-20,22},{-20,-2},{-2,-2}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senTCWEntChi.T,conPI.mea) annotation (Line( + points={{70,-69},{70,70},{-58,70},{-58,42},{-42,42}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(realExpression.y, conPI.set) annotation (Line( + points={{-53,20},{-48,20},{-48,48},{-42,48}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(realExpression1.y, conPI.On) annotation (Line( + points={{-59,80},{-50,80},{-50,54},{-42,54}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(On, mulCooTowSys.On) annotation (Line( + points={{-109,60},{-94,60},{-80,60},{-80,-26.1},{-40.9,-26.1}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-42,-144},{52,-112}}, + lineColor={0,0,255}, + textString="%name"), + Rectangle( + extent={{-40,68},{-12,40}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-36,76},{-16,68}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-36,72},{-28,70}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-24,72},{-16,70}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-34,60},{-36,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-34,60},{-32,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,60},{-28,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,60},{-24,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,60},{-20,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,60},{-16,54}}, + color={255,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-40,8},{-12,-20}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-36,16},{-16,8}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-36,12},{-28,10}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-24,12},{-16,10}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-34,0},{-36,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-34,0},{-32,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,0},{-28,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,0},{-24,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,0},{-20,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,0},{-16,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-40,-52},{-12,-80}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-36,-44},{-16,-52}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-36,-48},{-28,-50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-24,-48},{-16,-50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-34,-60},{-36,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-34,-60},{-32,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,-60},{-28,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-26,-60},{-24,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,-60},{-20,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-18,-60},{-16,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{60,60},{60,-60}}, + color={0,0,255}, + smooth=Smooth.None), + Polygon( + points={{60,0},{50,10},{70,10},{60,0}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{60,0},{50,-12},{70,-12},{60,0}}, + lineColor={0,0,0}, + smooth=Smooth.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{90,60},{100,60},{-34,60}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,60},{0,0},{-34,0}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,0},{0,-60},{-34,-60}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-12,40},{10,40},{10,-80},{60,-80},{60,-60}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{100,-80},{60,-80}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-12,-20},{10,-20}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{-12,-80},{10,-80}}, + color={0,0,255}, + smooth=Smooth.None)}), + Documentation(revisions=" +
      +
    • +March 30, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end CoolingTowersWithBypass; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/MultiCoolingTowers.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/MultiCoolingTowers.mo new file mode 100644 index 000000000..6399374f9 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/MultiCoolingTowers.mo @@ -0,0 +1,249 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.CoolingTower; +model MultiCoolingTowers + "This model is designed to simulate the cooling tower systwm with N towers" + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the condenser water side"; + parameter Modelica.Units.SI.Power P_nominal[n] + "Nominal cooling tower power (at y=1)"; + parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal + "Temperature difference between the outlet and inlet of the tower "; + parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal + "Nominal approach temperature"; + parameter Modelica.Units.SI.Temperature TWetBul_nominal + "Nominal wet bulb temperature"; + parameter Modelica.Units.SI.Pressure dP_nominal + "Pressure difference between the outlet and inlet of the tower "; + parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal[n] + "Nominal mass flow rate at condenser water wide"; + parameter Real GaiPi "Gain of the tower PI controller"; + parameter Real tIntPi "Integration time of the tower PI controller"; + parameter Real v_flow_rate[n,:] "Air volume flow rate ratio"; + parameter Real eta[n,:] "Fan efficiency"; + parameter Modelica.Units.SI.Temperature TCW_start + "The start temperature of condenser water side"; + + parameter Integer n + "the number of cooling towers"; + Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package + Medium = MediumCW) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package + Medium = MediumCW) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Modelica.Blocks.Interfaces.RealInput TWetBul + "Entering air wet bulb temperature" + annotation (Placement(transformation(extent={{-118,-69},{-100,-51}}))); + Modelica.Blocks.Interfaces.RealInput TCWSet + "Temperature set point of the condenser water" + annotation (Placement(transformation(extent={{-118,70},{-100,88}}))); + VSDCoolingTower ct[n]( + redeclare package MediumCW = MediumCW, + P_nominal=P_nominal, + dTCW_nominal=dTCW_nominal, + dTApp_nominal=dTApp_nominal, + TWetBul_nominal=TWetBul_nominal, + dP_nominal=dP_nominal, + mCW_flow_nominal=mCW_flow_nominal, + GaiPi=GaiPi, + tIntPi=tIntPi, + eta=eta, + TCW_start=TCW_start, + v_flow_rate=v_flow_rate, + conPI(reverseActing=false)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Interfaces.RealInput On[n] + "Temperature set point of the condenser water" + annotation (Placement(transformation(extent={{-118,30},{-100,48}}))); + Modelica.Blocks.Interfaces.RealOutput P[n] + "Electric power consumed by compressor" + annotation (Placement(transformation(extent={{100,30},{120,50}}))); +equation + + for i in 1:n loop + connect(ct[i].port_a_CW, port_a_CW); + connect(ct[i].port_b_CW, port_b_CW); + connect(ct[i].TSet, TCWSet); + connect(TWetBul, ct[i].TWetBul); + connect(ct[i].P, P[i]); + end for; + + connect(ct.On, On) annotation (Line( + points={{-12,4},{-60,4},{-60,39},{-109,39}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + extent={{-44,-144},{50,-112}}, + lineColor={0,0,255}, + textString="%name"), + Rectangle( + extent={{-14,68},{14,40}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-10,76},{10,68}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-10,72},{-2,70}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{2,72},{10,70}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-8,60},{-10,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-8,60},{-6,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,60},{-2,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,60},{2,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,60},{6,54}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,60},{10,54}}, + color={255,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-14,8},{14,-20}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-10,16},{10,8}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-10,12},{-2,10}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{2,12},{10,10}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-8,0},{-10,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-8,0},{-6,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,0},{-2,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,0},{2,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,0},{6,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,0},{10,-6}}, + color={255,0,0}, + smooth=Smooth.None), + Rectangle( + extent={{-14,-52},{14,-80}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-10,-44},{10,-52}}, + lineColor={95,95,95}, + fillColor={95,95,95}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-10,-48},{-2,-50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{2,-48},{10,-50}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-8,-60},{-10,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-8,-60},{-6,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,-60},{-2,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{0,-60},{2,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,-60},{6,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{8,-60},{10,-66}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-100,0},{-40,0},{-40,60},{8,60}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-40,0},{8,0}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{-40,0},{-40,-60},{8,-60}}, + color={255,0,0}, + smooth=Smooth.None), + Line( + points={{14,40},{40,40},{40,0},{90,0}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{14,-20},{40,-20},{40,0}}, + color={0,0,255}, + smooth=Smooth.None), + Line( + points={{14,-80},{40,-80},{40,-20}}, + color={0,0,255}, + smooth=Smooth.None)}), + Documentation(revisions=" +
      +
    • +March 30, 2014 by Sen Huang:
      +First implementation. +
    • +
    +")); +end MultiCoolingTowers; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/VSDCoolingTower.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/VSDCoolingTower.mo new file mode 100644 index 000000000..19169e04b --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/VSDCoolingTower.mo @@ -0,0 +1,174 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.CoolingTower; +model VSDCoolingTower "the cooling tower" + replaceable package MediumCW = + Modelica.Media.Interfaces.PartialMedium + "Medium in the condenser water side"; + parameter Modelica.Units.SI.Power P_nominal + "Nominal cooling tower component power (at y=1)"; + parameter Modelica.Units.SI.TemperatureDifference dTCW_nominal + "Temperature difference between the outlet and inlet of the module"; + parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal + "Nominal approach temperature"; + parameter Modelica.Units.SI.Temperature TWetBul_nominal + "Nominal wet bulb temperature"; + parameter Modelica.Units.SI.Pressure dP_nominal + "Pressure difference between the outlet and inlet of the module "; + parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal + "Nominal mass flow rate"; + parameter Real GaiPi "Gain of the component PI controller"; + parameter Real tIntPi "Integration time of the component PI controller"; + parameter Real v_flow_rate[:] "Volume flow rate ratio"; + parameter Real eta[:] "Fan efficiency"; + parameter Modelica.Units.SI.Temperature TCW_start + "The start temperature of condenser water side"; + BaseClasses.YorkCalc yorkCalc( + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal, + dp_nominal=0, + TRan_nominal=dTCW_nominal, + TAirInWB_nominal=TWetBul_nominal, + TApp_nominal=dTApp_nominal, + fraPFan_nominal=P_nominal/mCW_flow_nominal, + T_start=TCW_start, + fanRelPow(r_V=v_flow_rate, r_P=eta)) + annotation (Placement(transformation(extent={{0,-10},{20,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b_CW(redeclare package + Medium = + MediumCW) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{90,-10},{110,10}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a_CW(redeclare package + Medium = + MediumCW) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage val( + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal, + dpValve_nominal=dP_nominal) + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + .MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.conPI + conPI(k=GaiPi, Ti=tIntPi) + annotation (Placement(transformation(extent={{-30,72},{-10,92}}))); + Modelica.Blocks.Interfaces.RealInput On(min=0,max=1) "On signal" + annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); + Modelica.Blocks.Interfaces.RealInput TSet + "Temperature setpoint of the condenser water" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput TWetBul + "Entering air wet bulb temperature" + annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=yorkCalc.PFan) annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); + Modelica.Blocks.Interfaces.RealOutput P "Power of the cooling tower module" + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Buildings.Fluid.Sensors.TemperatureTwoPort senTCWEnt( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-78,0}))); + replaceable Buildings.Fluid.Sensors.TemperatureTwoPort senTCWLea( + allowFlowReversal=true, + redeclare package Medium = MediumCW, + m_flow_nominal=mCW_flow_nominal) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={44,0}))); + Buildings.Fluid.Sensors.MassFlowRate senMasFloCW(redeclare package + Medium = + MediumCW) + annotation (Placement(transformation(extent={{60,-10},{78,10}}))); + Buildings.Fluid.Sensors.Pressure senPreCWLea(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{94,-16},{74,-36}}))); + Buildings.Fluid.Sensors.Pressure senPreCWEnt(redeclare package Medium = + MediumCW) + annotation (Placement(transformation(extent={{-22,-16},{-42,-36}}))); + Modelica.Blocks.Math.RealToBoolean realToBoolean + annotation (Placement(transformation(extent={{-86,20},{-72,34}}))); +equation + connect(yorkCalc.port_a, val.port_b) annotation (Line( + points={{0,0},{-40,0}}, + color={0,127,255}, + smooth=Smooth.None, + thickness=1)); + connect(yorkCalc.TAir, TWetBul) annotation (Line( + points={{-2,4},{-20,4},{-20,-40},{-120,-40}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(realExpression.y, P) annotation (Line( + points={{21,-40},{110,-40}}, + color={0,0,127}, + smooth=Smooth.None, + pattern=LinePattern.Dash)); + connect(val.port_a, senTCWEnt.port_b) annotation (Line( + points={{-60,0},{-68,0}}, + color={0,127,255}, + thickness=1)); + connect(senTCWEnt.port_a, port_a_CW) annotation (Line( + points={{-88,0},{-100,0}}, + color={0,127,255}, + thickness=1)); + connect(yorkCalc.port_b, senTCWLea.port_a) annotation (Line( + points={{20,0},{34,0}}, + color={0,127,255}, + thickness=1)); + connect(senTCWLea.port_b, senMasFloCW.port_a) annotation (Line( + points={{54,0},{56,0},{60,0}}, + color={0,127,255}, + thickness=1)); + connect(senMasFloCW.port_b, port_b_CW) annotation (Line( + points={{78,0},{100,0}}, + color={0,127,255}, + thickness=1)); + connect(senPreCWLea.port, port_b_CW) annotation (Line( + points={{84,-16},{84,0},{100,0}}, + color={0,127,255}, + thickness=1)); + connect(senPreCWEnt.port, val.port_b) annotation (Line( + points={{-32,-16},{-32,-16},{-32,0},{-40,0}}, + color={0,127,255}, + thickness=1)); + connect(realToBoolean.u, On) annotation (Line( + points={{-87.4,27},{-92,27},{-92,40},{-120,40}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(realToBoolean.y, conPI.On) annotation (Line( + points={{-71.3,27},{-54,27},{-54,88},{-32,88}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(conPI.set, TSet) annotation (Line( + points={{-32,82},{-76,82},{-76,80},{-120,80}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(senTCWLea.T,conPI.mea) annotation (Line( + points={{44,11},{44,11},{44,40},{-44,40},{-44,76},{-32,76}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(conPI.y, yorkCalc.y) annotation (Line( + points={{-9,82},{12,82},{12,22},{-20,22},{-20,8},{-2,8}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(val.y, On) annotation (Line( + points={{-50,12},{-50,40},{-120,40}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(coordinateSystem( + preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-52,34},{58,-34}}, + lineColor={0,0,255}, + textString="CoolingTower"), + Text( + extent={{-44,-146},{50,-114}}, + lineColor={0,0,255}, + textString="%name")})); +end VSDCoolingTower; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.mo new file mode 100644 index 000000000..913b889be --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide; +package CoolingTower "This package contains the modules which can be used to simulate the cooling towers" + +end CoolingTower; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.order new file mode 100644 index 000000000..4a61a0847 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/CoolingTower/package.order @@ -0,0 +1,5 @@ +MultiCoolingTowers +CoolingTowersWithBypass +VSDCoolingTower +Bypass +BaseClasses diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/PipeNetwork.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/PipeNetwork.mo new file mode 100644 index 000000000..5f0c42f58 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/PipeNetwork.mo @@ -0,0 +1,130 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide.Network; +model PipeNetwork "Water distribution network" + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium for the air"; + parameter Modelica.Units.SI.Pressure PreDroMai1 + "Pressure drop 1 across the duct"; + + parameter Modelica.Units.SI.Pressure PreDroMai2 + "Pressure drop 2 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreDroBra1 + "Pressure drop 1 across the duct branch 1"; + + parameter Modelica.Units.SI.Pressure PreDroBra2 + "Pressure drop 1 across the duct branch 2"; + + parameter Modelica.Units.SI.Pressure PreDroBra3 + "Pressure drop 1 across the duct branch 3"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat1 + "mass flow rate for the first branch1"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat2 + "mass flow rate for the first branch2"; + + parameter Modelica.Units.SI.MassFlowRate mFloRat3 + "mass flow rate for the first branch3"; + + Buildings.Fluid.FixedResistances.Junction junSup1(m_flow_nominal={mFloRat1 + mFloRat2 + mFloRat3,-mFloRat2-mFloRat3,- + mFloRat1}, redeclare package Medium = Medium, + dp_nominal={PreDroMai1/2,PreDroMai2/2,PreDroBra1/2}) + annotation (Placement(transformation(extent={{-90,30},{-70,50}}))); + Buildings.Fluid.FixedResistances.Junction junRet1(redeclare package + Medium = Medium, m_flow_nominal={mFloRat2 + mFloRat3,-mFloRat1-mFloRat2-mFloRat3,mFloRat1}, + dp_nominal={PreDroMai2/2,PreDroMai1/2,PreDroBra1/2}) + annotation (Placement(transformation(extent={{-70,-70},{-90,-50}}))); + Buildings.Fluid.FixedResistances.Junction junRet2( redeclare package + Medium = Medium, m_flow_nominal={mFloRat3,-mFloRat2-mFloRat3,mFloRat2}, + dp_nominal={PreDroBra3/2,PreDroMai2/2,PreDroBra2/2}) + annotation (Placement(transformation(extent={{10,-70},{-10,-50}}))); + Buildings.Fluid.FixedResistances.Junction junSup2(m_flow_nominal={mFloRat2 + mFloRat3,-mFloRat3,- + mFloRat2}, redeclare package Medium = Medium, + dp_nominal={PreDroMai2/2,PreDroBra3/2,PreDroBra2/2}) + annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium = + Medium) "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium = + Medium) "Second port, typically outlet" + annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); + Buildings.Fluid.Sensors.RelativePressure senRelPre(redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{-80,-26},{-60,-6}}))); + Modelica.Fluid.Interfaces.FluidPorts_b ports_b[3](redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{90,6},{110,86}}))); + Modelica.Fluid.Interfaces.FluidPorts_a ports_a[3](redeclare package + Medium = Medium) + annotation (Placement(transformation(extent={{90,-102},{110,-22}}))); + Modelica.Blocks.Interfaces.RealOutput p "Pressure at port" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +equation + connect(junSup1.port_2, junSup2.port_1) annotation (Line( + points={{-70,40},{-10,40}}, + color={0,127,255}, + thickness=1)); + connect(junRet2.port_2, junRet1.port_1) + annotation (Line( + points={{-10,-60},{-10,-60},{-70,-60}}, + color={0,127,255}, + thickness=1)); + connect(junRet1.port_2, port_b) annotation (Line( + points={{-90,-60},{-100,-60}}, + color={0,127,255}, + thickness=1)); + connect(junSup1.port_1, port_a) annotation (Line( + points={{-90,40},{-100,40}}, + color={0,127,255}, + thickness=1)); + + connect(ports_b, ports_b) annotation (Line(points={{100,46},{100,46}}, color={0,127,255})); + connect(junSup2.port_3, ports_b[2]) + annotation (Line( + points={{0,30},{0,30},{0,8},{84,8},{84,46},{100,46}}, + color={0,127,255}, + thickness=1)); + connect(junSup1.port_3, ports_b[1]) + annotation (Line( + points={{-80,30},{-80,30},{-80,0},{90,0},{90,19.3333},{100,19.3333}}, + color={0,127,255}, + thickness=1)); + connect(junRet2.port_3, ports_a[2]) + annotation (Line( + points={{0,-70},{0,-86},{100,-86},{100,-62}}, + color={0,127,255}, + thickness=1)); + connect(junRet1.port_3, ports_a[1]) + annotation (Line( + points={{-80,-70},{-80,-70},{-80,-94},{100,-94},{100,-88.6667}}, + color={0,127,255}, + thickness=1)); + connect(junSup2.port_2, ports_b[3]) + annotation (Line( + points={{10,40},{100,40},{100,72.6667}}, + color={0,127,255}, + thickness=1)); + connect(junRet2.port_1, ports_a[3]) + annotation (Line( + points={{10,-60},{100,-60},{100,-35.3333}}, + color={0,127,255}, + thickness=1)); + connect(senRelPre.port_a, port_a) annotation (Line(points={{-80,-16},{-94,-16},{-94,40},{-100,40}}, color={0,127, + 255})); + connect(senRelPre.port_b, port_b) + annotation (Line(points={{-60,-16},{-48,-16},{-48,-40},{-94,-40},{-94,-60},{-100,-60}}, color={0,127, + 255})); + connect(senRelPre.p_rel, p) annotation (Line( + points={{-70,-25},{-70,-34},{90,-34},{90,0},{110,0}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Line(points={{-90,40},{80,40}}, color={0,127,255}), + Line(points={{-90,-60},{80,-60}}, color={0,127,255}), + Line(points={{80,40},{80,-60}}, color={0,127,255}), + Line(points={{50,40},{50,-60}}, color={0,127,255}), + Line(points={{20,40},{20,-60}}, color={0,127,255}), + Text( + extent={{-148,106},{152,146}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end PipeNetwork; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.mo new file mode 100644 index 000000000..bcd9e6a10 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component.WaterSide; +package Network + +end Network; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.order new file mode 100644 index 000000000..65cc004c9 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/Network/package.order @@ -0,0 +1 @@ +PipeNetwork diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.mo new file mode 100644 index 000000000..4baa57601 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.mo @@ -0,0 +1,7 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; +package WaterSide "Basic modeld" + +annotation (Documentation(info=" +

    This package contains component models that are used to construct the chillers with two compressors.

    +")); +end WaterSide; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.order new file mode 100644 index 000000000..3e0aa8504 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/WaterSide/package.order @@ -0,0 +1,5 @@ +Boiler +Chiller +CoolingTower +Control +Network diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/conPI.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/conPI.mo new file mode 100644 index 000000000..7e452c35a --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/conPI.mo @@ -0,0 +1,76 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Component; +model conPI "PI Controller with ON/OFF Signal" + + parameter Real yMin(min=0, max=1, unit="1") = 0 + "Lowest y output"; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block"; + parameter Boolean reverseActing=true + "Set to true for reverse acting, or false for direct acting control action"; + Modelica.Blocks.Interfaces.BooleanInput On + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealOutput y "Connector of Real output signal" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Buildings.Controls.OBC.CDL.Continuous.PIDWithReset + conPID( + controllerType=Modelica.Blocks.Types.SimpleController.PI, + yMin=yMin, + xi_start=0, + k=k, + Ti=Ti, + reverseActing=reverseActing, + y_reset=yMin) + annotation (Placement(transformation(extent={{-8,-30},{12,-10}}))); + Modelica.Blocks.Interfaces.RealInput set + "Connector of setpoint input signal" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealInput mea + "Connector of measurement input signal" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Buildings.Controls.OBC.CDL.Continuous.Switch swi + annotation (Placement(transformation(extent={{40,10},{60,-10}}))); + + Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zerSpe(k=0) + "Zero fan speed when it becomes OFF" + annotation (Placement(transformation(extent={{-10,26},{10,46}}))); +equation + connect(conPID.u_s, set) annotation (Line(points={{-10,-20},{-66,-20},{ + -66,0},{-120,0}}, color={0,0,127})); + connect(swi.y, y) annotation (Line( + points={{62,0},{110,0}}, + color={0,0,127})); + connect(mea, conPID.u_m) annotation (Line( + points={{-120,-60},{-60,-60},{2,-60},{2,-32}}, + color={0,0,127})); + connect(On, swi.u2) annotation (Line(points={{-120,60},{-40,60},{-40,0},{38,0}}, + color={255,0,255})); + connect(conPID.y, swi.u1) annotation (Line(points={{14,-20},{20,-20},{20,-8},{ + 38,-8}}, color={0,0,127})); + connect(zerSpe.y, swi.u3) + annotation (Line(points={{12,36},{30,36},{30,8},{38,8}}, color={0,0,127})); + connect(On, conPID.trigger) annotation (Line(points={{-120,60},{-60,60},{-60,-40}, + {-4,-40},{-4,-32}}, color={255,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{-66,50},{62,-48}}, + lineColor={0,127,255}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + textString="PI"), + Text( + extent={{-152,110},{148,150}}, + textString="%name", + textColor={0,0,255})}), Diagram(coordinateSystem( + preserveAspectRatio=false), graphics={Line(points={{32,-16}}, color={28, + 108,200})}), + Documentation(info=" +

    This model is a PI controller with an external boolean signal. When the boolean signal is true, the model outputs the PI controller output. When it is false, the model outputs zero.

    +")); +end conPI; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.mo new file mode 100644 index 000000000..93f567bc3 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.mo @@ -0,0 +1,7 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses; +package Component "System conmponent models" + +annotation (Documentation(info=" +

    This package contains component models with controls for the large office testcase.

    +")); +end Component; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.order new file mode 100644 index 000000000..8be877ffd --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Component/package.order @@ -0,0 +1,4 @@ +conPI +AirSide +FlowMover +WaterSide diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/AirsideFloor.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/AirsideFloor.mo new file mode 100644 index 000000000..d6b709a11 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/AirsideFloor.mo @@ -0,0 +1,327 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.Examples; +model AirsideFloor + extends Modelica.Icons.Example; + package MediumAir = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Buildings library air media package with CO2"; + package MediumCooWat = Buildings.Media.Water "Medium model for chilled water"; + package MediumHeaWat = Buildings.Media.Water "Medium model for heating water"; + + parameter Modelica.Units.SI.Pressure PreDroCoiAir=50 + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroMixingBoxAir=50 + "Pressure drop in the air side"; + parameter Modelica.Units.SI.Pressure PreDroCooWat=79712 + "Pressure drop in the water side"; + + parameter Modelica.Units.SI.Temperature TemEcoHig=273.15 + 15.58 + "the highest temeprature when the economizer is on"; + parameter Modelica.Units.SI.Temperature TemEcoLow=273.15 + 0 + "the lowest temeprature when the economizer is on"; + parameter Real MixingBoxDamMin = 0.3 "the minimum damper postion"; + + parameter Modelica.Units.SI.Time waitTime(min=0) = 1800 + "Wait time before transition fires"; + parameter Modelica.Units.SI.VolumeFlowRate VolFloCur[:]={(mAirFloRat1 + + mAirFloRat2 + mAirFloRat3 + mAirFloRat4 + mAirFloRat5)/1.2*0.5,( + mAirFloRat1 + mAirFloRat2 + mAirFloRat3 + mAirFloRat4 + mAirFloRat5)/1.2* + 0.7,(mAirFloRat1 + mAirFloRat2 + mAirFloRat3 + mAirFloRat4 + mAirFloRat5) + /1.2,(mAirFloRat1 + mAirFloRat2 + mAirFloRat3 + mAirFloRat4 + mAirFloRat5) + /1.2*2} "Volume flow rate curve"; + parameter Real HydEff[:] = {0.93*0.65,0.93*0.7,0.93,0.93*0.6} "Hydraulic efficiency"; + parameter Real MotEff[:] = {0.6045*0.65,0.6045*0.7,0.6045,0.6045*0.6} "Motor efficiency"; + + parameter Modelica.Units.SI.Pressure SupPreCur[:]={1400,1000,700,700*0.5} + "Pressure curve"; + parameter Modelica.Units.SI.Pressure RetPreCur[:]={600,400,200,100} + "Pressure curve"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai1=140 + "Pressure drop 1 across the duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai2=140 + "Pressure drop 2 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai3=120 + "Pressure drop 3 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroMai4=152 + "Pressure drop 4 across the main duct"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra1=0 + "Pressure drop 1 across the duct branch 1"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra2=0 + "Pressure drop 1 across the duct branch 2"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra3=0 + "Pressure drop 1 across the duct branch 3"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra4=0 + "Pressure drop 1 across the duct branch 4"; + + parameter Modelica.Units.SI.Pressure PreAirDroBra5=0 + "Pressure drop 1 across the duct branch 5"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai1=79712*0.2 + "Pressure drop 1 across the pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai2=79712*0.2 + "Pressure drop 2 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai3=79712*0.2 + "Pressure drop 3 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroMai4=79712*0.2 + "Pressure drop 4 across the main pipe"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra1=0 + "Pressure drop 1 across the pipe branch 1"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra2=0 + "Pressure drop 1 across the pipe branch 2"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra3=0 + "Pressure drop 1 across the pipe branch 3"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra4=0 + "Pressure drop 1 across the pipe branch 4"; + + parameter Modelica.Units.SI.Pressure PreWatDroBra5=0 + "Pressure drop 1 across the pipe branch 5"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat1=10.92*1.2 + "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat2=2.25*1.2 + "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat3=1.49*1.2 + "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat4=1.9*1.2 + "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mAirFloRat5=1.73*1.2 + "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat1=mAirFloRat1*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 1"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat2=mAirFloRat2*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 2"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat3=mAirFloRat3*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 3"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat4=mAirFloRat4*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 4"; + + parameter Modelica.Units.SI.MassFlowRate mWatFloRat5=mAirFloRat5*0.3*(35 - + 12.88)/4.2/20 "mass flow rate for vav 5"; + + parameter Modelica.Units.SI.Pressure PreDroAir1=200 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat1=79712 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps1(max=1) = 0.8 + "Heat exchanger effectiveness of vav 1"; + + parameter Modelica.Units.SI.Pressure PreDroAir2=124 + "Pressure drop in the air side of vav 2"; + parameter Modelica.Units.SI.Pressure PreDroWat2=79712 + "Pressure drop in the water side of vav 2"; + parameter Modelica.Units.SI.Efficiency eps2(max=1) = 0.8 + "Heat exchanger effectiveness of vav 2"; + + parameter Modelica.Units.SI.Pressure PreDroAir3=124 + "Pressure drop in the air side of vav 3"; + parameter Modelica.Units.SI.Pressure PreDroWat3=79712 + "Pressure drop in the water side of vav 3"; + parameter Modelica.Units.SI.Efficiency eps3(max=1) = 0.8 + "Heat exchanger effectiveness of vav 3"; + + parameter Modelica.Units.SI.Pressure PreDroAir4=124 + "Pressure drop in the air side of vav 4"; + parameter Modelica.Units.SI.Pressure PreDroWat4=79712 + "Pressure drop in the water side of vav 4"; + parameter Modelica.Units.SI.Efficiency eps4(max=1) = 0.8 + "Heat exchanger effectiveness of vav 4"; + + parameter Modelica.Units.SI.Pressure PreDroAir5=124 + "Pressure drop in the air side of vav 1"; + parameter Modelica.Units.SI.Pressure PreDroWat5=79712 + "Pressure drop in the water side of vav 1"; + parameter Modelica.Units.SI.Efficiency eps5(max=1) = 0.8 + "Heat exchanger effectiveness of vav 5"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses.AirsideFloor + airsideFloor( + redeclare package MediumAir = MediumAir, + redeclare package MediumHeaWat = MediumHeaWat, + redeclare package MediumCooWat = MediumCooWat, + PreDroCoiAir=PreDroCoiAir, + PreDroMixingBoxAir=PreDroMixingBoxAir, + PreDroCooWat=PreDroCooWat, + TemEcoHig=TemEcoHig, + TemEcoLow=TemEcoLow, + MixingBoxDamMin=MixingBoxDamMin, + waitTime=waitTime, + HydEff=HydEff, + MotEff=MotEff, + VolFloCur=VolFloCur, + SupPreCur=SupPreCur, + RetPreCur=RetPreCur, + PreAirDroMai1=PreAirDroMai1, + PreAirDroMai2=PreAirDroMai2, + PreAirDroMai3=PreAirDroMai3, + PreAirDroMai4=PreAirDroMai4, + PreAirDroBra1=PreAirDroBra1, + PreAirDroBra2=PreAirDroBra2, + PreAirDroBra3=PreAirDroBra3, + PreAirDroBra4=PreAirDroBra4, + PreAirDroBra5=PreAirDroBra5, + PreWatDroMai1=PreWatDroMai1, + PreWatDroMai2=PreWatDroMai2, + PreWatDroMai3=PreWatDroMai3, + PreWatDroMai4=PreWatDroMai4, + PreWatDroBra1=PreWatDroBra1, + PreWatDroBra2=PreWatDroBra2, + PreWatDroBra3=PreWatDroBra3, + PreWatDroBra4=PreWatDroBra4, + PreWatDroBra5=PreWatDroBra5, + mAirFloRat1=mAirFloRat1, + mAirFloRat2=mAirFloRat2, + mAirFloRat3=mAirFloRat3, + mAirFloRat4=mAirFloRat4, + mAirFloRat5=mAirFloRat5, + mWatFloRat1=mWatFloRat1, + mWatFloRat2=mWatFloRat2, + mWatFloRat3=mWatFloRat3, + mWatFloRat4=mWatFloRat4, + mWatFloRat5=mWatFloRat5, + PreDroAir1=PreDroAir1, + PreDroWat1=PreDroWat1, + eps1=eps1, + PreDroAir2=PreDroAir2, + PreDroWat2=PreDroWat2, + eps2=eps2, + PreDroAir3=PreDroAir3, + PreDroWat3=PreDroWat3, + eps3=eps3, + PreDroAir4=PreDroAir4, + PreDroWat4=PreDroWat4, + eps4=eps4, + PreDroAir5=PreDroAir5, + PreDroWat5=PreDroWat5, + eps5=eps5) + annotation (Placement(transformation(extent={{-24,-20},{26,22}}))); + Buildings.Fluid.Sources.Boundary_pT sou( + nPorts=2, + redeclare package Medium = MediumAir, + p(displayUnit="Pa") = 100000) + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); + + Buildings.Fluid.Sources.Boundary_pT souCooWat( + redeclare package Medium = MediumCooWat, + nPorts=1, + p(displayUnit="Pa") = 100000 + PreDroCooWat) + annotation (Placement(transformation(extent={{-22,60},{-42,80}}))); + + Buildings.Fluid.Sources.Boundary_pT sinCooWat( + nPorts=1, + redeclare package Medium = MediumCooWat, + p(displayUnit="Pa") = 100000, + T=279.15) + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); + Buildings.Fluid.Sources.Boundary_pT souHeaWat( + nPorts=1, + p(displayUnit="Pa") = 100000 + PreWatDroMai1 + PreWatDroMai2 + + PreWatDroMai3 + PreWatDroMai4 + PreWatDroBra5 + PreDroWat5, + redeclare package Medium = MediumHeaWat) + annotation (Placement(transformation(extent={{0,60},{20,80}}))); + + Buildings.Fluid.Sources.Boundary_pT sinHeaWat( + nPorts=1, + p(displayUnit="Pa") = 100000, + redeclare package Medium = MediumHeaWat) + annotation (Placement(transformation(extent={{60,60},{40,80}}))); + + Modelica.Blocks.Sources.Ramp loa[5](duration=86400, height=1*1000*10) + annotation (Placement(transformation(extent={{0,-60},{20,-40}}))); + Modelica.Blocks.Sources.Constant zonCooTset[5](k=273.15 + 24) + annotation (Placement(transformation(extent={{-98,44},{-82,60}}))); + Modelica.Blocks.Sources.Constant disTset(k=273.15 + 12.88) + annotation (Placement(transformation(extent={{-98,20},{-82,36}}))); + Modelica.Blocks.Sources.Constant pSet(k=400) + annotation (Placement(transformation(extent={{-100,-80},{-80,-60}}))); + Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=true) + annotation (Placement(transformation(extent={{-100,-106},{-80,-86}}))); + Modelica.Blocks.Sources.Constant zonHeaTset[5](k=273.15 + 20) + annotation (Placement(transformation(extent={{0,-100},{-20,-80}}))); + Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= + Modelica.Utilities.Files.loadResource( + "modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"), + computeWetBulbTemperature=false) "Weather data reader" + annotation (Placement(transformation(extent={{30,-80},{50,-60}}))); + Modelica.Blocks.Routing.RealPassThrough TOut(y( + final quantity="ThermodynamicTemperature", + final unit="K", + displayUnit="degC", + min=0)) + annotation (Placement(transformation(extent={{72,-80},{92,-60}}))); + Buildings.BoundaryConditions.WeatherData.Bus + weaBus + "Weather data bus" + annotation (Placement(transformation(extent={{50,-80},{70,-60}}))); + Modelica.Blocks.Sources.Constant nPeo[5](k=20) + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); +equation + connect(airsideFloor.port_Fre_Air, sou.ports[1]) annotation (Line(points={{-24, + 4.5},{-56,4.5},{-56,-1},{-80,-1}}, color={0,127,255})); + connect(airsideFloor.port_Exh_Air, sou.ports[2]) annotation (Line(points={{-24.625, + -9.5},{-80,-9.5},{-80,1}}, color={0,127,255})); + connect(sinCooWat.ports[1], airsideFloor.port_b_CooWat) annotation (Line( + points={{-60,70},{-52,70},{-52,40},{-7.4375,40},{-7.4375,-20}}, color={0, + 127,255})); + connect(airsideFloor.port_a_CooWat, souCooWat.ports[1]) annotation (Line( + points={{-3.6875,-20},{-3.6875,46},{-48,46},{-48,70},{-42,70}}, color={0, + 127,255})); + connect(airsideFloor.port_a_HeaWat, souHeaWat.ports[1]) annotation (Line( + points={{7.25,-20},{7.25,-20},{7.25,46},{24,46},{24,70},{20,70}}, color + ={0,127,255})); + connect(airsideFloor.port_b_HeaWat, sinHeaWat.ports[1]) annotation (Line( + points={{9.75,-20},{9.75,36},{34,36},{34,70},{40,70}}, color={0,127,255})); + connect(loa.y, airsideFloor.Q_flow) annotation (Line( + points={{21,-50},{24,-50},{24,-26},{4,-26},{4,-21.75},{3.5,-21.75}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(booleanExpression.y, airsideFloor.OnZon) annotation (Line( + points={{-79,-96},{-34,-96},{-34,-18.25},{-25.5625,-18.25}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(airsideFloor.OnFan, airsideFloor.OnZon) annotation (Line( + points={{-25.5625,-11.25},{-34,-11.25},{-34,-18.25},{-25.5625,-18.25}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(weaDat.weaBus, weaBus) annotation (Line( + points={{50,-70},{54,-70},{54,-70},{60,-70}}, + color={255,204,51}, + thickness=0.5)); + connect(TOut.u, weaBus.TDryBul) + annotation (Line(points={{70,-70},{60,-70}}, color={0,0,127})); + connect(TOut.y, airsideFloor.TOut) annotation (Line(points={{93,-70},{96,-70}, + {96,-28},{-2,-28},{-2,-21.75},{-1.1875,-21.75}}, color={0,0,127})); + connect(pSet.y, airsideFloor.pSet) annotation (Line(points={{-79,-70},{-40, + -70},{-40,0},{-25.5625,0},{-25.5625,-0.75}}, color={0,0,127})); + connect(zonCooTset.y, airsideFloor.zonCooTSet) annotation (Line(points={{ + -81.2,52},{-54,52},{-54,15},{-25.5625,15}}, color={0,0,127})); + connect(zonHeaTset.y, airsideFloor.zonHeaTSet) annotation (Line(points={{-21, + -90},{-48,-90},{-48,12},{-25.5625,12},{-25.5625,11.5}}, color={0,0, + 127})); + connect(disTset.y, airsideFloor.disTSet) annotation (Line(points={{-81.2,28}, + {-56,28},{-56,8},{-25.5625,8}}, color={0,0,127})); + connect(nPeo.y, airsideFloor.nPeo) annotation (Line(points={{-79,-30},{-36, + -30},{-36,-4.25},{-25.5625,-4.25}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem( + preserveAspectRatio=false)), + experiment(StopTime=86400)); +end AirsideFloor; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.mo new file mode 100644 index 000000000..c683e16f3 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.BaseClasses; +package Examples + extends Modelica.Icons.ExamplesPackage; +end Examples; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.order new file mode 100644 index 000000000..ac167c194 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/Examples/package.order @@ -0,0 +1 @@ +AirsideFloor diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/package.order index 6fa6ee309..5f3490826 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/package.order +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/BaseClasses/package.order @@ -3,3 +3,4 @@ AirsideFloor BoilerPlant ChillerPlant Component +Examples diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/HVAC.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/HVAC.mo new file mode 100644 index 000000000..2224a2c85 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/HVAC.mo @@ -0,0 +1,110 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide.Examples; +model HVAC + extends Modelica.Icons.Example; + //package MediumAir = Buildings.Media.Air(extraPropertiesNames={"CO2"}) "Buildings library air media package with CO2"; + //package MediumHeaWat = Buildings.Media.Water "Medium model for heating water"; + + MultizoneOfficeComplexAir.BaseClasses.HVACSide.HVAC hva( + floor1(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0)))), + floor2(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0)))), + floor3(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0))))) + annotation (Placement(transformation(extent={{0,-20},{40,20}}))); + + Modelica.Blocks.Sources.Ramp loa[15](duration=86400, height=1000) + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + Modelica.Blocks.Sources.Step occ(startTime=3600*6) + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); + Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= + Modelica.Utilities.Files.loadResource( + "modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"), + computeWetBulbTemperature=false) "Weather data reader" + annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}))); + Modelica.Blocks.Routing.RealPassThrough TDryBul(y( + final quantity="ThermodynamicTemperature", + final unit="K", + displayUnit="degC", + min=0)) + annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}))); + Buildings.BoundaryConditions.WeatherData.Bus + weaBus + "Weather data bus" + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + Buildings.Utilities.Psychrometrics.TWetBul_TDryBulPhi TWetBul + annotation (Placement(transformation(extent={{-40,-88},{-20,-68}}))); + Modelica.Blocks.Sources.Constant numOcc[15](k=10) + annotation (Placement(transformation(extent={{-80,-20},{-60,0}}))); +equation + connect(weaDat.weaBus, weaBus) annotation (Line( + points={{-80,-50},{-70,-50}}, + color={255,204,51}, + thickness=0.5)); + connect(loa.y, hva.loa) annotation (Line(points={{-59,30},{-20,30},{-20,10}, + {-2.8,10}}, color={0,0,127})); + connect(TDryBul.y, hva.TDryBul) annotation (Line(points={{-19,-50},{-14,-50}, + {-14,-4},{-2.8,-4}}, color={0,0,127})); + connect(occ.y, hva.occ) annotation (Line(points={{-59,70},{-14,70},{-14,16}, + {-2.8,16}}, color={0,0,127})); + connect(weaBus.TDryBul, TWetBul.TDryBul) annotation (Line( + points={{-70,-50},{-70,-70},{-41,-70}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus.relHum, TWetBul.phi) annotation (Line( + points={{-70,-50},{-70,-78},{-41,-78}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus.pAtm, TWetBul.p) annotation (Line( + points={{-70,-50},{-70,-86},{-41,-86}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(TWetBul.TWetBul, hva.TWetBul) annotation (Line(points={{-19,-78},{ + -10,-78},{-10,-13.7},{-2.7,-13.7}}, color={0,0,127})); + connect(weaBus.TDryBul, TDryBul.u) annotation (Line( + points={{-70,-50},{-42,-50}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(numOcc.y, hva.numOcc) annotation (Line(points={{-59,-10},{-20,-10}, + {-20,4},{-2.8,4}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem( + preserveAspectRatio=false)), + experiment(StopTime=86400)); +end HVAC; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.mo new file mode 100644 index 000000000..40571dae2 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.HVACSide; +package Examples + extends Modelica.Icons.ExamplesPackage; +end Examples; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.order new file mode 100644 index 000000000..3620e91d8 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/Examples/package.order @@ -0,0 +1 @@ +HVAC diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/HVAC.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/HVAC.mo index b21a7dadb..16b6f26ae 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/HVAC.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/HVAC.mo @@ -163,12 +163,12 @@ model HVAC "Full HVAC system that contains the air side and water side systems" annotation (Placement(transformation(extent={{70,-36},{90,-14}}))); equation connect(chiWatNet.ports_a[1], floor1.port_b_CooWat) annotation (Line( - points={{40,-91.1333},{40,-94},{106,-94},{106,6},{130.563,6},{130.563,20}}, + points={{40,-92.4667},{40,-94},{106,-94},{106,6},{130.562,6},{130.562,20}}, color={0,127,225}, thickness=1)); connect(floor1.port_a_CooWat, chiWatNet.ports_b[1]) annotation (Line( - points={{134.313,20},{134.313,0},{112,0},{112,-102},{72,-102},{72, - -101.933},{40,-101.933}}, + points={{134.312,20},{134.312,0},{112,0},{112,-102},{72,-102},{72, + -103.267},{40,-103.267}}, color={0,127,225}, thickness=1)); @@ -177,12 +177,12 @@ equation connect(chiWatNet.ports_a[3], floor3.port_b_CooWat); connect(floor3.port_a_CooWat, chiWatNet.ports_b[3]); connect(boiWatNet.ports_a[1], floor1.port_b_HeaWat) annotation (Line( - points={{176,-93.1333},{196,-93.1333},{196,6},{154,6},{154,20},{147.75,20}}, + points={{176,-94.4667},{196,-94.4667},{196,6},{154,6},{154,20},{147.75,20}}, color={238,46,47}, thickness=1)); connect(boiWatNet.ports_b[1], floor1.port_a_HeaWat) annotation (Line( - points={{176,-103.933},{192,-103.933},{192,0},{150,0},{150,20},{145.25,20}}, + points={{176,-105.267},{192,-105.267},{192,0},{150,0},{150,20},{145.25,20}}, color={238,46,47}, thickness=1)); diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/package.order index 93ed5ac54..37fd7f0e1 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/package.order +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/HVACSide/package.order @@ -1,2 +1,3 @@ HVAC BaseClasses +Examples diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples.bak-mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples.bak-mo new file mode 100644 index 000000000..dcd52ee57 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples.bak-mo @@ -0,0 +1,20 @@ +within MultizoneOfficeComplexAir.BaseClasses.LoadSide; +package Examples + extends Modelica.Icons.Example; + model LoadWrapper + extends Modelica.Icons.Example; + MultizoneOfficeComplexAir.BaseClasses.LoadSide.LoadWrapper loadWrapper(building( + spawnExe="spawn-0.3.0-0fa49be497")) + "Load calculation in EnergyPlus using Spawn, note this version spawn-0.3.0-8d93151657 is specified for BOPTEST environment; Use spawn-0.3.0-0fa49be497 for Buildings library version" + annotation (Placement(transformation(extent={{-20,-20},{20,20}}))); + Modelica.Blocks.Sources.Step Tzon[15]( + height=2, + offset=273.15 + 20, + startTime=3600*12) + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + equation + connect(Tzon.y, loadWrapper.T) + annotation (Line(points={{-59,0},{-24,0}}, color={0,0,127})); + annotation (experiment(StopTime=86400, __Dymola_Algorithm="Cvode")); + end LoadWrapper; +end Examples; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/LoadWrapper.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/LoadWrapper.mo new file mode 100644 index 000000000..4ce50eb46 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/LoadWrapper.mo @@ -0,0 +1,17 @@ +within MultizoneOfficeComplexAir.BaseClasses.LoadSide.Examples; +model LoadWrapper + extends Modelica.Icons.Example; + MultizoneOfficeComplexAir.BaseClasses.LoadSide.LoadWrapper loadWrapper(building( + spawnExe="spawn-0.3.0-0fa49be497")) + "Load calculation in EnergyPlus using Spawn, note this version spawn-0.3.0-8d93151657 is specified for BOPTEST environment; Use spawn-0.3.0-0fa49be497 for Buildings library version" + annotation (Placement(transformation(extent={{-20,-20},{20,20}}))); + Modelica.Blocks.Sources.Step Tzon[15]( + height=2, + offset=273.15 + 20, + startTime=3600*12) + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); +equation + connect(Tzon.y, loadWrapper.T) + annotation (Line(points={{-59,0},{-24,0}}, color={0,0,127})); + annotation (experiment(StopTime=86400, __Dymola_Algorithm="Cvode")); +end LoadWrapper; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.mo new file mode 100644 index 000000000..c960664b6 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.mo @@ -0,0 +1,4 @@ +within MultizoneOfficeComplexAir.BaseClasses.LoadSide; +package Examples + extends Modelica.Icons.Example; +end Examples; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.order new file mode 100644 index 000000000..f886dbf14 --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/Examples/package.order @@ -0,0 +1 @@ +LoadWrapper diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/package.order b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/package.order index baa14f8fc..c7f58e7ce 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/package.order +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/LoadSide/package.order @@ -1,2 +1,3 @@ LoadWrapper BaseClasses +Examples diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadAhu.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadAhu.mo index b351975bf..84747bacd 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadAhu.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadAhu.mo @@ -125,6 +125,33 @@ model ReadAhu "Collection of AHU measurements for BOPTEST" annotation (Placement(transformation(extent={{-50,244},{-30,264}}))); Modelica.Blocks.Interfaces.BooleanInput occ_in "Occupancy status" annotation (Placement(transformation(extent={{-140,234},{-100,274}}))); + Buildings.Utilities.IO.SignalExchange.Read CO2_AHUSup( + description="Supply air CO2 measurement for AHU", + KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.CO2Concentration, + + y(unit="ppm")) "Air CO2 concentration measurement" + annotation (Placement(transformation(extent={{0,-170},{20,-150}}))); + Modelica.Blocks.Interfaces.RealInput CO2_AHUSup_in + "Volume fraction of CO2 (PPM)" + annotation (Placement(transformation(extent={{-140,-180},{-100,-140}}))); + Buildings.Utilities.IO.SignalExchange.Read CO2_AHUFre( + description="Fresh air CO2 measurement for AHU", + KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.CO2Concentration, + + y(unit="ppm")) "Air CO2 concentration measurement" + annotation (Placement(transformation(extent={{0,-200},{20,-180}}))); + Modelica.Blocks.Interfaces.RealInput CO2_AHUFre_in + "Volume fraction of CO2 (PPM)" + annotation (Placement(transformation(extent={{-140,-210},{-100,-170}}))); + Buildings.Utilities.IO.SignalExchange.Read CO2_AHURet( + description="Return air CO2 measurement for AHU", + KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.CO2Concentration, + + y(unit="ppm")) "Air CO2 concentration measurement" + annotation (Placement(transformation(extent={{0,-230},{20,-210}}))); + Modelica.Blocks.Interfaces.RealInput CO2_AHURet_in + "Volume fraction of CO2 (PPM)" + annotation (Placement(transformation(extent={{-140,-240},{-100,-200}}))); equation connect(TSup.u, TSup_in) annotation (Line(points={{-2,200},{-120,200}}, color={0,0,127})); @@ -160,9 +187,15 @@ equation annotation (Line(points={{-29,254},{-2,254}}, color={0,0,127})); connect(booleanToReal.u, occ_in) annotation (Line(points={{-52,254},{-120,254}}, color={255,0,255})); + connect(CO2_AHUSup_in, CO2_AHUSup.u) + annotation (Line(points={{-120,-160},{-2,-160}}, color={0,0,127})); + connect(CO2_AHUFre_in, CO2_AHUFre.u) + annotation (Line(points={{-120,-190},{-2,-190}}, color={0,0,127})); + connect(CO2_AHURet_in, CO2_AHURet.u) + annotation (Line(points={{-120,-220},{-2,-220}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -180},{100,280}}), graphics={Rectangle( - extent={{-102,282},{106,-178}}, + -240},{100,280}}), graphics={Rectangle( + extent={{-102,282},{100,-246}}, lineColor={0,0,0}, fillColor={255,170,170}, fillPattern=FillPattern.Solid), @@ -174,5 +207,5 @@ AHU"), Text( extent={{-156,290},{144,330}}, textString="%name", textColor={0,0,255})}),Diagram(coordinateSystem(preserveAspectRatio= - false, extent={{-100,-160},{100,280}}))); + false, extent={{-100,-240},{100,280}}))); end ReadAhu; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadZone.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadZone.mo index 6ead7bbb9..66572ed8b 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadZone.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/BaseClasses/ReadOverwrite/ReadZone.mo @@ -98,6 +98,15 @@ model ReadZone "Collection of zone measurements for BOPTEST" annotation (Placement(transformation(extent={{-140,-150},{-100,-110}}))); Modelica.Blocks.Interfaces.RealInput yCoo_in "Cooling PID signal measurement" annotation (Placement(transformation(extent={{-140,-120},{-100,-80}}))); + Buildings.Utilities.IO.SignalExchange.Read CO2Zon( + description="Zone air CO2 measurement for zone " + zone, + KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.CO2Concentration, + + y(unit="ppm"), + zone=zone) "Zone air CO2 concentration measurement" + annotation (Placement(transformation(extent={{0,-170},{20,-150}}))); + Modelica.Blocks.Interfaces.RealInput CO2Zon_in "Volume fraction of CO2 (PPM)" + annotation (Placement(transformation(extent={{-140,-180},{-100,-140}}))); equation connect(TZon.u, TZon_in) annotation (Line(points={{-2,70},{-120,70}}, color={0,0,127})); @@ -121,10 +130,12 @@ equation connect(yCoo_in,yCoo. u) annotation (Line(points={{-120,-100},{-2,-100}}, color={0,0,127})); + connect(CO2Zon_in, CO2Zon.u) + annotation (Line(points={{-120,-160},{-2,-160}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -140},{100,140}}), graphics={ + -180},{100,140}}), graphics={ Rectangle( - extent={{-100,140},{100,-140}}, + extent={{-100,140},{100,-180}}, lineColor={0,0,0}, fillColor={255,170,170}, fillPattern=FillPattern.Solid), @@ -136,5 +147,5 @@ Zone"), Text( extent={{-152,152},{148,192}}, textString="%name", textColor={0,0,255})}),Diagram(coordinateSystem(preserveAspectRatio= - false, extent={{-100,-140},{100,140}}))); + false, extent={{-100,-180},{100,140}}))); end ReadZone; diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestCase.mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestCase.mo index b66d0b47f..a5744a36d 100644 --- a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestCase.mo +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestCase.mo @@ -2,10 +2,6 @@ within MultizoneOfficeComplexAir.TestCases; model TestCase "Complex office building model that includes air side systems, water side systems from Modelica, and building thermal load calucation from EnergyPlus." extends Modelica.Icons.Example; - MultizoneOfficeComplexAir.BaseClasses.LoadSide.LoadWrapper loaEnePlu(building( - spawnExe="spawn-0.3.0-0fa49be497")) - "Load calculation in EnergyPlus using Spawn, note this version spawn-0.3.0-8d93151657 is specified for BOPTEST environment; Use spawn-0.3.0-0fa49be497 for Buildings library version" - annotation (Placement(transformation(extent={{-10,-50},{10,-30}}))); MultizoneOfficeComplexAir.BaseClasses.HVACSide.HVAC hva( floor1(duaFanAirHanUni( mixBox(mixBox( @@ -35,24 +31,33 @@ model TestCase "Complex office building model that includes air side systems, wa use_inputFilter=true, y_start=0))), cooCoi(val(use_inputFilter=true, y_start=0))))) "Full HVAC system that contains the airside and waterside systems and controls" - annotation (Placement(transformation(extent={{10,-10},{-10,10}}))); + annotation (Placement(transformation(extent={{20,20},{-20,60}}))); -equation - connect(hva.occ, loaEnePlu.occ) annotation (Line(points={{11.4,8},{24,8},{24, - -48.4},{11,-48.4}}, color={0,0,127})); - connect(loaEnePlu.loa, hva.loa) annotation (Line(points={{11,-42},{22,-42},{ - 22,3},{11.4,3}}, color={0,0,127})); - connect(loaEnePlu.dryBul, hva.TDryBul) annotation (Line(points={{11,-34},{20, - -34},{20,-2},{11.4,-2}}, color={0,0,127})); - connect(loaEnePlu.wetBul, hva.TWetBul) annotation (Line(points={{11,-31},{18, - -31},{18,-6.85},{11.35,-6.85}}, color={0,0,127})); + MultizoneOfficeComplexAir.BaseClasses.LoadSide.LoadWrapper loaEnePlu(building( + spawnExe="spawn-0.3.0-0fa49be497")) + "Load calculation in EnergyPlus using Spawn, note this version spawn-0.3.0-8d93151657 is specified for BOPTEST environment; Use spawn-0.3.0-0fa49be497 for Buildings library version" + annotation (Placement(transformation(extent={{-20,-60},{20,-20}}))); - connect(hva.TZon, loaEnePlu.T) annotation (Line(points={{-11,0},{-20,0},{-20, - -40},{-12,-40}}, color={0,0,127})); +equation + connect(loaEnePlu.occ, hva.occ) annotation (Line(points={{22,-56.8},{22,-56}, + {46,-56},{46,56},{22.8,56}}, + color={0,0,127})); + connect(loaEnePlu.loa, hva.loa) annotation (Line(points={{22,-44},{42,-44},{ + 42,50},{22.8,50}}, + color={0,0,127})); + connect(loaEnePlu.dryBul, hva.TDryBul) annotation (Line(points={{22,-28},{34, + -28},{34,36},{22.8,36}}, color={0,0,127})); + connect(loaEnePlu.wetBul, hva.TWetBul) annotation (Line(points={{22,-22},{30, + -22},{30,26.3},{22.7,26.3}}, color={0,0,127})); + connect(hva.TZon, loaEnePlu.T) annotation (Line(points={{-22,40},{-34,40},{ + -34,-40},{-24,-40}}, + color={0,0,127})); + connect(loaEnePlu.numOcc, hva.numOcc) annotation (Line(points={{22,-36},{38, + -36},{38,44},{22.8,44}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false)), experiment( - StopTime=172800, + StopTime=604800, __Dymola_NumberOfIntervals=1440, Tolerance=1e-06, __Dymola_Algorithm="Cvode"), diff --git a/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestSuccess.bak-mo b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestSuccess.bak-mo new file mode 100644 index 000000000..78ced762c --- /dev/null +++ b/testcases/multizone_office_complex_air/models/MultizoneOfficeComplexAir/TestCases/TestSuccess.bak-mo @@ -0,0 +1,58 @@ +within MultizoneOfficeComplexAir.TestCases; +model TestSuccess + extends Modelica.Icons.Example; + MultizoneOfficeComplexAir.BaseClasses.HVACSide.HVAC hva( + floor1(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0)))), + floor2(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0)))), + floor3(duaFanAirHanUni( + mixBox(mixBox( + valRet(riseTime=15, y_start=1), + valExh(riseTime=15, y_start=0), + valFre(riseTime=15, y_start=0))), + retFan(varSpeFloMov(use_inputFilter=true, y_start=0)), + supFan(varSpe(variableSpeed(zerSpe(k=0))), withoutMotor(varSpeFloMov( + use_inputFilter=true, y_start=0))), + cooCoi(val(use_inputFilter=true, y_start=0))))) + annotation (Placement(transformation(extent={{20,-50},{-20,-10}}))); + + BaseClasses.LoadSide.LoadWrapper loaEnePlu(building(spawnExe= + "spawn-0.3.0-0fa49be497")) + "Load calculation in EnergyPlus using Spawn, note this version spawn-0.3.0-8d93151657 is specified for BOPTEST environment; Use spawn-0.3.0-0fa49be497 for Buildings library version" + annotation (Placement(transformation(extent={{-20,10},{20,50}}))); +equation + connect(hva.TZon, loaEnePlu.T) annotation (Line(points={{-22,-30},{-34,-30},{ + -34,30},{-24,30}}, color={0,0,127})); + connect(loaEnePlu.wetBul, hva.TWetBul) annotation (Line(points={{22,48},{52, + 48},{52,-43.7},{22.7,-43.7}}, color={0,0,127})); + connect(loaEnePlu.dryBul, hva.TDryBul) annotation (Line(points={{22,42},{48, + 42},{48,-34},{22.8,-34}}, color={0,0,127})); + connect(loaEnePlu.loa, hva.loa) annotation (Line(points={{22,26},{40,26},{40, + -20},{22.8,-20}}, color={0,0,127})); + connect(loaEnePlu.occ, hva.occ) annotation (Line(points={{22,13.2},{36,13.2}, + {36,-14},{22.8,-14}}, color={0,0,127})); + connect(loaEnePlu.numOcc, hva.numOcc) annotation (Line(points={{22,34},{44,34}, + {44,-26},{22.8,-26}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem( + preserveAspectRatio=false)), + experiment( + StopTime=172800, + __Dymola_NumberOfIntervals=1440, + Tolerance=1e-06, + __Dymola_Algorithm="Cvode")); +end TestSuccess;