# Introduction¶

Python implementation of standard from IAPWS (http://www.iapws.org/release.html).

- Home: https://github.com/jjgomera/iapws
- Author: Juan José Gómez Romera <jjgomera@gmail.com>
- License: GPL-3
- Documentation: http://iapws.readthedocs.io/

# Dependences¶

- python 2x, 3x, compatible with both versions
- Numpy-scipy: library with mathematic and scientific tools

# Installation¶

In debian you can find in official repositories in jessie, testing and sid. In ubuntu it’s in official repositories from ubuntu saucy (13.10). In other system you can install using pip:

```
pip install iapws
```

or directly cloning the github repository:

```
git clone https://github.com/jjgomera/iapws.git
```

and adding the folder to a python path.

# Features¶

This module implements almost the full set of standards:

Releases:

- R1-76(2014): Revised Release on the Surface Tension of Ordinary Water Substance,
`iapws._iapws._Tension()`

- R2-83(1992): Release on the Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at their Respective Critical Points,
`iapws._iapws()`

- R5-85(1994): Release on Surface Tension of Heavy Water Substance,
`iapws._iapws._D2O_Tension()`

- R6-95(2018): Revised Release on the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use,
`iapws.iapws95.IAPWS95()`

- R7-97(2012): Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,
`iapws.iapws97()`

- R8-97: Release on the Static Dielectric Constant of Ordinary Water Substance for Temperatures from 238 K to 873 K and Pressures up to 1000 MPa,
`iapws._iapws._Dielectric()`

- R9-97: Release on the Refractive Index of Ordinary Water Substance as a Function of Wavelength, Temperature and Pressure,
`iapws._iapws._Refractive()`

- R10-06(2009): Revised Release on the Equation of State 2006 for H2O Ice Ih,
`iapws._iapws._Ice()`

- R11-07(2019): Release on the Ionization Constant of H2O,
`iapws._iapws._Kw()`

- R12-08: Release on the IAPWS Formulation 2008 for the Viscosity of Ordinary Water Substance,
`iapws._iapws._Viscosity()`

- R13-08: Release on the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater,
`iapws.iapws08()`

- R14-08(2011): Revised Release on the Pressure along the Melting and Sublimation Curves of Ordinary Water Substance,
`iapws._iapws._Melting_Pressure()`

,`iapws._iapws._Sublimation_Pressure()`

- R15-11: Release on the IAPWS Formulation 2011 for the Thermal Conductivity of Ordinary Water Substance,
`iapws._iapws._ThCond()`

- R16-17(2018): Release on the IAPWS Formulation 2017 for the Thermodynamic Properties of Heavy Water,
`iapws.iapws95.D2O()`

- R17-20: Release on the IAPWS Formulation 2020 for the Viscosity of Heavy Water,
`iapws._iapws._D2O_Viscosity()`

- R18-21: Release on the IAPWS Formulation 2021 for the Thermal Conductivity of Heavy Water,
`iapws._iapws._D2O_ThCond()`

Supplementary Releases:

- SR1-86(1992): Revised Supplementary Release on Saturation Properties of Ordinary Water Substance,
`iapws.iapws95.MEoS._Liquid_Density()`

,`iapws.iapws95.MEoS._Vapor_Density()`

,`iapws.iapws95.MEoS._Vapor_Pressure()`

- SR2-01(2014): Revised Supplementary Release on Backward Equations for Pressure as a Function of Enthalpy and Entropy p(h,s) for Regions 1 and 2 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,
`iapws.iapws97._Backward1_P_hs()`

,`iapws.iapws97._Backward2_P_hs()`

- SR3-03(2014): Revised 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,
`iapws.iapws97._Backward3_T_Ph()`

,`iapws.iapws97._Backward3_T_Ps()`

,`iapws.iapws97._Backward3_v_Ph()`

,`iapws.iapws97._Backward3_v_Ps()`

- SR4-04(2014): Revised Supplementary Release on Backward Equations p(h,s) for Region 3, Equations as a Function of h and s for the Region Boundaries, and an Equation Tsat(h,s) for Region 4 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,
`iapws.iapws97._Backward3_P_hs()`

- SR5-05(2016): Revised Supplementary Release on Backward Equations for Specific Volume as a Function of Pressure and Temperature v(p,T) for Region 3 of the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam,
`iapws.iapws97._Backward3_v_PT()`

- SR6-08(2011): Revised Supplementary Release on Properties of Liquid Water at 0.1 MPa,
`iapws._iapws._Liquid()`

- SR7-09: Supplementary Release on a Computationally Efficient Thermodynamic Formulation for Liquid Water for Oceanographic Use,
`iapws.iapws08.SeaWater._waterSupp()`

Guidelines:

- G1-90: Electrolytic Conductivity (Specific Conductance) of Liquid and Dense Supercritical Water from 0°C to 800°C and Pressures up to 1000 MPa,
`iapws._iapws._Conductivity()`

- G2-90(1994): Solubility of Sodium Sulfate in Aqueous Mixtures of Sodium Chloride and Sulfuric Acid from Water to Concentrated Solutions, from 250 °C to 350 °C,
`iapws.iapws08._solNa2SO4()`

- G3-00(2012): Revised Guideline on the Critical Locus of Aqueous Solutions of Sodium Chloride,
`iapws.iapws08._critNaCl()`

- G4-01: Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures,
`iapws.ammonia()`

- G5-01(2016): Guideline on the Use of Fundamental Physical Constants and Basic Constants of Water,
`iapws._iapws()`

- G6-03: Guideline on the Tabular Taylor Series Expansion (TTSE) Method for Calculation of Thermodynamic Properties of Water and Steam Applied to IAPWS-95 as an Example (Not implemented)
- G7-04: Guideline on the Henry’s Constant and Vapor-Liquid Distribution Constant for Gases in H2O and D2O at High Temperatures,
`iapws._iapws._Henry()`

,`iapws._iapws._Kvalue()`

- G8-10: Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater,
`iapws.humidAir.HumidAir()`

- G9-12: Guideline on a Low-Temperature Extension of the IAPWS-95 Formulation for Water Vapor,
`iapws.iapws95.IAPWS95._phiex()`

- G10-15: Guideline on the Thermal Conductivity of Seawater,
`iapws.iapws08._ThCond_SeaWater()`

- G11-15: Guideline on a Virial Equation for the Fugacity of H2O in Humid Air,
`iapws.humidAir._virial()`

- G12-15: Guideline on Thermodynamic Properties of Supercooled Water,
`iapws._iapws._Supercooled()`

- G13-15: Guideline on the Fast Calculation of Steam and Water Properties with the Spline-Based Table Look-Up Method (SBTL) (Not implemented)
- G14-19: Guideline on the Surface Tension of Seawater,
`iapws.iapws08._Tension_SeaWater()`

Advisory Notes:

- AN1-03: Uncertainties in Enthalpy for the IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use (IAPWS-95) and the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam (IAPWS-IF97)
- AN2-04(2013): Role of Various IAPWS Documents Concerning the Thermodynamic Properties of Ordinary Water Substance
- AN3-07(2018): Thermodynamic Derivatives from IAPWS Formulations,
`iapws._utils.deriv_G()`

,`iapws._utils.deriv_H()`

- AN4-09: Roles of IAPWS and CIPM Standards for the Density of Water
- AN5-13(2016): Industrial Calculation of the Thermodynamic Properties of Seawater,
`iapws.iapws08.Seawater._waterIF97()`

,`iapws.iapws08._Tb()`

,`iapws.iapws08._Tf()`

,`iapws.iapws08._Triple()`

,`iapws.iapws08._OsmoticPressure()`

- AN6-16: Relationship between Various IAPWS Documents and the International Thermodynamic Equation of Seawater - 2010 (TEOS-10)

# Documentation¶

You can navigate the full documentation of package:

For a rapid usage demostration, see this examples

IAPWS-IF97 (see full documentation)

```
from iapws import IAPWS97
sat_steam=IAPWS97(P=1,x=1) #saturated steam with known P
sat_liquid=IAPWS97(T=370, x=0) #saturated liquid with known T
steam=IAPWS97(P=2.5, T=500) #steam with known P and T
print(sat_steam.h, sat_liquid.h, steam.h) #calculated enthalpies
```

IAPWS-95 (see full documentation)

```
from iapws import IAPWS95
sat_steam=IAPWS95(P=1,x=1) #saturated steam with known P
sat_liquid=IAPWS95(T=370, x=0) #saturated liquid with known T
steam=IAPWS95(P=2.5, T=500) #steam with known P and T
print(sat_steam.h, sat_liquid.h, steam.h) #calculated enthalpies
```

IAPWS-17 for Heavy water (see full documentation)

```
from iapws import D2O
sat_liquid=D2O(T=370, x=0) #saturated liquid with known T
print(sat_liquid.h) #calculated enthalpy
```

IAPWS-06 for Ice Ih (see full documentation)

```
from iapws import _Ice
ice=_Ice(273.15, 0.101325) #Ice at normal melting point
print(ice["rho"]) #Calculated density
```

IAPWS-08 for seawater (see full documentation)

```
from iapws import SeaWater
state = SeaWater(T=300, P=0.101325, S=0.001) #Seawater with 0.1% Salinity
print(state.cp) # Get cp
```

# TODO¶

- FIXME: Electrolytic conductiviy
- TODO: Improve convergence in two phase region for IAPWS95 and D2O class
- TODO: Implement SBTL method for fast calculation
- TODO: Implement TTSE method for fast calculation

Ammonia-water mixture:

- TODO: Add equilibrium routine

I’ve tried to test all code and use all values for computer verification the standards give, but anyway the code can have hidden problem. For any suggestions, comments, bugs … you can usage the github issue section, or contact directly with me at email.