This repository implements a clean hydrodynamic foundation for reacting-flow simulations, incorporating Cantera for thermodynamics/transport and providing a scaffold for future radiation coupling.
The solver utilizes a robust mesh import strategy that decouples geometry generation from the simulation core.
tools/mesh/convert_gmsh_hex.py reads the .msh file using meshio.points.dat, cells.dat, faces.dat, patches.dat, and periodic.dat).mod_mesh_io reads these files into the mesh_t data structure.The code implements a dual-MPI architecture designed to balance flow solver efficiency with the needs of the future radiation kernel.
mesh_t). This is intentional to ensure that the radiation solver (which will decompose by wavenumber rather than space) has access to the full geometry on every rank.mod_mpi_flow assigns a contiguous range of global cell IDs to each rank (flow%first_cell to flow%last_cell).flow_allreduce_global_vector or flow_allgather_owned_scalar to assemble global fields from local contributions.MPI_Allreduce.mod_mpi_flow: Handles flow solver and species transport synchronization.mod_mpi_radiation: Manages a separate communicator for radiation work items (bands, rays, external batches).The solver is organized into functional modules to separate concerns:
mod_kinds: Centralizes precision parameters (rk=real64) and global constants.mod_input: Handles namelist parsing and configuration validation.mod_mesh_types: Defines the data structures for cells, faces, and patches.mod_mesh_io: Manages the reading of native hexahedral mesh files.mod_fields: Allocates and initializes primary flow fields (U, P, Flux).mod_bc: Maps namelist boundary conditions to geometric mesh patches.mod_flow_projection: Implements the fractional-step projection method and Poisson solver.mod_species: Manages the advection-diffusion of chemical mass fractions.mod_energy: Owns sensible-enthalpy transport, temperature recovery, thermal conductivity, heat capacity, diagnostic thermodynamic density, and qrad storage.mod_transport_properties: Evaluates transport properties through constant models or Cantera. The flow density remains the configured constant rho; Cantera rho_thermo is diagnostic and owned by the energy path.mod_mpi_flow: Provides the replicated-mesh MPI infrastructure and global synchronizers.mod_mpi_radiation: Supports task-based decomposition for the radiation solver.mod_profiler: Implements a hierarchical, MPI-aware profiler for performance analysis.mod_output: Generates XML-based VTK files (.vtu) and CSV diagnostics.
[!NOTE] Boundary Conditions: The solver supports field-specific conditions (Dirichlet, Neumann, Periodic) for Velocity, Pressure, and Species. Dirichlet pressure boundaries automatically remove the Poisson matrix null space, ensuring unique solutions for open flow systems.
mod_species: Manages the transport of passive scalars (). Supports Scale-on-Demand architecture with dynamic allocation for 0 to 256+ species. Implements a Correction Velocity (diffusive flux correction) to ensure strict mass conservation when using different species diffusivities ().
mod_transport_properties: Abstracts property evaluation. It provides a bridge to the Cantera 3.x C++ API for dynamic evaluation of viscosity and species diffusivity. Features include:.yaml mechanism when enable_reactions is active.mod_profiler: A hierarchical, MPI-aware profiling module used to track execution time for critical kernels, Cantera thermo sync, and MPI communication. The report uses inclusive timings; flat rows are not additive when nested timers are enabled.mod_bc: A unified boundary condition manager that supports field-specific types (Velocity, Pressure, Species) for every patch.Boundary patches are configured in case.nml and mapped to mesh patches at runtime.
patch_type: Legacy type used as a fallback.patch_velocity_type: Supports no_slip, moving_wall, symmetry, periodic.patch_pressure_type: Supports zero_gradient, dirichlet, periodic.patch_species_type: Supports zero_gradient, dirichlet, periodic.patch_temperature_type: Supports fixed-temperature and zero-gradient temperature/enthalpy boundaries.-div(sum_k h_k J_k) once passive energy/species tests pass.qrad volumetric source field.