diff --git a/.travis.yml b/.travis.yml index 6dfc060da2d..f3dac3db1ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -96,9 +96,9 @@ env: # - 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.AirHandlers\"" + # - TEST_ARG="make test-dymola PACKAGE=\"Buildings.Templates.AirHandlers\"" # - TEST_ARG="make test-optimica PACKAGE=\"Buildings.Templates.AirHandlers\"" - - TEST_ARG="make test-templates-optimica"" + - TEST_ARG="make test-templates-optimica" before_install: - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin diff --git a/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWater.mos b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWater.mos new file mode 100644 index 00000000000..a1410ac1175 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWater.mos @@ -0,0 +1,21 @@ +simulateModel("Buildings.Templates.Components.Validation.BoilerHotWater", + method="cvode", + tolerance=1e-6, + stopTime=2000.0, + resultFile="BoilerHotWater"); +createPlot(id=1, + position={19, 10, 474, 390}, + y={"THeaWatRet.y", "THeaWatSupSet.y", "boiTab.bus.THeaWatSup", "boiPol.bus.THeaWatSup"}, + subPlot=1, + autoscale=true, + grid=true); +createPlot(id=1, + y={"boiTab.boi.Q_flow_nominal", "boiPol.boi.Q_flow_nominal", "boiTab.boi.QWat_flow", "boiPol.boi.QWat_flow"}, + subPlot=2, + autoscale=true, + grid=true); +createPlot(id=1, + y={"boiTab.boi.m_flow_nominal", "boiPol.boi.m_flow_nominal", "boiTab.boi.m_flow", "boiPol.boi.m_flow"}, + subPlot=3, + autoscale=true, + grid=true); \ No newline at end of file diff --git a/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWaterRecord.mos b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWaterRecord.mos new file mode 100644 index 00000000000..cfc651598b8 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/BoilerHotWaterRecord.mos @@ -0,0 +1,16 @@ +simulateModel("Buildings.Templates.Components.Validation.BoilerHotWaterRecord", + method="cvode", + tolerance=1e-6, + stopTime=2000.0, + resultFile="BoilerHotWaterRecord"); +createPlot(id=1, + position={19, 10, 474, 390}, + y={"per.Q_flow_nominal", "datBoiTab.per.Q_flow_nominal", "datBoiTabRed.per.Q_flow_nominal", "datBoiTabLoc.per.Q_flow_nominal"}, + subPlot=1, + autoscale=true, + grid=true); +createPlot(id=1, + y={"per.effCur[4, 11]", "datBoiTab.per.effCur[4, 11]", "datBoiTabRed.per.effCur[4, 11]", "datBoiTabLoc.per.effCur[4, 11]"}, + subPlot=2, + autoscale=true, + grid=true); diff --git a/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/PumpMultipleRecord.mos b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/PumpMultipleRecord.mos new file mode 100644 index 00000000000..57309173814 --- /dev/null +++ b/Buildings/Resources/Scripts/Dymola/Templates/Components/Validation/PumpMultipleRecord.mos @@ -0,0 +1,31 @@ +simulateModel("Buildings.Templates.Components.Validation.PumpMultipleRecord", + method="cvode", + tolerance=1e-6, + stopTime=2000.0, + resultFile="PumpMultipleRecord"); +createPlot(id=1, + position={19, 10, 476, 550}, + y={"V_flow_nominal[1]", "V_flow_nominal[2]"}, + subPlot=1, + autoscale=true, + grid=true); +createPlot(id=1, + y={"datDef.per[1].pressure.V_flow[2]", "datDef.per[2].pressure.V_flow[2]"}, + subPlot=2, + autoscale=true, + grid=true); +createPlot(id=1, + y={"datRed.per[1].pressure.V_flow[2]", "datRed.per[2].pressure.V_flow[2]"}, + subPlot=3, + autoscale=true, + grid=true); +createPlot(id=1, + y={"datAss.per[1].pressure.V_flow[2]", "datAss.per[2].pressure.V_flow[2]"}, + subPlot=4, + autoscale=true, + grid=true); +createPlot(id=1, + y={"datPre.per[1].pressure.V_flow[2]", "datPre.per[2].pressure.V_flow[2]"}, + subPlot=5, + autoscale=true, + grid=true); \ No newline at end of file diff --git a/Buildings/Templates/Components/Boilers/HotWaterPolynomial.mo b/Buildings/Templates/Components/Boilers/HotWaterPolynomial.mo index 644652dae3f..acf553fcfd4 100644 --- a/Buildings/Templates/Components/Boilers/HotWaterPolynomial.mo +++ b/Buildings/Templates/Components/Boilers/HotWaterPolynomial.mo @@ -1,6 +1,6 @@ within Buildings.Templates.Components.Boilers; -model HotWaterPolynomial "Hot water boiler" - extends Buildings.Templates.Components.Interfaces.BoilerHotWater( +model HotWaterPolynomial "Hot water boiler with efficiency described by a polynomial" + extends Buildings.Templates.Components.Interfaces.PartialBoilerHotWater( final typMod=Buildings.Templates.Components.Types.BoilerHotWaterModel.Polynomial, redeclare Buildings.Fluid.Boilers.BoilerPolynomial boi( final Q_flow_nominal = dat.cap_nominal, @@ -11,5 +11,32 @@ model HotWaterPolynomial "Hot water boiler" annotation ( defaultComponentName="boi", Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +
+This is a model for a hot water boiler where the efficiency is computed +based on a polynomial of the firing rate and optionally of the hot water +temperature. +This model is based on + +Buildings.Fluid.Boilers.BoilerPolynomial. +The user may refer to the documentation of + +Buildings.Fluid.Boilers.UsersGuide +for the modeling assumptions. +
++See the documentation of + +Buildings.Templates.Components.Interfaces.BoilerHotWater. +
+", revisions=" ++This is a model for a hot water boiler where the efficiency is computed +based on a lookup table indexed by the firing rate and the inlet temperature. +This model is based on + +Buildings.Fluid.Boilers.BoilerTable. +The user may refer to the documentation of + +Buildings.Fluid.Boilers.UsersGuide +for the modeling assumptions. +
++See the documentation of + +Buildings.Templates.Components.Interfaces.BoilerHotWater. +
++The design parameters and the efficiency table are specified with an instance of + +Buildings.Templates.Components.Data.BoilerHotWater. +The documentation of this record class provides further details on how to +properly parameterize the model. +
+", revisions=" +This record provides the set of sizing and operating parameters for @@ -68,5 +64,35 @@ the classes within Buildings.Templates.Components.Boilers.
+
+When using the boiler model where the efficiency is based on a lookup table
+(typMod=Buildings.Templates.Components.Types.BoilerHotWaterModel.Table
),
+the design values declared at the top-level are propagated by default to the
+performance data record per
under the assumption that the nominal
+conditions from the performance data match the design conditions.
+Redeclaring the parameter per
allows assigning a value to the efficiency curve
+without overwriting the default bindings to the design values for the other parameters.
+This is the recommended approach.
+Alternatively, assigning the parameter per
to a local instance of a
+compatible record allows completely overwriting all the parameters inside per
.
+In this case, the consistency between the design parameters and the values from the
+subrecord per
is checked and a warning is issued if the design capacity or
+HW flow rate (resp. pressure drop) is higher (resp. lower) than the value from the
+performance data record.
+This check is performed within
+
+Buildings.Templates.Components.Interfaces.PartialBoilerHotWater.
+The validation model
+
+Buildings.Templates.Components.Validation.BoilerHotWater
+illustrates the different use cases of this record.
+
This record provides the set of sizing and operating parameters for -the multiple pump model +the multiple-pump model Buildings.Templates.Components.Pumps.Multiple.
-A default pump characteristic is provided, which goes through +A default flow characteristic is provided, which goes through the design operating point and spans over 0 and twice the design flow rate at maximum speed. This default characteristic is based on a least squares polynomial fit of the characteristics from Buildings.Fluid.Movers.Data.Pumps.Wilo. +The user may refer to the documentation of + +Buildings.Fluid.HydronicConfigurations.UsersGuide.ModelParameters +for further details. Note that a default medium density is used to parameterize the pump characteristic. So models that use this record should overwrite this default value with the density of the medium in use, especially in the case of a water/glycol mix.
++In order to modify the default characteristic, one may use either +of the following methods. +
+per
or
+only its component per.pressure
.
+In this case the elements per[i]
may differ one from another.
+This is the recommended approach for unequally sized units
+such as dedicated pumps.per
.
+In this case the elements per[i]
are all equal to the redeclared
+record instance.
+This is the recommended approach for equally sized units
+such as headered pumps.+Those various use cases are illustrated in + +Buildings.Templates.Components.Validation.PumpMultipleRecord. +
")); end PumpMultiple; diff --git a/Buildings/Templates/Components/Data/PumpSingle.mo b/Buildings/Templates/Components/Data/PumpSingle.mo index 1ff6cd4a50d..227ead5b1cf 100644 --- a/Buildings/Templates/Components/Data/PumpSingle.mo +++ b/Buildings/Templates/Components/Data/PumpSingle.mo @@ -9,22 +9,22 @@ record PumpSingle "Record for single pump model" parameter Modelica.Units.SI.MassFlowRate m_flow_nominal( start=1, final min=0) - "Individual pump nominal mass flow rate" - annotation (Dialog(group="Pump")); + "Mass flow rate" + annotation (Dialog(group="Nominal condition", + enable=typ<>Buildings.Templates.Components.Types.Pump.None)); parameter Modelica.Units.SI.PressureDifference dp_nominal( start=0, final min=0) "Total pressure rise" - annotation (Dialog(group="Pump", + annotation (Dialog(group="Nominal condition", enable=typ<>Buildings.Templates.Components.Types.Pump.None)); - replaceable parameter Fluid.Movers.Data.Generic per - constrainedby Buildings.Fluid.Movers.Data.Generic( - pressure( - V_flow={0, 1, 2} * m_flow_nominal / rho_default, - dp={1.14, 1, 0.42} * dp_nominal)) + replaceable parameter Fluid.Movers.Data.Generic per( + pressure( + V_flow={0, 1, 2} * m_flow_nominal / rho_default, + dp={1.14, 1, 0.42} * dp_nominal)) + constrainedby Buildings.Fluid.Movers.Data.Generic "Performance data" - annotation(Dialog(group="Pump", - enable=typ<>Buildings.Templates.Components.Types.Pump.None)); + annotation(Dialog(enable=typ<>Buildings.Templates.Components.Types.Pump.None)); parameter Modelica.Units.SI.Density rho_default= Modelica.Media.Water.ConstantPropertyLiquidWater.d_const @@ -40,17 +40,11 @@ the single pump model Buildings.Templates.Components.Pumps.Single.-A default pump characteristic is provided, which goes through -the design operating point and spans over -0 and twice the design flow rate at maximum speed. -This default characteristic is based on a least squares -polynomial fit of the characteristics from - -Buildings.Fluid.Movers.Data.Pumps.Wilo. -Note that a default medium density is used to parameterize -the pump characteristic. So models that use this record should -overwrite this default value with the density of the medium -in use, especially in the case of a water/glycol mix. +A default flow characteristic is provided and can be overwritten as +described in the documentation of + +Buildings.Templates.Components.Data.PumpMultiple +in the more generic case of multiple units.