Skip to content

Commit 5d4a319

Browse files
Merge pull request modelica#4115 from henrikt-ma/examples-moistair-unit-error
Fix unit errors in Examples.MoistAir
2 parents f586b42 + 6e81a36 commit 5d4a319

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

Modelica/Media/package.mo

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,6 +2406,14 @@ is given to compare the approximation.
24062406
Real der_T;
24072407
protected
24082408
constant SI.Time unitTime=1;
2409+
parameter SI.AbsolutePressure p01 = 1.e5 "state1.p at time 0";
2410+
parameter Real pRate1(unit = "Pa/s") = 1.e5 "state1.p rate of change";
2411+
parameter SI.Temperature T01 = 300 "state1.T at time 0";
2412+
parameter SI.TemperatureSlope Trate1 = 10 "state1.T rate of change";
2413+
parameter SI.AbsolutePressure p02 = 1.e5 "state2.p at time 0";
2414+
parameter Real pRate2(unit = "Pa/s") = 1.e5/2 "state2.p rate of change";
2415+
parameter SI.Temperature T02 = 340 "state2.T at time 0";
2416+
parameter SI.TemperatureSlope Trate2 = -20 "state2.T rate of change";
24092417
equation
24102418
der(medium.p) = 0.0;
24112419
der(medium.T) = 90;
@@ -2415,12 +2423,12 @@ is given to compare the approximation.
24152423
// medium.X_liquidWater = if medium.X_sat < medium.X[2] then medium.X[2] - medium.X_sat else 0.0;
24162424

24172425
// Smooth state
2418-
m_flow_ext = time - 0.5;
2419-
state1.p = 1.e5*(1 + time);
2420-
state1.T = 300 + 10*time;
2426+
m_flow_ext = time/unitTime - 0.5;
2427+
state1.p = p01 + pRate1*time;
2428+
state1.T = T01 + Trate1*time;
24212429
state1.X = {time,1 - time}/unitTime;
2422-
state2.p = 1.e5*(1 + time/2);
2423-
state2.T = 340 - 20*time;
2430+
state2.p = p02 + pRate2*time;
2431+
state2.T = T02 + Trate2*time;
24242432
state2.X = {0.5*time,1 - 0.5*time}/unitTime;
24252433
smoothState = Medium.setSmoothState(
24262434
m_flow_ext,

0 commit comments

Comments
 (0)