Skip to content

Commit

Permalink
Batch pr maint 9.1.x (#3768)
Browse files Browse the repository at this point in the history
* Corrected wrong parameter assignment in ChillerDXHeatingEconomizer (maint_9.1.x)

This corrects the wrong dimension, which OMEdit detects and triggers a warning

* Adjust hysteresis for heating

* Refactored implementation to avoid infinite event iteration in OpenModelica

For #3754

* Corrected assertion for operating mode (main 9.1.x)

For #3664

* Corrected assertion for operating mode

For #3664

* Refactored implementation to avoid infinite event iteration in OpenModelica

---------

Co-authored-by: David Blum <[email protected]>
  • Loading branch information
mwetter and dhblum authored Apr 2, 2024
1 parent bfd98bf commit d4eb6be
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 196 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,6 @@ model ControllerChillerDXHeatingEconomizer
annotation (Placement(transformation(extent={{-60,-30},{-40,-10}})));
Buildings.Controls.OBC.CDL.Continuous.Switch swiFan "Switch fan on"
annotation (Placement(transformation(extent={{70,120},{90,140}})));
Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysHea(
final uLow=0.01,
final uHigh=0.05)
"Hysteresis for heating"
annotation (Placement(transformation(extent={{-30,120},{-10,140}})));
Buildings.Controls.OBC.CDL.Logical.MultiOr orFan(nin=3)
"Switch fan on if heating, cooling, or occupied"
annotation (Placement(transformation(extent={{40,94},{60,114}})));
Expand All @@ -226,6 +221,9 @@ model ControllerChillerDXHeatingEconomizer
"Chiller on signal based on room temperature"
annotation (Placement(transformation(extent={{20,-80},{40,-60}})));

Controls.OBC.CDL.Continuous.Greater heaOnTRoo(h=0.5)
"Heatin on signal based on room temperature"
annotation (Placement(transformation(extent={{-40,120},{-20,140}})));
protected
Modelica.Blocks.Sources.Constant TSetSupChiConst(
final k=TSupChi_nominal)
Expand Down Expand Up @@ -271,21 +269,17 @@ equation
138},{68,138}}, color={0,0,127}));
connect(swiFan.y, yFan) annotation (Line(points={{92,130},{96,130},{96,90},{
110,90}}, color={0,0,127}));
connect(conSup.yHea, hysHea.u) annotation (Line(points={{-39,86},{-34,86},{
-34,130},{-32,130}}, color={0,0,127}));
connect(swiFan.u2, orFan.y) annotation (Line(points={{68,130},{64,130},{64,104},{62,104}},
color={255,0,255}));
connect(hysHea.y, orFan.u[1]) annotation (Line(points={{-8,130},{24,130},{24,
108.667},{38,108.667}},
color={255,0,255}));
connect(conEco.TMixSet, conCooVal.u_s) annotation (Line(points={{39,78},{-10,
78},{-10,-20},{-2,-20}}, color={0,0,127}));
connect(and1.y, chiOn) annotation (Line(points={{91,-30},{96,-30},{96,-54},{110,
-54}}, color={255,0,255}));
connect(conEco.yCoiSta, and1.u1) annotation (Line(points={{61,62},{64,62},{64,
-30},{68,-30}}, color={255,0,255}));
connect(uOcc, orFan.u[2]) annotation (Line(points={{-120,0},{-14,0},{-14,104},
{38,104}}, color={255,0,255}));
connect(uOcc, orFan.u[1]) annotation (Line(points={{-120,0},{-14,0},{-14,
101.667},{38,101.667}},
color={255,0,255}));
connect(TMix, conEco.TMix) annotation (Line(points={{-120,30},{-26,30},{-26,75},
{39,75}}, color={0,0,127}));
connect(TOut, conEco.TOut) annotation (Line(points={{-120,-40},{-66,-40},{-66,
Expand All @@ -303,8 +297,14 @@ equation
connect(chiOnTRoo.y, conEco.cooSta) annotation (Line(points={{42,-70},{50,-70},
{50,40},{34,40},{34,62},{39,62}}, color={255,0,255}));

connect(chiOnTRoo.y, orFan.u[3]) annotation (Line(points={{42,-70},{50,-70},{
50,40},{34,40},{34,99.3333},{38,99.3333}}, color={255,0,255}));
connect(chiOnTRoo.y, orFan.u[2]) annotation (Line(points={{42,-70},{50,-70},{
50,40},{34,40},{34,104},{38,104}}, color={255,0,255}));
connect(heaOnTRoo.y, orFan.u[3]) annotation (Line(points={{-18,130},{34,130},
{34,106.333},{38,106.333}}, color={255,0,255}));
connect(heaOnTRoo.u2, TRoo) annotation (Line(points={{-42,122},{-86,122},{-86,
-80},{-120,-80}}, color={0,0,127}));
connect(heaOnTRoo.u1, TSetRooHea) annotation (Line(points={{-42,130},{-80,130},
{-80,120},{-120,120}}, color={0,0,127}));
annotation (
defaultComponentName="conChiDXHeaEco",
Icon(graphics={Line(points={{-100,-100},{0,2},{-100,100}}, color=
Expand All @@ -316,6 +316,11 @@ heating coil and a cooling coil.
</html>", revisions="<html>
<ul>
<li>
March 28, 2024, by David Blum:<br/>
Adjust hysteresis based on heating to avoid chatter.
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3735\">issue 3735</a>.
</li>
<li>
November 20, 2020, by David Blum:<br/>
Turn fan on when setup cooling required.
This is for <a href=\"https://github.com/lbl-srg/modelica-buildings/issues/2265\">issue 2265</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
within Buildings.Controls.DemandResponse.BaseClasses;
block BaselinePrediction "Predicts the baseline consumption"
extends Buildings.Controls.DemandResponse.BaseClasses.PartialDemandResponse(nIn=1,
nOut=1);
extends Modelica.Blocks.Icons.DiscreteBlock;

parameter Integer nSam
"Number of intervals in a day for which baseline is computed";

parameter Integer nPre(min=1)
"Number of intervals for which future load need to be predicted (set to one to only predict current time, or to nSam to predict one day)";

parameter Buildings.Controls.Predictors.Types.PredictionModel predictionModel
"Load prediction model";

parameter Integer nHis(min=1) = 10 "Number of history terms to be stored";

Modelica.Blocks.Interfaces.RealInput ECon(unit="J")
"Consumed electrical energy"
annotation (Placement(transformation(extent={{-140,-50},{-100,-10}}),
iconTransformation(extent={{-120,-30},{-100,-10}})));
Modelica.Blocks.Interfaces.RealOutput PPre[nPre](each unit="W")
"Predicted power consumption for the current time interval"
annotation (Placement(transformation(extent={{100,-10},{120,10}}),
iconTransformation(extent={{100,-10},{120,10}})));

Modelica.Blocks.Interfaces.RealInput TOutFut[nPre-1](each unit="K")
if (predictionModel == Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression)
"Future outside air temperatures"
annotation (Placement(
transformation(extent={{-140,-110},{-100,-70}}),
iconTransformation(extent={{-120,-100},{-100,-80}})));

Modelica.Blocks.Interfaces.RealInput TOut(unit="K", displayUnit="degC")
if (predictionModel == Buildings.Controls.Predictors.Types.PredictionModel.WeatherRegression)
"Outside air temperature"
Expand Down Expand Up @@ -41,7 +65,7 @@ equation
color={0,0,127},
smooth=Smooth.None));
connect(basLin.PPre, PPre) annotation (Line(
points={{11,0},{40,0},{40,-80},{110,-80}},
points={{11,0},{110,0}},
color={0,0,127},
smooth=Smooth.None));
connect(stoHis.u, isEventDay) annotation (Line(
Expand Down Expand Up @@ -93,6 +117,12 @@ the current type of day, then the predicted power consumption
</html>", revisions="<html>
<ul>
<li>
March 29, 2024, by Michael Wetter:<br/>
Refactored implementation to avoid an infinite event iteration in OpenModelica.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3754\">#3754</a>.
</li>
<li>
March 20, 2014 by Michael Wetter:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ which is equal to its input signal.
</html>", revisions="<html>
<ul>
<li>
March 29, 2024, by Michael Wetter:<br/>
Due to the refactoring for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3754\">3754</a>,
this model is no longer used. It is left in the library for backward compatibility,
and will be removed for release 11.
</li>
<li>
March 20, 2014 by Michael Wetter:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ used by the blocks that compute the demand reponse client.
revisions="<html>
<ul>
<li>
March 29, 2024, by Michael Wetter:<br/>
Due to the refactoring for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3754\">3754</a>,
this model is no longer used. It is left in the library for backward compatibility,
and will be removed for release 11.
</li>
<li>
March 20, 2014 by Michael Wetter:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ control signal and the consumed electrical power.
</html>", revisions="<html>
<ul>
<li>
March 29, 2024, by Michael Wetter:<br/>
Due to the refactoring for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/3754\">3754</a>,
this model is no longer used. It is left in the library for backward compatibility,
and will be removed for release 11.
</li>
<li>
March 20, 2014 by Michael Wetter:<br/>
First implementation.
</li>
Expand Down
Loading

0 comments on commit d4eb6be

Please sign in to comment.