Skip to content
MatthewBonanniPublic

Repository files navigation

C++ License: Apache 2.0 DOI

logo_dark logo_light

Mallard is a high-order unstructured finite volume solver for compressible Euler, Navier-Stokes and reacting flows, written in C++ with Kokkos to run on CPUs and NVIDIA and AMD GPUs.

Mallard simulations

A 2D Riemann problem on 16.8M quadrilaterals; a cellular detonation in 2H2-O2-7Ar on 19.2M hexahedra, front speed within 0.2% of Chapman-Jouguet; the Taylor-Green vortex at Re = 1600 on 256³ hexahedra, peak dissipation within 0.3% of the spectral DNS; autoignition of stratified lean H2/air at 41 atm (examples/).

NOTE: Mallard is under active development; finite-rate chemistry is new, and its GPU performance is still being tuned.

Features

Meshes (guide)

  • 2D triangles and quadrilaterals; 3D tetrahedra, hexahedra, prisms, pyramids and mixed meshes
  • Gmsh, CGNS, Fluent, OpenFOAM and HDF5 files, or generated boxes and annuli
  • Translational and rotational periodicity; axisymmetric flows
  • Curved high-order boundaries

Numerics (guide)

  • TENO-E reconstruction, orders 3 to 6, on every cell type (what is new)
  • Rusanov, HLL, HLLC, Roe and RHLL Riemann solvers, with low-Mach correction
  • Explicit Runge-Kutta, at a CFL number or with error-controlled steps

Physics (guide)

  • Compressible Euler and Navier-Stokes
  • Thermally perfect mixtures and finite-rate chemistry from Cantera mechanism files
  • Detailed transport, Soret diffusion, optically thin radiation
  • Source terms and sponges as expressions over named regions

Large-eddy simulation (guide)

  • Sigma, WALE, Vreman and Smagorinsky models; kinetic-energy-preserving hybrid flux
  • Thickened flames with dynamic efficiency; synthetic turbulent inflow
  • Wall models: Griffin-Fu-Moin compressible and equilibrium ODE

Boundary conditions (guide)

  • Walls, inlets, outlets, far field and symmetry, with composable options (NSCBC, averaging, turbulence, wall models)
  • Every value a number or an expression of x, y, z and t

Performance (guide)

  • CPUs (OpenMP, threads) and NVIDIA and AMD GPUs; single or double precision
  • MPI with GPU-aware or NCCL halo exchange overlapped with computation; multi-jagged, Hilbert-curve or graph partitions
  • The whole time step as one CUDA graph
  • Bitwise-identical results on any number of ranks; restarts bit for bit

Input and output (guide)

  • TOML input with units (p = "1 atm"); every error names the key, line and fix
  • mallard check before a run, mallard new case templates, mallard ctl to steer a running job
  • VTKHDF output for ParaView
  • Probes on points, curves, surfaces, boundaries and regions; statistics, spectra and phase averages

Verification and validation (cases)

Every method and reference is cited in docs/references.md.

Installing

Best for
Container: ghcr.io/matthewbonanni/mallard (CPU) or :cuda (NVIDIA GPUs) Trying Mallard; workstations; GPU nodes; Kubernetes
Spack: spack install mallard with this repository's package Clusters: your compilers, MPI and GPUs
From source with CMake Development; every build option

Quickest, on a CPU:

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

Installation covers containers, Spack, GPU and MPI builds and every CMake option.

Running

cd examples/riemann_2d
mallard -i input.toml --kokkos-num-threads=8                   # installed (container, Spack)
../../build/src/mallard -i input.toml --kokkos-num-threads=8   # source build

mallard new --list shows ready-to-run templates (mallard new cylinder creates a case with its mesh, run and plot scripts), mallard check input.toml checks a case before a long run, and mallard ctl <run-dir> status|stop steers it while it runs. Start with the tutorials; see examples/ for complete cases, the user guide for each topic, docs/input.md for every input key, Running on clusters for MPI and job scripts, and tools/ for plotting and animation.

mallard test runs the test suites of an install (./build/src/mallard test in a build tree).

Contributing

Bug reports, questions and pull requests are welcome. CONTRIBUTING.md covers building and testing, code style (the Google C++ Style Guide, warnings as errors), how CI runs, and what a pull request includes: tests, documentation, an example and a changelog fragment for CHANGELOG.md. Everyone taking part follows the Code of Conduct.

Citing

If you use Mallard, please cite it (doi:10.5281/zenodo.23112953, or the DOI of the version you used on Zenodo) with the metadata in CITATION.cff (GitHub's "Cite this repository" button), and the papers behind the methods you use (docs/references.md).

License

Mallard is licensed under the Apache License, Version 2.0. Redistributions and derivative works must keep the attribution in NOTICE. Versions 0.1.0 to 0.6.0 were released under the AGPL v3.0.

Mallard includes code and data derived from Cantera under the BSD 3-Clause License (licenses/Cantera-BSD-3-Clause.txt).


Mach 8 flow over a mallard
Mach 8 flow over a mallard: 1.05M triangles, TENO5 + RHLL (examples/mallard).

Releases

Packages

Contributors

Languages