16.8 million cells, fifth order¶
The 2D Riemann problem (configuration 3) on 4096 × 4096 quadrilaterals with fifth-order TENO-E: the slip lines roll up into cascades of Kelvin–Helmholtz vortices. 72,570 time steps in 3 hours on two A100 GPUs, 112 million cell updates per second. Details in the gallery · full-resolution still
What's inside¶
-
Meshes
- 2D triangles and quadrilaterals; 3D tetrahedra, hexahedra, prisms, pyramids and mixed meshes
- Gmsh 2.2/4.1 or HDF5 mesh files, or generated boxes
- Periodic boundaries, on generated meshes or paired zones of mesh files
- Axisymmetric (r-z) flows, at design order up to the axis
- Curved high-order boundaries, from Gmsh high-order elements or an analytic projection
-
Numerics
- First order, MUSCL (Barth–Jespersen or Venkatakrishnan) and TENO-E of orders 3 to 6, optionally bound preserving
- Rusanov, HLL, HLLC, Roe and the rotated-hybrid RHLL, carbuncle-free except at shocks at rest on cell faces; all for single gases and mixtures
- Low-Mach correction of the upwind dissipation
- Forward Euler, SSPRK3 and RK4 at a CFL number or a fixed step
-
Physics
- Compressible Euler and Navier–Stokes; constant, Sutherland or power-law viscosity
- Thermally perfect multicomponent mixtures, with an optional double-flux scheme for interfaces
- Gravity and arbitrary source terms
-
Reacting flow
- Finite-rate chemistry from Cantera YAML mechanisms: elementary, three-body, falloff, PLOG and Chebyshev reactions
- RODAS Rosenbrock integrator per cell with analytical Jacobians, with Strang or SIMPLER splitting; ignition delays match Cantera up to 1268 species
- Mixture-averaged, unity-Lewis or constant-Lewis transport, optionally with thermal (Soret) diffusion; optically thin radiation
- Chemistry load balancing across MPI ranks;
MallardReactor, a 0D constant-volume reactor
-
Large-eddy simulation
- Explicit LES: Sigma (default), WALE, Vreman or Smagorinsky eddy viscosity, with Scotti's filter width on anisotropic cells and an opt-in dynamic constant
- Kinetic-energy-preserving hybrid flux, with the Riemann solver only at compressions, and a dissipation budget that separates the model's, the scheme's and molecular dissipation
- Thickened flame (TFLES) with dynamic thickening and Charlette efficiency; PaSR closure (experimental)
- Synthetic turbulent inflow through characteristic inlets: a digital filter or a precursor run's statistics, bitwise the same on any number of ranks
- Channel flow: Reτ within 0.7% and 1.6% of DNS at 395 and 590
-
Boundary conditions
- Slip, adiabatic, isothermal and heat-flux walls, optionally moving
- Inflow, characteristic far field, pressure outlets (local or area-averaged), transmissive, time-dependent expressions
- Partially non-reflecting characteristic (NSCBC) inlets and outlets with transverse terms (1% of an acoustic pulse reflected, against 97–99% at a fixed-pressure outlet); sponge layers
- Zones split between conditions by expressions
-
Performance and parallelism
- Kokkos Serial, Threads, OpenMP, CUDA (NVIDIA) and HIP (AMD) backends; double or single precision
- MPI with GPU-aware or NCCL halo exchange, overlapped with computation, and multi-jagged partitions: 93% (2D) and 91% (3D) weak-scaling efficiency on 16 A100 GPUs; no rank holds the whole mesh
- CUDA graphs per step; 3D TENO-E setup on the GPU
- Bitwise-identical results on any number of threads or ranks; restarts on a different rank count
- Stiff chemistry on GPUs, with a sparse LU for large mechanisms
-
Input, output and diagnostics
- TOML input; initial and boundary states, sources and sponges as expressions
- VTU (ParaView) or parallel HDF5 with XDMF; boundary-zone surfaces
- Running means and covariances, point and line probes, domain integrals, wall forces
- Heat release, production rates and detonation soot foils
-
Validated and tested
- 40 examples against exact solutions, theory, DNS and Cantera, e.g.:
- Sphere wake at Re = 300: Strouhal number and drag within 3% and 2% of Johnson & Patel
- Compressible isotropic turbulence: enstrophy within 2.4% of the filtered DNS of Johnsen et al.
- CJ detonation speed within 0.01%; H2/air flame speeds within 0.81% of Cantera from φ = 0.6 to 1.4
- 400+ unit and regression tests on every change: 2D, 3D, MPI on 1–4 ranks, single precision
- Nightly sanitizers; a performance suite with per-hardware baselines
- 40 examples against exact solutions, theory, DNS and Cantera, e.g.:
Validated¶
Every number below comes from a Mallard run compared with an exact solution, theory or published reference data; the validation page has the setups, figures and error tables.
-
Orders 3, 4, 5, 6
measured for TENO-E of design orders 3–6 on triangles and on quadrilaterals (isentropic vortex)
-
42.82° and 1.4984
shock angle and pressure ratio of a Mach 1.76 oblique shock; theory gives 42.82° and 1.4984 (wedge)
-
St 0.165, CD 1.37, CL′ 0.33
cylinder wake at Re = 100; reference computations give 0.164–0.165, 1.33–1.35 and 0.33–0.34 (cylinder)
-
0.7% RMS
difference in wall density (which ranges from 37 to 118) between the viscous shock tube and the grid-converged reference of Zhou et al. (viscous shock tube)
-
St 0.133, CD 0.669
hairpin-vortex shedding of a sphere at Re = 300; Johnson & Patel give 0.137 and 0.656 (sphere)
-
0.01%
from the Chapman–Jouguet speed: front speed of a planar detonation in 2H2-O2-7Ar with finite-rate chemistry (CJ detonation)
The test suite (more than 400 tests) checks the Riemann solvers against an exact solver, design order on triangles and quadrilaterals, conservation, symmetry and free-stream preservation, shock tubes, an oblique shock and exact viscous solutions on every change.
Quick start¶
git clone --recursive https://github.com/MatthewBonanni/mallard.git
cd mallard
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DUSE_SYSTEM_KOKKOS=OFF -DKokkos_ENABLE_THREADS=ON
cmake --build build -j
cd examples/sod && ../../build/src/Mallard -i input.toml
This builds Mallard for CPUs, then runs the Sod shock tube, which takes about a second. First simulation walks through the input, the output and the comparison with the exact solution; Installation covers OpenMP, GPU and MPI builds.
Citing Mallard¶
Mallard is archived on Zenodo: doi:10.5281/zenodo.23112953 (all versions; each release also has its own DOI there). Cite the software with the metadata in its CITATION.cff (GitHub's "Cite this repository" button), and the papers behind the methods you use, listed with where Mallard uses them on the References page.
For fun¶
The code's namesake at Mach 8: inviscid flow over a flying mallard from an impulsive start, on 1,067,536 triangles with fifth-order TENO-E and the RHLL flux. More in the gallery.