Mathematical Formulation & Numerics

Mathematical Formulation & Numerics

This guide details the governing equations, spatial discretization, time-marching schemes, and projection steps implemented in the solver.


1. Scope & Implemented Physics

The solver is a collocated finite-volume method on unstructured hexahedral control volumes, supporting two distinct runtime paths: * Constant-Density Baseline: constant-density incompressible / low-Mach projection solver (). * Active Variable-Density Path: variable-density low-Mach solver using Cantera/PelePhysics thermodynamics, conservative and transport, and a conservative low-Mach divergence source.


2. Notation & Discretization Definitions

For a cell : * : Cell volume () * : Face of cell * : Face area () * : Normal perpendicular distance used for face gradients () * : Face normal, owner-to-neighbor orientation * : Face normal reoriented outward from cell * : Volumetric face flux, owner-to-neighbor orientation () * : Volumetric face flux reoriented outward from cell * : Mass face flux, owner-to-neighbor orientation () * : Mass face flux reoriented outward from cell

The stored volumetric face flux is:

The stored mass face flux is:

For an upwind transported scalar :


3. Density & Pressure Variables

The solver manages two distinct pressure and density scales: * Projection Pressure (): Hydrodynamic pressure driving velocity projections (). * Thermodynamic Pressure (): Uniform background thermodynamic pressure (background_press) used for Cantera/PelePhysics state evaluations: , , etc. * Flow Density (transport%rho): Active flow density. Constant in baseline mode () and coupled to thermodynamics in variable-density mode (). * Thermodynamic Density (): Density returned from state equations: .


4. Governing Low-Mach Reacting Flow Equations

4.1 Momentum Conservation

where is the viscous stress tensor: Kinematic viscosity is updated as when variable viscosity is active.

4.2 Species Transport

In variable-density mode:

4.3 Sensible Enthalpy Transport

Sensible enthalpy is defined relative to reference temperature (typically ) to prevent artificial heat release during non-reacting mixing:


5. Fractional-Step Pressure Projection Method

5.1 Momentum Predictor Step

The predictor computes a tentative cell velocity using an explicit Adams-Bashforth 2nd-order (AB2) time scheme: where the momentum residual is: The pressure gradient is calculated using the Gauss finite-volume reconstruction:

5.2 Poisson Solver for Pressure Correction

The corrected face fluxes satisfy the low-Mach divergence constraint: The face correction is: The elliptic system is formulated as:


6. Preconditioned Conjugate Gradient (PCG) Solver

The Poisson system is solved iteratively using a parallel PCG method implemented in src/numerics/mod_linear_solver.f90:

  1. Diagonal Jacobi Preconditioner ():
  2. Iteration Loop: For an initial guess :
  3. Compute initial residual: , apply preconditioner: , set search direction: .
  4. For each iteration :
    • Compute matrix-vector product:
    • Compute step length:
    • Update solution:
    • Update residual:
    • Check convergence: if , exit.
    • Apply preconditioner:
    • Compute update factor:
    • Update search direction:
  5. Nullspace Projection (Pressure Pin): For pure-Neumann boundaries, the constant pressure nullspace is removed by projecting a zero-mean gauge:

7. High-Order Spatial Reconstruction Schemes

To reduce numerical diffusion while enforcing physical boundedness, the solver supports high-order convection schemes:

7.1 Quadratic Upstream Interpolation (QUICK)

For a face with flow from cell to cell : The virtual upstream node is reconstructed dynamically on unstructured grids:

7.2 Hybrid Linear/Parabolic Approximation (HLPA) Limiter

To prevent unphysical oscillations, QUICK is combined with a low-order upwind fallback using the Normalized Variable Diagram (NVD):


8. Stiff Chemistry Integration & Adaptive Subcycling

Decoupled from transport via a fractional-step operator-splitting approach, reactions are integrated using CVODE.

8.1 Adaptive Subcycling

The global flow step is divided into a cell-local number of sub-slices : where is max_chemistry_subcycles and is subcycling_dT_threshold ().

8.2 Dominant-Species Simplex Projection

To preserve mass conservation without triggering numerical stiffness in trace intermediate radicals, mass fractions are normalized by modifying only the dominant majority bath species (typically ):

8.3 Continuous Cubic Spline Temperature Clipping

To avoid non-differentiable step transitions that break Newton-solver Jacobian evaluations, temperature clipping is smoothed using a cubic spline over window :


9. Dynamic Timestep Control, Rejection & Damping

9.1 Timestep Rejection & Rollback

If a physical check fails, the timestep is rejected, the state is rolled back to time level , and retried with . Rejections are triggered if: * NaN/Inf states occur. * Pressure Poisson CG iterations exceed pressure_max_iter. * Local CFL exceeds stability limits. * Density ratios fall below safety thresholds.

9.2 Chemical Source Damping

To prevent pressure shocks in low-Mach projection source terms due to massive local energy release, chemical source terms can be relaxed: where is chemistry_source_relaxation.