Appendix B: Transient Solver Mathematical Foundation
This appendix provides a high-level overview of the physical and mathematical foundation of the R-THYM transient hydraulic engine.
The R-THYM web application is directly integrated with the open-source RTHYM-MOC engine. This ensures that the solver physics, numerical accuracy, and boundary condition logic remain mathematically equivalent across both the JavaScript web environment and the C++/Python engines.
For detailed mathematical derivations—including the governing partial differential equations, Courant grid discretization, unsteady friction (Brunone) filter formulations, and the specific quadratic proofs for all boundary conditions (valves, pumps, and hydropneumatic tanks)—please refer to the complete theoretical documentation hosted in the RTHYM-MOC GitHub repository.
1. Solver Architecture & Scope
The engine utilizes the Method of Characteristics (MOC), a widely established numerical technique for computing the propagation of pressure waves through pressurized pipe networks. The solver is designed to accurately model:
- 1-D flow (cross-sectional average velocities)
- Elastic pipe walls and slightly compressible liquids
- Fully turbulent, single-phase liquid conditions
- Relatively small velocity changes (the acoustic approximation)
Internal Unit System
All calculations are performed internally using US customary units. The API boundary automatically handles conversion from user-facing inputs (such as GPM or psi) to the internal system:
| Quantity | Internal Unit | API Boundary Equivalent |
|---|---|---|
| Length, diameter | ft | inches (for diameter) |
| Piezometric head | ft | - |
| Velocity | ft/s | - |
| Flow | ft³/s (CFS) | GPM |
| Pressure | ft HGL | psi |
| Gravitational acceleration g | 32.2 ft/s² | - |
2. Fundamental Benchmark: The Joukowsky Relation
While the complete system of MOC compatibility equations (C+ and C-) is handled by the open-source library, the theoretical maximum pressure surge for an instantaneous flow stoppage remains the primary physical benchmark used to validate the solver.
This instantaneous pressure change is governed by the Joukowsky equation:
$$\Delta H = -\frac{a}{g} \Delta V$$For a complete, instantaneous valve closure from an initial velocity $V_0$, the maximum head rise is:
$$\Delta H = \frac{a \cdot V_0}{g}$$Where: * $H$ = piezometric head (ft) * $V$ = cross-sectional average velocity (ft/s) * $a$ = pressure wave speed (ft/s) * $g$ = gravitational acceleration (32.2 ft/s²)
By default, when no specific pipe material elasticity ($E$) is defined, the engine applies a conservative rigid-pipe approximation with a wave speed of $a = 4{,}000 \text{ ft/s}$.
3. Advanced Numerical Parameters
For advanced transient calibration, the engine exposes several adjustable numerical parameters. The default values represent conservative, industry-standard assumptions:
| Parameter | Symbol | Default | Notes |
|---|---|---|---|
| Time step | $\Delta t$ | 0.01 s | Spatial grids are auto-adjusted to maintain a Courant number of 1.0 |
| Vapor pressure | $p_\text{vap}$ | −14.0 psi | Threshold for column separation (simplified cavitation) |
| Boundary-layer time constant | $\tau_{BL}$ | 0.5 s | IIR filter constant for unsteady friction (USF) |
| Brunone USF coefficient | $k_\text{Bru}$ | 0.0 | 0 = steady friction only; typical calibrated range: 0.02–0.15 |
Further Reading: For a complete breakdown of how these parameters are utilized in the discrete algebraic MOC updates, visit the RTHYM-MOC documentation.