Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
Mallard API reference

The C++ classes and functions of Mallard's solver, generated from the comments in src/. To build and run Mallard, write input files, or read about the numerical methods, see the user guide.

All of Mallard is one static library, MallardCore, linked by the Mallard executable (src/main.cpp) and the test suite. Data live in Kokkos views on the execution device, with host mirrors (h_ prefix) for setup and output; kernels are functors, so the same code runs on CPUs and GPUs.

Code organization

Directory Contents Main types
src/solver/ Initialization, the time loop, right-hand-side assembly, Dirichlet and averaged-pressure boundary updates, restarts Solver, Data, DirichletBoundary
src/mesh/ Generated meshes (cartesian, cartesian_tri, wedge), the Gmsh reader, geometry (face normals and centroids, cell volumes, neighbors), zones Mesh, Zone, FaceZone, CellZone
src/boundary/ Boundary conditions as device-copyable ghost-state rules, and the map from boundary faces to conditions BoundaryCondition, BoundaryData
src/numerics/ Face reconstruction, Riemann solvers, convective and viscous fluxes, gradients, quadrature, time integrators FaceReconstruction, TENO, MUSCL, FirstOrder, TimeIntegrator, ConvectiveFluxFunctor, ViscousFluxFunctor
src/physics/ Calorically perfect gas: state conversions and transport properties Euler
src/io/ VTU output (with .pvd series), boundary-zone surface output, restart files DataWriter
src/common/ Precision (rtype), dimensions, small math, TOML input lookups, exprtk expressions of x, y and t Expression

The Riemann solvers are in namespace riemann: Rusanov, HLL, HLLC, Roe and RHLL, each with a static calc_flux on primitive states W = [ρ, u, v, p]. The TENO-E stencil machinery is in namespace teno.

One time step

Solver::run calls take_step until a stop condition is met. Each stage of the TimeIntegrator evaluates calc_rhs:

  1. The conservative variables are converted to primitives, and calc_face_values reconstructs the primitive variables at the face quadrature points from both sides, as face_solution(face, point, side, variable). Side 1 of a boundary face is left unset.
  2. ConvectiveFluxFunctor integrates the Riemann flux over every face; on boundary faces it builds the exterior state from BoundaryData.
  3. For Navier–Stokes, ViscousFluxFunctor adds the viscous stress and heat flux from face gradients.
  4. Sources (gravity, expressions in x, y and t) are added per cell.

Face normals point from cells_of_face(f, 0) to cells_of_face(f, 1); boundary faces have cells_of_face(f, 1) = -1.