Skip to content

Commit

Permalink
Templates • Refactor multiple-unit components with flow rate multipli…
Browse files Browse the repository at this point in the history
…er (#3537)

* Refactor fan array

* Refactor fan array, move block out of DHC

* Change unnecessary inner/outer into bindings

---------

Co-authored-by: Michael Wetter <[email protected]>
  • Loading branch information
AntoineGautier and mwetter authored Nov 19, 2023
1 parent c3542e0 commit 34e00a1
Show file tree
Hide file tree
Showing 51 changed files with 480 additions and 365 deletions.
139 changes: 70 additions & 69 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,75 +40,76 @@ env:
- MODELICA_JSON_HOME=${TRAVIS_BUILD_DIR}/modelica-json

jobs:
- TEST_ARG="make test-cdl-conformance"
- TEST_ARG="make test-energyplus-validations test-dymola-spawn-spaces test-openmodelica-spawn-spaces test-openmodelica-cdl" #target test-optimica-spawn-fmu removed as it requires a local installation of OCT
- TEST_ARG="make test-bestest"
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Air,Examples}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Air,Examples}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Air,Examples}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Applications\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Applications\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Applications\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\" SINGLEPROC=\"true\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.FixedResistances\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.FixedResistances\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.FixedResistances\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Electrical\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Electrical\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Electrical\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.HeatTransfer\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.HeatTransfer\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.HeatTransfer\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Utilities\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Utilities\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Utilities\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-optimica PACKAGE=\"Buildings.Templates\""
# - TEST_ARG="make test-cdl-conformance"
# - TEST_ARG="make test-energyplus-validations test-dymola-spawn-spaces test-openmodelica-spawn-spaces test-openmodelica-cdl" #target test-optimica-spawn-fmu removed as it requires a local installation of OCT
# - TEST_ARG="make test-bestest"
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Air,Examples}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Air,Examples}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Air,Examples}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.EnergyPlus_9_6_0\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.{BaseClasses,Constructions,Examples}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.BESTEST\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.Validation.{Initialization,LBNL_71T,TestConditionalConstructions}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.Detailed.FLEXLAB\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.ThermalZones.{ISO13790,ReducedOrder}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Applications\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Applications\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Applications\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.{EnergyTransferStations,Loads,Networks,Plants}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\" SINGLEPROC=\"true\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.Examples.Combined\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Experimental.DHC.Examples.{Cooling,Steam}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Actuators,BaseClasses,Boilers,Chillers,CHPs,Delays}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Examples,FMI}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.FixedResistances\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.FixedResistances\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.FixedResistances\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{Geothermal,HeatExchangers,HeatPumps,Humidifiers,HydronicConfigurations,Interfaces}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Fluid.{MassExchangers,MixingVolumes,Movers,Sensors,SolarCollectors,Sources,Storage,Utilities}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Electrical\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Electrical\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Electrical\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Airflow,BoundaryConditions,Controls}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.HeatTransfer\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.HeatTransfer\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.HeatTransfer\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.{Obsolete,Occupants,Media}\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Utilities\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Utilities\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Utilities\""
# - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Templates\""
# - TEST_ARG="make test-openmodelica PACKAGE=\"Buildings.Templates\""
# - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Templates\""
- TEST_ARG="make test-dymola PACKAGE=\"Buildings.Experimental.DHC.Plants.Combined\""

before_install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
Expand Down
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
Loading

0 comments on commit 34e00a1

Please sign in to comment.