Tabulated chemistry (flamelets)¶
gas = "flamelet" replaces the species of a mechanism with two transported
scalars, the mixture fraction Z and the progress variable C, and looks the
gas's thermodynamics, transport and the source of C up in a flamelet table
computed beforehand (flamelet/progress variable, FPV). A run then costs little
more than a non-reacting one: six or seven values per cell instead of
5 + N_species, and no stiff chemistry. Reading tables needs a build with
HDF5. Design and rationale: design notes; the table
format: table_format.md.
Mallard does not generate tables: they come from
chemtab, a separate table
generator that writes Mallard's format, or any
other program that writes it. Laminar runs look
the table up at zero subgrid variance of Z; with [les] the variance comes
from the resolved gradient of Z (LES), or is zero with
variance = "none" and with thickened flames (thickened flames).
[physics]
type = "navier_stokes" # or "euler": no transport
gas = "flamelet"
table = "h2_fpv.h5" # relative to the directory the run starts in
[initialize]
type = "analytical"
p = "101325"
T = "300"
u = ["0", "0"]
Z = "x < 0 ? 1 : 0" # 1: fuel stream, 0: oxidizer
C = "0" # fresh; "burnt" is the table's burnt value at Z
[[boundaries]]
name = "fuel"
type = "inlet_state"
u = 1.0
p = 101325.0
T = 300.0
Z = 1.0
C = 0.0
The model¶
The transported scalars are rho Z and rho C, in the species block
(output Y_Z, Y_C, restart and probes as any species). The table's axes are
Z, SZ and LAMBDA (written Sz and Lambda below, as in FPVgen): Sz
the normalized variance of Z and Lambda = (C - C_min) / (C_max - C_min) the
normalized progress variable at (Z, Sz), between the bounds of C the table
stores as its fields C_MIN and C_MAX. Mallard finds Lambda from the
transported C with those bounds, so the table's C at a lookup is the
transported C exactly.
FPV tables hold the whole S-curve of steady counterflow flamelets, not only
its burning flames. The S-curve has three branches: the stable (burning)
branch, from low strain to extinction; the unstable branch, from extinction
back toward low strain at lower temperatures; and the extinguished branch, pure
mixing at C = 0. The unstable flamelets fill the range between burning and
extinguished, so that ignition, extinction and lifted flames move through
states the table holds. Each flamelet is a profile in Z. At each Z the
flamelets, ordered by their progress variable, become the Lambda axis.
The figures on this page come from a sample table built that way
(tools/docs/flamelet.py). It holds Cantera flamelets of H2/N2 (1:1 by mole)
against air, both at 300 K and 1 atm, with mechanisms/h2o2.yaml, unity Lewis
number and C = Y_H2O. The stable branch runs from chi_st = 0.32 1/s
(T_max = 1978 K) to extinction at 2777 1/s and 1246 K. The unstable branch
runs from there back to 0.52 1/s, where it levels off at T_max = 986 K.
At the stoichiometric Z, the stable branch fills Lambda from 0.63 to 1 and
the unstable branch from 0.34 to 0.63. Below 0.34 no steady flamelet of the
sample exists, and the table interpolates linearly to the mixing solution at
Lambda = 0. The source of C peaks at 707 kg/m³/s at Lambda = 0.67, near
extinction; the most burning flamelet, at Lambda = 1, has the highest
T_TABLE and a small source.
Over (Z, Lambda) at zero variance, the dashed line is the extinction
flamelet and the dotted line the last unstable one:
A lookup maps the transported (Z, C) to Lambda with the table's bounds of
C at that (Z, Sz), then interpolates multilinearly between the 2^3
nodes of the table cell around (Z, Sz, Lambda)
(design).
- Thermodynamics (Saghafian et al. 2015): the table holds, per node,
T0,E0 = e(T0),R,GAMMA0andA_GAMMA, withgamma(T) = gamma0 + a_gamma (T - T0). The temperature follows from the transported energy in closed form,p = rho R T, so heat release, compression and acoustics are consistent with the energy equation; every Riemann solver and face reconstruction works. - Transport (
navier_stokes):MU,KAPPAandCPfrom the table; unity Lewis number,rho D = kappa / cpfor both scalars, and the heat flux-(kappa / cp) grad h(so that enthalpy diffuses withZ, as in the flamelets the table came from). The time step includes the largest of4/3 mu / rho,kappa / (rho cv)andD. - Source:
OMEGA_Cfrom the table, an explicit source ofrho Cin the RHS, scaled from the table's densityRHO0at that node to the local density by(rho / rho0)^2(a second-order rate). It is a pointwise kernel on the device, with no chemistry step.
Each scalar is limited by its own slope cut in reconstruction (they are not mass fractions that sum to one).
A table in float32 (chemtab's precision) is looked up in float32 on the
device too, halving the memory and bandwidth of lookups at a relative error of
about 6e-8; lookups still sum in double. Each lookup record takes the precision
of its own fields: the solver's fields and the bounds of C may differ, for
example float64 bounds beside float32 fields. The run log says float32 on the
table's line when the solver's fields are. float64, the default, is exact.
Transport of the flamelets¶
The flamelet gas diffuses Z, C and enthalpy at unity Lewis number, so the
table's flamelets should be computed with unity-Lewis transport too (chemtab's
default). A table computed with another transport model (its /model_data
attribute transport, for example "mixture-averaged") is read with the
warning W-TABLE-TRANSPORT: its flamelets carry differential diffusion that
the solver's transport does not, which is a legitimate study but not a
consistent model. transport must be "unity-lewis", "mixture-averaged" or
"multicomponent"; any other value is an input error.
Checking a table: mallard table check¶
mallard table check FILE reads a table with the reader a run uses, so it
refuses a table for the reasons a run would, with the same message (the checks
of the format), and a table
it accepts, a run reads. It then summarizes what it read: the tags, pressure,
precision, species, provenance, axes, and the fields Mallard reads (it ignores
the others). What depends on a case, the run's pressure against the table's
(W-TABLE-PRESSURE), is left to mallard check. It exits with 0 when the
table is read, 1 when it is refused or the build has no HDF5.
mallard table check h2_fpv.h5 # the verdict and the summary
mallard table check h2_fpv.h5 --format json | jq .valid
The reference fixture (table format):
$ mallard table check test/data/flamelet/fixture_fpv.h5
== Table test/data/flamelet/fixture_fpv.h5 ============================================= ok
A Mallard table of format version 1 that this Mallard reads: it meets the format and the
contract of its model and thermodynamics.
model: fpv
thermodynamics: saghafian2015
transport: unity-lewis
pressure: 101325 Pa
precision: float64
species: H2, O2, H2O, N2
generator: mallard-test-fixture 3
created: 2026-11-29T00:00:00Z
mechanism: h2o2.yaml
mechanism sha256: 0efc6c52862741a29e0c29b65d979c7d8cb409db5282bca83b9c5437b3d8c8d4
dependencies: h5py 3.16.0, numpy 2.5.3
== Axes ===================================================================================
axis nodes from to units quantity transform
Z 5 0 1 1 Z identity
SZ 3 0 1 1 ZVAR normalized-variance of Z
LAMBDA 4 0 1 1 C bounds
== Fields =================================================================================
The fields Mallard reads; it ignores the others.
field axes precision units (UDUNITS-2)
A_GAMMA Z, SZ, LAMBDA float64 K-1
...
With --format json the report is one JSON object, for scripts and for a
table generator's conformance tests. Its schema is mallard-table-check, version 1, and it is printed for a
refused table too. An added member keeps the version; a member removed or
changed in meaning increments it (Command line).
| Member | Type | Meaning |
|---|---|---|
schema, version |
string, integer | "mallard-table-check", 1 |
file |
string | The file, as given |
valid |
boolean | Whether a run reads the table |
error |
string or null | Why the table is refused, as a run says it; null when valid |
warnings |
array | {code, message} of each warning a run gives of the table alone (W-TABLE-TRANSPORT); empty if none |
table |
object or null | The summary below; null unless valid |
table.format_version |
integer | The table format's version, 1 |
table.model, table.thermodynamics |
string | The model and thermodynamics tags |
table.transport |
string | /model_data transport: unity-lewis, mixture-averaged or multicomponent |
table.pressure |
number or null | The table's pressure in Pa; null for a table with a pressure axis P |
table.precision |
string | float64 or float32 when every field read is, else mixed |
table.species |
array of strings | The species block |
table.axes[] |
object | In the table's order: name, nodes (count), min, max, units, quantity, transform, of (the axis of a normalized-variance, else null) |
table.fields[] |
object | Each field Mallard reads, in name order: name, units, axes (array of axis names), precision (float64 or float32) |
table.provenance |
object | generator (name, version), created, mechanism (name, sha256), dependencies (library to version) |
Keys¶
| Key | Where | Meaning |
|---|---|---|
gas = "flamelet", table |
[physics] |
The table file, an FPV table with saghafian2015 thermodynamics |
Z, C |
[initialize], [[initialize.regions]], inlet_state |
Mixture fraction in [0, 1] (default 0) and progress variable in the table's range at Z (default 0); numbers, expressions, or C = "burnt" |
variance |
[physics], with [les] |
Closure of the subgrid variance of Z: algebraic (default), transported, or none (zero variance; the default, and the only choice, with [les.combustion]) |
C_Z |
[physics], variance = "algebraic" |
Constant of the algebraic variance, default 0.1, non-negative |
C_chi |
[physics], variance = "transported" |
Constant of the subgrid dissipation rate, default 2, positive |
C must lie between the table's C_MIN and C_MAX at its Z; values
outside are clamped in lookups.
Output¶
Besides Y_Z and Y_C (the transported scalars), a flamelet run writes the
table's fields at each cell's Z and C ([[write_data]] only):
| Field | Meaning |
|---|---|
Y_<species> |
Mass fraction of each species of the table's species block (Y_* selects them with Y_Z and Y_C); a species named Z or C is not written |
T_TABLE |
Temperature of the tabulated flamelet state, the table's field T0 (not the output's stagnation temperature T0). T is the temperature of the energy equation, which compression and heat loss move away from it |
HRR |
Heat release rate, if the table has the optional field HRR (W m-3), scaled from the table's density RHO0 by (rho / rho0)^2 as the source of C (and by E / F in a thickened flame) |
MIXTURE_FRACTION |
Z |
C_NORM |
The table's normalized progress variable Lambda = (C - C_min) / (C_max - C_min) at (Z, Sz), in [0, 1] (FPVgen's Λ). PROGRESS_VARIABLE is the mixtures' own, defined by [output.mixture], and not a field of flamelet runs |
MIXTURE_FRACTION_VARIANCE |
([les], variance other than none) The subgrid variance of Z of each cell's lookups |
With [les] the table fields are those at the cell's variance.
[[write_data]]
prefix = "flame"
format = "vtkhdf"
interval = 100
fields = ["RHO", "U", "P", "T", "T_TABLE", "HRR", "Y_*", "C_NORM"]
Pressure¶
A table holds flamelets computed at one pressure. A run whose initial pressure,
or a boundary's prescribed pressure (inlet_state, inlet_stagnation,
outlet_pressure), differs from it by more than 10% warns W-TABLE-PRESSURE:
the tabulated source, transport and composition are those of the table's
pressure. Generate the table at the run's pressure.
Boundaries¶
Z and C take the place of X or Y at inlet_state, inlet_stagnation
and inlet_mass_flow: numbers, expressions of x, y, z, t (as other
boundary values), or C = "burnt", the table's burnt value at Z. A "burnt"
C may follow a Z that varies in space, but not one that varies in time:
give C as an expression of t too. The inlets' gas constant, energy and, for
inlet_stagnation, isentrope are the table's at their Z and C.
[[boundaries]]
name = "pilot"
type = "inlet_stagnation"
p0 = 1.1e5
T0 = 1800.0
Z = "0.27 + 0.02 * sin(2000 * t)"
C = "0.12"
Walls pass no flux of Z or C. wall_isothermal conducts heat with
(kappa / cp) dh/dn, h the enthalpy at the wall temperature and the
cell's Z and C; wall_heat_flux passes its q; wall_adiabatic
nothing.
LES¶
With [les] every lookup (thermodynamics, transport, the source of C and the
output fields) is at the cell's subgrid variance of Z, the table's second
axis. The algebraic closure of Pierce & Moin (1998) sets it from the resolved
gradient:
with Delta the LES filter width (filter_width) and the least-squares
gradient of the viscous fluxes. The table maps it to its normalized axis
Sz = Zvar / (Z (1 - Z)), so the clip is the table's edge.
The variance smooths the flamelets over a beta distribution of Z: the peak
temperature and the source of C fall and spread with Sz, and Sz = 1
leaves only the two pure streams.
On the rich side, Lambda = 1 at Sz = 0 is not one flamelet: at each Z it
is the flamelet with the most C there, hence the kinks of the laminar curve.
The eddy viscosity adds mu_t / Sc_t to the diffusivity of Z and C, and
mu_t / Pr_t to the conductivity of the enthalpy (h is conducted with
kappa / cp, so its eddy part is mu_t / Pr_t, not cp mu_t / Pr_t). With
Sc_t = Pr_t (both default 0.9) enthalpy mixes with Z, as the unity Lewis
number of the table assumes; other values let the energy drift from the
flamelets'. Wall faces keep the molecular fluxes.
[physics]
type = "navier_stokes"
gas = "flamelet"
table = "h2_fpv.h5"
C_Z = 0.1 # variance = "algebraic" is the default
[les]
model = "sigma"
With variance = "transported" the second moment Z2, the filtered Z^2, is
a third transported scalar (written as Y_Z2), and the variance is
Zvar = Z2 - Z^2, within [0, Z (1 - Z)]. rho Z2 is conserved and diffuses
with rho (D + D_t), as Z; its sink is the filtered dissipation rate
The eddy diffusion of Z2 = Z^2 + Zvar produces the variance at
2 rho D_t |grad Z|^2, so it relaxes in Delta^2 / (C_chi (D + D_t)) toward
2 D_t / (C_chi (D + D_t)) Delta^2 |grad Z|^2: with D_t >> D the algebraic
model with C_Z = 2 / C_chi. The default C_chi = 2 relaxes within a few
explicit time steps; much larger values make the sink stiff at the viscous time
step, as C_chi (D + D_t) dt / Delta^2 reaches C_chi cfl / 8 on regular cells.
Transporting Z2 rather than Zvar keeps the production out of the scheme's
discretization (Kaul et al. 2013).
[physics]
type = "navier_stokes"
gas = "flamelet"
table = "h2_fpv.h5"
variance = "transported"
C_chi = 2.0
With variance = "none" every lookup is at zero variance, the table's
Sz = 0 slice (the laminar flamelets), as in laminar runs; Z and C still
take the eddy diffusivity.
Inlets and the boundary states are laminar (zero variance; with the transported
variance, inlets carry Z2 = Z^2). The initial state
is converted at its variance: p, T, u, Z and C are those given, the
density and energy those of the table at the cell's variance. A transported
Z2 starts at zero variance.
Thickened flames¶
[les.combustion] with model = "tfles" thickens the flame of the table so
that the mesh resolves it, as for finite-rate chemistry
(thickened flames): where the flame
sensor Omega is 1, the diffusivity of Z and C and the conductivity of the
enthalpy are multiplied by E F, the source of C (and the HRR output) by
E / F, and the eddy diffusivities by 1 - Omega. The thickened flame keeps
the laminar flame speed times the efficiency E and spans n_res cells.
- Sensor: the table's normalized progress variable
Lambda(C_NORM) in place of the temperature,Omega = min(1, Lambda (1 - Lambda) / 0.0475): 1 across the flame (0.05 <= Lambda <= 0.95), 0 in fresh and burnt gas and where the table has no flame at the cell'sZ. The dynamic efficiency filtersLambdatoo.sensor = "progress"is the default and the only sensor withgas = "flamelet";T_unburntandT_burntare not used. - Variance: none. The thickened flame is resolved on the mesh, so the
table is looked up at zero subgrid variance of
Z(Sz = 0, the laminar flamelets):variance = "none"is the default, andalgebraicortransportedis an input error with[les.combustion], as areC_ZandC_chi. The table keeps itsSzaxis; only its first slice is read. delta_Lands_L, the thickness and speed of the laminar flame thatFand the efficiency scale with, are required, as withsensor = "temperature".
The sensor is 1 wherever the table's source of C is (the sample table at
3 mixture fractions):
[physics]
type = "navier_stokes"
gas = "flamelet"
table = "ch4_fpv.h5" # variance = "none" is implied
[les]
model = "sigma"
[les.combustion]
model = "tfles"
delta_L = 4.5e-4 # m, of the laminar flame
s_L = 0.38 # m/s
n_res = 5
The partially stirred reactor (model = "pasr") scales finite-rate rates and
is an input error with the flamelet gas.
Not yet supported¶
These are input errors with gas = "flamelet", each naming the key:
[les.combustion] model = "pasr", [chemistry], [radiation], [output.mixture], the fields ENTROPY and the
mixture's other derived fields, and nondimensional units. Probes and statistics
do not sample the table fields (T_TABLE, HRR, the table's Y_<species>).