Skip to content

Commit

Permalink
Add the unit modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
terrancelu92 committed Jun 20, 2023
1 parent 20f96a9 commit 22f82c7
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1734,8 +1734,11 @@ package BuildingControlEmulator
Modelica.Blocks.Interfaces.RealInput Tout
"Connector of measurement input signal"
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveEcoDam(description
="AHU economizer damper position")
Buildings.Utilities.IO.SignalExchange.Overwrite oveEcoDam(description=
"AHU economizer damper position", u(
min=0,
max=1,
unit="1"))
annotation (Placement(transformation(extent={{-62,-6},{-48,8}})));
equation
connect(mixBox.port_Exh, port_Exh) annotation (Line(
Expand Down Expand Up @@ -2989,25 +2992,40 @@ package BuildingControlEmulator
Modelica.Blocks.Math.Add add(k2=-1)
annotation (Placement(transformation(extent={{-56,10},{-36,30}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveTCooSet(
description="Zone air cooling temperature setpoint")
description="Zone air cooling temperature setpoint", u(
max=273.15 + 28,
unit="K",
min=273.15 + 21))
annotation (Placement(transformation(extent={{-80,50},{-60,70}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveTHeaSet(
description="Zone air heating temperature setpoint")
description="Zone air heating temperature setpoint", u(
max=273.15 + 27,
unit="K",
min=273.15 + 18))
annotation (Placement(transformation(extent={{-96,-64},{-88,-56}})));
Buildings.Utilities.IO.SignalExchange.Read TZon(description=
"Zone air temperature", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None)
"Zone air temperature", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None,
y(unit="K"))
annotation (Placement(transformation(extent={{-92,-10},{-72,10}})));
Buildings.Utilities.IO.SignalExchange.Read TCooSet(description=
"Zone air cooling temperature setpoint", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None)
"Zone air cooling temperature setpoint", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None,
y(unit="K"))
annotation (Placement(transformation(extent={{-46,50},{-26,70}})));
Buildings.Utilities.IO.SignalExchange.Read THeaSet(description=
"Zone air heating temperature setpoint", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None)
"Zone air heating temperature setpoint", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.None,
y(unit="K"))
annotation (Placement(transformation(extent={{-80,-64},{-72,-56}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveAirFlowSetPoi(
description="Zone air flow rate setpoint")
description="Zone air flow rate setpoint", u(
min=0,
max=1,
unit="1"))
annotation (Placement(transformation(extent={{68,54},{82,68}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveyValPos(
description="Zone air terminal valve rate position")
description="Zone air terminal valve rate position", u(
min=0,
max=1,
unit="1"))
annotation (Placement(transformation(extent={{70,-66},{84,-52}})));
equation
connect(cooCon.y, swi.u1) annotation (Line(points={{11,60},{34,60},{34,28},{46,
Expand Down Expand Up @@ -4743,11 +4761,17 @@ First implementation.
annotation (Placement(transformation(extent={{-140,-80},{-100,-40}})));
Modelica.Blocks.Logical.Not not1
annotation (Placement(transformation(extent={{-62,0},{-42,20}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeSup(description
="AHU supply fan speed control signal")
Buildings.Utilities.IO.SignalExchange.Overwrite oveSpeSup(description=
"AHU supply fan speed control signal", u(
min=0,
max=1,
unit="1"))
annotation (Placement(transformation(extent={{14,72},{30,88}})));
Buildings.Utilities.IO.SignalExchange.Overwrite ovePreSetPoi(
description="AHU supply fan static pressure setpoint")
description="AHU supply fan static pressure setpoint", u(
min=80,
max=600,
unit="Pa"))
annotation (Placement(transformation(extent={{-70,-88},{-54,-72}})));
Buildings.Controls.OBC.CDL.Continuous.Switch swi
annotation (Placement(transformation(extent={{12,28},{32,48}})));
Expand Down Expand Up @@ -19000,7 +19024,7 @@ First implementation.
pattern=LinePattern.Dash));

annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{
-100,-100},{100,40}}), graphics={
-100,-100},{100,80}}), graphics={
Rectangle(
extent={{-100,100},{100,-100}},
lineColor={0,0,127},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ model AirSide "Air side system"
annotation (Placement(transformation(extent={{-70,10},{-50,30}})));
Modelica.Blocks.Sources.BooleanExpression onZon[n](each y=true)
"Zone VAV terminal on signal"
annotation (Placement(transformation(extent={{40,56},{60,76}})));
annotation (Placement(transformation(extent={{40,62},{60,82}})));
MultizoneOfficeComplexAir.BaseClasses.BuildingControlEmulator.Devices.AirSide.Terminal.Controls.ZonCon zonVAVCon[15](
MinFlowRateSetPoi=0.3,
HeatingFlowRateSetPoi=0.5,
Expand Down Expand Up @@ -408,11 +408,20 @@ model AirSide "Air side system"
Modelica.Blocks.Math.RealToBoolean reaToBooOcc
"Convert real signal to boolean signal for occupancy signal"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor1TDisAir(description="Floor 1 AHU supply air temperature setpoint")
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor1TDisAir(description="Floor 1 AHU supply air temperature setpoint", u(
max=273.15 + 20,
unit="K",
min=273.15 + 8))
annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor2TDisAir(description="Floor 2 AHU supply air temperature setpoint")
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor2TDisAir(description="Floor 2 AHU supply air temperature setpoint", u(
max=273.15 + 20,
unit="K",
min=273.15 + 8))
annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor3TDisAir(description="Floor 3 AHU supply air temperature setpoint")
Buildings.Utilities.IO.SignalExchange.Overwrite oveFloor3TDisAir(description="Floor 3 AHU supply air temperature setpoint", u(
max=273.15 + 20,
unit="K",
min=273.15 + 8))
"AHU supply air temperature overwritten block"
annotation (Placement(transformation(extent={{-40,46},{-20,66}})));
Modelica.Blocks.Continuous.FirstOrder firOrd(T=1)
Expand All @@ -426,30 +435,34 @@ equation
annotation (Line(points={{38,40},{-38,40},{-38,1.77636e-15},{-114,1.77636e-15}},
color={0,0,127}));
connect(floor1.port_Exh_Air, sou[1].ports[1]) annotation (Line(
points={{114,38},{90,38},{90,38.6667},{60,38.6667}},
points={{114,34},{90,34},{90,38.6667},{60,38.6667}},
color={0,140,72},
thickness=0.5));
connect(floor1.port_Fre_Air, sou[1].ports[2]) annotation (Line(
points={{114,62},{90,62},{90,36},{60,36}},
points={{114,52.6667},{90,52.6667},{90,36},{60,36}},
color={0,140,72},
thickness=0.5));
connect(dpStaSet[1].y, floor1.PreSetPoi) annotation (Line(points={{-49,20},{
102,20},{102,53},{111.5,53}}, color={0,0,127}));
102,20},{102,45.6667},{111.5,45.6667}},
color={0,0,127}));
connect(oveFloor1TDisAir.y, floor1.DisTemPSetPoi) annotation (Line(points={{-19,56},
{100,56},{100,68},{111.5,68}}, color={0,0,127}));
{100,56},{100,57.3333},{111.5,57.3333}},
color={0,0,127}));
connect(reaToBooOcc.y, floor1.OnFan) annotation (Line(points={{-39,100},{-36,
100},{-36,86},{106,86},{106,35},{111.5,35}},color={255,0,255}));
connect(floor1.OnZon, onZon[1].y) annotation (Line(points={{111.5,23},{108,23},
{108,22},{104,22},{104,66},{61,66}}, color={255,0,255}));
100},{-36,86},{106,86},{106,31.6667},{111.5,31.6667}},
color={255,0,255}));
connect(floor1.OnZon, onZon[1].y) annotation (Line(points={{111.5,22.3333},{
108,22.3333},{108,22},{104,22},{104,72},{61,72}},
color={255,0,255}));
for j in 1:5 loop
connect(floor1.TZon[j], zonVAVCon[(1 - 1)*5 + j].T) annotation (Line(points={{166.5,
50},{180,50},{180,84},{50,84},{50,100},{58,100}},
43.3333},{180,43.3333},{180,84},{50,84},{50,100},{58,100}},
color={0,0,127}));
connect(zonVAVCon[(1 - 1)*5 + j].yAirFlowSetPoi, floor1.AirFlowRatSetPoi[j])
annotation (Line(points={{81.1,106.1},{100,106.1},{100,47},{111.5,47}},
annotation (Line(points={{81.1,106.1},{100,106.1},{100,41},{111.5,41}},
color={0,0,127}));
connect(zonVAVCon[(1 - 1)*5 + j].yValPos, floor1.yVal[j]) annotation (Line(
points={{81.1,94.1},{102,94.1},{102,29},{111.5,29}}, color={0,0,127}));
points={{81.1,94.1},{102,94.1},{102,27},{111.5,27}}, color={0,0,127}));
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], zonVAVCon[(1 - 1)*5 + j].TCooSetPoi)
Expand All @@ -459,10 +472,11 @@ equation
annotation (Line(points={{22,101},{22,100},{36,100},{36,94},{58,94}},
color={0,0,127}));
connect(TZonAirSet[(1 - 1)*5 + j].SetPoi[1], floor1.ZonCooTempSetPoi[j])
annotation (Line(points={{22,99},{32,99},{32,80},{111.5,80}}, color={0,0,127}));
annotation (Line(points={{22,99},{32,99},{32,66.6667},{111.5,66.6667}},
color={0,0,127}));
connect(TZonAirSet[(1 - 1)*5 + j].SetPoi[2], floor1.ZonHeaTempSetPoi[j])
annotation (Line(points={{22,101},{34,101},{34,82},{98,82},{98,74},{111.5,
74}}, color=
annotation (Line(points={{22,101},{34,101},{34,82},{98,82},{98,62},{111.5,
62}}, color=
{0,0,127}));
end for;

Expand All @@ -482,7 +496,8 @@ equation
connect(zonVAVCon[(2 - 1)*5 + j].yAirFlowSetPoi, floor2.AirFlowRatSetPoi[j]);
connect(zonVAVCon[(2 - 1)*5 + j].yValPos, floor2.yVal[j]);
connect(loaMulMidFlo[j].y, floor2.Q_flow[j]) annotation (Line(points={{-81.4,
60},{-76,60},{-76,2},{142,2},{142,17},{141.5,17}}, color={0,0,127}));
60},{-76,60},{-76,2},{142,2},{142,17.6667},{141.5,17.6667}},
color={0,0,127}));
connect(floor2.TZon[j], TZon[(2-1)*5+j]);
connect(TZonAirSet[(2 - 1)*5 + j].SetPoi[1], zonVAVCon[(2 - 1)*5 + j].TCooSetPoi);
connect(TZonAirSet[(2 - 1)*5 + j].SetPoi[2], zonVAVCon[(2 - 1)*5 + j].THeaSetPoi);
Expand Down Expand Up @@ -510,8 +525,8 @@ equation
end for;
connect(booRep.y, TZonAirSet.Occ)
annotation (Line(points={{-9,100},{-2,100}}, color={255,0,255}));
connect(floor1.TOut, TDryBul) annotation (Line(points={{134,17},{134,0},{-84,
0},{-84,1.77636e-15},{-114,1.77636e-15}},
connect(floor1.TOut, TDryBul) annotation (Line(points={{134,17.6667},{134,0},
{-84,0},{-84,1.77636e-15},{-114,1.77636e-15}},
color={0,0,127}));
connect(floor2.TOut, TDryBul);
connect(floor3.TOut, TDryBul);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ model HVAC
annotation (Placement(transformation(extent={{-128,-82},{-100,-54}}),
iconTransformation(extent={{-127,-83},{-100,-54}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveTCHWSet(description=
"Chilled water supply temperature setpoint")
"Chilled water supply temperature setpoint", u(
max=273.15 + 13,
unit="K",
min=273.15 + 4))
annotation (Placement(transformation(extent={{-40,-50},{-20,-30}})));
Modelica.Blocks.Sources.RealExpression PHWPum(y=sum(boiWatPla.pumSecHW.P))
"Hot water pump power consumption"
Expand All @@ -82,7 +85,8 @@ model HVAC
+ boiWatPla.multiBoiler.boi[2].boi.QFue_flow) "Boiler gas consumption"
annotation (Placement(transformation(extent={{114,-54},{134,-34}})));
Buildings.Utilities.IO.SignalExchange.Read read(description=
"Boiler gas consumption", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.GasPower)
"Boiler gas consumption", KPIs=Buildings.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.GasPower,
y(unit="W"))
annotation (Placement(transformation(extent={{152,-54},{172,-34}})));
equation
connect(chiWatNet.ports_a[1], floor1.port_b_CooWat) annotation (Line(
Expand Down

0 comments on commit 22f82c7

Please sign in to comment.