Skip to main content

The high-speed IAPWS-IF97 package in Rust with Python bindings

Project description

SEUIF97

PyPI

SEUIF97 2, built on Rust, is a major upgrade over SEUIF97 1 built on C, delivering significant improvements in performance, functionality and ecosystem support.

SEUIF97 achieves a 5-20x speedup over naive implementations that use the Rust standard library's powi() in for loops for the basic equations of Regions 1, 2, 3,and 5.

It is suitable for computation-intensive calculations, such as heat cycle calculations, simulations of non-stationary processes, real-time process monitoring and optimizations.

This package supports 12 distinct input state pairs for calculating 36 thermodynamic, transport, and derived properties (see Properties), and thermodynamic process functions (see Thermodynamic Process Functions).

What's New in SEUIF97 2

Feature 1.* 2.*
Implementation C Rust
Calculation Speed Baseline ~2× speedup
Supported Properties 30 properties 36 properties (+6 new)
Supported OS Windows, Linux Windows, Linux, macOS

Property Calculation API

The package provides two types of APIs.

Universal Property Functions

Each function accepts an input pair, an output property ID (o_id).

The following 12 input pairs are implemented:

pt(p,t,o_id) ph(p,h,o_id) ps(p,s,o_id) pv(p,v,o_id)

th(t,h,o_id) ts(t,s,o_id) tv(t,v,o_id)

hs(h,s,o_id)

px(p,x,o_id) tx(p,x,o_id) hx(h,x,o_id) sx(s,x,o_id)

Note: Only linearly related thermodynamic properties are calculable in the wet steam region.

Direct Property Functions

The following 12 input pairs are implemented:

pt2h(p, t)  pt2s(p, t)  pt2v(p, t)  pt2x(p, t)
ph2t(p, h)  ph2s(p, h)  ph2v(p, h)  ph2x(p, h)   
ps2t(p, s)  ps2h(p, s)  ps2v(p, s)  ps2x(p, s)  
pv2t(p, v)  pv2h(p, v)  pv2s(p, v)  pv2x(p, v)  

th2p(t, h)  th2s(t, h)  th2v(t, h)  th2x(t, h)   
ts2p(t, s)  ts2h(t, s)  ts2v(t, s)  ts2x(t, s)  
tv2p(t, v)  tv2h(t, v)  tv2s(t, v)  tv2x(t, v)  

hs2p(h, s)  hs2t(h, s)  hs2v(h, s)  hs2x(h, s)    

px2t(p, x)  px2h(p, x)  px2s(p, x)  px2v(p, x)
tx2p(t, x)  tx2h(t, x)  tx2s(t, x)  tx2v(t, x)

hx2p(h, x)  hx2t(h, x)  hx2s(h, x)  hx2v(h, x)
sx2p(s, x)  sx2t(s, x)  sx2h(s, x)  sx2v(s, x)

Thermodynamic Process Functions

The following thermodynamic process functions are also available:

  • ishd(pi, ti, pe): isentropic enthalpy drop for steam expansion (kJ/kg)
  • ief(pi, ti, pe, te): isentropic efficiency for superheated steam expansion (%)

Usage

from seuif97 import  pt, pt2s

OH=4

p=16.0
t=535.1
# universal property function with o_id
h=pt(p,t,OH)
# direct property function
s=pt2s(p,t)
print(f"p={p}, t={t} h={h:.3f} s={s:.3f}")

Examples

T-S Diagram

Properties

