Transient Tank Pressurization and Blowdown Validation of OpenFLUME
A validation study of transient tank gas dynamics — adiabatic blowdown through a choked orifice, time-step convergence, two-tank pressure equalization, adiabatic charge (fill) heating, and blowdown through a scheduled valve
Generated by scripts/tank-transient-validation-report.ts — all numbers and figures come from live solves of the current solver. The corresponding CI gates are src/core/__tests__/transient.test.ts and src/core/__tests__/benchmarks.test.ts.
Abstract
This report verifies and validates the transient (time-marching) capability of the OpenFLUME solver — a pressure-based node-and-branch network code in the same family as NASA's GFSSP — for lumped tank gas dynamics. A tank is an internal node with a finite volume whose stored mass and internal energy are integrated in time; the solver's backward-Euler / coupled-Newton predictions are compared against fourth-order Runge-Kutta integrations of the exact lumped-parameter ODEs and against classical closed-form results: the choked adiabatic blowdown solution and its cooling law T/T₀ = (m/m₀)^(γ−1), the two-tank equalization equilibrium pressure from energy conservation, and the adiabatic fill-heating limit T → γT_supply. Five cases are run: choked blowdown through a gas orifice (ISO/AGA expansibility, choking at $r_*$), a four-level time-step convergence study of that blowdown, equalization of two unequal tanks through an orifice, charging of a tank from a constant-pressure supply, and blowdown through a valve whose area follows a prescribed opening schedule. At the working time step (dt = 0.05 s) every trace agrees with its analytical reference to within 1.5 %, the time-step study confirms the expected first-order convergence of the backward-Euler integrator, and global mass conservation holds to 0.001 % or better in every case.
Introduction
Steady network solvers answer "what flow does this system carry"; transient solvers answer "how does it get there and how fast". For pressurized-gas systems the canonical transient problems are the blowdown of a tank through an orifice, the charging of a tank from a supply line, and the equalization of two tanks — problems with exact lumped-parameter solutions that exercise precisely the terms a network code must get right: the nodal mass-storage term ρV, the internal-energy storage term m·c_v·T, and the enthalpy ṁ·c_p·T carried by every branch. They are also unforgiving of energy-equation mistakes: an adiabatic blowdown must cool following T/T₀ = (m/m₀)^(γ−1), and an adiabatic fill must heat above the supply temperature — a tank filled from an evacuated state approaches γT_supply, a classical result of open-system thermodynamics (Moran & Shapiro). The purpose of this report is to verify the OpenFLUME transient integrator against these benchmarks with the same live-solve, figure-for-figure reporting format as the companion GFSSP compressible-flow report (docs/validation/compressible-report.md).
Problem Description
The working fluid is air, treated as an ideal gas with γ = 1.4, R = 287 J/kg·K, and c_p = γR/(γ−1) = 1004.5 J/kg·K (so that c_p, c_v = 717.5 J/kg·K, and γ are mutually consistent and the analytic closed forms hold exactly). Five cases are studied:
| Case | Description |
|---|---|
| 1 | Adiabatic blowdown of a 0.1 m³ tank from 10 bar through a choked gas orifice |
| 2 | Time-step convergence study of case 1 at dt = 0.4 / 0.2 / 0.1 / 0.05 s |
| 3 | Pressure equalization of two tanks (0.05 m³ at 5 bar, 0.1 m³ at 2 bar) through an orifice |
| 4 | Adiabatic charging of a 0.1 m³ tank at 1 bar from a 5 bar constant-pressure supply (fill heating) |
| 5 | Blowdown of a 0.1 m³ tank at 5 bar through a valve whose position ramps 0 → 1 over 2 s in series with a fixed orifice |
Single-Tank Layouts
Cases 1, 2, 4, and 5 use one tank — an internal node with volume — connected to a pressure boundary through a flow component (Figure 1). Case 1 vents through an orifice (expansibility $Y(r,\kappa)$ with choking, C_d = 0.6, A = 10⁻⁴ m²) to a 1 bar boundary; the pressure ratio stays below the critical value 0.5283 for the whole 8 s transient (the final tank pressure is 2.91 bar, still above the unchoking pressure of 1.89 bar; final ratio P_b/P = 0.344 < 0.528), so the orifice is choked throughout. Case 4 reverses the flow: a 5 bar, 300 K supply charges the tank through a square-law resistance (K = 10, A = 0.001 m²). Case 5 vents through a scheduled valve in series with a fixed orifice, joined by a small plenum node (volume 10⁻⁶ m³).
Figure 1. Lumped tank connected to a pressure boundary through a flow component (cases 1, 2, 4, 5).
Two-Tank Layout
Case 3 joins two rigid tanks of different volumes and pressures with an orifice (C_dA = 6.0e-5 m²). Both start at 300 K. A closed valve (position 0) connects tank 1 to a boundary node because the transient system requires at least one boundary; its measured leakage flow is 2.0e-5 of the peak orifice flow — negligible (Figure 2).
Figure 2. Two-tank equalization layout (case 3).
Benchmark Solutions
Tank ODEs
A rigid adiabatic tank of volume V exchanging mass through quasi-steady branches obeys the lumped mass and energy balances
$$\frac{dm}{dt} = \sum \dot m_{in} - \sum \dot m_{out}, \qquad \frac{dU}{dt} = \sum \dot m_{in}, c_p T_{up} - \sum \dot m_{out}, c_p T, \qquad U = m, c_v T, \quad P = \frac{m R T}{V},$$
where each stream carries the enthalpy of its upstream state. These ODEs are integrated with classical fourth-order Runge-Kutta at a reference step of 1 ms (0.5 ms for the coupled two-tank system, 2.5 ms for the scheduled valve) — 50–100× finer than the solver's step, so the reference truncation error is negligible against the deviations being measured.
Choked Orifice Mass Flux
The gas orifice ($Y(r,\kappa)$ with choking) passes the isentropic mass flux
$$\dot m = C_d A, P_u \sqrt{\tfrac{\gamma}{R T_u}} \left(\tfrac{2}{\gamma+1}\right)^{\frac{\gamma+1}{2(\gamma-1)}} \quad \text{for } P_d/P_u \le \left(\tfrac{2}{\gamma+1}\right)^{\frac{\gamma}{\gamma-1}} = 0.5283,$$
$$\dot m = C_d A, P_u \sqrt{\tfrac{2\gamma}{(\gamma-1) R T_u}\left[\left(\tfrac{P_d}{P_u}\right)^{2/\gamma} - \left(\tfrac{P_d}{P_u}\right)^{(\gamma+1)/\gamma}\right]} \quad \text{otherwise},$$
the standard result for isentropic flow through a converging passage (Saad; Anderson).
Adiabatic Blowdown: Cooling Law and Closed Form
For an adiabatic tank discharging through any orifice, eliminating time from the mass and energy balances gives the polytropic cooling law
$$\frac{T}{T_0} = \left(\frac{m}{m_0}\right)^{\gamma-1}, \qquad \frac{P}{P_0} = \left(\frac{m}{m_0}\right)^{\gamma}.$$
While the orifice is choked the mass balance closes in closed form:
$$\frac{m}{m_0} = \left[1 + \frac{\gamma-1}{2},\frac{t}{\tau}\right]^{-\frac{2}{\gamma-1}}, \qquad \tau = \frac{V}{C_d A, \sqrt{\gamma R T_0},\left(\frac{2}{\gamma+1}\right)^{\frac{\gamma+1}{2(\gamma-1)}}} = 8.295\ \text{s}.$$
The RK4 reference and this closed form agree to within 2.9e-13 % of P₀ over the whole transient — machine-level agreement that cross-checks both derivations, exactly as the Fanno/Rayleigh closed forms cross-check the RK4 duct integration in the companion report.
Two-Tank Equalization Equilibrium
Two rigid adiabatic tanks exchanging mass conserve total internal energy, and since U = PV/(γ−1) for an ideal gas, the common final pressure is
$$P_{eq} = \frac{P_{1,0} V_1 + P_{2,0} V_2}{V_1 + V_2} = 3.00\ \text{bar},$$
independent of the flow path. The individual final temperatures are path-dependent (the discharging tank cools, the receiving tank heats) and are taken from the RK4 integration of the coupled four-equation system.
Adiabatic Fill Heating
Charging a rigid adiabatic tank from a constant supply at T_s converts flow work into internal energy: the energy balance U_f − U_0 = Δm·c_p·T_s gives, for T_s = T₀,
$$T_f = \frac{\gamma, T_0, P_f}{P_f + (\gamma-1) P_0} = 388.9\ \text{K at } P_f = 5\ \text{bar},$$
which reduces to the classical evacuated-tank limit T_f → γT_s = 420 K as P₀ → 0 (Moran & Shapiro). The fill in case 4 completes well within the 5 s window, so the solver's final temperature can be compared directly against this closed form as well as against the RK4 trace.
Numerical Modeling
OpenFLUME integrates the transient network with backward (implicit) Euler: at every time step the full set of nodal mass and energy balances — including the storage terms (ρV)ⁿ⁺¹ − (ρV)ⁿ and (m c_v T)ⁿ⁺¹ − (m c_v T)ⁿ for every internal node with volume — is solved simultaneously with the branch momentum relations by a coupled Newton-Raphson iteration on the end-of-step state. A tank is therefore nothing special: it is an internal node whose volume field activates the storage terms. Branch closures are quasi-steady and evaluated at end-of-step conditions: a gas orifice imposes ṁ = ṁ_isentropic(P_u, P_d, T_u) via $Y(r,\kappa)$, a liquid orifice and resistance impose ΔP = K ṁ²/(2ρ_up C_dA²)-type square laws with upstream density, and scheduled valves interpolate their position at the end-of-step time. Backward Euler is unconditionally stable and first-order accurate: its truncation error is O(dt), so halving the time step should halve the deviation from the exact solution — the hypothesis tested in the time-step study below. All solves here use fixed stepping, a Newton tolerance of 10⁻⁹, and the same networks as the CI gates.
Time-Step Selection
Case 1 is run at four time steps, dt = 0.4, 0.2, 0.1, 0.05 s (20 / 40 / 80 / 160 steps over the 8 s transient). Figure 6 overlays the pressure traces on the RK4 reference; Figure 7 plots the deviations against dt. The trace deviation is dominated by the first-order local truncation error of backward Euler and shrinks almost exactly linearly with dt: the final-pressure deviation falls from 1.07 % of P₀ at dt = 0.4 s to 0.14 % at dt = 0.05 s, an observed convergence order of 0.99, 0.99, 1.00 between successive halvings (1.00 is ideal first order). The CI gate asserts the same behavior (error ratio between 1.5 and 3.0 for a dt halving). On this basis dt = 0.05 s — roughly τ/166 — is used as the working step for every case in this report; even the coarsest step, dt = 0.4 s ≈ τ/21, stays within 1.2 % of the reference everywhere, a useful property for design-loop screening runs.
| dt [s] | steps | max ΔP trace | max ΔT trace | final ΔP | final Δṁ (max, /ṁ₀) |
|---|---|---|---|---|---|
| 0.4 | 20 | 1.16 % | 1.25 % | 1.07 % | 1.00 % |
| 0.2 | 40 | 0.59 % | 0.64 % | 0.54 % | 0.51 % |
| 0.1 | 80 | 0.30 % | 0.32 % | 0.27 % | 0.25 % |
| 0.05 | 160 | 0.15 % | 0.16 % | 0.14 % | 0.13 % |
Figure 6. Time-step study: blowdown pressure traces at dt = 0.4, 0.2, and 0.1 s against the RK4 reference.
Figure 7. Deviation from the RK4 reference versus time step: near-linear decay confirms first-order backward-Euler convergence.
Results and Discussion
The table below summarizes the agreement between the solver and the analytic references at the working step dt = 0.05 s. Trace deviations are maxima over all solved time points, normalized by the initial tank pressure P₀ and temperature T₀ (the convention of the CI gates); final-state deviations are taken at t = endTime; the conservation column is the global mass balance — the integrated branch flow ∫|ṁ| dt versus the tank mass change V·Δρ (cases 1, 4, 5), or the maximum total-mass drift (case 3).
| Case | max ΔP trace | max ΔT trace | final ΔP | final ΔT | mass conservation | steps |
|---|---|---|---|---|---|---|
| 1 — Choked blowdown (dt = 0.05 s) | 0.15 % | 0.16 % | 0.136 % | 0.162 % | 0.000 % | 160 |
| 3 — Two-tank equalization (vs P_eq) | 0.48 % | 0.26 % | 0.001 % | 0.079 % | 0.001 % | 60 |
| 4 — Adiabatic fill | 1.46 % | 0.25 % | 0.001 % | 0.000 % | 0.000 % | 100 |
| 5 — Scheduled valve | 1.16 % | 0.68 % | 0.000 % | 0.436 % | 0.001 % | 80 |
(Case 2 is the dt sweep tabulated in the previous section. Case 3's final-ΔP column compares against the closed-form equilibrium pressure; its final-ΔT column and all trace columns compare against the coupled RK4 reference, and its conservation column is the peak total-mass drift.)
Case 1: Adiabatic Blowdown Through a Choked Orifice
The tank starts at 10 bar and 300 K and vents to a 1 bar boundary. Over 8 s it loses 58.6 % of its initial 1.161 kg charge; the pressure falls to 2.91 bar and the gas cools by adiabatic expansion to 210.8 K. Figures 3 and 4 compare the solver's pressure and temperature traces with the RK4 reference and the choked closed form (the two analytic curves are indistinguishable at plot scale, deviating by at most 2.9e-13 %); Figure 5 compares the vent mass flow rate. The solver tracks the pressure trace within 0.15 % of P₀, the temperature within 0.16 % of T₀ — confirming the T/T₀ = (m/m₀)^(γ−1) cooling law that the CI gate asserts to 1 % — and the mass flow within 0.13 % of the initial flow. The deviations are one-sided — the implicit step evaluates the vent flow at the end-of-step (lower-pressure) state, so each step discharges slightly less mass than the true average and the discrete trace lags the exact decay — and they shrink linearly with dt, as the time-step study shows. Global mass conservation — discharged mass versus tank inventory change — closes to 4.7e-5 %.
Figure 3. Tank pressure during choked adiabatic blowdown: RK4 reference, choked closed form, and solver.
Figure 4. Tank temperature during choked adiabatic blowdown: the gas cools following T/T₀ = (m/m₀)^(γ−1).
Figure 5. Vent mass flow rate during choked blowdown.
Case 3: Two-Tank Pressure Equalization
Tank 1 (0.05 m³ at 5 bar) discharges into tank 2 (0.1 m³ at 2 bar) through an orifice until the pressures meet at the energy-conservation equilibrium 3.00 bar. Figure 8 shows both pressure traces against the coupled RK4 reference with the closed-form equilibrium marked; the solver reaches final pressures of 3.000 and 3.000 bar — within 1.0e-3 % of the exact value — and tracks the transient within 0.48 % of P₁,₀. Figure 9 shows the thermal signature of the exchange: the expanding tank cools to 259.5 K while the receiving tank, compressed and fed with warm enthalpy, heats to 325.4 K (RK4: 259.3 / 325.6 K). Total mass drifts by at most 8.2e-4 % over the transient, and the closed boundary valve leaks only 2.0e-5 of the peak orifice flow.
Figure 8. Two-tank equalization: both tank pressures converge to the closed-form equilibrium (P₁V₁+P₂V₂)/(V₁+V₂).
Figure 9. Two-tank equalization: the discharging tank cools, the receiving tank heats.
Case 4: Adiabatic Charging (Fill Heating)
The tank starts at 1 bar, 300 K and is charged from a 5 bar supply at the same temperature. Because the entering stream carries enthalpy c_pT_s but the tank stores only internal energy c_vT, the contents heat above the supply temperature — the classical fill-heating effect. The solver's final temperature is 388.9 K against the closed-form 388.9 K (deviation 8.1e-8 %), squarely between the supply temperature and the evacuated-tank limit γT_s = 420 K, and the final pressure equalizes to 5.000 bar. Figures 10 and 11 show the pressure and temperature traces: the fill completes in roughly 1 s (the square-root pressure-deficit law closes in finite time), after which both curves sit on their equilibrium values. Trace agreement is within 1.46 % of P_s on pressure and 0.25 % of T_s on temperature; mass conservation closes to 7.5e-7 %.
Figure 10. Tank pressure during adiabatic charging from a constant-pressure supply.
Figure 11. Tank temperature during adiabatic charging: fill heating carries the contents above the supply temperature toward the γT_s limit.
Case 5: Blowdown Through a Scheduled Valve
The tank vents through a valve whose position ramps linearly from 0 to 1 over 2 s and then holds, in series with a fixed orifice — the analytic reference integrates the same series network with the time-varying effective area by RK4 with an inner bisection for the intermediate pressure. This case exercises time-varying component handling: the solver interpolates the valve schedule at each end-of-step time inside the coupled Newton solve. Figure 12 shows the tank pressure: nearly flat while the valve is barely open, then a fast blowdown as the effective area grows, approaching the 1 bar ambient (final pressure 1.000 bar vs 1.000 bar reference; final temperature 190.7 K vs 189.4 K). Figure 13 shows the vent flow rising with the schedule to a peak of 0.289 kg/s and collapsing as the tank empties. The solver tracks the pressure within 1.16 % of P₀ and the flow within 4.82 % of the peak; the largest flow deviation sits at the emptying knee near t ≈ 2.2 s, where the flow collapses fastest and the first-order backward-Euler step lags the steep decay — a truncation effect that shrinks with dt like every other deviation in this report. Discharged mass matches the tank inventory change to 1.0e-3 %.
Figure 12. Tank pressure during blowdown through a valve following a linear opening schedule.
Figure 13. Vent mass flow during the scheduled-valve blowdown: the flow follows the valve ramp, peaks, and collapses as the tank empties.
Conclusions
The transient integrator of OpenFLUME — backward Euler with a fully coupled Newton solve of the nodal mass/energy storage and branch momentum equations — reproduces the classical lumped-parameter gas dynamics of tank systems. Choked adiabatic blowdown follows the closed-form solution and its T/T₀ = (m/m₀)^(γ−1) cooling law; two-tank equalization lands on the exact energy-conservation equilibrium pressure to 1.0e-3 %; adiabatic charging reproduces the fill-heating closed form to 8.1e-8 %; and a scheduled valve demonstrates time-varying component handling against an RK4 reference with time-varying area. All traces agree with their references to within 1.5 % at dt = 0.05 s, deviations decay at the expected first order in dt (observed orders 0.99, 0.99, 1.00), and global mass conservation closes to 0.001 % or better. The dominant error is the first-order temporal truncation of backward Euler — visible as a one-sided lag at coarse dt — not any defect in the storage or transport terms. Heat transfer to tank walls and real-fluid tank thermodynamics are exercised by other parts of the test suite and remain out of scope here.
References
- Saad, M. A., Compressible Fluid Flow, 2nd ed., Prentice Hall, 1993 (isentropic orifice flow, choking).
- Anderson, J. D., Modern Compressible Flow: With Historical Perspective, 3rd ed., McGraw-Hill, 2003.
- Moran, M. J., Shapiro, H. N., Boettner, D. D., and Bailey, M. B., Fundamentals of Engineering Thermodynamics, 8th ed., Wiley, 2014 (transient charging and discharging of rigid vessels; fill heating).
- White, F. M., Fluid Mechanics, 7th ed., McGraw-Hill, 2011 (orifice discharge coefficients).
- Press, W. H., et al., Numerical Recipes, 2nd ed., Cambridge University Press, 1992 (fourth-order Runge-Kutta method).
- Majumdar, A. K., LeClair, A. C., Moore, R., and Schallhorn, P. A., Generalized Fluid System Simulation Program, Version 6.0, NASA/TM-2013-217492, 2013 (network transient formulation).
Nomenclature
| Symbol | Meaning |
|---|---|
| A | orifice / valve flow area |
| C_d | discharge coefficient |
| c_p, c_v | specific heats at constant pressure / volume |
| dt | solver time step |
| K | resistance loss coefficient |
| m | tank gas mass |
| ṁ | mass flow rate |
| P | tank pressure |
| P_b | boundary pressure |
| P_eq | equalization equilibrium pressure |
| R | gas constant |
| T | tank temperature |
| T_s | supply temperature |
| t | time |
| U | tank internal energy |
| V | tank volume |
| γ | specific heat ratio |
| ρ | density |
| τ | choked-blowdown time constant |
| 0 / f | initial / final state |
| u / d | upstream / downstream state |