Skip to main content

tampines_steam_tables/
lib.rs

1//! # TAMPINES Steam Tables
2//!
3//! In-house Rust implementation of the IAPWS-IF97 industrial formulation for
4//! the thermodynamic and transport properties of water and steam, used by the
5//! TAMPINES (Thermo-hydraulic Artificial-intelligence Multi-Phase INtegrated
6//! Emulator System) solver. Unlike the upstream `rust-steam` library it draws
7//! from, every public property function takes and returns `uom` dimensioned
8//! quantities (SI units) rather than bare `f64`.
9//!
10//! ## Organisation
11//!
12//! Properties are grouped by IAPWS-IF97 region:
13//!
14//! - Region 1 — subcooled liquid (273.15–623.15 K, up to 100 MPa, below saturation)
15//! - Region 2 — vapour / superheated steam (incl. a metastable subregion)
16//! - Region 3 — single-phase near-critical liquid/vapour + supercritical fluid
17//! - Region 4 — vapour-liquid equilibrium (the saturation line)
18//! - Region 5 — ultra-high-temperature steam (> 800 °C, up to ~2273 K)
19//!
20//! Forward equations are `(p,T)` / `(v,T)` flashes; the backward (inverse)
21//! equations solve from `(p,h)`, `(p,s)`, or `(h,s)`. The user-facing
22//! region-dispatch entry points (both a functional API and the
23//! `TampinesSteamTableCV` control-volume type) live in [`interfaces`]. Transport
24//! and miscellaneous properties are in [`dynamic_viscosity`],
25//! [`thermal_conductivity`], [`surface_tension`], and [`dielectric_constant`].
26//! Nozzle / turbine and HEM choked-flow equations are in
27//! [`steam_turbine_equations`].
28//!
29//! All quantities are SI: pressure in Pa, temperature in K, specific enthalpy
30//! and energy in J/kg, specific entropy and heat capacity in J/(kg·K), specific
31//! volume in m³/kg, density in kg/m³.
32
33/// allows for easy importing as with most rust
34/// crates.
35pub mod prelude;
36#[warn(missing_docs)]
37/// constants for the steam table calculations
38pub mod constants;
39
40/// region 1
41///
42/// Temperature from 273.15 to 623.15 K
43/// Pressure from 0 to 100 MPa
44///
45/// Up to the saturation line.
46/// This I believe is subcooled liquid region
47pub mod region_1_subcooled_liquid;
48
49/// region 2
50///
51/// vapour region
52pub mod region_2_vapour;
53
54/// region 3
55///
56/// single phase liquid and vapour
57/// region, also includes supercritical region
58/// and critical point
59///
60/// auxilliary equation for region 2 and 3 are also put here
61///
62///
63pub mod region_3_single_phase_plus_supercritical_steam;
64
65/// region 4
66///
67/// two phase region
68/// where vapour liq equilibrium exists
69pub mod region_4_vap_liq_equilibrium;
70
71/// region 5
72///
73/// superheated steam region (ultra high temp)
74pub mod region_5_steam_at_800_plus_degc;
75
76/// backward equations ph boundary equations
77/// overall equation
78pub mod backward_eqn_ph_region_1_to_4;
79
80/// backward equations ps boundary equations
81/// overall equation
82pub mod backward_eqn_ps_region_1_to_4;
83
84/// backward equations hs boundary equations
85/// overall equation
86pub mod backward_eqn_hs_region_1_to_4;
87
88/// dynamic viscosity calcs
89pub mod dynamic_viscosity;
90
91/// thermal conductivity calcs
92pub mod thermal_conductivity;
93
94/// public facing interfaces where the user
95/// simply inputs pressure and temperature
96/// or pressure and enthalpy etc
97/// and gets all the required data automatically
98///
99/// the logic for splitting between regions is
100/// mostly here
101pub mod interfaces;
102
103/// surface tension
104/// important for boiling
105pub mod surface_tension;
106
107/// dielectric constant
108pub mod dielectric_constant;
109
110/// useful equations for steam turbines
111/// These include nozzles, impulse turbines
112/// and reaction turbines at some steady
113/// state,
114/// as well as angular momentum balance
115pub mod steam_turbine_equations;
116
117/// reference openfoam algorithms which will be combined with steam
118/// tables for solving simple two phase flow problems
119pub mod openfoam_algorithms;
120
121/// Re-export of the 1-D compressible PIMPLE pipe array solver
122/// (`TampinesSteamArray`) and its error type (`TampinesSteamArrayError`) from
123/// [`openfoam_algorithms::rhoPimpleFoam`], surfaced at the crate root for
124/// convenience. `TampinesSteamArray` backs each finite-volume cell with an
125/// IAPWS-IF97 `(p,h)` flash so a 1-D pipe can carry two-phase steam-water flow.
126pub use openfoam_algorithms::rhoPimpleFoam::{
127    AdvectionTerminalState, SolverMode, TampinesSteamArray, TampinesSteamArrayError,
128};
129
130// pool boiling code for use within the fhr sim v1
131mod fhr_sim_debugging_tests;