Skip to content

Modelica.Media.Interfaces.PartialSimpleIdealGasMedium.setState_psX #4749

@RaphaelGebhart

Description

@RaphaelGebhart

Modelica.Media.Interfaces.PartialSimpleIdealGasMedium.setState_psX is wrong.

    redeclare replaceable function setState_psX
      "Return thermodynamic state from p, s, and X or Xi"
      extends Modelica.Icons.Function;
      input AbsolutePressure p "Pressure";
      input SpecificEntropy s "Specific entropy";
      input MassFraction X[:]=reference_X "Mass fractions";
      output ThermodynamicState state "Thermodynamic state record";
    algorithm
      state := ThermodynamicState(p=p, T=Modelica.Math.exp(s/cp_const +
        Modelica.Math.log(reference_T) + R_gas*Modelica.Math.log(p/reference_p)));
    end setState_psX;

state := ThermodynamicState(p=p, T=Modelica.Math.exp(s/cp_const +
        Modelica.Math.log(reference_T) + R_gas/cp_const*Modelica.Math.log(p/reference_p)));

is correct (or T=reference_T*Modelica.Math.exp(1/cp_const*(s + R_gas*Modelica.Math.log(p/reference_p))) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    L: MediaIssue addresses Modelica.Media

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions