diff --git a/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirEntropy.mo b/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirEntropy.mo new file mode 100644 index 00000000..2afb2572 --- /dev/null +++ b/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirEntropy.mo @@ -0,0 +1,32 @@ +within ThermofluidStream.Media.Tests.MoistAirDiscussion; +model MoistAirEntropy "Find PsiXmax concerning entropy, found that entropy is continous and therefor not as critical as kappa" + extends Modelica.Icons.Example; + package Medium = ThermofluidStream.Media.myMedia.Air.MoistAir + "Medium model"; + + Medium.ThermodynamicState state; + //SI.SpecificEntropy s2 = Medium.specificEntropy_pTX(state.p,state.T,state.X); + SI.SpecificEntropy s1 = Medium.specificEntropy(state); + Real XSaturation "Saturation of state3"; + parameter SI.Pressure p0 = 1e5; + parameter SI.Temperature T0 = 273.15+20; + parameter SI.TemperatureDifference dT = 20; + parameter Real x0 = Medium.xsaturation_pT(p0,T0); + parameter SI.MassFraction X0 = x0/(1+x0); + parameter SI.MassFraction dX0 = X0; + parameter SI.AngularFrequency omega0 = 10; + Real phi; +protected + constant SI.Time unitTime=1; +equation + state.p = p0; + state.T = T0; + state.X = {X0, 1-X0} - {dX0, 1-dX0}*(2*time-1); + XSaturation = Medium.Xsaturation(state); + phi = Medium.relativeHumidity(state); + annotation (experiment(StopTime=1.0, Tolerance=1e-005), Documentation(info=" +
Check specific entropy s
and relative humidity phi
versus time
.
Since there is no kink in specific entropy s
at satuarion (X_sat = X
), i assume, that MoistAir uses the specific entropy of vapor also for condensed water.
+Of course this is wrong, but the error is proportional to the amount of condensed water, and therefor the calculation of specific entropy is not as critial as the calculation of isentropic coefficient kappa, which jumps at saturation.
Check isentropic exponent kappa
, mass fraction of water X0
and mass fraction of water at saturation XSaturation
versus time
.
Pressure and water mass fraction are constant, whereas temperature is changed peridically, and therefor saturation is changed periodically
+For (over)saturated state both Medium.specificEntropy(state), Medium.specificEntropy_pTX(p,T,X) and Medium.isentropicCoefficient will give a warning
")); +end MoistAirEntropyAndIsentropicExponent; diff --git a/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirIsentropicExponent.mo b/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirIsentropicExponent.mo new file mode 100644 index 00000000..d451a389 --- /dev/null +++ b/ThermofluidStream/Media/Tests/MoistAirDiscussion/MoistAirIsentropicExponent.mo @@ -0,0 +1,35 @@ +within ThermofluidStream.Media.Tests.MoistAirDiscussion; +model MoistAirIsentropicExponent "Find PsiXmax concerning kappa (found to be 0.998)" + extends Modelica.Icons.Example; + package Medium = ThermofluidStream.Media.myMedia.Air.MoistAir + "Medium model"; + + Medium.ThermodynamicState state; + //SI.SpecificEntropy s2 = Medium.specificEntropy_pTX(state.p,state.T,state.X); + //SI.SpecificEntropy s1 = Medium.specificEntropy(state); + Real kappa = Medium.isentropicExponent(state); + Real XSaturation "Saturation of state3"; + parameter SI.Pressure p0 = 1e5; + parameter SI.Temperature T0 = 273.15+20; + parameter SI.TemperatureDifference dT = 20; + parameter Real x0 = Medium.xsaturation_pT(p0,T0); + parameter SI.MassFraction X0 = x0/(1+x0); + parameter SI.MassFraction dX0 = 1e-2*X0; + parameter SI.AngularFrequency omega0 = 10; + Real phi; + parameter Real kappa0 = 1.39811; + Real e_kappa_real = (kappa-kappa0)/kappa0; + SI.SpecificEntropy s1 = Medium.specificEntropy(state); +protected + constant SI.Time unitTime=1; +equation + state.p = p0; + state.T = T0; + state.X = {X0, 1-X0} - {dX0, 1-dX0}*time; + XSaturation = Medium.Xsaturation(state); + phi = Medium.relativeHumidity(state); + annotation (experiment(StopTime=1.0, Tolerance=1e-005), Documentation(info=" +Check isentropic exponent kappa
and relative humidity phi
versus time
.
Isentropic exponent kappa
'jumps' at approximatly phi=1
. Therefor the calculation of isentropic exponent kappa
should be limited.
+I suggest a limit of phimax=0.998
, we could of course also choose one that is more on the 'safe side', but phimax
may not be 1!