setState_pTX

Set state for pressure and temperature (X not used since single substance)

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

This function should be used by default in order to calculate the thermodynamic state record used as input by many functions.

Example:

     parameter Medium.AbsolutePressure p = 3e5;
     parameter Medium.Temperature T = 290;

     Medium.Density rho;

     equation

     rho = Medium.density(setState_pTX(p, T, fill(0, Medium.nX)));

Please note, that in contrast to setState_phX, setState_dTX and setState_psX this function can not calculate properties in the two-phase region since pressure and temperature are dependent variables. A guard function will be called if the temperature difference to the phase boundary is lower than 1K or the pressure difference to the critical pressure is lower than 1000 Pa.

Syntax

state = setState_pTX(p, T, X, phase)

Inputs (4)

p

Type: AbsolutePressure (Pa)

Description: Pressure

T

Type: Temperature (K)

Description: Temperature

X

Default Value: reference_X

Type: MassFraction[:] (kg/kg)

Description: Mass fractions

phase

Default Value: 0

Type: FixedPhase

Description: 2 for two-phase, 1 for one-phase, 0 if not known

Outputs (1)

state

Type: ThermodynamicState

Description: Thermodynamic state record