Skip to content

Commit

Permalink
Merge pull request ibpsa#1941 from ibpsa/patch_Buildings_issue4032_el…
Browse files Browse the repository at this point in the history
…ectricalResistance

Changed guard against division by zero in electrical resistance
  • Loading branch information
LauraMaier authored Nov 5, 2024
2 parents 1b514c2 + be3dbd1 commit 65029b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions IBPSA/Electrical/DC/Loads/Resistor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model Resistor "Ideal linear electrical resistor"
redeclare package PhaseSystem = PhaseSystems.TwoConductor,
redeclare Interfaces.Terminal_n terminal,
final mode=IBPSA.Electrical.Types.Load.FixedZ_steady_state,
final P_nominal=V_nominal^2/max(R, Modelica.Constants.small));
final P_nominal=V_nominal^2/max(R, sqrt(Modelica.Constants.small)));
extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref);
parameter Modelica.Units.SI.Resistance R(start=1)
"Resistance at temperature T_ref";
Expand Down Expand Up @@ -44,12 +44,17 @@ The temperature <i>T</i> is the temperature of the heat port if <code>useHeatPor
</html>",
revisions="<html>
<ul>
<li>November 2, 2024, by Michael Wetter:<br/>
Changed guarding against division by zero.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4032\">Buildings #4032</a>.
</li>
<li>November 3, 2015, by Michael Wetter:<br/>
Set default value for <code>P_nominal</code> to avoid an error when translating
the model in Dymola's pedantic mode.
</li>
<li>May 14, 2015, by Marco Bonvini:<br/>
Changed parent class to <a href=\"modelica://Buildings.Electrical.Interfaces.ResistiveLoad\">
Changed parent class to <a href=\"modelica://IBPSA.Electrical.Interfaces.ResistiveLoad\">
IBPSA.Electrical.Interfaces.ResistiveLoad</a> in order
to help openmodelica parsing the model. This fixes issue
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/415\">#415</a>.
Expand Down

0 comments on commit 65029b0

Please sign in to comment.