Skip to content

Commit

Permalink
Fix unit errors in ReferenceAir.MoistAir
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Apr 6, 2023
1 parent 64b1f57 commit 3bcda8c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Modelica/Media/package.mo
Expand Up @@ -2698,16 +2698,24 @@ points, e.g., when an isentropic reference state is computed.
Real der_T;
protected
constant SI.Time unitTime=1;
parameter SI.AbsolutePressure p01 = 1.e5 "state1.p at time 0";
parameter Real pRate1(unit = "Pa/s") = 1.e5 "state1.p rate of change";
parameter SI.Temperature T01 = 300 "state1.T at time 0";
parameter SI.TemperatureSlope Trate1 = 10 "state1.T rate of change";
parameter SI.AbsolutePressure p02 = 1.e5 "state2.p at time 0";
parameter Real pRate2(unit = "Pa/s") = 1.e5/2 "state2.p rate of change";
parameter SI.Temperature T02 = 340 "state2.T at time 0";
parameter SI.TemperatureSlope Trate2 = -20 "state2.T rate of change";
equation
der(medium.p) = 0.0;
der(medium.T) = 90;
medium.X[Medium.Air] = 0.95;
m_flow_ext = time - 0.5;
state1.p = 1.e5*(1 + time);
state1.T = 300 + 10*time;
state1.p = p01 + pRate1*time;
state1.T = T01 + Trate1*time;
state1.X = {time,1 - time}/unitTime;
state2.p = 1.e5*(1 + time/2);
state2.T = 340 - 20*time;
state2.p = p02 + pRate2*time;
state2.T = T02 + Trate2*time;
state2.X = {0.5*time,1 - 0.5*time}/unitTime;
smoothState = Medium.setSmoothState(
m_flow_ext,
Expand Down

0 comments on commit 3bcda8c

Please sign in to comment.