This guide details the procedures for compiling and executing the solver using either the CPU-based Cantera backend or the GPU-native PelePhysics/AMReX backend.
The solver compiles as a hybrid Fortran/C++ codebase. Ensure the following compilers and libraries are loaded:
gfortran (version 9+) or nvfortran (for GPU offloading).g++ (C++17 standard support required) or nvc++.OpenMPI (version 4.0+) or MPICH.pyyaml, numpy, and matplotlib (for mesh tools and diagnostics).On an HPC cluster, load the required modules to align compiler wrappers:
# Load GCC compiler suite, OpenMPI wrappers, and Miniconda
module load openmpi miniforge3
# Activate the dedicated reacting flow Python environment
module load react_env
To compile and run the solver using the standard Cantera CPU backend:
Install Cantera C++ Headers & Libraries:
On Ubuntu/Debian:
bash
sudo apt-get install libcantera-dev
Or load it from the cluster's custom module environment.
Locate Cantera Installation:
Ensure cantera is in your compiler's default search path, or export its location:
bash
export CANTERA_DIR=/usr/local/include/cantera
PelePhysics integrates AMReX (portable CPU/GPU grid managers) and SUNDIALS CVODE (stiff implicit ODE integration) into a unified, GPU-native thermodynamics and reaction network.
Clone the repository recursively to fetch the AMReX submodule:
git clone --recursive https://github.com/AMReX-Combustion/PelePhysics.git
cd PelePhysics
bash
mkdir build && cd buildbash
cmake -DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=Release \
-DPELE_PHYSICS_ENABLE_SUNDIALS=ON \
-DCMAKE_CXX_COMPILER=mpicxx \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
..bash
make -j4
make installThe solver compilation is controlled by environment variables toggling the active chemistry backend.
Builds the solver using the Cantera C++ bridge and transport caching:
# Clean previous objects
make clean
# Compile for Cantera
make CHEMISTRY_BACKEND=cantera
Builds the solver using the PelePhysics bridge, linking against AMReX and CVODE:
# Setup PelePhysics home directory
export PELEPHYSICS_HOME=/home/kmukut/Radiation/PelePhysics
# Clean previous objects
make clean
# Compile specifying chemistry mechanism
make CHEMISTRY_BACKEND=pelephysics CHEMISTRY_MODEL=drm19
./lowmach_react_hex cases/coflow_laminar_diffusion_2D_optimized/case_reacting.nml
Launch a parallel job using mpirun or mpiexec:
mpirun -np 4 ./lowmach_react_hex cases/coflow_laminar_diffusion_2D_optimized/case_reacting.nml