Skip to main content

Crate vle_steam

Crate vle_steam 

Source
Expand description

§vle-steam — IAPWS-IF97 industrial water/steam properties

Steam tables are the single most-used thermodynamic reference in chemical engineering practice — sizing reboilers and condensers, steam-header balances, flash-steam recovery, turbine and valve calculations. Every printed steam table in a modern handbook is computed from one open standard, the IAPWS Industrial Formulation 1997 (IF97), so this crate implements that standard directly rather than interpolating tabulated data.

This is, in effect, “VLE for water only”: a companion to the multicomponent vle-thermo engine, kept as a separate crate because IF97 is a self-contained formulation with zero coupling to the mixture-EOS machinery — and dependency-free (pure f64 math), so it stays trivially portable to a static-library / FFI build.

§What is implemented

RegionPhysical domainEquation
1Compressed / subcooled liquid, 273.15–623.15 KGibbs g(p,T)
2Superheated vapor, ≤ 1073.15 K, ≤ 100 MPaGibbs g(p,T)
3Near-critical, 623.15–863.15 K above B23Helmholtz f(ρ,T)
4Saturation line, 273.15–647.096 Kclosed-form both ways
5High-T steam, 1073.15–2273.15 K, ≤ 50 MPaGibbs g(p,T)

Plus IF97 backward equations T(p,h) and T(p,s) for regions 1 and 2 (all three sub-regions each), which seed a short Newton polish on the forward equation — so a PH or PS flash costs a polynomial evaluation and two or three refinement steps rather than a bracketed search. Regions 3 and 5 still solve T by bracketed iteration on the forward surface. Property derivatives are analytic throughout, never finite differences.

Beyond the thermodynamic surface, the crate implements the three IAPWS transport/interfacial releases in their industrial form — viscosity (viscosity, R12-08), thermal conductivity (thermal_conductivity, R15-11, critical enhancement included) and surface tension (surface_tension, R1-76(2014)) — plus the derived Prandtl number, kinematic viscosity and thermal diffusivity. See transport.

§Units

The public API takes T in K and P in kPa absolute (the repo canon, matching vle-thermo) and returns mass-basis properties — what every steam-table user expects:

  • specific enthalpy h, internal energy u — kJ/kg
  • specific entropy s, heat capacities cp, cv — kJ/(kg·K)
  • specific volume v — m³/kg; density ρ — kg/m³
  • speed of sound w — m/s

Internally the IF97 equations run in their native units (MPa, kJ/kg); conversion happens once at the API boundary. Every function documents its units per the project’s units rule.

§References

  • IAPWS. Revised Release on the IAPWS Industrial Formulation 1997 for the Thermodynamic Properties of Water and Steam; IAPWS R7-97(2012), 2012.
  • Wagner, W.; Kretzschmar, H.-J. International Steam Tables, 3rd ed.; Springer: Berlin, 2019.

Re-exports§

pub use region4::d_psat_d_t as psat_derivative_mpa;
pub use region4::psat as psat_mpa;
pub use region4::tsat as tsat_mpa;
pub use regions::Region;
pub use regions::region_of;
pub use transport::surface_tension;

Modules§

region4
IF97 Region 4 — the saturation line, 273.15 K … 647.096 K.
regions
Region detection and the B23 boundary line.
transport
Transport and interfacial properties — viscosity, thermal conductivity, surface tension.

Structs§

MolarState
A molar-basis view of a SteamState, for interop with the molar-canon vle-thermo engine. Converts via M_water = 18.015268 kg/kmol.
Props
A full mass-basis property set at one single-phase state point.
SatProps
A saturation-table row: the classic printed-steam-table entry.
SteamState
A fully-resolved water/steam state at one point.

Enums§

Phase
The qualitative phase of a SteamState.
SteamError
Errors returned by the state constructors and property queries.

Constants§

M_WATER
Molar mass of water, kg/kmol (IAPWS value) — used by the .molar() view to convert mass-basis properties to the engine’s molar canon.
P_C_MPA
Critical pressure of water, MPa (R7-97 §1).
R
Specific gas constant of ordinary water, kJ/(kg·K).
RHO_C
Critical density of water, kg/m³ (R7-97 §1).
T_C
Critical temperature of water, K (R7-97 §1).

Functions§

latent_heat
Latent heat of vaporization at temperature t.
latent_heat_at_p
Latent heat of vaporization at pressure p.
psat
Saturation pressure at temperature t.
psat_derivative
Analytic derivative dPsat/dT of the saturation curve.
sat_p
Saturation-table row at a given pressure.
sat_t
Saturation-table row at a given temperature.
thermal_conductivity
Thermal conductivity at a single-phase state.
tsat
Saturation temperature at pressure p.
viscosity
Dynamic viscosity at a single-phase state.
viscosity_rho_t
Dynamic viscosity from density and temperature — the form IAPWS R12-08 is written in, and the one region-3 callers already have.