Skip to content
SHD Sim
Menu

Validation/Reacting flow

Zero-dimensional reactor

The one case here with no reference table, and deliberately so: the product ships a one-step mechanism, so a measured flame temperature would be a comparison against chemistry it does not have. What is left is the laws it cannot escape.

VerificationElements conserved to 5.8 × 10⁻¹²; end temperature 0.0106 % from complete conversion

Why this case

Reacting flow was the last solver family in the product with no reference of any kind behind it. A zero-dimensional reactor is the smallest thing that family can be asked to do: no mesh, no transport, no geometry — one cell of gas held at constant pressure while the chemistry runs to completion. Everything that could be blamed on a mesh has been removed, so what is left is the thermodynamics and the integrator.

It is also the case where this section’s own rule bites hardest, and the next heading is about that rather than about the physics.

PhysicsZero-dimensional, adiabatic, at constant pressure — no transport, no geometry
SolverchemFoam, hePsiThermo, sensibleEnthalpy, EulerImplicit chemistry
MixtureStoichiometric methane and air — CH₄ 0.5, O₂ 1, N₂ 3.76 by mole — at 1000 K and 101 325 Pa
MechanismOne step, irreversible Arrhenius: CH₄ + 2O₂ = CO₂ + 2H₂O
Run100 000 steps of 10⁻⁶ s to 0.1 s, 50 written compositions
ReferenceConservation of C, H, O and N; complete conversion on the case’s own stoichiometry, with the temperature solved out of its janaf polynomials
AgreementEvery element conserved to 5.77 × 10⁻¹² of itself, and the end temperature 0.0106 % from the one complete conversion fixes

There is no reference table here, and there deliberately is not one

Every published number for methane oxidation is a measurement of a real mixture with a real mechanism behind it — dozens of reactions, hundreds in the detailed sets, and dissociation of the products at flame temperature. The product ships one irreversible step. Putting a measured flame temperature on this page would be comparing the product against a mechanism it does not have, and the difference would say nothing about whether the solver works.

So this page does not compare a temperature with a table. What it compares the run against are two things the run did not produce:

  • Conservation of each element. A reaction rearranges atoms; it does not make or destroy them. The moles of C, H, O and N per kilogram at the end must equal the moles at the start. There is no reference to transcribe, no tolerance to argue about, and — this is the part that matters — nothing a plausible-looking wrong answer can do to satisfy it. A chemistry solver reporting that it has created carbon has reported something that cannot happen.
  • Complete conversion. One irreversible reaction with no dissociation has exactly one end state: the limiting reactant gone. The case’s own stoichiometry fixes that composition without looking at the run at all, and the temperature that goes with it is then solved out of the janaf polynomials the case carries. That number is produced before the solver is consulted, so unlike a balance struck on the run’s own output it cannot be satisfied by a solver that is self-consistently wrong.

A third statement is on the page and is not in the list above, and the distinction is worth being blunt about. The enthalpy balance below takes the composition the solver ended at and asks what temperature that composition demands. It is a strong check on the energy equation — it catches heat lost between the reaction rate and the temperature — but it reads the run’s own answer as its input, so it is a consistency statement rather than an independent one. It is reported here as that.

What the reactor cannot escape

constant/initialConditions says constantProperty pressure, so the reactor is adiabatic at constant pressure and the mixture’s absolute specific enthalpy cannot change, whatever the chemistry does:

    h(Y_end, T_end) = h(Y_0, T_0)          at constant pressure
    u(Y_end, T_end) = u(Y_0, T_0)          at constant volume,  u = h - R T

Solved for T by bisection on the case’s own polynomials, either line gives the temperature the reactor must end at. Which line applies is read out of the dictionary rather than assumed, and the two answers are 445.15 K apart on this mixture — 15.48 % — so getting the reactor type wrong would not be a subtle error.

Neither line depends on the universal gas constant: every janaf enthalpy is proportional to it, so it cancels exactly out of both. The build’s own value is measured rather than assumed and comes out at 8314.470 J/(kmol K), which is not the CODATA 8314.4626, and it makes no difference to any temperature on this page.

The starting composition is not converted by the harness and trusted. The mixture is declared on a mole basis and everything here needs mass fractions, so rather than put a harness arithmetic step underneath every statement, the same case is run a second time with chemistry off; chemFoam builds the mixture and writes it out without reacting it, and the element balance is then measured against measured. The harness’s own conversion is carried beside it and agrees to 5.55 × 10⁻¹⁶.

Result

The reactor burns 99.984 % of its limiting reactant — oxygen, by a hair — and settles. That number is on the page before anything else because every conservation statement below is satisfied perfectly by a mixture sitting still: the chemistry off twin conserves every element to 0.0 exactly and closes its enthalpy balance to 1.9 × 10⁻⁹, which is better than the real run manages. Without a burn behind them the agreements are not evidence about anything.

