Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates • Refactor multiple-unit components with flow rate multiplier #3537

Merged
merged 22 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3dbd127
Refactor fan array
AntoineGautier Sep 25, 2023
f8fd50a
Refactor fan array, move block out of DHC
AntoineGautier Sep 25, 2023
d697c16
Change unnecessary inner/outer into bindings
AntoineGautier Sep 25, 2023
cae2f7e
Add revision and release notes
AntoineGautier Sep 26, 2023
de08233
Fix href
AntoineGautier Sep 26, 2023
6f3ddb6
Remove each
AntoineGautier Sep 27, 2023
6cc4b17
Merge branch 'master' of github.com:lbl-srg/modelica-buildings into i…
AntoineGautier Nov 1, 2023
e43818e
Refactor after merge
AntoineGautier Nov 1, 2023
f48f188
Merge branch 'master' of github.com:lbl-srg/modelica-buildings into i…
AntoineGautier Nov 4, 2023
ebf1f9a
Update conversion script
AntoineGautier Nov 8, 2023
18991b2
Corrected comment
mwetter Nov 16, 2023
025c74d
Reformulated using a multi-or block
mwetter Nov 16, 2023
0ed90c7
Removed the word 'elementary' as elementary blocks are defined in CDL
mwetter Nov 16, 2023
1b2add0
Edit description strings
AntoineGautier Nov 17, 2023
fa7200e
Remove obsolete declarations (commented out)
AntoineGautier Nov 17, 2023
c4bbdaf
Change global class names
AntoineGautier Nov 17, 2023
312c580
Empty commit to work around OMC timeout
AntoineGautier Nov 18, 2023
65d53df
Update reference results
AntoineGautier Nov 18, 2023
3f3538c
Update reference results for Dymola 2023x Golden
AntoineGautier Nov 19, 2023
866c78a
TMP: Restrict CI scope
AntoineGautier Nov 19, 2023
2b1cce0
Update results from different machine
AntoineGautier Nov 19, 2023
a580711
Update reference results with Ubuntu 20.04
AntoineGautier Nov 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ partial model PartialMultiplePumps
final per=per,
addPowerToMedium=false) "Pump"
annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
MultipleCommands com(final nUni=nPum) "Convert command signal"
Buildings.Templates.Components.Controls.MultipleCommands com(final nUni=nPum)
"Convert command signal"
annotation (Placement(transformation(extent={{-50,90},{-30,110}})));

Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea
Expand Down Expand Up @@ -241,15 +242,15 @@ equation
<p>
This base class represents multiple identical pumps that are piped in parallel.
An optional check valve in series with each pump is included.
This class is used to construct the various multiple-pump models within
This class is used to construct the various multiple-pump models within
<a href=\"modelica://Buildings.Experimental.DHC.Plants.Combined.Subsystems\">
Buildings.Experimental.DHC.Plants.Combined.Subsystems</a>.
</p>
<h4>Details</h4>
<p>
In a parallel arrangement, all operating units have the same operating point.
This allows modeling the multiple pumps with a single instance of any
class derived from
class derived from
<a href=\"modelica://Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine\">
Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine</a>.
Hydronics are resolved with mass flow rate multiplier components.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
MultipleCommands
MultipleValves
PartialMultiplePumps
PassThroughFluid
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ model ChillerGroup
final use_input=true)
"Flow rate multiplier"
annotation (Placement(transformation(extent={{-30,-70},{-50,-50}})));
BaseClasses.MultipleCommands com(
Buildings.Templates.Components.Controls.MultipleCommands com(
final nUni=nUni)
"Convert command signals"
annotation (Placement(transformation(extent={{-80,110},{-60,130}})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ model CoolingTowerGroup "Model of multiple identical cooling towers in parallel"
final use_input=false,
final k=nUni) "Flow rate multiplier"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
BaseClasses.MultipleCommands com(final nUni=nUni)
Buildings.Templates.Components.Controls.MultipleCommands com(final nUni=nUni)
"Convert command signals"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
Buildings.Controls.OBC.CDL.Reals.Multiply mulP "Scale power"
Expand Down Expand Up @@ -222,15 +222,15 @@ The following input and output points are available.
</p>
<ul>
<li>
Start command (VFD Run) <code>y1</code>:
Start command (VFD Run) <code>y1</code>:
DO signal dedicated to each unit, with a dimensionality of one
</li>
<li>
Speed command <code>y</code>:
AO signal common to all units, with a dimensionality of zero
</li>
<li>
CW supply temperature <code>TConWatSup</code>:
CW supply temperature <code>TConWatSup</code>:
AI signal common to all units, with a dimensionality of zero
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ model HeatPumpGroup
final use_input=true)
"Flow rate multiplier"
annotation (Placement(transformation(extent={{60,-10},{80,10}})));
BaseClasses.MultipleCommands com(final nUni=nUni)
Buildings.Templates.Components.Controls.MultipleCommands com(final nUni=nUni)
"Convert command signals"
annotation (Placement(transformation(extent={{-60,90},{-40,110}})));
Buildings.Controls.OBC.CDL.Reals.Multiply mulP "Scale power"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ convertClear();
// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3517
convertClass("Buildings.Controls.OBC.CDL.Discrete.Examples",
"Buildings.Controls.OBC.CDL.Discrete.Validation");

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3526
convertElement("Buildings.Controls.OBC.ASHRAE.G36.AHUs.MultiZone.VAV.SetPoints.PlantRequests",
"uCooCoi_actual", "uCooCoiSet");
convertElement("Buildings.Controls.OBC.ASHRAE.G36.AHUs.MultiZone.VAV.SetPoints.PlantRequests",
"uHeaCoi_actual", "uHeaCoiSet");
convertElement("Buildings.Controls.OBC.ASHRAE.G36.AHUs.MultiZone.VAV.SetPoints.ReliefFan",
"yDam", "y1RelDam");

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/3536
convertClass("Buildings.Experimental.DHC.Plants.Combined.Subsystems.BaseClasses.MultipleCommands",
"Buildings.Templates.Components.Controls.MultipleCommands");
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ simulateModel("Buildings.Templates.Components.Validation.Fans",
createPlot(
id=1,
position={0, 0, 400, 400},
y={"arr.bus.y", "arr.bus.y1", "arr.bus.y1_actual", "arr.fan[1].m_flow", "arr.m_flow_nominal"},
y={"arr.bus.y", "arr.bus.y1", "arr.bus.y1_actual", "arr.fan.m_flow", "arr.m_flow_nominal"},
autoscale=true,
grid=true
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ compareVars :=
"arr.bus.y",
"arr.bus.y1",
"arr.bus.y1_actual",
"arr.fan[1].m_flow",
"arr.fan.m_flow",
"arr.m_flow_nominal",
"cst.bus.y1",
"cst.bus.y1_actual",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,25 @@ partial block PartialController "Interface class for AHU controller"

outer parameter Buildings.Templates.Data.AllSystems datAll
"Top-level (whole building) system parameters";
outer parameter Buildings.Templates.Components.Types.Fan typFanSup

parameter Buildings.Templates.Components.Types.Fan typFanSup
"Type of supply fan";
outer parameter Buildings.Templates.Components.Types.Fan typFanRet
"Type of relief/return fan";
parameter Buildings.Templates.Components.Types.Fan typFanRel
"Type of relief fan";
parameter Buildings.Templates.Components.Types.Fan typFanRet
"Type of return fan";
parameter Integer nFanSup
"Number of supply fan";
parameter Integer nFanRel
"Number of relief fan";
parameter Integer nFanRet
"Number of return fan";

replaceable parameter
Buildings.Templates.AirHandlersFans.Components.Data.PartialController dat(
final typ=typ,
final typFanSup=typFanSup,
final typFanRel=typFanRel,
final typFanRet=typFanRet)
"Design and operating parameters"
annotation (Placement(transformation(extent={{190,170},{210,190}})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,28 @@ partial model PartialOutdoorReliefReturnSection
parameter Buildings.Templates.Components.Types.Fan typFanRet
"Return fan type"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRel
"Number of relief fans"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRet
"Number of return fans"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Boolean have_eco
"Set to true in case of economizer function"
annotation (Evaluate=true, Dialog(group="Configuration"));
inner parameter Boolean have_recHea = false
parameter Boolean have_recHea = false
"Set to true in case of heat recovery"
annotation (Evaluate=true,
Dialog(group="Configuration"));
inner parameter Buildings.Templates.AirHandlersFans.Types.ControlFanReturn typCtlFanRet=
parameter Buildings.Templates.AirHandlersFans.Types.ControlFanReturn typCtlFanRet=
Buildings.Templates.AirHandlersFans.Types.ControlFanReturn.AirflowMeasured
"Return fan control type"
annotation (__ctrlFlow(enable=false),
Evaluate=true,
Dialog(
group="Configuration",
enable=typFanRet<>Buildings.Templates.Components.Types.Fan.None));
inner parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco=
parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco=
Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer.FixedDryBulb
"Economizer control type"
annotation (__ctrlFlow(enable=false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ partial model PartialOutdoorSection "Interface class for outdoor air section"
else Buildings.Templates.Components.Types.Damper.None
"Minimum outdoor air damper type"
annotation (Evaluate=true, Dialog(group="Configuration"));

outer parameter Boolean have_recHea
parameter Boolean have_recHea
"Set to true in case of heat recovery";
outer parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco
parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco
"Economizer control type";

parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@ partial model PartialReliefReturnSection "Interface class for relief/return air
parameter Buildings.Templates.Components.Types.Fan typFanRet
"Return fan type"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRel
"Number of relief fans"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRet
"Number of return fans"
annotation (Evaluate=true, Dialog(group="Configuration"));

outer parameter Buildings.Templates.AirHandlersFans.Types.ControlFanReturn typCtlFanRet
"Return fan control type";
outer parameter Boolean have_recHea
parameter Boolean have_recHea
"Set to true in case of heat recovery";
outer parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco
parameter Buildings.Templates.AirHandlersFans.Types.ControlFanReturn typCtlFanRet
"Return fan control type";
parameter Buildings.Controls.OBC.ASHRAE.G36.Types.ControlEconomizer typCtlEco
"Economizer control type";

parameter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ model MixedAirWithDamper "Mixed air system with return air damper"
final typDamRet=damRet.typ,
final typFanRel=secRel.typFanRel,
final typFanRet=secRel.typFanRet,
final nFanRel=secRel.nFanRel,
final nFanRet=secRel.nFanRet,
final have_eco=true,
final have_recHea=recHea.typ<>Buildings.Templates.AirHandlersFans.Types.HeatRecovery.None);

Expand All @@ -21,7 +23,9 @@ model MixedAirWithDamper "Mixed air system with return air damper"
redeclare final package MediumAir = MediumAir,
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final dat=dat)
final dat=dat,
final have_recHea=have_recHea,
final typCtlEco=typCtlEco)
"Outdoor air section"
annotation (
choices(
Expand All @@ -41,7 +45,10 @@ model MixedAirWithDamper "Mixed air system with return air damper"
redeclare final package MediumAir = MediumAir,
final energyDynamics=energyDynamics,
final allowFlowReversal=allowFlowReversal,
final dat=dat)
final dat=dat,
final have_recHea=have_recHea,
final typCtlFanRet=typCtlFanRet,
final typCtlEco=typCtlEco)
"Relief/return air section"
annotation (
choices(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ model NoRelief "No relief branch"
final typ=Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection.NoRelief,
final typDamRel=Buildings.Templates.Components.Types.Damper.None,
final typFanRel=Buildings.Templates.Components.Types.Fan.None,
final typFanRet=fanRet.typ);
final typFanRet=fanRet.typ,
final nFanRel=0,
final nFanRet=fanRet.nFan);

replaceable Buildings.Templates.Components.Fans.None fanRet
constrainedby Buildings.Templates.Components.Interfaces.PartialFan(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ model NoReturn "No return branch"
final typ=Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection.NoReturn,
final typDamRel=damRel.typ,
final typFanRel=Buildings.Templates.Components.Types.Fan.None,
final typFanRet=fanRet.typ);
final typFanRet=fanRet.typ,
final nFanRel=0,
final nFanRet=fanRet.nFan);

Buildings.Templates.Components.Actuators.Damper damRel(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ model ReliefDamper "Modulating relief damper without fan"
final typ=Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection.ReliefDamper,
final typDamRel=damRel.typ,
final typFanRel=Buildings.Templates.Components.Types.Fan.None,
final typFanRet=Buildings.Templates.Components.Types.Fan.None);
final typFanRet=Buildings.Templates.Components.Types.Fan.None,
final nFanRel=0,
final nFanRet=0);

Buildings.Templates.Components.Actuators.Damper damRel(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ model ReliefFan "Relief fan with two-position relief damper"
final typ=Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection.ReliefFan,
final typDamRel=damRel.typ,
final typFanRel=fanRel.typ,
final typFanRet=Buildings.Templates.Components.Types.Fan.None);
final typFanRet=Buildings.Templates.Components.Types.Fan.None,
final nFanRel=fanRel.nFan,
final nFanRet=0);

Buildings.Templates.Components.Actuators.Damper damRel(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ model ReturnFan "Return fan with modulating relief damper"
final typ=Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection.ReturnFan,
final typDamRel=damRel.typ,
final typFanRel=Buildings.Templates.Components.Types.Fan.None,
final typFanRet=fanRet.typ);
final typFanRet=fanRet.typ,
final nFanRel=0,
final nFanRet=fanRet.nFan);

