Validation 5 — NH3 breakthrough of a Langmuir storage bed¶
Time: ~10 minutes. Case: examples/benchmarks/thomas_nh3_breakthrough.toml.
Gated by: tests/validation/test_thomas_breakthrough.py, which also runs
this case file.
An SCR catalyst stores ammonia on its surface before it reduces NOx with it.
Feed NH3 into a clean brick and none leaves at first: the surface takes it up,
and a front of saturated sites moves slowly down the brick. When the front
reaches the end the outlet NH3 rises, and that rise is the breakthrough curve.
This page checks the storage model a case runs ([pipe.species] reaction =
"nh3_ads_des"; closures/scr_kinetics.py, make_nh3_ads_des) against the
exact breakthrough curve of a Langmuir bed.
Where the case is
examples/benchmarks/ is in a clone, in the GUI installers and, from the
release after 0.5.2, in the pip install aeolus1d wheel, where
aeolus1d examples prints its directory on line 1. The commands below run
from a clone. The comparison snippet imports the exact solution from
tests/, which only a clone has.
The problem¶
Gas flows at u through a bed with W storage sites per reactor volume. A
fraction θ of them hold NH3. With the Temkin term off (alpha_des = 0) the
model is Langmuir's: sites fill at a rate set by the gas concentration C and
the free sites, and empty at a rate set by the filled ones,
The bed starts clean, and the feed carries C₀ from t = 0. H. C. Thomas solved this exactly in 1944 ("Heterogeneous ion exchange in a flowing system", J. Am. Chem. Soc. 66, 1664, doi:10.1021/ja01238a017). Write X = k_a W x / u for the distance and Y = k_d (t − x/u) for the time, where the x/u is the time the gas takes to get there. Write κ = K C₀ = k_a C₀ / k_d for how strongly the surface binds at the feed, and r = 1/(1 + κ) for the separation factor. With Thomas's function J(x, y) = 1 − ∫₀ˣ e^(−y−s) I₀(2√(ys)) ds,
The equilibrium coverage is κ r. The bed's stoichiometric front leaves it at Y = r X_L, so throughput 1, (t − L/u)/t_stoich, is the moment a bed with no kinetic spread would break through. The test checks the formula before it uses it: - It satisfies the two equations, and the residual falls as the square of the difference step (1.19e-5, then 2.98e-6 when the step halves). - J satisfies its own symmetry identity. - The boundaries hold: the feed at the inlet, a clean bed ahead of the gas, and C/C₀ = e^(−X) just behind the gas front. - So do the equilibrium and the mass balance: the NH3 the bed takes up is its equilibrium load, to 1e-8.
What the discretisation should give. The quasi-steady solver moves the gas
through the bed by upwind differences inside its stiff chemistry solve
(qs_surface_transport). The density and the temperature are frozen during
that solve, and with no heat of adsorption nothing else changes. So a run is
an N-cell cascade: each cell is a stirred tank feeding the next, integrated by
LSODA. That converges on Thomas at first order in 1/N. A cell's value is the
gas leaving it, so it belongs at the cell's downstream face.
The bundled case: air at 500 K and 1 bar, u = 10 m/s, through a 0.1 m bed of 100 cells. The feed carries NH3 at a mass fraction of 3e-4 (C₀ = 0.0123 mol/m³, about 500 ppm). There are W = 100 mol/m³ of sites, with k_a = 20 m³/(mol s), so that k_a W L / u = 20, and k_d = k_a C₀, so that K C₀ = 1. That makes the separation factor ½ and the equilibrium coverage ½. Neither rate has an activation energy, and there is no heat of adsorption. The bed holds 4074 times the NH3 in its gas, so the front takes 40.7 s, about 4000 residence times, to cross it. The run goes to throughput 2, at 81.5 s.
Run it¶
Terminal¶
aeolus1d run examples/benchmarks/thomas_nh3_breakthrough.toml --out /tmp/thomas.h5 --trace-dt 1.0
About 3 s. --trace-dt 1.0 records the bed about once a second, which the
comparison below reads the breakthrough curve from. Without it the file holds
only the end state, a saturated bed with C/C₀ = 1 and θ = ½ everywhere.
The case sets qs_cfl_adv = 1e9. By default the quasi-steady step is held
to half a cell's residence time (qs_cfl_adv = 0.5), here 0.05 ms against an
81 s run. On 25 cells, a run to throughput 1 took 203,691 steps and 306 s that
way. The transport is inside the stiff solve, so the step only sets where that
solve stops. At 1e9 the step reaches qs_dt_max. On 10 cells at
chem_rtol = 1e-9, 8154 steps and 32 steps give beds within 4e-9 of each
other (the test checks this).
GUI¶
- File → Open Example → Benchmarks → thomas_nh3_breakthrough.
- In the Runner dock tick Trace every Δt: and set it to 1 s.
- Click Run (or press F5).
- In the plot dock pick Y_NH3 and move the time slider. The front, where
Y_NH3 rises from 0 to the feed's 3e-4, moves down the bed and reaches the
outlet near t = 41 s. Pick surface/theta_NH3 for the stored ammonia's
coverage. In the output file it is in the
surfacegroup (pipes/bed/surface/theta_NH3, and undertime_series/with a trace).
Compare with the exact solution¶
From the repository root, on the traced file:
import h5py
import numpy as np
from tests.validation.test_thomas_breakthrough import X_L, k_d, thomas
with h5py.File("/tmp/thomas.h5") as f:
t = f["time_series/t"][:]
c_out = f["time_series/pipes/bed/Y_NH3"][:, -1] / 3.0e-4 # C / C0 leaving the bed
Y = k_d(1.0) * (t - 0.01) # k_d (t - L/u)
exact = np.array([thomas(X_L, y, 1.0)[0] for y in Y])
i = np.searchsorted(Y, 10.0) # throughput 1
print(t[i], c_out[i], exact[i]) # 41.42 0.5408 0.5460
print(np.abs(c_out - exact).max(), np.abs(c_out - exact).mean()) # 0.0150 0.00427
At throughput 1 the outlet reads 0.541 against the exact 0.546. Over the run the outlet is 4.3e-3 off on average, and 1.5e-2 at worst, on the front's steepest part. The 100 cells smear the front a little, and refining them closes the gap at first order.
Results¶

