Skip to content
Mallard

Unstructured, GPU accelerated, high-order finite volume CFD solver

TENO-E reconstruction of orders 3 to 6 on triangles, quads and mixed meshes, Euler and Navier–Stokes, written in C++20 with Kokkos so one code runs on CPUs and GPUs.

  • Design order 3–6 measured on triangles and quadrilaterals
  • Validated against exact solutions, theory and published data
  • 50 million cell time steps per second on one A100 (fifth-order TENO-E, 2D Euler)
  • Open source, Apache 2.0, 400+ tests on every change
Get started Validation Gallery
Documentation for Mallard 0.8.0
Configuration 3 of the 2D Riemann problem on 4096² quadrilaterals (16.8 million cells), with Kelvin–Helmholtz roll-ups along the slip lines of the jet; a cellular detonation in 2H2-O2-7Ar in a 3 cm square duct, 19.2 million hexahedra in a window that follows the front, whose transverse waves sweep both directions and print their tracks on the numerical soot foils of the walls (front speed within 0.2% of the Chapman–Jouguet speed); the Taylor–Green vortex at Re = 1600 on the full periodic box at 256³ (16.8 million hexahedra), whose kinetic-energy dissipation rate, traced beside it, peaks within 0.3% of the 512³ spectral DNS of the High-Order CFD Workshop; and a DNS of the autoignition of thermally stratified lean H2/air at 41 atm (T′ = 15 K, after Chen et al.), burning by spontaneous ignition fronts and deflagrations.

16.8 million cells, fifth order

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

    Meshes · Curved boundaries · Axisymmetric flows

  • 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

    Numerics guide · Numerical methods

  • 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

    Physics · Sources

  • 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

    Thermochemistry · Validation

  • 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

    Large-eddy simulation · Synthetic inflow · Validation

  • 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

    Boundary conditions · Sponges

  • 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

    Running in parallel · Performance · Dashboard

  • 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

    Output and diagnostics · Input reference

  • Validated and tested


    • 40 examples against exact solutions, theory, DNS and Cantera, e.g.:
    • 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

    Validation · Examples

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.