Buildings.Templates.Components.Actuators.Damper damRel(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ partial model PartialAirHandler "Interface class for air handler"
inner parameter Buildings.Templates.Components.Types.Fan typFanRel
"Type of relief fan"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanSup
"Number of supply fan"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRet
"Number of return fan"
annotation (Evaluate=true, Dialog(group="Configuration"));
parameter Integer nFanRel
"Number of relief fan"
annotation (Evaluate=true, Dialog(group="Configuration"));

// Design parameters
final parameter Modelica.Units.SI.MassFlowRate mAirSup_flow_nominal=
Expand Down
14 changes: 13 additions & 1 deletion Buildings/Templates/AirHandlersFans/VAVMultiZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ model VAVMultiZone "Multiple-zone VAV"
then fanSupBlo.typ else Buildings.Templates.Components.Types.Fan.None,
final typFanRel=secOutRel.typFanRel,
final typFanRet=secOutRel.typFanRet,
final nFanSup=if
fanSupDra.typ <> Buildings.Templates.Components.Types.Fan.None then
fanSupDra.nFan elseif fanSupBlo.typ <> Buildings.Templates.Components.Types.Fan.None
then fanSupBlo.nFan else 0,
final nFanRel=secOutRel.nFanRel,
final nFanRet=secOutRel.nFanRet,
final mChiWat_flow_nominal=if coiCoo.have_sou then dat.coiCoo.mWat_flow_nominal else 0,
final mHeaWat_flow_nominal=(if coiHeaPre.have_sou then dat.coiHeaPre.mWat_flow_nominal else 0) +
(if coiHeaReh.have_sou then dat.coiHeaReh.mWat_flow_nominal else 0),
Expand Down Expand Up @@ -330,7 +336,13 @@ model VAVMultiZone "Multiple-zone VAV"
constrainedby
Buildings.Templates.AirHandlersFans.Components.Interfaces.PartialControllerVAVMultizone(
final dat=dat.ctl,
final nZon=nZon)
final nZon=nZon,
final typFanSup=typFanSup,
final typFanRel=typFanRel,
final typFanRet=typFanRet,
final nFanSup=nFanSup,
final nFanRel=nFanRel,
final nFanRet=nFanRet)
"Control selections"
annotation (
Dialog(group="Controls"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class AllSystems "Top-level (whole building) system parameters"
damRel(dp_nominal=15),
damRet(dp_nominal=15),
mOutMin_flow_nominal=0.2,
fanSup(m_flow_nominal=1, dp_nominal=500),
fanRel(m_flow_nominal=1, dp_nominal=200),
fanRet(m_flow_nominal=1, dp_nominal=200),
fanSup(m_flow_nominal=1, dp_nominal=500, nFan=VAV_1.nFanSup),
fanRel(m_flow_nominal=1, dp_nominal=200, nFan=VAV_1.nFanRel),
fanRet(m_flow_nominal=1, dp_nominal=200, nFan=VAV_1.nFanRet),
coiHeaPre(
cap_nominal=1e4,
dpAir_nominal=100,
Expand Down
4 changes: 2 additions & 2 deletions Buildings/Templates/Components/Actuators/Damper.mo
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ model Damper "Multiple-configuration damper"
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-40,40})));
Controls.OBC.CDL.Reals.LessThreshold y0_actual(t=0.01, h=0.5E-2)
Buildings.Controls.OBC.CDL.Reals.LessThreshold y0_actual(t=0.01, h=0.5E-2)
if typ == Buildings.Templates.Components.Types.Damper.TwoPosition
"Closed end switch status" annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
rotation=-90,
origin={40,40})));
Controls.OBC.CDL.Reals.GreaterThreshold y1_actual(t=0.99, h=0.5E-2)
Buildings.Controls.OBC.CDL.Reals.GreaterThreshold y1_actual(t=0.99, h=0.5E-2)
if typ == Buildings.Templates.Components.Types.Damper.TwoPosition
"Open end switch status" annotation (Placement(transformation(
extent={{10,-10},{-10,10}},
Expand Down
Loading