Left: the outlet NH3 on 100 cells at three binding strengths K C₀, against Thomas's curves in black. The stronger the binding, the smaller the separation factor r and the sharper the front. Right: the outlet's mean error over the run as the bed is cut into more cells.
Each run is its own cascade (measured 2026-11-10). The test solves the
N-cell cascade apart, with Radau at rtol 1e-11. Runs at the default
chem_rtol = 1e-6 are within 1.35e-5 of it, 4.6e-7 at 1e-7 and 1.5e-8 at
1e-9, so the gap is the integrator's tolerance. With a desorption energy of
80 kJ/mol and A_des scaled to the same k_d at 500 K, the gap is the same. So
the rates read the gas's static 500 K. Reading the stagnation temperature,
0.05 K higher, would move k_d by 0.2 % and the outlet by about 1e-3.
The breakthrough, the outlet's mean |C/C₀ − exact| from throughput 0 to 2:
| K C₀ | r | 25 cells | 50 | 100 | 200 | 400 |
|---|---|---|---|---|---|---|
| 0.2 | 0.833 | 2.162e-2 | 1.129e-2 | 5.778e-3 | 2.923e-3 | 1.468e-3 |
| 1 | 0.5 | 1.699e-2 | 8.712e-3 | 4.414e-3 | 2.222e-3 | 1.116e-3 |
| 5 | 0.167 | 9.581e-3 | 4.898e-3 | 2.483e-3 | 1.250e-3 | 6.273e-4 |
Orders 0.94-1.00, rising with the cells.
The bed itself. At Y = 5 (K C₀ = 1, the front mid-bed), the mean error of C/C₀ on the 100 faces the grids share is 6.80e-3, 3.44e-3 and 1.73e-3 on 100, 200 and 400 cells. Richardson's extrapolation of the last two is within 1.09e-4 of Thomas's profile, and of the first two 4.08e-4. The extrapolation converges at second order, so the limit is Thomas's.
The test gates each error at 1.5 times these tables. The two comparisons of a run with its own cascade are gated at 1e-7: the integrator's tolerance, with room for another machine's rounding. It found nothing wrong in the model. It did find that the reason the solver gave for its default step cap was out of date; the help now says the species step is implicit and the cap buys accuracy.
Not covered:
- the Temkin term (alpha_des > 0), which Thomas's model does not have;
- film or pore resistance, which this closure does not have;
- a heat of adsorption, which would add a temperature front;
- the transient strang driver, whose acoustic time step makes 4000 residence
times unaffordable;
- the full SCR mechanism's NO reactions.
Reproduce the figure¶
python scripts/validation_figures.py thomas
It runs the test's own harness on 25 to 400 cells at the three binding
strengths, prints the table above, and writes
docs/img/validation/thomas.png. About a minute.