Base functions as described in IAWPS/IF97
Information
Package description
Package BaseIF97/Basic computes the the fundamental functions for the 5 regions of the steam tables
as described in the standards document IF97.pdf. The code of these
functions has been generated using Mathematica and the add-on packages "Format" and "Optimize"
to generate highly efficient, expression-optimized C-code from a symbolic representation of the thermodynamic
functions. The C-code has than been transformed into Modelica code. An important feature of this optimization was to
simultaneously optimize the functions and the directional derivatives because they share many common subexpressions.
Package contents
- Function g1 computes the dimensionless Gibbs function for region 1 and all derivatives up
to order 2 w.r.t. pi and tau. Inputs: p and T.
- Function g2 computes the dimensionless Gibbs function for region 2 and all derivatives up
to order 2 w.r.t. pi and tau. Inputs: p and T.
- Function g2metastable computes the dimensionless Gibbs function for metastable vapour
(adjacent to region 2 but 2-phase at equilibrium) and all derivatives up
to order 2 w.r.t. pi and tau. Inputs: p and T.
- Function f3 computes the dimensionless Helmholtz function for region 3 and all derivatives up
to order 2 w.r.t. delta and tau. Inputs: d and T.
- Function g5computes the dimensionless Gibbs function for region 5 and all derivatives up
to order 2 w.r.t. pi and tau. Inputs: p and T.
- Function tph1 computes the inverse function T(p,h) in region 1.
- Function tph2 computes the inverse function T(p,h) in region 2.
- Function tps2a computes the inverse function T(p,s) in region 2a.
- Function tps2b computes the inverse function T(p,s) in region 2b.
- Function tps2c computes the inverse function T(p,s) in region 2c.
- Function tps2 computes the inverse function T(p,s) in region 2.
- Function tsat computes the saturation temperature as a function of pressure.
- Function dtsatofp computes the derivative of the saturation temperature w.r.t. pressure as
a function of pressure.
- Function tsat_der computes the Modelica derivative function of tsat.
- Function psat computes the saturation pressure as a function of temperature.
- Function dptofT computes the derivative of the saturation pressure w.r.t. temperature as
a function of temperature.
- Function psat_der computes the Modelica derivative function of psat.
Version Info and Revision history
Author: Hubertus Tummescheit,
Modelon AB
Ideon Science Park
SE-22370 Lund, Sweden
email: hubertus@modelon.se
- Initial version: July 2000
- Documentation added: December 2002
Equation from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Package (Icon for standard packages).
Package Content
Name | Description |
g1
| Gibbs function for region 1: g(p,T) |
g2
| Gibbs function for region 2: g(p,T) |
g2metastable
| Gibbs function for metastable part of region 2: g(p,T) |
f3
| Helmholtz function for region 3: f(d,T) |
g5
| Base function for region 5: g(p,T) |
gibbs
| Gibbs function for region 1, 2 or 5: g(p,T,region) |
g1pitau
| Derivative of g w.r.t. pi and tau |
g2pitau
| Derivative of g w.r.t. pi and tau |
g5pitau
| Derivative of g w.r.t. pi and tau |
f3deltatau
| 1st derivatives of f w.r.t. delta and tau |
tph1
| Inverse function for region 1: T(p,h) |
tps1
| Inverse function for region 1: T(p,s) |
tph2
| Reverse function for region 2: T(p,h) |
tps2a
| Reverse function for region 2a: T(p,s) |
tps2b
| Reverse function for region 2b: T(p,s) |
tps2c
| Reverse function for region 2c: T(p,s) |
tps2
| Reverse function for region 2: T(p,s) |
tsat
| Region 4 saturation temperature as a function of pressure |
dtsatofp
| Derivative of saturation temperature w.r.t. pressure |
tsat_der
| Derivative function for tsat |
psat
| Region 4 saturation pressure as a function of temperature |
dptofT
| Derivative of pressure w.r.t. temperature along the saturation pressure curve |
psat_der
| Derivative function for psat |
p1_hs
| Pressure as a function of enthalpy and entropy in region 1 |
h2ab_s
| Boundary between regions 2a and 2b |
p2a_hs
| Pressure as a function of enthalpy and entropy in subregion 2a |
p2b_hs
| Pressure as a function of enthalpy and entropy in subregion 2a |
p2c_hs
| Pressure as a function of enthalpy and entropy in subregion 2c |
h3ab_p
| Region 3 a b boundary for pressure/enthalpy |
T3a_ph
| Region 3 a: inverse function T(p,h) |
T3b_ph
| Region 3 b: inverse function T(p,h) |
v3a_ph
| Region 3 a: inverse function v(p,h) |
v3b_ph
| Region 3 b: inverse function v(p,h) |
T3a_ps
| Region 3 a: inverse function T(p,s) |
T3b_ps
| Region 3 b: inverse function T(p,s) |
v3a_ps
| Region 3 a: inverse function v(p,s) |
v3b_ps
| Region 3 b: inverse function v(p,s) |
Gibbs function for region 1: g(p,T)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
g | Dimensionless Gibbs function and derivatives w.r.t. pi and tau |
Gibbs function for region 2: g(p,T)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
g | Dimensionless Gibbs function and derivatives w.r.t. pi and tau |
Gibbs function for metastable part of region 2: g(p,T)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
g | Dimensionless Gibbs function and derivatives w.r.t. pi and tau |
Helmholtz function for region 3: f(d,T)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
d | Density [kg/m3] |
T | Temperature (K) [K] |
Outputs
Name | Description |
f | Dimensionless Helmholtz function and derivatives w.r.t. delta and tau |
Base function for region 5: g(p,T)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
g | Dimensionless Gibbs function and derivatives w.r.t. pi and tau |
Gibbs function for region 1, 2 or 5: g(p,T,region)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
region | IF97 region, 1, 2 or 5 |
Outputs
Name | Description |
g | Dimensionless Gibbs function |
Derivative of g w.r.t. pi and tau
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
pi | Dimensionless pressure |
tau | Dimensionless temperature |
gpi | Dimensionless derivative of Gibbs function w.r.t. pi |
gtau | Dimensionless derivative of Gibbs function w.r.t. tau |
Derivative of g w.r.t. pi and tau
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
pi | Dimensionless pressure |
tau | Dimensionless temperature |
gpi | Dimensionless derivative of Gibbs function w.r.t. pi |
gtau | Dimensionless derivative of Gibbs function w.r.t. tau |
Derivative of g w.r.t. pi and tau
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
T | Temperature (K) [K] |
Outputs
Name | Description |
pi | Dimensionless pressure |
tau | Dimensionless temperature |
gpi | Dimensionless derivative of Gibbs function w.r.t. pi |
gtau | Dimensionless derivative of Gibbs function w.r.t. tau |
1st derivatives of f w.r.t. delta and tau
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
d | Density [kg/m3] |
T | Temperature (K) [K] |
Outputs
Name | Description |
delta | Dimensionless density |
tau | Dimensionless temperature |
fdelta | Dimensionless derivative of Helmholtz function w.r.t. delta |
ftau | Dimensionless derivative of Helmholtz function w.r.t. tau |
Inverse function for region 1: T(p,h)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Inverse function for region 1: T(p,s)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Reverse function for region 2: T(p,h)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Reverse function for region 2a: T(p,s)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Reverse function for region 2b: T(p,s)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Reverse function for region 2c: T(p,s)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Reverse function for region 2: T(p,s)
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature (K) [K] |
Region 4 saturation temperature as a function of pressure
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
Outputs
Name | Description |
t_sat | Temperature [K] |
Derivative of saturation temperature w.r.t. pressure
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
Outputs
Name | Description |
dtsat | Derivative of T w.r.t. p [K/Pa] |
Derivative function for tsat
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
der_p | Pressure derivative [Pa/s] |
Outputs
Name | Description |
der_tsat | Temperature derivative [K/s] |
Region 4 saturation pressure as a function of temperature
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
T | Temperature (K) [K] |
Outputs
Name | Description |
p_sat | Pressure [Pa] |
Derivative of pressure w.r.t. temperature along the saturation pressure curve
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
T | Temperature (K) [K] |
Outputs
Name | Description |
dpt | Temperature derivative of pressure [Pa/K] |
Derivative function for psat
Information
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
T | Temperature (K) [K] |
der_T | Temperature derivative [K/s] |
Outputs
Name | Description |
der_psat | Pressure [Pa/s] |
Pressure as a function of enthalpy and entropy in region 1
Information
Equation number 1 from:
The International Association for the Properties of Water and Steam
Gaithersburg, Maryland, USA
September 2001
Supplementary Release on Backward Equations for Pressure as a
Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
Formulation 1997 for the Thermodynamic Properties of Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
h | Specific enthalpy [J/kg] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
p | Pressure [Pa] |
Boundary between regions 2a and 2b
Information
Equation number 2 from:
The International Association for the Properties of Water and Steam
Gaithersburg, Maryland, USA
September 2001
Supplementary Release on Backward Equations for Pressure as a
Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
Formulation 1997 for the Thermodynamic Properties of Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
s | Entropy [J/(kg.K)] |
Outputs
Name | Description |
h | Enthalpy [J/kg] |
Pressure as a function of enthalpy and entropy in subregion 2a
Information
Equation number 3 from:
The International Association for the Properties of Water and Steam
Gaithersburg, Maryland, USA
September 2001
Supplementary Release on Backward Equations for Pressure as a
Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
Formulation 1997 for the Thermodynamic Properties of Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
h | Specific enthalpy [J/kg] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
p | Pressure [Pa] |
Pressure as a function of enthalpy and entropy in subregion 2a
Information
Equation number 4 from:
The International Association for the Properties of Water and Steam
Gaithersburg, Maryland, USA
September 2001
Supplementary Release on Backward Equations for Pressure as a
Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
Formulation 1997 for the Thermodynamic Properties of Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
h | Specific enthalpy [J/kg] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
p | Pressure [Pa] |
Pressure as a function of enthalpy and entropy in subregion 2c
Information
Equation number 5 from:
The International Association for the Properties of Water and Steam
Gaithersburg, Maryland, USA
September 2001
Supplementary Release on Backward Equations for Pressure as a
Function of Enthalpy and Entropy p(h,s) to the IAPWS Industrial
Formulation 1997 for the Thermodynamic Properties of Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
h | Specific enthalpy [J/kg] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
p | Pressure [Pa] |
Region 3 a b boundary for pressure/enthalpy
Information
Equation number 1 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
Outputs
Name | Description |
h | Enthalpy [J/kg] |
Region 3 a: inverse function T(p,h)
Information
Equation number 2 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
T | Temperature [K] |
Region 3 b: inverse function T(p,h)
Information
Equation number 3 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
T | Temperature [K] |
Region 3 a: inverse function v(p,h)
Information
Equation number 4 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
v | Specific volume [m3/kg] |
Region 3 b: inverse function v(p,h)
Information
Equation number 5 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
h | Specific enthalpy [J/kg] |
Outputs
Name | Description |
v | Specific volume [m3/kg] |
Region 3 a: inverse function T(p,s)
Information
Equation number 6 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature [K] |
Region 3 b: inverse function T(p,s)
Information
Equation number 7 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
T | Temperature [K] |
Region 3 a: inverse function v(p,s)
Information
Equation number 8 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
v | Specific volume [m3/kg] |
Region 3 b: inverse function v(p,s)
Information
Equation number 9 from:
[1] The international Association
for the Properties of Water and Steam
Vejle, Denmark
August 2003
Supplementary Release on Backward Equations for the Functions
T(p,h), v(p,h) and T(p,s),
v(p,s) for Region 3 of the IAPWS Industrial Formulation 1997 for
the Thermodynamic Properties of
Water and Steam
Extends from Modelica.Icons.Function (Icon for functions).
Inputs
Name | Description |
p | Pressure [Pa] |
s | Specific entropy [J/(kg.K)] |
Outputs
Name | Description |
v | Specific volume [m3/kg] |
Automatically generated Mon Sep 23 17:21:07 2013.