[WIP] Adding Cantera fluid model for incompressible reacting flows by Cristopher-Morales · Pull Request #2713 · su2code/SU2
Proposed Changes
This pull request aims to add a fluid model called FLUID_CANTERA for coupling Cantera library with SU2. Cantera library is an open-source library for problems involving chemical kinetics, thermodynamics, and transport processes. This is needed for combustion problems using the incompressible solver.
Current status:
• SU2 clones Cantera in the subprojects directory if Cantera is not found.
• SU2 creates a meson.build if that files does not exist using cantera_meson_build.py within the subprojects/cantera folder. This meson.build file is needed for compiling SU2 with the option -Denable-cantera=true.
• Cantera must be precompiled before compiling SU2.
• Cantera is built and compiled using SCons, following the compilation procedure explained in the following link:
https://cantera.org/dev/develop/compiling/compilation-reqs.html
A conda environment is created and activated as depicted in the cantera.org website. Then, the following commands are used for building and installing Cantera within the folder SU2/subprojects/cantera:
Build:
scons build boost_inc_dir=$PWD/include prefix=$PWD/install libdirname=$PWD/install/lib f90_interface=n system_eigen=n system_fmt=n system_yamlcpp=n system_sundials=n system_blas_lapack=n optimize=n`
install:
scons install
• After compiling Cantera, SU2 can be built with Cantera as follows (for example):
./meson.py build -Dwarning_level=2 -Denable-autodiff=false -Denable-directdiff=false -Dwith-mpi=enabled -Denable-cgns=true -Denable-tecio=false -Denable-cantera=true --prefix=/path_to_SU2_directory/SU2
• -Denable-tests=true can be used for testing if Cantera is correctly compiled with SU2, running one of the Cantera fluid unit test cases.
Work in progress:
• Compile Cantera simultaneously with SU2 when -Denable-cantera=true.
• Improve cantera coupling, only compile the functionalities needed for SU2. Currently, when cantera is compiled, whole functionalities are compiled. Most of the cantera implementations are not needed for incompressible reacting flows.
• Compile cantera with the AD options. For this purpose, a different repository must be cloned and compiled, where the AD implementation of cantera is located.
• Add regression and unit test cases in the SU2 workflow.
Regarding the coupling between SU2 and Cantera, any advice/suggestion how to improve it would be really appreciated.
Thanks in advance!!
Related Work
Related to pull request #2426
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
- I am submitting my contribution to the develop branch.
- My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
- My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
- I used the pre-commit hook to prevent dirty commits and used
pre-commit run --allto format old commits. - I have added a test case that demonstrates my contribution, if necessary.
- I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.