if97-0.1.7 has been yanked.
IF97
IF97 is the high-speed package of IAPWS-IF97 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~10x speed-up compared to the powi() of the Rust standard library,5x speed-up compared to the shared library in C using the same fast algorithms.
The following input pairs are implemented:
(p,t) (p,h) (p,s) (p,x)
(t,x)
(h,s)
Usage
Install the crate
The type of functions are provided in the if97 package:
fn ;
- first,second input parameters: the input propertry pairs(f64)
- third input parameter: o_id - the property ID of the calculated property(i32)
- the return: the calculated property value(f64)
pt;
ph;
ps;
hs;
px;
tx;
Examples
use pt;
Properties in if97
| Propertry | Unit | symbol | o_id | o_id value |
|---|---|---|---|---|
| Pressure | MPa | p | OH | 0 |
| Temperature | °C | t | OT | 1 |
| Density | kg/m^3 | d | OD | 2 |
| Specific Volume | m^3/kg | v | OV | 3 |
| Specific enthalpy | kJ/kg | h | OH | 4 |
| Specific entropy | kJ/(kg·K) | s | OS | 5 |
| 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 |
| Steam quality | x | OX | 15 | |
| Region | r | OR | 16 | |
| Dynamic viscosity | kg/(m·s) | dv | ODV | 24 |
| Kinematic viscosity | m^2/s | kv | OKV | 25 |
| Thermal conductivity | W/(m.K) | tc | OTC | 26 |
| Thermal diffusivity | um^2/s | td | OTD | 27 |
| Prandtl number | pr | OPR | 28 | |
| Surface tension | mN/m | st | OST | 29 |
| Static Dielectric Constant | sdc | OSDC | 30 |