Property Unit Symbol o_id o_id(i32)
Pressure MPa p OP 0
Temperature °C t OT 1
Density kg/m³ ρ OD 2
Specific Volume m³/kg v OV 3
Specific enthalpy kJ/kg h OH 4
Specific entropy kJ/(kg·K) s OS 5
Specific exergy kJ/kg e OE 6
Specific internal energy kJ/kg u OU 7
Specific isobaric heat capacity kJ/(kg·K) cp OCP 8
Specific isochoric heat capacity kJ/(kg·K) cv OCV 9
Speed of sound m/s w OW 10
Isentropic exponent k OKS 11
Specific Helmholtz free energy kJ/kg f OF 12
Specific Gibbs free energy kJ/kg g OG 13
Compressibility factor z OZ 14
Steam quality x OX 15
Region r OR 16
Isobaric cubic expansion coefficient 1/K ɑv OEC 17
Isothermal compressibility 1/MPa kT OKT 18
Partial derivative (∂v/∂T)p m³/(kg·K) (∂v/∂T)p ODVDT 19
Partial derivative (∂v/∂p)T m³/(kg·MPa) (∂v/∂p)T ODVDP 20
Partial derivative (∂p/∂T)v MPa/K (∂p/∂T)v ODPDT 21
Isothermal throttling coefficient kJ/(kg·MPa) δt OIJTC 22
Joule-Thomson coefficient K/MPa μ OJTC 23
Dynamic viscosity Pa·s η ODV 24
Kinematic viscosity m²/s ν OKV 25
Thermal conductivity W/(m.K) λ OTC 26
Thermal diffusivity m²/s a OTD 27
Prandtl number Pr OPR 28
Surface tension N/m σ OST 29
Static Dielectric Constant ε OSDC 30
Isochoric pressure coefficient 1/K β OPC 31
Isothermal stress coefficient kg/m³ βp OBETAP 32
Fugacity coefficient φ OFI 33
Fugacity MPa f OFU 34
Relative pressure coefficient 1/K αp OAFLAP 35

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

seuif97-2.3.8.tar.gz (397.3 kB view details)

Uploaded Source

Built Distributions

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

seuif97-2.3.8-cp38-abi3-win_amd64.whl (242.5 kB view details)

Uploaded CPython 3.8+Windows x86-64

seuif97-2.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (358.8 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

seuif97-2.3.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (353.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

seuif97-2.3.8-cp38-abi3-macosx_11_0_arm64.whl (326.2 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

seuif97-2.3.8-cp38-abi3-macosx_10_12_x86_64.whl (343.8 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file seuif97-2.3.8.tar.gz.

File metadata

  • Download URL: seuif97-2.3.8.tar.gz
  • Upload date:
  • Size: 397.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for seuif97-2.3.8.tar.gz
Algorithm Hash digest
SHA256 4679c0043517a3b0608e011e5e1fefdde2227f26b098b61f77c320135583edcd
MD5 1fbb1b3014d9af8fae6eac598544566c
BLAKE2b-256 422080464d5d83c87268e7289546823bdfa6f6855bbaa88cfc23bbd6ba3884ce

See more details on using hashes here.

File details

Details for the file seuif97-2.3.8-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: seuif97-2.3.8-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 242.5 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for seuif97-2.3.8-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 66ae77a4a1d448b826b55f45a8c2fc2d9998c644f65b4801f85750eeb78d2585
MD5 efcb999990c0f7e0761fb61fdcf13f6f
BLAKE2b-256 dc7510ac4a34491b3fb68d035caf95a1965a82ef1ab1534db695aff86d6d6200

See more details on using hashes here.

File details

Details for the file seuif97-2.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for seuif97-2.3.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb2ab08a8d914b7edac2844e906e6c8b58bc88a55aaafc7684c9eca093d7d7b4
MD5 7b2f652777567a59b378be786e6998d3
BLAKE2b-256 6efea87231adff42d089d8ca9d6844fb30cf31b3976898dd450dfda444050845

See more details on using hashes here.

File details

Details for the file seuif97-2.3.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for seuif97-2.3.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e9088fdd0beffb4fbf45702891438adf5c31aa6b085bb833fea030c1c45c0c0
MD5 d4a009a5269e2eed90936892999912df
BLAKE2b-256 c014be8590f49400201fa5c944c8745fbb569f7f860534258a0535a6c29792c2

See more details on using hashes here.

File details

Details for the file seuif97-2.3.8-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for seuif97-2.3.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b815d9aa8cf395649ab7c77d0c397d960472fa37cb364070b232201da7dd498c
MD5 4f86781d8885052cc150023f43833a06
BLAKE2b-256 07cd2d47d17704811d6727540ea5beee11c2ce74e64b7bdb656bcbcf4d6e2f11

See more details on using hashes here.

File details

Details for the file seuif97-2.3.8-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for seuif97-2.3.8-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6f992998a49855e38d327c701712e808debf8137812f8521d93c1f95554ae7c1
MD5 c4ab6ad79bddbf33dd54b1ca8dec98c3
BLAKE2b-256 5f90a0ce0bd4794eec6b313504b4ae15cae95e73435f10b776355a410ee0fe18

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