Solver implementation and numerical status

Solver implementation and numerical status

This file serves as the definitive, developer-facing status reference for the current LowMachReact-Hex solver. It documents all active, experimental, and robust numerical features currently implemented in the codebase on the squashed gpu branch.


1. Feature Status Matrix

Area Feature Status Main Files Notes / Code Implementation
Hydrodynamics Constant-density projection Active src/flow/mod_flow_projection.f90 Standard fractional-step projection solver; verified via mass-balance diagnostics.
Hydrodynamics Variable-density Low-Mach projection Active src/flow/mod_flow_projection.f90, src/energy/mod_energy.f90 Incorporates active low-Mach divergence source terms and Cantera thermodynamic EOS coupling.
Momentum upwind convection Active src/flow/mod_flow_projection.f90 Highly robust first-order upwinding; introduces significant numerical diffusion.
Momentum central convection Active src/flow/mod_flow_projection.f90 Second-order centered difference; low diffusion but prone to cell wiggles near stagnation zones.
Momentum muscl advective convection Active src/flow/mod_flow_projection.f90, src/numerics/mod_reconstruction.f90 Uses least-squares gradients, local pair-bounded face states, and the advective form sum_f F_f (u_f-u_c)/V to prevent spurious velocity-divergence source errors.
Parallel Scaling Replicated-Mesh Load Balancing Active src/chemistry/mod_cantera.f90, src/mpi/mod_mpi_flow.f90 Gathers active stiff reacting cells, distributes them in contiguous chunks across MPI ranks, integrates them in parallel, and broadcasts back via MPI_Allgatherv (delivering up to $66\times$ Reacting Zone speedups).
Parallel Scaling Decoupled Radiation Communicator Active src/mpi/mod_mpi_radiation.f90 Keeps the radiation MPI communicator (radiation_mpi_t%comm) completely isolated from the flow communicator to prevent halo exchange crosstalk.
Chemistry Bridge PelePhysics C++ Bridge Active src/chemistry/pelephysics_interface.cpp Connects Fortran to C++ reactions via ISO_C_BINDING, using SUNDIALS CVODE dense solver suites and pre-allocated static memory objects. GPU-capable via nvector_cuda.
Chemistry Bridge Cantera State-Caching Active src/chemistry/cantera_interface.cpp Persistent, contiguous cell-state cache for species fractions, temperature, and background pressure, achieving >93% cache hit rates.
Species Simplex Renormalization & Projection Active src/species/mod_species.f90 Implements a robust simplex projection algorithm (repair_cell_mass_fractions) with dynamic iterative bounds to correct clipping defects.
Thermodynamics Continuous $\mathcal{C}^1$ Spline Clipping Active src/energy/mod_energy.f90 Precludes step discontinuities in stiff CVODE finite-difference Jacobian evaluations by replacing hard min/max clipping with a continuously differentiable cubic spline window.
Timestepping Timestep Rejection & Rollback Active src/app/main.f90 Automatically rolls back flow and species states and shrinks the timestep size if CVODE stiff reactors fail to converge.
Preprocessing Carthex Hexahedral Preprocessor Active carthex/ Structured hex mesh preprocessor integrated into the Conda environment via editable pip installation (-e ./carthex/carthex_codebase).
Pressure BC resistance / convective outlet Active src/flow/mod_bc.f90 Outward-normal pressure-gradient relaxation (dp/dn = (p_inf - p_cell)/L) for stable, non-reflecting outflow zones.
Radiation DOM / P1 Models Active src/radiation/models/ Direct discrete ordinates sweep and P1 diffusion models with wall balance formulations.

To ensure code stability and mathematical correctness, validate your cases using this progressive ladder:

  1. Frozen Constant-Density Counterflow: No chemical source terms, no variable-density coupling. Validate velocity profiles, grid alignment, and passive scalar mass thickness.
  2. Frozen Variable-Density Counterflow: Enable Cantera EOS state-caching without active ODE integration. Validate density fields, momentum-divergence fields, and non-reflecting boundary outlets.
  3. Reacting Counterflow (Balanced): Enable the PelePhysics CVODE reactor networks with replicated-mesh load balancing. Cross-examine temperature profiles against Cantera reference models.
  4. Reacting with Retry/Rollbacks: Enable stiff, unstable reacting fronts. Validate that timestep rejection and state rollbacks smoothly recover convergence without crashing the MPI topology.

3. High-Order Counterflow Verification Settings

We recommend using the following namelist configurations to achieve a mathematically stable high-order counterflow simulation:

! Highly robust, mathematically consistent counterflow validation setup
momentum_convection_scheme = "upwind"
species_convection_scheme  = "muscl"
energy_convection_scheme   = "muscl"
scalar_limiter             = "local_bounds"

! Optional high-order advective momentum configuration
! momentum_convection_scheme = "muscl"
! momentum_high_order_blend  = 1.0

For scalars, muscl leverages least-squares cell gradients with local-neighbor bounding. For momentum, muscl resolves the primitive advective flow form to completely bypass divergence source wiggles, offering a highly stable, high-fidelity transport baseline.