LowMachReact-Hex currently implements a collocated finite-volume solver for constant-density low-Mach / incompressible flow on hexahedral control volumes. The current staged physics supports optional passive species transport and optional passive sensible-enthalpy transport with Cantera thermodynamic/property evaluation.
The current implementation should be interpreted as a constant-density projection solver, not a variable-density reacting low-Mach solver. The density used by the momentum equation, conservative face fluxes, CFL estimate, pressure projection, and diagnostic mass integral is the configured flow density:
Cantera thermodynamic density is stored separately as a diagnostic field:
and is not used in the pressure projection or continuity constraint.
The currently supported model contains:
qrad, with qrad = 0 unless filled by a future coupling.The following are intentionally not part of the current model:
In particular, the energy equation does not yet include:
where is the species enthalpy and is the diffusive species mass flux. Therefore, composition diffusion is modeled, but enthalpy transport carried by diffusing species is not yet modeled.
Cell-centered quantities are stored at control-volume centers. For a cell :
The stored face flux is oriented from owner cell to neighbor cell. During cell updates, the solver reorients it locally so that positive always means flow leaving the current cell.
For a scalar transported by upwind advection:
Here is either the neighboring-cell value or a boundary value.
The velocity field satisfies the constant-density incompressible constraint:
The momentum equation is advanced in fractional-step form:
where is the constant configured flow density, is the kinematic viscosity used by the flow solver, and is the configured body acceleration.
When Cantera transport is enabled, Cantera may supply mixture viscosity . The flow kinematic viscosity is then computed using the constant projection density,
only when variable-viscosity flow is explicitly enabled. Otherwise, validation runs keep the configured constant viscosity.
For each transported species , the current model advances passive mass fractions:
with no reaction source:
The solver applies a diffusive-flux correction so the sum of diffusive species fluxes is zero at each face. This keeps the species set consistent with mass-fraction transport.
The transported thermal variable is mixture sensible enthalpy:
not temperature. The energy equation currently solved is:
where is thermal conductivity and is a volumetric source term in W/m.
The conduction operator uses , not .
When Cantera thermodynamics are enabled, the solver stores sensible enthalpy relative to a reference temperature. For a local composition and pressure :
where is energy_reference_T.
Temperature recovery is performed by converting the stored sensible enthalpy back to an absolute Cantera enthalpy target:
and then solving the Cantera HPY inversion:
This avoids formation-enthalpy artifacts in the current non-reacting passive-mixing model.
The solver uses the following convention:
Temperature is recovered from the current transported enthalpy, current composition, and thermodynamic pressure:
Therefore, when species transport changes the composition from to , the solver preserves the already-transported enthalpy field and recovers a thermodynamically consistent temperature:
The solver must not hold the old temperature fixed and recompute enthalpy as:
That alternative would numerically add or remove sensible enthalpy when composition changes without an energy flux or source term accounting for that change.
The current time step uses this ordering:
transport_update_interval.In pseudocode:
for step = 1 ... nsteps:
update CFL / dt if needed
if transport_update_interval is active:
update mu and D_k
keep projection density rho_f = params%rho
advance projection step:
compute momentum RHS
predict u*
compute predicted face fluxes
solve pressure correction
correct face fluxes and velocity
if species enabled:
advance passive species Y_k
if energy enabled:
preserve transported h
if Cantera thermo enabled and species may have changed Y:
sync T, cp, lambda, rho_thermo from h, current Y, p0
restore h
advance h with advection, conduction, and qrad/rho
if Cantera thermo enabled:
sync T, cp, lambda, rho_thermo from updated h and current Y
restore h
else:
recover T from updated h with the constant-cp relation
write diagnostics / output if requested
The solver uses a fractional-step projection method.
A local momentum right-hand side is constructed as:
The advected velocity is selected by either the configured upwind or central scheme. The pressure gradient is evaluated by a finite-volume Gauss reconstruction:
The intermediate velocity is advanced with AB2 after the first step:
On the first step, where no previous right-hand side exists, the solver falls back to forward Euler:
The predicted cell-centered velocity is interpolated to faces to form a predicted volumetric flux:
The face normal is stored in owner-to-neighbor orientation. For boundary faces, the boundary velocity condition supplies the face velocity.
For all cell-local divergence and transport operations, the face flux is reoriented so that positive flux is outward from the current cell.
The pressure correction potential is:
The corrected face flux is:
The pressure correction is chosen so the corrected flux divergence vanishes:
With the solver sign convention, the discrete pressure operator is:
and the right-hand side is:
The linear system is:
The system is solved with preconditioned conjugate gradient using a diagonal Jacobi preconditioner. Neighbor indices and geometric coefficients are cached.
If a pressure Dirichlet boundary exists, it removes the null space. Otherwise, the solver pins cell 1 to remove the constant-pressure null mode.
After solving for :
and the cell-centered velocity is corrected with a Gauss gradient of :
The corrected conservative face fluxes are then used by species and enthalpy transport.
Species are advanced explicitly using the corrected face fluxes from the projection step.
For each cell and species , the solver accumulates:
The first term is upwind advection:
The uncorrected diffusive contribution is:
The correction term is:
where:
This correction enforces zero net diffusive mass flux across the species set:
up to the consistency of the face-linear mass fractions.
The explicit update is:
After the update, each mass fraction is clipped:
and the local vector is renormalized:
The transported energy variable is , not .
For each cell, the solver first stores:
If Cantera thermodynamics are enabled and transported species may have changed composition, the solver synchronizes the dependent thermodynamic state from the preserved enthalpy and current composition:
The sync is implemented as a combined Cantera recovery/property-refresh pass where possible. It then restores so the thermo sync cannot alter the transported state.
For Cantera thermo runs without transported species, this pre-flux sync may be skipped after initialization because composition has not changed and the previous post-flux sync is already valid.
The finite-volume enthalpy residual is:
The update is:
After the update:
The synchronization is logically equivalent to temperature recovery followed by property refresh, but the implementation may combine both operations into one Cantera pass and may reuse cached dependent thermo state when h, Y, and p0 are unchanged within tight tolerances.
When Cantera thermodynamics are disabled, the solver uses:
Temperature recovery is:
Thermal conductivity and heat capacity are taken from the configured constant values.
The transport-property update may use Cantera to evaluate mixture viscosity and species diffusivities. The bridge call uses:
when the energy equation is enabled, otherwise the configured background temperature is used. The pressure passed to Cantera is:
Cantera species mass fractions are built from the solver species list. If the solver species do not sum to one, remaining mass is assigned to the bath gas, usually N2, when available.
The projection density remains:
Cantera density is not fed back into the pressure projection.
Velocity boundaries support wall, symmetry, periodic, Dirichlet, and Neumann-like extrapolation behavior.
For wall or Dirichlet velocity boundaries:
For symmetry boundaries, the normal component is removed:
Other non-Dirichlet boundaries use the interior value for face evaluation.
For species Dirichlet boundaries:
For non-Dirichlet species boundaries:
For fixed-temperature boundaries, the boundary temperature is:
When species and Cantera thermodynamics are enabled, the boundary enthalpy is evaluated with the boundary composition:
The boundary composition is obtained from the species boundary condition:
patch_Y.This prevents fuel or oxidizer inlets from accidentally using an interior mixture or default bath-gas mixture when converting a fixed boundary temperature to enthalpy.
For non-Cantera thermodynamics, fixed-temperature boundary enthalpy uses the constant- relation:
The cell CFL rate is computed from the absolute sum of corrected conservative face fluxes:
The global CFL is:
When dynamic time stepping is enabled, the time step is scaled to target max_cfl, with a growth cap:
The terminal profiler uses inclusive timings. With nested profiling enabled, the flat rows are not additive.
Current top-level regions include:
Transport_Update
Projection_Step
Species_Transport
Energy_Transport
Diagnostics_Write_Flow
Diagnostics_Write_Energy
Output_Write_VTU
For Cantera thermo energy runs after the combined thermo-sync optimization, the main energy children are:
Energy_Cantera_PreSync
Energy_PreFlux_Exchange
Energy_Flux_Update
Energy_Cantera_PostSync
Energy_Final_Exchange
Energy_Cantera_PreSync appears only when a pre-flux thermo sync is needed, such as species-enabled runs where composition may have changed before the energy update.
The solver writes flow diagnostics including:
When energy is enabled, additional diagnostics include:
qrad,qrad,The diagnostic mass integral uses , not .
The current staged solver is suitable for validating passive transport and the enthalpy/species coupling convention. It is not yet a full reacting low-Mach formulation.
The most important missing energy term is the species-diffusion enthalpy flux:
The species solver can diffuse composition, but the energy equation does not yet transport the enthalpy carried by those diffusive species fluxes. This is acceptable for the present passive validation stage, but it must be added before treating strongly coupled multicomponent diffusion, reactions, or variable-density reacting low-Mach flow.
Do not add reactions or variable-density low-Mach coupling until the passive species and passive enthalpy tests pass with the current constant-density formulation.