This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4771.
Test example:
model MoistAirEntropy "Tests MoistAir.setState_psX()" replaceable package Medium = Modelica.Media.Air.MoistAir; Medium.AbsolutePressure p=pressureSawTooth.y;//Medium.p_default; Medium.Temperature T=temperatureSawTooth.y;//Medium.T_default; Medium.MassFraction Xi[:]={massFractionSawTooth.y};// Medium.X_default[1:Medium.nXi]; Medium.MassFraction X[:] = {Xi[1], 1-Xi[1]}; // Medium.X_default; Medium.SpecificEntropy s1 = Medium.specificEntropy_pTX(p,T,Xi); Medium.SpecificEntropy s2 = Medium.specificEntropy_pTX(p,T,X); Boolean check1 = abs(s1-s2) < Modelica.Constants.eps; // Check passed Medium.ThermodynamicState state1 = Medium.setState_psX(p,s1,Xi); // This requires modification Medium.ThermodynamicState state2 = Medium.setState_psX(p,s1,X); Medium.Temperature T1 = Medium.temperature(state1); Medium.Temperature T2 = Medium.temperature(state2); Boolean check2 = abs(T1-T) < 1e-12; // Check passed Boolean check3 = abs(T2-T) < 1e-12; // Check passed Modelica.Blocks.Sources.SawTooth pressureSawTooth( amplitude=2e5, period=0.5, offset=0.5e5, startTime=0.1) annotation (Placement(transformation(extent={{-80,42},{-60,62}}))); Modelica.Blocks.Sources.SawTooth temperatureSawTooth( amplitude=200, period=0.5, offset=273.15, startTime=0.2) annotation (Placement(transformation(extent={{-80,0},{-60,20}}))); Modelica.Blocks.Sources.SawTooth massFractionSawTooth( amplitude=0.5, period=0.5, offset=0, startTime=0.3) annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); end MoistAirEntropy;