Skip to main content
Build Status Windows Build Status coveralls.io analysis codecov.io analysis Code Quality Documentation Status DOI

iapws

Python implementation of standard from IAPWS (http://www.iapws.org/release.html). The module implements the full set of standards, including:

IAPWS-IF97
IAPWS-95
IAPWS-06 for Ice
IAPWS-08 for seawater
IAPWS-17 for Heavy water
...

dependences

  • Support for both python branch:

    * python 2.7
    * python 3.4 or later
  • Numpy-scipy: library with mathematic and scientific tools

install

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 from the github repository:

pip install git+https://github.com/jjgomera/iapws.git

This is the recommended option to have the latest version.

documentation

To see the full documentation of package, see readthedocs

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

For calculation of multiple states is possible use multiprocessing to speed up calculation, 6x in my laptop. Method valid too for D2O

from iapws import IAPWS95
from numpy import arange
from time import time

x = arange(0, 1.01, 0.01)

def fi(x):
    return IAPWS95(P=20.8, x=x)

start = time()
for xi in x:
    fi(xi)
print(f'Without multiprocessing: {time() - start}')

start = time()
states = IAPWS95.from_list("P", 20.8, "x", x)
print(f'With multiprocessing: {time() - start}')

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

  • 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.

Metadata

Release files for iapws 1.5.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iapws 1.5.5
File Size Uploaded
iapws-1.5.5.tar.gz 115.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iapws 1.5.5
File Interpreter ABI Platform
iapws-1.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 232.8 kB

Release files / iapws-1.5.5.tar.gz

Download URL iapws-1.5.5.tar.gz
Size 115.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c86e1e171551877fe9ceb03ee415e4a4906d2e52698ff9d5656784609739df4d
BLAKE2b-256 checksum
How to use checksums
ce3f9d90a362ef2f214965f98e8a11b2fbc3a315871f9a22c5e12a49d8e3286c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / iapws-1.5.5-py3-none-any.whl

Download URL iapws-1.5.5-py3-none-any.whl
Size 117.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97810dca5155cce1e2ec964dd254fc9e4858fbb1c9967da6c4f817adaf3a818e
BLAKE2b-256 checksum
How to use checksums
cb01256404a8f1fec81606c7127fa99b5a45f88da3c5ecce7a07f38b46e54984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

1.5.5 This release

2 release files

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5

1 release file

1.4.1

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page