Skip to content

Commit

Permalink
Merge pull request #9 from karthikeyad-pnnl/issue2614_ChilledBeamSequ…
Browse files Browse the repository at this point in the history
…ences_ForPR

Issue2614 chilled beam sequences for pr
  • Loading branch information
cerrinamouchref-pnnl authored Mar 14, 2024
2 parents 81ea895 + 77103b9 commit 178ac66
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 174 deletions.
250 changes: 140 additions & 110 deletions Buildings/Controls/OBC/FDE/DOAS/CoolingCoil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,139 +18,169 @@ block CoolingCoil "This block commands the cooling coil."
final quantity = "TemperatureDifference") = 5
"Value subtracted from ERW supply air dewpoint.";

parameter CDL.Types.SimpleController controllerTypeDeh=Buildings.Controls.OBC.CDL.Types.SimpleController.PI
"Type of controller";
parameter Real kDeh=1
"Gain of controller";
parameter Real TiDeh=0.5
"Time constant of integrator block";

// ---inputs---
Buildings.Controls.OBC.CDL.Interfaces.RealInput saT(
final unit = "K",
final displayUnit = "degC",
final quantity = "ThermodynamicTemperature")
"Supply air temperature sensor."
annotation(Placement(transformation(extent = {{-142, -56}, {-102, -16}}), iconTransformation(extent = {{-142, 36}, {-102, 76}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput supCooSP(
final unit = "K",
final displayUnit = "degC",
final quantity = "ThermodynamicTemperature")
"Supply air temperature cooling set point."
annotation(Placement(transformation(extent = {{-142, -86}, {-102, -46}}), iconTransformation(extent = {{-142, 8}, {-102, 48}})));

Buildings.Controls.OBC.CDL.Interfaces.BooleanInput supFanProof
"True when supply fan is proven on."
annotation(Placement(transformation(extent = {{-142, -116}, {-102, -76}}), iconTransformation(extent = {{-142, 64}, {-102, 104}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput erwHum(
final min = 0,
final max = 1,
unit = "1")
"ERW relative humidity sensor"
annotation(Placement(transformation(extent = {{-142, 34}, {-102, 74}}), iconTransformation(extent = {{-142, -78}, {-102, -38}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput erwT(
final unit = "K",
final displayUnit = "degC",
final quantity = "ThermodynamicTemperature")
"ERW dry bulb temperature sensor."
annotation(Placement(transformation(extent = {{-142, 4}, {-102, 44}}), iconTransformation(extent = {{-142, -104}, {-102, -64}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput ccT(
final unit = "K",
final displayUnit = "degC",
final quantity = "ThermodynamicTemperature")
"Cooling coil discharge air temperature sensor."
annotation(Placement(transformation(extent = {{-142, 64}, {-102, 104}}), iconTransformation(extent = {{-142, -52}, {-102, -12}})));

Buildings.Controls.OBC.CDL.Interfaces.BooleanInput dehumMode
"True when dehumidification mode is on."
annotation(Placement(transformation(extent = {{-142, -24}, {-102, 16}}), iconTransformation(extent = {{-142, -26}, {-102, 14}})));
// ---inputs---
Buildings.Controls.OBC.CDL.Interfaces.RealInput TAirSup(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Measured supply air temperature" annotation (Placement(transformation(
extent={{-142,-56},{-102,-16}}), iconTransformation(extent={{-142,36},
{-102,76}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput TAirSupSetCoo(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Supply air cooling setpoint temperature" annotation (Placement(
transformation(extent={{-142,-86},{-102,-46}}), iconTransformation(
extent={{-142,8},{-102,48}})));

Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uFanSupPro
"Supply fan proven on signal" annotation (Placement(transformation(extent={{
-142,-116},{-102,-76}}), iconTransformation(extent={{-142,64},{-102,
104}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput phiAirEneRecWhe(
final min=0,
final max=1,
unit="1")
"Measured relative humidity of air conditioned by energy recovery wheel"
annotation (Placement(transformation(extent={{-142,34},{-102,74}}),
iconTransformation(extent={{-142,-78},{-102,-38}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput TAirEneRecWhe(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Measured dry bulb temperature of air conditioned by energy recovery wheel"
annotation (Placement(transformation(extent={{-142,4},{-102,44}}),
iconTransformation(extent={{-142,-104},{-102,-64}})));

Buildings.Controls.OBC.CDL.Interfaces.RealInput TCoiCoo(
final unit="K",
final displayUnit="degC",
final quantity="ThermodynamicTemperature")
"Cooling coil discharge air temperature sensor." annotation (Placement(
transformation(extent={{-142,64},{-102,104}}), iconTransformation(
extent={{-142,-52},{-102,-12}})));

Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uDeh
"Dehumidification mode enable signal" annotation (Placement(transformation(
extent={{-142,-24},{-102,16}}), iconTransformation(extent={{-142,-26},
{-102,14}})));

// ---outputs---
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCC
"Cooling coil control signal"
annotation(Placement(transformation(extent = {{102, 56}, {142, 96}}), iconTransformation(extent = {{102, -20}, {142, 20}})));

Buildings.Controls.OBC.CDL.Reals.Sources.Constant con0(
final k = 0)
"Real constant 0"
annotation(Placement(transformation(extent = {{-20, -62}, {0, -42}})));

Buildings.Controls.OBC.CDL.Reals.Switch swi
"Logical switch outputs supply air PI value when fan is proven on."
annotation(Placement(transformation(extent={{22,-50},{42,-30}})));

Buildings.Controls.OBC.CDL.Reals.Switch swi1
"Logical switch passes different PI calculations to yCC based on dehumidification mode."
annotation(Placement(transformation(extent = {{58, 66}, {78, 86}})));

Buildings.Controls.OBC.CDL.Logical.And and2
"Logical AND;true when dehumidification is on and supply fan is proven on."
annotation(Placement(transformation(extent = {{-20, -14}, {0, 8}})));

Buildings.Controls.OBC.CDL.Reals.PID conPID2(reverseActing=false)
annotation(Placement(visible = true, transformation(origin = {-62, -42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Buildings.Controls.OBC.CDL.Reals.PID conPID(reverseActing=false)
annotation(Placement(visible = true, transformation(origin = {16, 78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Buildings.Controls.OBC.CDL.Psychrometrics.DewPoint_TDryBulPhi dewPoi
"Calculates dewpoint temperature for ERW return air"
annotation(Placement(visible = true, transformation(origin = {-66, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));

Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(
p = -erwDPadj) "Ensures setpoint is below calculated dewpoint"
annotation(Placement(visible = true, transformation(origin = {-36, 36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCoiCoo
"Cooling coil control signal" annotation (Placement(transformation(extent={{
102,56},{142,96}}), iconTransformation(extent={{102,-20},{142,20}})));

Buildings.Controls.OBC.CDL.Reals.Sources.Constant conZer(final k=0)
"Real constant zero"
annotation (Placement(transformation(extent={{-30,-80},{-10,-60}})));

Buildings.Controls.OBC.CDL.Reals.Switch swiFanSupPro
"Output non-zero cooling coil signal only when supply fan is proven on"
annotation (Placement(transformation(extent={{22,-50},{42,-30}})));

Buildings.Controls.OBC.CDL.Reals.Switch swiTSetCoo
"Switch cooling coil signal between regular operation and dehumidification mode"
annotation (Placement(transformation(extent={{58,66},{78,86}})));

Buildings.Controls.OBC.CDL.Logical.And andDehEna
"Enable dehumidification mode only when supply fan is proven on"
annotation (Placement(transformation(extent={{-20,-14},{0,8}})));

Buildings.Controls.OBC.CDL.Reals.PID conPIDRegOpe(reverseActing=false)
"PID controller for regular cooling coil operation mode" annotation (
Placement(visible=true, transformation(
origin={-62,-42},
extent={{-10,-10},{10,10}},
rotation=0)));

Buildings.Controls.OBC.CDL.Reals.PID conPIDDeh(
controllerType=controllerTypeDeh,
k=kDeh,
Ti=TiDeh,
reverseActing=false)
"PID controller for cooling air in dehumidification mode" annotation (
Placement(visible=true, transformation(
origin={10,80},
extent={{-10,-10},{10,10}},
rotation=0)));

Buildings.Controls.OBC.CDL.Psychrometrics.DewPoint_TDryBulPhi TAirDewEneRecWhe
"Calculates dewpoint temperature for air conditioned by energy recovery wheel"
annotation (Placement(visible=true, transformation(
origin={-66,48},
extent={{-10,-10},{10,10}},
rotation=0)));

Buildings.Controls.OBC.CDL.Reals.AddParameter TSetCooDeh(p=-erwDPadj)
"Calculate cooling setpoint temperature for air in dehumidification mode"
annotation (Placement(visible=true, transformation(
origin={-36,36},
extent={{-10,-10},{10,10}},
rotation=0)));

equation
connect(con0.y, swi.u3) annotation (
Line(points={{2,-52},{18,-52},{18,-48},{20,-48}},
color = {0, 0, 127}));
connect(conZer.y, swiFanSupPro.u3) annotation (Line(points={{-8,-70},{18,-70},
{18,-48},{20,-48}}, color={0,0,127}));

connect(swi.u2, supFanProof) annotation (
Line(points={{20,-40},{6,-40},{6,-96},{-122,-96}}, color = {255, 0, 255}));
connect(swiFanSupPro.u2, uFanSupPro) annotation (Line(points={{20,-40},{6,-40},
{6,-96},{-122,-96}}, color={255,0,255}));

connect(and2.u1, dehumMode) annotation (
Line(points = {{-22, -3}, {-78, -3}, {-78, -4}, {-122, -4}}, color = {255, 0, 255}));
connect(andDehEna.u1, uDeh) annotation (Line(points={{-22,-3},{-78,-3},{-78,-4},
{-122,-4}}, color={255,0,255}));

connect(supFanProof, and2.u2) annotation (
Line(points = {{-122, -96}, {-42, -96}, {-42, -11.8}, {-22, -11.8}}, color = {255, 0, 255}));
connect(uFanSupPro, andDehEna.u2) annotation (Line(points={{-122,-96},{-42,-96},
{-42,-11.8},{-22,-11.8}}, color={255,0,255}));

connect(and2.y, swi1.u2) annotation (
Line(points = {{2, -3}, {36, -3}, {36, 76}, {56, 76}}, color = {255, 0, 255}));
connect(andDehEna.y, swiTSetCoo.u2) annotation (Line(points={{2,-3},{36,-3},{36,
76},{56,76}}, color={255,0,255}));

connect(swi1.y, yCC) annotation (
Line(points = {{80, 76}, {122, 76}}, color = {0, 0, 127}));
connect(swiTSetCoo.y, yCoiCoo)
annotation (Line(points={{80,76},{122,76}}, color={0,0,127}));

connect(swi.y, swi1.u3) annotation (
Line(points={{44,-40},{46,-40},{46,68},{56,68}}, color = {0, 0, 127}));
connect(swiFanSupPro.y, swiTSetCoo.u3) annotation (Line(points={{44,-40},{46,-40},
{46,68},{56,68}}, color={0,0,127}));

connect(saT, conPID2.u_m) annotation (
Line(points = {{-122, -36}, {-90, -36}, {-90, -54}, {-62, -54}}, color = {0, 0, 127}));
connect(TAirSup, conPIDRegOpe.u_m) annotation (Line(points={{-122,-36},{-90,-36},
{-90,-54},{-62,-54}}, color={0,0,127}));

connect(supCooSP, conPID2.u_s) annotation (
Line(points = {{-122, -66}, {-80, -66}, {-80, -42}, {-74, -42}}, color = {0, 0, 127}));
connect(TAirSupSetCoo, conPIDRegOpe.u_s) annotation (Line(points={{-122,-66},{
-80,-66},{-80,-42},{-74,-42}}, color={0,0,127}));

connect(conPID2.y, swi.u1) annotation (
Line(points={{-50,-42},{-17,-42},{-17,-32},{20,-32}}, color = {0, 0, 127}));
connect(conPIDRegOpe.y, swiFanSupPro.u1) annotation (Line(points={{-50,-42},{-17,
-42},{-17,-32},{20,-32}}, color={0,0,127}));

connect(ccT, conPID.u_m) annotation (
Line(points = {{-122, 84}, {-22, 84}, {-22, 66}, {16, 66}}, color = {0, 0, 127}));
connect(TCoiCoo, conPIDDeh.u_m) annotation (Line(points={{-122,84},{-22,84},{-22,
68},{10,68}}, color={0,0,127}));

connect(conPID.y, swi1.u1) annotation (
Line(points = {{28, 78}, {28, 80}, {56, 80}, {56, 84}}, color = {0, 0, 127}));
connect(conPIDDeh.y, swiTSetCoo.u1)
annotation (Line(points={{22,80},{56,80},{56,84}}, color={0,0,127}));

connect(erwT, dewPoi.TDryBul) annotation (
Line(points = {{-122, 24}, {-88, 24}, {-88, 54}, {-78, 54}}, color = {0, 0, 127}));
connect(TAirEneRecWhe, TAirDewEneRecWhe.TDryBul) annotation (Line(points={{-122,
24},{-88,24},{-88,54},{-78,54}}, color={0,0,127}));

connect(erwHum, dewPoi.phi) annotation (
Line(points = {{-122, 54}, {-94, 54}, {-94, 42}, {-78, 42}}, color = {0, 0, 127}));
connect(phiAirEneRecWhe, TAirDewEneRecWhe.phi) annotation (Line(points={{-122,
54},{-94,54},{-94,42},{-78,42}}, color={0,0,127}));


connect(dewPoi.TDewPoi, addPar.u) annotation (
Line(points = {{-54, 48}, {-48, 48}, {-48, 36}}, color = {0, 0, 127}));
connect(TAirDewEneRecWhe.TDewPoi, TSetCooDeh.u)
annotation (Line(points={{-54,48},{-48,48},{-48,36}}, color={0,0,127}));

connect(addPar.y, conPID.u_s) annotation (Line(points={{-24,36},{-10,36},{-10,
78},{4,78}}, color={0,0,127}));
connect(TSetCooDeh.y, conPIDDeh.u_s) annotation (Line(points={{-24,36},{-10,36},
{-10,80},{-2,80}}, color={0,0,127}));
annotation (
defaultComponentName = "Cooling",
defaultComponentName = "conCoiCoo",
Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics={ Rectangle(lineColor = {179, 151, 128}, fillColor = {255, 255, 255},
fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}, radius = 10), Text(textColor = {28, 108, 200}, extent = {{-90, 180}, {90, 76}}, textString = "%name", textStyle = {TextStyle.Bold}), Text(textColor = {28, 108, 200}, extent = {{-98, 92}, {-54, 78}}, textString = "supFanProof"), Text(textColor = {28, 108, 200}, extent = {{-110, 62}, {-70, 50}}, textString = "saT"), Text(textColor = {28, 108, 200}, extent = {{-98, 34}, {-58, 22}}, textString = "supCooSP"), Text(textColor = {28, 108, 200}, extent = {{-108, -26}, {-68, -38}}, textString = "ccT"), Text(textColor = {28, 108, 200}, extent = {{-100, -52}, {-60, -64}}, textString = "erwHum"), Text(textColor = {28, 108, 200}, extent = {{-108, -78}, {-68, -90}}, textString = "erwT"), Text(textColor = {28, 108, 200}, extent = {{-98, 0}, {-58, -12}}, textString = "dehumMode"), Text(textColor = {28, 108, 200}, extent = {{62, 8}, {106, -8}}, textString = "yCC"), Rectangle(lineColor = {28, 108, 200}, fillColor = {85, 255, 255},
fillPattern = FillPattern.Solid, extent = {{-22, 68}, {6, -66}}), Rectangle(lineColor = {28, 108, 200}, fillColor = {0, 0, 255},
Expand Down
Loading

0 comments on commit 178ac66

Please sign in to comment.