Skip to content

Commit 2518ca1

Browse files
Merge pull request #4114 from henrikt-ma/testonly-moistair-unit-error
Fix unit error in TestOnly.MoistAir, R134a_setState_pTX and WaterIF97_dewEnthalpy
2 parents 5d4a319 + bce24db commit 2518ca1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ModelicaTest/Media.mo

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,9 @@ is given to compare the approximation.
922922
extends Modelica.Icons.Example;
923923
package Medium = Modelica.Media.Air.MoistAir "Medium model";
924924
SI.Temperature T = 273.15 + 100;
925-
SI.AbsolutePressure p = 2e5 - 1.5e5*time;
925+
parameter SI.AbsolutePressure p0 = 2e5 "p at time 0";
926+
parameter Real pRate(unit = "Pa/s") = -1.5e5 "p's rate of change";
927+
SI.AbsolutePressure p = p0 + pRate*time;
926928
Medium.MassFraction X[Medium.nX] = {0.05,0.95};
927929
Medium.ThermodynamicState state = Medium.setState_pTX(p,T,X);
928930
SI.SpecificEntropy s = Medium.specificEntropy(state);
@@ -936,7 +938,9 @@ is given to compare the approximation.
936938
extends Modelica.Icons.Example;
937939
replaceable package Medium = Modelica.Media.R134a.R134a_ph "Medium model";
938940
SI.Temperature T = 273.15 + 25;
939-
SI.AbsolutePressure p = 10e5 + 20e5*time;
941+
parameter SI.AbsolutePressure p0 = 10e5 "p at time 0";
942+
parameter Real pRate(unit = "Pa/s") = 20e5 "p's rate of change";
943+
SI.AbsolutePressure p = p0 + pRate*time;
940944
Medium.ThermodynamicState state = Medium.setState_pTX(p, T);
941945
SI.SpecificEnthalpy h = Medium.specificEnthalpy(state);
942946
SI.Density rho = Medium.density(state);
@@ -950,7 +954,9 @@ is given to compare the approximation.
950954
extends Modelica.Icons.Example;
951955
replaceable package Medium = Modelica.Media.Water.WaterIF97_fixedregion "Medium model";
952956
SI.Temperature T = 273.15 + 25;
953-
SI.AbsolutePressure p = 10e5 + 20e5*time;
957+
parameter SI.AbsolutePressure p0 = 10e5 "p at time 0";
958+
parameter Real pRate(unit = "Pa/s") = 20e5 "p's rate of change";
959+
SI.AbsolutePressure p = p0 + pRate*time;
954960
Medium.ThermodynamicState state = Medium.setState_pTX(p, T);
955961
SI.SpecificEnthalpy h_dew = Medium.dewEnthalpy(Medium.SaturationProperties(Tsat=Medium.saturationTemperature(state.p), psat=Medium.pressure(state)));
956962
annotation (experiment(StopTime=1));

0 commit comments

Comments
 (0)