From c91300bfc7ef3dd9f84b61c214dc2d7de77a0901 Mon Sep 17 00:00:00 2001 From: Henrik Tidefelt Date: Thu, 6 Apr 2023 08:29:07 +0200 Subject: [PATCH] Fix unit error in IdealGasH2O --- Modelica/Media/package.mo | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Modelica/Media/package.mo b/Modelica/Media/package.mo index c6ac41c801..67bb65c296 100644 --- a/Modelica/Media/package.mo +++ b/Modelica/Media/package.mo @@ -2217,12 +2217,21 @@ package Examples Real m_flow_ext; Real der_p; Real der_T; + protected + parameter SI.AbsolutePressure p01 = 100000.0 "state.p at time 0"; + parameter Real pRate1(unit = "Pa/s") = 0 "state.p rate of change"; + parameter SI.Temperature T01 = 200 "state.T at time 0"; + parameter SI.TemperatureSlope Trate1 = 1000 "state.T rate of change"; + parameter SI.AbsolutePressure p02 = 2.0e5 "state2.p at time 0"; + parameter Real pRate2(unit = "Pa/s") = 0 "state2.p rate of change"; + parameter SI.Temperature T02 = 500 "state2.T at time 0"; + parameter SI.TemperatureSlope Trate2 = 0 "state2.T rate of change"; equation - state.p = 100000.0; - state.T = 200 + 1000*time; - state2.p = 2.0e5; - state2.T = 500.0; + state.p = p01 + pRate1*time; + state.T = T01 + Trate1*time; + state2.p = p02 + pRate2*time; + state2.T = T02 + Trate2*time; // s2 = s; // Smooth state