Skip to content

Fix PartialSimpleIdealGasMedium_setState_psX#4782

Open
RaphaelGebhart wants to merge 1 commit intomodelica:masterfrom
RaphaelGebhart:4749_PartialSimpleIdealGasMedium_setState_psX
Open

Fix PartialSimpleIdealGasMedium_setState_psX#4782
RaphaelGebhart wants to merge 1 commit intomodelica:masterfrom
RaphaelGebhart:4749_PartialSimpleIdealGasMedium_setState_psX

Conversation

@RaphaelGebhart
Copy link
Copy Markdown

Closes #4749 .

Test model:

model PartialSimleIdealGasMediumTest "Checks Modelica.Media.Air.SimpleAir.setState_psX"

  replaceable package Medium = Modelica.Media.Air.SimpleAir;
  Medium.AbsolutePressure p=pressureSawTooth.y;
  Medium.Temperature T=temperatureSawTooth.y;
  Medium.SpecificEntropy s = Modelica.Media.Air.SimpleAir.specificEntropy_pTX(p,T, Medium.X_default);
  Medium.ThermodynamicState state = Medium.setState_psX(p,s); // This requires modification
  Medium.Temperature T1 = Medium.temperature_ps(p,s);

  Boolean check = abs(T-T1) < Modelica.Constants.eps; // Check passed

  Modelica.Blocks.Sources.SawTooth pressureSawTooth(
    amplitude=2e5,
    period=0.5,
    offset=0.5e5,
    startTime=0.1) annotation (Placement(transformation(extent={{-10,12},{10,32}})));
  Modelica.Blocks.Sources.SawTooth temperatureSawTooth(
    amplitude=200,
    period=0.5,
    offset=273.15,
    startTime=0.2) annotation (Placement(transformation(extent={{-10,-30},{10,-10}})));

end PartialSimleIdealGasMediumTest;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modelica.Media.Interfaces.PartialSimpleIdealGasMedium.setState_psX

1 participant