Skip to content

Commit

Permalink
Add explicit conversion rules
Browse files Browse the repository at this point in the history
* Add explicit conversion rules for Modelica.Media.Interfaces.PartialCondensingGases.gasConstant and Modelica.Media.Interfaces.PartialRealCondensingGases.gasConstant
* Add conversion test medium packages

As reported by https://trac.openmodelica.org/OpenModelica/ticket/5297#comment:13
  • Loading branch information
beutlich committed Sep 25, 2021
1 parent f095aa0 commit bbb75a5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1948,3 +1948,7 @@ convertElement("Modelica.Media.Interfaces.PartialSimpleMedium.BaseProperties", "
convertElement("Modelica.Media.Interfaces.PartialTwoPhaseMedium.BaseProperties", "R", "R_s")
convertElement("Modelica.Media.R134a.R134a_ph.BaseProperties", "R", "R_s")
convertElement("Modelica.Media.Water.WaterIF97_base.BaseProperties", "R", "R_s")

// Reported by https://trac.openmodelica.org/OpenModelica/ticket/5297#comment:13
convertElement("Modelica.Media.Interfaces.PartialCondensingGases.gasConstant", "R", "R_s");
convertElement("Modelica.Media.Interfaces.PartialRealCondensingGases.gasConstant", "R", "R_s");
40 changes: 40 additions & 0 deletions ModelicaTestConversion4.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2837,6 +2837,46 @@ Conversion test for <a href=\"https://github.com/modelica/ModelicaStandardLibrar
</p>
</html>"));
end Issue3205;

package Issue3767_PartialCondensingGases
extends Modelica.Media.Interfaces.PartialCondensingGases(
mediumName="Test",
substanceNames={"water", "air"});

redeclare function setState_pTX
extends Modelica.Media.Air.MoistAir.setState_pTX;
end setState_pTX;

redeclare function extends gasConstant "Gas constant"
algorithm
R := 23;
end gasConstant;
annotation(Documentation(info="<html>
<p>
Conversion test for <a href=\"https://github.com/modelica/ModelicaStandardLibrary/issues/3767\">#3767</a>.
</p>
</html>"));
end Issue3767_PartialCondensingGases;

package Issue3767_PartialRealCondensingGases
extends Modelica.Media.Interfaces.PartialRealCondensingGases(
mediumName="Test",
substanceNames={"water", "air"});

redeclare function setState_pTX
extends Modelica.Media.Air.MoistAir.setState_pTX;
end setState_pTX;

redeclare function extends gasConstant "Gas constant"
algorithm
R := 23;
end gasConstant;
annotation(Documentation(info="<html>
<p>
Conversion test for <a href=\"https://github.com/modelica/ModelicaStandardLibrary/issues/3767\">#3767</a>.
</p>
</html>"));
end Issue3767_PartialRealCondensingGases;
end Media;

package Thermal
Expand Down

0 comments on commit bbb75a5

Please sign in to comment.