Skip to content

Commit

Permalink
Maint 9.0.x ibpsa sync pump assertion (#3159)
Browse files Browse the repository at this point in the history
* Integrated changes from IBPSASync_pumpAssertion

* Updated version number

* Updated reference results
  • Loading branch information
mwetter authored Nov 22, 2022
1 parent 7f6db28 commit b45c530
Show file tree
Hide file tree
Showing 53 changed files with 686 additions and 250 deletions.
3 changes: 3 additions & 0 deletions Buildings/.copiedFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ Buildings/BoundaryConditions/SolarIrradiation/DirectTiltedSurface.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/DiffuseIsotropic.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/DiffusePerez.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/DirectTiltedSurface.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/GlobalPerezTiltedSurface.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/package.mo
Buildings/BoundaryConditions/SolarIrradiation/Examples/package.order
Buildings/BoundaryConditions/SolarIrradiation/GlobalPerezTiltedSurface.mo
Buildings/BoundaryConditions/SolarIrradiation/package.mo
Buildings/BoundaryConditions/SolarIrradiation/package.order
Buildings/BoundaryConditions/Types.mo
Expand Down Expand Up @@ -1546,6 +1548,7 @@ Buildings/Resources/Scripts/Dymola/BoundaryConditions/SolarIrradiation/BaseClass
Buildings/Resources/Scripts/Dymola/BoundaryConditions/SolarIrradiation/Examples/DiffuseIsotropic.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/SolarIrradiation/Examples/DiffusePerez.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/SolarIrradiation/Examples/DirectTiltedSurface.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/SolarIrradiation/Examples/GlobalPerezTiltedSurface.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/Validation/BESTEST/WD100.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/Validation/BESTEST/WD200.mos
Buildings/Resources/Scripts/Dymola/BoundaryConditions/Validation/BESTEST/WD300.mos
Expand Down
16 changes: 11 additions & 5 deletions Buildings/Applications/BaseClasses/Equipment/FlowMachine_m.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ model FlowMachine_m "Identical m_flow controlled pumps"

Modelica.Blocks.Math.Gain gaiM_flow[num](each final k=m_flow_nominal)
"Gain for mass flow rate"
annotation (Placement(transformation(extent={{-48,30},{-28,50}})));
annotation (Placement(transformation(extent={{-30,30},{-10,50}})));

equation
connect(gaiM_flow.y, pum.m_flow_in)
annotation (Line(points={{-27,40},{0,40},{0,12}}, color={0,0,127}));
connect(gaiM_flow.u, u)
annotation (Line(points={{-50,40},{-120,40},{-120,40}}, color={0,0,127}));
connect(swi.y, gaiM_flow.u)
annotation (Line(points={{-26,-30},{28,-30},{28,54},{-38,54},{-38,40},{-32,40}},
color={0,0,127}));
connect(gaiM_flow.y, pum.m_flow_in) annotation (Line(points={{-9,40},{0,40},{0,
12}}, color={0,0,127}));
annotation ( Documentation(info="<html>
<p>This model implements a parallel of identical pumps with <code>m_flow</code> being controlled.
The number can be specified by setting a value of <code>num</code>.
Expand All @@ -22,6 +24,10 @@ The shutoff valves are used to avoid circulating flow among pumps.
</html>", revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Improved sequence to avoid switching pump on when the valve is commanded off.
</li>
<li>
July 27, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
Expand Down
9 changes: 7 additions & 2 deletions Buildings/Applications/BaseClasses/Equipment/FlowMachine_y.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ model FlowMachine_y "Identical speed controlled flow machines"
rhoStd=Medium.density_pTX(101325, 273.15+4, Medium.X_default));

equation
connect(u, pum.y)
annotation (Line(points={{-120,40},{0,40},{0,12}}, color={0,0,127}));
connect(swi.y, pum.y)
annotation (Line(points={{-26,-30},{-20,-30},{-20,20},{0,20},{0,12}},
color={0,0,127}));
annotation ( Documentation(revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Improved sequence to avoid switching pump on when the valve is commanded off.
</li>
<li>
July 27, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ partial model PartialCoolingCoilHumidifyingHeating "Partial AHU model "
"Valve leakage, l=Kv(y=0)/Kv(y=1)"
annotation(Dialog(group="Valve"));

parameter Boolean use_inputFilterValve=true
parameter Boolean use_inputFilterValve=false
"= true, if opening is filtered with a 2nd order CriticalDamping filter for the water-side valve"
annotation(Dialog(tab="Dynamics", group="Valve"));
parameter Modelica.Units.SI.Time riseTimeValve=120
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ partial model PartialHeatExchanger "Partial model for heat exchangers "
parameter Boolean use_inputFilter=true
"= true, if opening is filtered with a 2nd order CriticalDamping filter"
annotation(Dialog(tab="Dynamics", group="Filtered opening",enable=activate_ThrWayVal));
parameter Modelica.Units.SI.Time riseTime=120
parameter Modelica.Units.SI.Time riseTime=30
"Rise time of the filter (time to reach 99.6 % of an opening step)"
annotation (Dialog(
tab="Dynamics",
Expand Down Expand Up @@ -234,6 +234,10 @@ This module simulates a heat exchanger with a three-way bypass used to modulate
</html>", revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Changed <code>riseTime</code> of valve to be <i>30</i> seconds to make it the same as the rise time of pumps.
</li>
<li>
April 9, 2021, by Kathryn Hinkelman:<br/>
Added <code>dpValve_nominal</code> to avoid redundant declaration of <code>dp2_nominal</code>.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ partial model PartialPumpParallel "Partial model for pump parallel"
// Valve parameters
parameter Real l=0.0001 "Valve leakage, l=Kv(y=0)/Kv(y=1)"
annotation(Dialog(group="Two-way valve"));
parameter Modelica.Units.SI.Time riseTimeValve=120
parameter Modelica.Units.SI.Time riseTimeValve=riseTimePump
"Rise time of the filter (time to become 99.6 % open)" annotation (
Dialog(
tab="Dynamics",
group="Valve",
enable=use_inputFilter));
parameter Real[num] yValve_start = fill(0,num)
"Initial value of pump signals"
parameter Real[num] yValve_start = fill(1,num)
"Initial value of valve signals"
annotation(Dialog(tab="Dynamics", group="Valve",enable=use_inputFilter));

// Dynamics
Expand Down Expand Up @@ -142,11 +142,19 @@ partial model PartialPumpParallel "Partial model for pump parallel"
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys[num](
each final uLow=threshold,
each final uHigh=2*threshold) "Hysteresis for isolation valves"
annotation (Placement(transformation(extent={{-20,50},{0,70}})));
Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea[num]
"Boolean to real conversion for isolation valves"
annotation (Placement(transformation(extent={{20,50},{40,70}})));
annotation (Placement(transformation(extent={{-80,30},{-60,50}})));

Buildings.Controls.OBC.CDL.Continuous.Switch swi[num]
"Switch to enable pump only once the valve is commanded open"
annotation (Placement(transformation(extent={{-48,-40},{-28,-20}})));
protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer[num](
each final k=0) "Outputs 0 as the control signal"
annotation (Placement(transformation(extent={{-90,-70},{-70,-50}})));
protected
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one[num](each final k=
1) "Outputs 1 as the control signal"
annotation (Placement(transformation(extent={{-90,-32},{-70,-12}})));
initial equation
assert(homotopyInitialization, "In " + getInstanceName() +
": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.",
Expand All @@ -164,12 +172,17 @@ equation
connect(pum.P, P)
annotation (Line(points={{11,9},{20,9},{20,40},{110,40}},
color={0,0,127}));
connect(booToRea.y, val.y)
annotation (Line(points={{42,60},{50,60},{50,12}}, color={0,0,127}));
connect(hys.y, booToRea.u)
annotation (Line(points={{2,60},{18,60}}, color={255,0,255}));
connect(hys.u, u) annotation (Line(points={{-22,60},{-62,60},{-62,40},{-120,40}},
connect(hys.u, u) annotation (Line(points={{-82,40},{-120,40}},
color={0,0,127}));
connect(hys.y, swi.u2) annotation (Line(points={{-58,40},{-52,40},{-52,-30},{
-50,-30}}, color={255,0,255}));
connect(zer.y, swi.u3)
annotation (Line(points={{-68,-60},{-60,-60},{-60,-38},{-50,-38}},
color={0,0,127}));
connect(one.y, swi.u1)
annotation (Line(points={{-68,-22},{-50,-22}}, color={0,0,127}));
connect(swi.y, val.y) annotation (Line(points={{-26,-30},{28,-30},{28,20},{50,
20},{50,12}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
extent={{-60,60},{60,40}},
Expand Down Expand Up @@ -241,17 +254,27 @@ equation
rotation=90)}), Documentation(revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Improved sequence to avoid switching pump on when the valve is commanded off.
</li>
<li>
November 15, 2022, by Michael Wetter:<br/>
Set initial state of valve to be open, and changed rise time of valve to be the same as pump.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1659\">IBPSA, issue 1659</a>.
</li>
<li>
March 3, 2022, by Michael Wetter:<br/>
Moved <code>massDynamics</code> to <code>Advanced</code> tab and
added assertion for correct combination of energy and mass dynamics.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1542\">issue 1542</a>.
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1542\">IBPSA, issue 1542</a>.
</li>
<li>
April 14, 2020, by Michael Wetter:<br/>
Changed <code>homotopyInitialization</code> to a constant.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1341\">Buildings, #1341</a>.
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1341\">IBPSA, Buildings, #1341</a>.
</li>
<li>
September 2, 2017, by Michael Wetter:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ record SignalFilterParameters
parameter Boolean use_inputFilter=true
"= true, if opening is filtered with a 2nd order CriticalDamping filter"
annotation(Dialog(tab="Dynamics", group="Filtered opening"));
parameter Modelica.Units.SI.Time riseTimeValve=120
parameter Modelica.Units.SI.Time riseTimeValve=30
"Rise time of the filter (time to reach 99.6 % of an opening step)"
annotation (Dialog(
tab="Dynamics",
Expand All @@ -20,14 +20,21 @@ record SignalFilterParameters
annotation ( Documentation(revisions="<html>
<ul>
<li>
November 15, 2022, by Michael Wetter:<br/>
Change <code>riseTimeValve</code> to 30 seconds so that it is the same as for pumps.
Otherwise, pumps may work against almost closed valves.
</li>
<li>
June 30, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
</ul>
</html>",
info="<html>
<p>
Record that contains essential parameters for the vectored signal filters.
The number of filters is specified by <code>nFilter</code>.
</p>
<p>
Note that all the signal filters have the same on/off control signal, rising time, and initialization type,
which are specified by <code>use_inputFilter, riseTimeValve</code> and <code>initValve</code> respectively.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ model IntegratedPrimarySecondary
k=0.4,
Ti=80,
numChi=numChi,
perPum=perPum,
addPowerToMedium=false,
show_T=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
Expand Down Expand Up @@ -70,6 +71,7 @@ model IntegratedPrimarySecondary
k=0.4,
Ti=80,
numChi=numChi,
perPum=perPum,
addPowerToMedium=false,
show_T=true,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
Expand Down Expand Up @@ -148,6 +150,10 @@ is reset every 1800s.
</html>", revisions="<html>
<ul>
<li>
November 15, 2022, by Michael Wetter:<br/>
Added missing assignment of pump record.
</li>
<li>
May 13, 2021, by Michael Wetter:<br/>
Changed boundary condition model to prescribed pressure rather than prescribed mass flow rate.
Prescribing the mass flow rate caused
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,17 @@ partial model PartialDataCenter
annotation (Placement(transformation(extent={{-180,-100},{-160,-80}})));
Modelica.Blocks.Math.Gain gai1(k=1/dpSetPoi) "Gain effect"
annotation (Placement(transformation(extent={{-200,-70},{-220,-50}})));
Buildings.Controls.OBC.CDL.Continuous.Switch swi[numChi]
"Switch to assign pump signal if plant is on"
annotation (Placement(transformation(extent={{-120,230},{-100,250}})));
Buildings.Controls.OBC.CDL.Logical.Or plaOn "Output true if plant is on"
annotation (Placement(transformation(extent={{-160,230},{-140,250}})));
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer[numChi](each final
k=0) "Outputs zero"
annotation (Placement(transformation(extent={{-220,230},{-200,250}})));
Modelica.Blocks.MathBoolean.Or chiOnSta(nu=numChi)
"Output true if at least one chiller is on"
annotation (Placement(transformation(extent={{-102,122},{-90,134}})));
equation
connect(chiWSE.port_b2, TCHWSup.port_a)
annotation (Line(
Expand Down Expand Up @@ -382,10 +393,6 @@ equation
annotation (Line(
points={{-151,70},{-132,70}},
color={0,0,127}));
connect(gai.y, pumCW.m_flow_in)
annotation (Line(
points={{-109,70},{-68,70},{-68,100},{-62,100}},
color={0,0,127}));
connect(TCWSupSet.y, cooTowSpeCon.TCWSupSet)
annotation (Line(
points={{-239,186},{-172,186}},
Expand Down Expand Up @@ -477,13 +484,13 @@ equation
color={255,127,0}));
connect(ahu.port_a2, roo.airPorts[1])
annotation (Line(
points={{20,-126},{32,-126},{32,-196},{1.525,-196},{1.525,-188.7}},
points={{20,-126},{32,-126},{32,-196},{4.5625,-196},{4.5625,-188.7}},
color={0,127,255},
thickness=0.5));

connect(roo.airPorts[2], TAirSup.port_b)
annotation (Line(
points={{5.575,-188.7},{5.575,-196},{-50,-196},{-50,-160}},
points={{2.5375,-188.7},{2.5375,-196},{-50,-196},{-50,-160}},
color={0,127,255},
thickness=0.5));
connect(roo.TRooAir, ahuFanSpeCon.u_m)
Expand Down Expand Up @@ -523,8 +530,27 @@ equation
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));

connect(chiOnSta.u, chiOn.y) annotation (Line(points={{-102,128},{-106,128},{-106,
140},{-109,140}}, color={255,0,255}));
connect(chiOnSta.y, plaOn.u1) annotation (Line(points={{-89.1,128},{-84,128},
{-84,222},{-174,222},{-174,240},{-162,240}},color={255,0,255}));
connect(wseOn.y, plaOn.u2) annotation (Line(points={{-109,110},{-109,112},{
-82,112},{-82,224},{-168,224},{-168,232},{-162,232}},
color={255,0,255}));
connect(zer.y, swi.u3) annotation (Line(points={{-198,240},{-184,240},{-184,
226},{-130,226},{-130,232},{-122,232}},
color={0,0,127}));
for i in 1:numChi loop
connect(plaOn.y, swi[i].u2)
annotation (Line(points={{-138,240},{-122,240}}, color={255,0,255}));
end for;
connect(swi.y, pumCW.m_flow_in) annotation (Line(points={{-98,240},{-92,240},
{-92,158},{-68,158},{-68,100},{-62,100}},
color={0,0,127}));
connect(gai.y, swi.u1) annotation (Line(points={{-109,70},{-86,70},{-86,226},
{-126,226},{-126,248},{-122,248}},color={0,0,127}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-360,-200},{160,220}})),
extent={{-360,-200},{160,260}})),
Documentation(info="<html>
<p>
This is a partial model that describes the chilled water cooling system in a data center. The sizing data
Expand All @@ -539,6 +565,11 @@ Taylor, S. T. (2014). How to design &amp; control waterside economizers. ASHRAE
</html>", revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Corrected control to avoid cooling tower pumps to operate when plant is off, because
shut-off valves are off when plant is off.
</li>
<li>
November 1, 2021, by Michael Wetter:<br/>
Corrected weather data bus connection which was structurally incorrect
and did not parse in OpenModelica.<br/>
Expand Down Expand Up @@ -568,5 +599,6 @@ July 30, 2017, by Yangyang Fu:<br/>
First implementation.
</li>
</ul>
</html>"));
</html>"),
Icon(coordinateSystem(extent={{-360,-200},{160,260}})));
end PartialDataCenter;
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ equation
thickness=0.5));

annotation (Diagram(coordinateSystem(preserveAspectRatio=false,
extent={{-360,-200},{300,220}})),
extent={{-360,-200},{320,260}})),
__Dymola_Commands(file=
"modelica://Buildings/Resources/Scripts/Dymola/Applications/DataCenters/ChillerCooled/Examples/IntegratedPrimaryLoadSideEconomizer.mos"
"Simulate and plot"),
Expand Down Expand Up @@ -230,6 +230,11 @@ are not implemented in this example.
</html>", revisions="<html>
<ul>
<li>
November 16, 2022, by Michael Wetter:<br/>
Corrected control to avoid cooling tower pumps to operate when plant is off, because
shut-off valves are off when plant is off.
</li>
<li>
November 1, 2021, by Michael Wetter:<br/>
Corrected weather data bus connection which was structurally incorrect
and did not parse in OpenModelica.<br/>
Expand All @@ -249,5 +254,6 @@ First implementation.
experiment(
StartTime=0,
StopTime=86400,
Tolerance=1e-06));
Tolerance=1e-06),
Icon(coordinateSystem(extent={{-100,-100},{100,100}})));
end IntegratedPrimaryLoadSideEconomizer;
Loading

0 comments on commit b45c530

Please sign in to comment.