IAPWS-97 thermodynamics#

Introduction#

The IAPWS97 library in PyTOUGH contains a Python implementation of the main functions of the International Association for the Properties of Water and Steam (IAPWS) 1997 thermodynamic formulation. These can be used to calculate the thermodynamic properties of water, steam and supercritical water. The IAPWS-97 supersedes the IFC-67 formulation used in TOUGH2, being generally faster and more accurate, as well as having a simpler representation of the thermodynamic region around the critical point.

The operating range of the IAPWS-97 formulation is shown in the pressure-temperature plot below. It covers temperatures up to 800°C and pressures up to 100 MPa, and is divided into four thermodynamic regions:

  1. liquid water

  2. dry steam

  3. supercritical fluid

  4. two-phase

The two-phase region (4) follows the saturation line on the pressure-temperature plot (the boundary between liquid water and dry steam), up to the critical point \(C\) (\(T\) = 373.946 °C, \(P\) = 22.064 MPa), where the distinction between liquid water and steam disappears. Region 3 covers supercritcal fluid (above the critical point) and also near-critical fluid, just below the critical point. The boundary between regions 1 and 3 (liquid water and supercritical) is aribitrarily set at \(T\) = 350 °C. The boundary between regions 2 and 3 (dry steam and supercritical) is described by the b23p and b23t functions.

IAPWS-97 thermodynamics operating range

The IAPWS97 library can be imported using the command:

from IAPWS97 import *

The functions available through the IAPWS97 library are listed in the table below.

IAPWS97 functions#

Function

Type

Description

b23p

float

pressure on boundary between steam and supercritical regions, as a function of temperature

b23t

float

temperature on boundary between steam and supercritical regions, as a function of pressure

cowat

tuple

density and internal energy of liquid water

density_temperature_plot

draws region boundaries on a density-temperature plot

pressure_temperature_plot

draws region boundaries on a pressure-temperature plot

region

integer

thermodynamic region

sat

float

saturation pressure as a function of temperature

super

tuple

pressure and internal energy of supercritical fluid

supst

tuple

density and internal energy of dry steam

tsat

float

saturation temperature as a function of pressure

visc

float

dynamic viscosity of water, steam or supercritical fluid

Thermodynamic functions#

The IAPWS-97 formulation provides thermodynamic functions for liquid water, dry steam and supercritical fluid. These functions calculate secondary parameters from the primary thermodynamic variables.


Liquid water: cowat(t,p)#

The cowat function returns a two-element tuple (d,u) of density (kg/m\(^3\)) and internal energy (J/kg) of liquid water as a function of temperature t (°C) and pressure p (Pa).

Parameters:

  • t: float
    Temperature (°C)
  • p: float
    Pressure (Pa)

Dry steam: supst(t,p)#

The supst function returns a two-element tuple (d,u) of density (kg/m\(^3\)) and internal energy (J/kg) of dry steam as a function of temperature t (°C) and pressure p (Pa).

Parameters:

  • t: float
    Temperature (°C)
  • p: float
    Pressure (Pa)

Supercritical fluid: super(d,t)#

The super function returns a two-element tuple (p,u) of pressure (Pa) and internal energy (J/kg) of supercritical fluid as a function of density d (kg/m\(^3\)) and temperature t (°C).

Parameters:

  • d: float
    Density (kg/m\(^3\))
  • t: float
    Temperature (°C)

Viscosity: visc(d,t)#

The visc function returns the dynamic viscosity (Pa.s) of liquid water, dry steam or supercritical fluid as a function of density d (kg/m\(^3\)) and temperature t (°C). This function is based on the supplementary “IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance”, without the critical enhancement of viscosity near the critical point.

Parameters:

  • d: float
    Density (kg/m\(^3\))
  • t: float
    Temperature (°C)

Region boundaries#

These functions describe the boundaries between the four thermodynamic regions of the IAPWS-97 formulation. There is no equation for the boundary between regions 1 and 3 as this is simply the line \(T\) = 350 °C.

Saturation line: sat(t) and tsat(p)#

sat(t)#

The sat function returns the saturation pressure (Pa) at a given temperature t (°C), for temperatures below the critical temperature.

Parameters:

  • t: float
    Temperature (°C)

tsat(p)#

The tsat function returns the saturation temperature (°C) at a given pressure p (Pa), for pressures below the critical pressure.

Parameters:

  • p: float
    Pressure (Pa)

Steam/supercritical boundary#

b23p(t)#

The b23p function returns the pressure (Pa) on the boundary of the dry steam and supercritical regions (regions 2 and 3) at a given temperature t (°C).

Parameters:

  • t: float
    Temperature (°C)

b23t(p)#

The b23t function returns the temperature (°C) on the boundary of the dry steam and supercritical regions (regions 2 and 3) at a given pressure p (Pa).

Parameters:

  • p: float
    Pressure (Pa)

Determining thermodynamic region#

region(t, p)#

Returns the thermodynamic region (integer, or None) corresponding to the given temperature (°C) and pressure (Pa), as defined by the IAPWS-97 specification. The regions are:

  1. liquid water

  2. dry steam

  3. supercritical

If the input temperature and/or pressure are outside the operating range of the IAPWS-97 formulation, the routine will return None.

Parameters:

  • t: float
    Temperature (°C)
  • Pressure: float
    Pressure (Pa)

Plotting functions#

The IAPWS97 library contains two functions used for including the IAPWS-97 thermodynamic region boundaries on plots.


pressure_temperature_plot(plt)#

Draws the IAPWS-97 thermodynamic region boundaries on a pressure-temperature diagram.

Parameters:

  • plt: matplotlib.pyplot instance
    An instance of the matplotlib.pyplot library, imported in the calling script using e.g. import matplotlib.pyplot as plt.

density_temperature_plot(plt)#

Draws the IAPWS-97 thermodynamic region boundaries on a density-temperature diagram. (This function requires the Scientific Python (scipy) library to be installed.)

Parameters:

  • plt: matplotlib.pyplot instance
    An instance of the matplotlib.pyplot library, imported in the calling script using e.g. import matplotlib.pyplot as plt.