Skip to main content

Python implementation of standards from The InternationalAssociation for the Properties of Water and Steam

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iapws-1.5.5.tar.gz (115.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iapws-1.5.5-py3-none-any.whl (117.4 kB view details)

Uploaded Python 3

File details

Details for the file iapws-1.5.5.tar.gz.

File metadata

  • Download URL: iapws-1.5.5.tar.gz
  • Upload date:
  • Size: 115.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for iapws-1.5.5.tar.gz
Algorithm Hash digest
SHA256 c86e1e171551877fe9ceb03ee415e4a4906d2e52698ff9d5656784609739df4d
MD5 73781a805de4928dc96730f1f83c16c1
BLAKE2b-256 ce3f9d90a362ef2f214965f98e8a11b2fbc3a315871f9a22c5e12a49d8e3286c

See more details on using hashes here.

File details

Details for the file iapws-1.5.5-py3-none-any.whl.

File metadata

  • Download URL: iapws-1.5.5-py3-none-any.whl
  • Upload date:
  • Size: 117.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for iapws-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 97810dca5155cce1e2ec964dd254fc9e4858fbb1c9967da6c4f817adaf3a818e
MD5 e71c4e675d22e4f690ad9b56f49d194d
BLAKE2b-256 cb01256404a8f1fec81606c7127fa99b5a45f88da3c5ecce7a07f38b46e54984

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page