Skip to content

Commit

Permalink
Move hysteresis from base class to derived classes
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGautier committed Feb 26, 2025
1 parent e6de2f3 commit 38c5a91
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
18 changes: 18 additions & 0 deletions IBPSA/Fluid/Chillers/ModularReversible/Modular.mo
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ model Modular
extent={{-10,-10},{10,10}},
rotation=0,
origin={70,50})));
Modelica.Blocks.Logical.Hysteresis hys(
final uLow=0.001,
final uHigh=ySet_small,
final pre_y_start=false) "Use default ySet value" annotation (Placement(
transformation(extent={{10,10},{-10,-10}}, rotation=180,
origin={-110,-90})));
equation
connect(conCoo.y, sigBus.coo)
annotation (Line(points={{-99,-130},{-76,-130},{-76,-40},{-138,-40},{-138,-42},
Expand All @@ -102,11 +108,23 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(hys.y, sigBus.onOffMea) annotation (Line(points={{-99,-90},{-88,-90},
{-88,-70},{-128,-70},{-128,-40},{-134,-40},{-134,-41},{-141,-41}},
color={255,0,255}));
connect(hys.u, sigBus.yMea) annotation (Line(points={{-122,-90},{-132,-90},{
-132,-40},{-136,-40},{-136,-41},{-141,-41}},
color={0,0,127}));
annotation (Icon(coordinateSystem(extent={{-100,-100},{100,100}})),
Diagram(coordinateSystem(extent={{-140,-160},{140,160}})),
Documentation(revisions="<html>
<ul>
<li>
February 25, 2025, by Antoine Gautier:<br/>
Added hysteresis that was removed from base class.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1977\">IBPSA #1977</a>.
</li>
<li>
May 2, 2024, by Michael Wetter:<br/>
Refactored check for device identifiers.<br/>
This is for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1576\">IBPSA, #1576</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,6 @@ partial model PartialReversibleRefrigerantMachine
extent={{-10,10},{10,-10}},
rotation=0)));

Modelica.Blocks.Logical.Hysteresis hys(
final uLow=0.001,
final uHigh=ySet_small,
final pre_y_start=false) "Use default ySet value" annotation (Placement(
transformation(extent={{10,10},{-10,-10}}, rotation=180,
origin={-110,-90})));

RefrigerantCycleInertia refCycIneCon "Inertia model for condenser side"
annotation(Placement(transformation(
extent={{-10,-10},{10,10}},
Expand Down Expand Up @@ -491,9 +484,6 @@ equation
string="%second",
index=1,
extent={{6,3},{6,3}}));
connect(hys.y, sigBus.onOffMea) annotation (Line(points={{-99,-90},{-88,-90},{
-88,-70},{-128,-70},{-128,-40},{-134,-40},{-134,-41},{-141,-41}},
color={255,0,255}));
connect(TConAmb, sigBus.TConAmbMea) annotation (Line(
points={{-152,120},{-128,120},{-128,50},{-76,50},{-76,-42},{-78,-42},{-78,
-41},{-141,-41}},
Expand All @@ -503,9 +493,6 @@ equation
points={{-152,-130},{-130,-130},{-130,-110},{-76,-110},{-76,-41},{-141,-41}},
color={0,0,127},
pattern=LinePattern.Dash));
connect(hys.u, sigBus.yMea) annotation (Line(points={{-122,-90},{-132,-90},{-132,
-40},{-136,-40},{-136,-41},{-141,-41}},
color={0,0,127}));
connect(con.T, sigBus.TConOutMea) annotation (Line(points={{22.4,90},{38,90},{
38,32},{-76,32},{-76,-40},{-140,-40},{-140,-41},{-141,-41}},
color={0,0,127}));
Expand Down Expand Up @@ -691,6 +678,12 @@ equation
fillPattern=FillPattern.Solid)}),
Diagram(coordinateSystem(extent={{-140,-160},{140,160}})),
Documentation(revisions="<html><ul>
<li>
February 25, 2025, by Antoine Gautier:<br/>
Removed hysteresis.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1977\">IBPSA #1977</a>.
</li>
<li>
<i>August 19, 2024</i> by Michael Wetter:<br/>
Changed markup commands for code merge.<br/>
Expand Down
21 changes: 19 additions & 2 deletions IBPSA/Fluid/HeatPumps/ModularReversible/Modular.mo
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ model Modular
"=true for heating, =false for cooling"
annotation (Placement(transformation(extent={{-164,-82},{-140,-58}}),
iconTransformation(extent={{-120,-30},{-102,-12}})));
Modelica.Blocks.Logical.Hysteresis hys(
final uLow=0.001,
final uHigh=ySet_small,
final pre_y_start=false) "Use default ySet value" annotation (Placement(
transformation(extent={{10,10},{-10,-10}}, rotation=180,
origin={-110,-90})));
equation
connect(conHea.y, sigBus.hea)
annotation (Line(points={{-99,-130},{-76,-130},{-76,-40},{-140,-40},{-140,-41},
Expand All @@ -90,16 +96,27 @@ equation
index=1,
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));
connect(hys.y, sigBus.onOffMea) annotation (Line(points={{-99,-90},{-88,-90},
{-88,-70},{-128,-70},{-128,-40},{-134,-40},{-134,-41},{-141,-41}},
color={255,0,255}));
connect(hys.u, sigBus.yMea) annotation (Line(points={{-122,-90},{-132,-90},{
-132,-40},{-136,-40},{-136,-41},{-141,-41}},
color={0,0,127}));
annotation (Icon(coordinateSystem(extent={{-100,-100},{100,100}}), graphics={
Text(
extent={{-100,-12},{-72,-30}},
textColor={255,85,255},
visible=not use_busConOnl and use_rev,
textString="hea")}),
Diagram(coordinateSystem(extent={{-140,-160},{140,160}})),
Documentation(revisions="
<html>
Documentation(revisions="<html>
<ul>
<li>
February 25, 2025, by Antoine Gautier:<br/>
Added hysteresis that was removed from base class.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1977\">IBPSA #1977</a>.
</li>
<li>
May 2, 2024, by Michael Wetter:<br/>
Refactored check for device identifiers.<br/>
Expand Down

0 comments on commit 38c5a91

Please sign in to comment.