Repository navigation
Mallard 0.4.0
Mallard 0.4.0 completes the distributed-memory solver and adds finite-rate chemistry: reacting Euler and Navier–Stokes flows with arbitrary Cantera mechanisms.
Finite-rate chemistry
Following the design in docs/design/chemistry.md (#52), milestones 1–9 (#94, #96, #102, #107, #113 (with #110), #114–#116):
- Mechanisms: Cantera YAML read at run time (yaml-cpp): species, NASA-7/9 thermodynamics, elementary, three-body, falloff (Lindemann, Troe, SRI), PLOG and Chebyshev reactions. No recompilation per mechanism.
- Mixtures: thermally perfect multicomponent gas, species transported with the flow; Riemann solvers on a fixed-width face state (
gamma,e0surrogates); species fluxes by mass-flux upwinding; MUSCL and TENO-E for mixtures with bound-preserving mass fractions; double flux as an input option for oscillation-free material interfaces. - Chemistry: analytical Jacobians; an adaptive Rosenbrock (RODAS) integrator per cell, always in double precision; Strang splitting with the flow; a
[chemistry]input section;MallardReactor, a 0D constant-volume reactor tool. - Transport: species transport fits ported from Cantera (agreeing to 2e-12), mixture-averaged, unity-Lewis and constant-Lewis models, species diffusion with a correction velocity, enthalpy diffusion.
- Validation against Cantera and the Shock and Detonation Toolbox on the same mechanisms:
- 0D ignition delay within 1.4e-4 (H2/air) and 3e-6 (CH4/air); equilibrium temperature within 0.1 K.
- 1D CJ detonation (2H2–O2–7Ar, 6.67 kPa): front speed within 0.01% of D_CJ at 20 cells per induction length; von Neumann pressure reproduced.
- Reactive shock tube: detonation front position converged to 0.03 mm.
- Premixed laminar flame speed: H2/air at φ = 0.6–1.4 within 0.85% of Cantera (mixture-averaged and unity Lewis); CH4/air at φ = 1 within 0.93%.
- Reacting runs are bitwise identical on any number of MPI ranks and across restarts; the single-gas solver is byte-for-byte unchanged.
Distributed memory: complete
- Periodic boundaries in distributed runs no longer gather any global data (#117): periodic nodes are matched by hashing their coordinates to owner ranks, so no rank holds more than its share of any part of the mesh.
- Periodic zone pairs for mesh files (#81):
[[periodic]] zones = [A, B], translation = [...]for Gmsh and HDF5 meshes, with clear errors for mismatched seams. - TENO setup memory and caches (#89): stencils stored at their actual size (GPU memory −15–48%, host setup peak about 3× lower; 3D hexahedra at order 5 need 41 KB per cell), and the stencil cache now works on any number of ranks with one file per rank.
- Multi-node runs with GPU-aware MPI over InfiniBand (GPUDirect RDMA) verified: 16M cells scale 1.91× from 8 to 16 A100s across 4 nodes, and weak scaling is 93% efficient at 16 GPUs.
- Dynamic load balancing was prototyped and measured and is not adopted: after the TENO kernel work in 0.3.0 the remaining imbalance is too small to pay for repartitioning (
docs/design/mpi.md, §10, #97).
Numerics
- TENO stencils (#109): ill-conditioned central stencils are rejected using a bound on the reconstruction's Lebesgue constant, and candidate cells near walls are gathered completely. This fixes TENO4 and TENO6 on jittered and mixed-element 3D meshes (maximum error up to 25× lower) and TENO6 next to symmetry walls (#68). Results change in boundary cells of 2D meshes and on tetrahedral, prismatic and mixed 3D meshes; hexahedral meshes are unchanged.
- MUSCL on tetrahedra (#111) uses vertex-neighbour gradients; face-neighbour gradients amplified small perturbations.
- Single precision builds compile warning-clean and are tested (#95); several tolerance bugs that only bit in single precision were fixed.
Validation cases
- Mach 3 flow over a sphere: bow-shock standoff Δ/R = 0.226 against Billig's 0.205, i.e. within half a cell (#77).
- Sedov–Taylor blast in 3D: shock radius within 1.1% of the exact similarity solution (#76).
- Flow past a sphere at Re = 300: Strouhal number 0.133, drag 0.666 and lift 0.070, within the published range (Johnson & Patel 1999 and others) (#106).
- Taylor–Green vortex in the full periodic box at 128³: kinetic energy within 2.6% of the 512³ spectral DNS to t = 20 (#100).
Fixes and engineering
- Boundary face lists are cleared when the halo is rebuilt at startup; a stale entry could cause an out-of-bounds write in distributed TENO runs with Dirichlet or average-pressure boundaries (#98).
- Strict compiler warnings are errors in every CI job, with a Clang job (#83, #85–#87, #112); nightly AddressSanitizer and UndefinedBehaviorSanitizer runs (#99).
- Unused Toro star-pressure estimators removed (#101).
Known limitations
- TENO-E can amplify perturbations on cells of high aspect ratio (thin prisms and tetrahedra); use MUSCL on boundary-layer meshes for now (a fix is in progress).
- Chemistry on GPUs is latency-bound in this release; faster kernels are in progress.
- The Mach 3 sphere develops a carbuncle on the axis where two symmetry planes meet with RHLL and TENO5 (#80).
- Gmsh files are read whole by every rank; convert large meshes to HDF5 for distributed runs.
Full list of changes: v0.3.0...v0.4.0