Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unit errors in ReferenceAir.MoistAir #4116

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Modelica/Media/package.mo
Original file line number Diff line number Diff line change
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