You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add chemistry support to MFC with Spack compatibility
This commit enables thermochemistry in MFC via a new MFC_CHEMISTRY CMake
option and adds full Spack package support for the chemistry variant.
Changes:
CMake (CMakeLists.txt):
- Add MFC_CHEMISTRY option (default OFF) to enable chemistry
- Add MFC_MECH_FILE cache variable for specifying Cantera mechanism files
- Pass chemistry flag to Fypp preprocessor as -D chemistry=True/False
- Add Python3 requirement when MFC_CHEMISTRY=ON
- Generate m_thermochem.f90 via gen_thermochem.py during build
Python (toolchain/scripts/gen_thermochem.py):
- New script to generate Fortran chemistry module using Pyrometheus and Cantera
- Called by CMake when MFC_CHEMISTRY=ON
- Supports custom mechanism files via --mech argument
Fortran (src/common/m_derived_types.fpp):
- Guard m_thermochem import with #:if chemistry
- Move fallback num_species declaration after implicit none
- Fixes "IMPLICIT NONE after data declaration" error
Build system (toolchain/mfc/build.py):
- Auto-enable MFC_CHEMISTRY=ON when case requests chemistry
- Pass MFC_MECH_FILE when cantera_file is specified in case
Spack (packaging/spack/package.py):
- Add chemistry variant (default False)
- Add cantera+python dependency when +chemistry
- Vendor Pyrometheus 1.0.5 as a resource
- Pass MFC_CHEMISTRY to CMake via cmake_args
- Add Pyrometheus to PYTHONPATH in setup_build_environment
Documentation (packaging/spack/SPACK.md):
- Document chemistry variant and usage
- List chemistry dependencies
This preserves backward compatibility: existing builds work unchanged
(chemistry OFF by default), while enabling reproducible chemistry builds
via Spack with "spack install mfc+chemistry".
Controls whether the post-processing tool is built.
90
90
91
+
#### Chemistry (default: disabled)
92
+
```
93
+
spack install mfc+chemistry
94
+
```
95
+
Enables thermochemistry support by generating the `m_thermochem.f90` module using Pyrometheus and Cantera during the build. When enabled, MFC can perform reactive flow simulations with detailed chemical kinetics. Requires `cantera+python` and vendors Pyrometheus automatically.
96
+
91
97
### Dependencies
92
98
93
99
Build-time dependencies (required during compilation):
0 commit comments