Moles of each element per kilogram of mixture, before and after
ElementBefore (kmol/kg)After (kmol/kg)Drift, relative
C0.0034398981680070.0034398981680224.548 × 10⁻¹²
H0.0137595926720260.0137595926720884.492 × 10⁻¹²
O0.0137595926720260.0137595926720884.521 × 10⁻¹²
N0.0517360684468190.0517360684471175.771 × 10⁻¹²
Both columns are measured: the before column from a `chemistry off` run of the same case, the after column from the reacting run. The write precision is fifteen significant figures, so the drift is four decades above the floor of the file and six decades below the gate.
The end temperature against the two references, and against the one that is not independent
ReferenceTemperature (K)Measured against itUses the run?
Complete conversion on the case’s own stoichiometry2873.35369636−0.0106 %No
Enthalpy conserved, on the composition the run ended at2873.05712103−0.000277 %Yes
Internal energy conserved — the wrong constraint for this case3317.93675396+15.48 %Yes
Measured T is 2873.04916651 K. The complete-conversion row is the independent one; the gap it leaves is the 3.58 × 10⁻⁵ mass fraction of oxygen still unburnt when the run stopped, which is why its band is looser than the enthalpy row’s and not tighter.
Composition at the end, against the one stoichiometry fixes
SpecieMeasured mass fractionComplete conversion
CH₄8.983290 × 10⁻⁶0
O₂3.583573 × 10⁻⁵0
CO₂0.1513652749430.151389918374
H₂O0.1239193559690.123939530993
N₂0.7246671107390.724667110735
The complete-conversion column is fixed by the reaction as written and the starting mixture; nothing in it was read off the run. Nitrogen takes no part in the one-step mechanism and is unchanged to twelve figures.

Two more statements, and both are exact rather than approximate. The mass fractions must sum to one: measured 0.999996560667, which is 3.4393 × 10⁻⁶ short. That is not round-off. The case’s own molecular weights do not close its one reaction — the products weigh 0.001 kg/kmol less than the reactants — and over an extent of 3.4393 × 10⁻³ kmol/kg that predicts a deficit of 3.43934 × 10⁻⁶ against a measured 3.43933 × 10⁻⁶, leaving 1.578 × 10⁻⁶ of it unexplained. The same deficit appears again, to the same figures, when the solver’s own density, gas constant and temperature are put back into perfectGas: ρRT gives 101 324.65 Pa where the pressure field says 101 325. It is one arithmetic artefact showing up in two places, not two losses.

And the run has finished. Over the last tenth of the record the temperature moves at 1.579 K/s, which is 6.74 × 10⁻⁶ of the whole excursion from 1000 K. A run stopped at 10⁻⁶ s instead is still climbing at 4.12 × 10⁸ K/s, 1.97 × 10⁻² of the excursion — three decades apart, which is what makes the settled state a measurement and not an assumption.

The other reactor type, run

The same case with constantProperty volume conserves the internal energy instead, and that is a different exact statement with a different answer. It is run, and it is the closest thing on this page to an independent prediction: the constant-pressure run’s own composition and the janaf polynomials say that if the volume had been held instead, the reactor would end at 3317.94 K. A separate run that actually holds the volume measures 3318.20 K.

The two reactor types, each predicted from the other run and then measured
ReactorPredicted from the other run (K)Measured (K)Difference
Constant pressure, enthalpy conserved2873.280815662873.04916651−0.00806 %
Constant volume, internal energy conserved3317.936753963318.20151139+0.00798 %
Each prediction is made from the other run’s composition on the same polynomials, and holds nothing back from the run it is compared with. The constant-volume run conserves its elements to 5.82 × 10⁻¹² and sits 0.00306 % from the temperature complete conversion fixes for it, 3318.30 K.

That the two constraints separate by 15.48 % is the reason this is worth running at all. If holding the internal energy gave nearly the same answer as holding the enthalpy, the agreement above would not establish that constantProperty had been read at all.

What this page does not establish

  • No flow solver is exercised. reactingFoam and rhoReactingFoam share this thermo, this mechanism and this chemistry model, but they add transport, turbulence and a burner geometry, and none of the five statements above survives an open domain. What is verified is chemFoam.
  • Two of the checks are wired but cannot be tightened. The held quantity — pressure at constant pressure, density at constant volume — is bit-identical between the first and last state on every run here, and the chemistry off twin sits at exactly its declared 1000 K. Both measure 0.0 exactly, so no threshold above zero can be set on them and neither counts as demonstrated coverage.
  • The case as the product stages it produces nothing to check. Run exactly as written, with only its own meshing script in front of it, chemFoam takes 281 time steps, prints End and exits 0 — and writes no time directory at all, because the control dictionary pairs endTime 1 with writeInterval 100 under adjustableRunTime, so the first write time is t = 100 s in a run that stops at t = 1 s. The composition, which is the entire output of a chemistry run, never reaches disk. Nothing in the exit code, the log or the verdict says so. Every number on this page comes from a case with that dictionary corrected.

Repeat this yourself

Every case here is set up from the worked examples in the product, with no hand-editing of solver files — so you can run it, and get the same numbers. The free tier runs real cases up to 250,000 cells of fluids, or 100,000 nodes of solid, with no account needed to download and no time limit.

All validation cases · Written by the team building SHD Sim.