The Python API of the high-speed IAPWS-IF97 package in Rust
Project description
SEUIF97
The version of seuif97 2 is the Python API of the high-speed IAPWS-IF97 package in Rust. It is suitable for computation-intensive calculations, such as heat cycle calculations, simulations of non-stationary processes, real-time process monitoring and optimizations.
Through the high-speed package, the results of the IAPWS-IF97 are accurately produced at about 5-20x speed-up compared to using the powi()
of the Rust standard library in the for
loop directly when computing the basic equations of Region 1,2,3.
The Fast Methods
- The multi-step method unleashes the full power of the compiler optimizations while using
powi()
with thefor
loop - The recursive method computes the polynomial values of the base variable and its derivatives
In the package, 36 thermodynamic, transport and further properties can be calculated.
The following 12 input pairs are implemented:
(p,t) (p,h) (p,s) (p,v)
(p,x) (t,x) (h,x) (s,x)
(t,h) (t,s) (t,v)
(h,s)
The functions
The two types of functions are provided in the package
-
the input propertry pairs and the property ID(o_id) to get the value of the specified property
-
the input propertry pairs to get the one of
p
,t
,h
,s
,v
orx
directly
The input propertry pairs and the property ID
??(in1,in2,o_id)
- the first,second input parameters : the input propertry pairs
- the third input parametes: the property ID of the calculated property - o_id
- the return: the calculated property value of o_id
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)
The input propertry pairs
??2?(in1,in2)
- the
?
in2?
is the one ofp
,t
,h
,s
,v
orx
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)
hs2t(h, s) hs2p(h, s) hs2v(p, s) hs2x(h, s)
th2p(t, h) th2s(t, h) th2v(t, h) th2x(t, h)
ts2p(t, s) ts2h(t, s) th2v(t, s) ts2x(t, s)
tv2p(t, v) tv2h(t, v) tv2s(t, v) tv2x(t, v)
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)
Example
from seuif97 import *
OH=4
p=16.0
t=535.1
# ??(in1,in2,o_id)
h=pt(p,t,OH)
# ??2?(in1,in2)
s=pt2s(p,t)
print(f"p={p}, t={t} h={h:.3f} s={s:.3f}")
The Examples
Properties
Propertry | 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 | |
Isobari 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 | fi | OFI | 33 | |
Fugacity | MPa | f* | OFU | 34 |
Relative pressure coefficient | 1/K | αp | OAFLAP | 35 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file seuif97-2.2.0.tar.gz
.
File metadata
- Download URL: seuif97-2.2.0.tar.gz
- Upload date:
- Size: 78.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7314165b6951949202145912717761ed69e6108559a89137e98cbe54b81b5517 |
|
MD5 | 841894bd83eba2f4e7e9e566970812a3 |
|
BLAKE2b-256 | fdde5851def0874f7500dae62b720926aa8cd8b841da658fa595a96e46bb7668 |