ChemPlasKin is a free code optimized for zero-dimensional (0D) simulations of neutral gas chemical kinetics coupled with non-equilibrium plasma.
Stay up to date with the latest changes and updates by visiting the Releases page and watching this repository.
- Add example of H2 oxidation with DBD discharges (section 3.5 in the paper).
- Add "branch_ratio" option for Boltzmann-type reactions, see issue.
- Improved code readability and robustness.
- ChemPlasKin has been integrated into OpenFOAM to build a fully coupled high fidelity solver for plasma & reacting flow. Read paper.
- Two more examples: N2 plasma kinetics and nanosecond discharge in air.
- Add YouTube video tutorials.
- Join Google Group for users' discussion.
- Improve robustness and documentation.
- Update the documentation for clarity.
- Update
CMakeLists.txtfor portable compilation.
- Initial Release: Version 1.0 of ChemPlasKin is now available.
ChemPlasKin integrates an electron Boltzmann equation solver, CppBOLOS, with the open-source combustion library Cantera at the source code level. ChemPlasKin enables the calculation of species concentration and gas temperature over time within a unified gas-plasma framework. This approach enables accurate modeling of both chemical thermal effects and plasma-induced heating, including fast gas heating and slower vibrational-translational relaxation processes.
Check our paper and cite:
Shao, X., Lacoste, D. A., & Im, H. G. (2024). ChemPlasKin: A general-purpose program for unified gas and plasma kinetics simulations. Applications in Energy and Combustion Science, 100280. https://doi.org/10.1016/j.jaecs.2024.100280
- Unified ODE system: neutral gas and plasma kinetics are solved together in a single ODE system
- Versatility: Suitable for plasma assisted combustion (PAC) and plasma assisted fuel reforming.
- Compatibility: Maintains compatibility with Bolsig+ cross-section input format and ZDPlasKin input mechanism.
- High Performance: Written in pure C++, at least 3x faster than ZDPlasKin + Cantera/CHEMKIN method.
- Heat Loss model: Designed for nanosecond pulsed discharges in pin-pin electrode configurations.
This section provides details on how to modify the Cantera source code and compile it for the usage of ChemPlasKin on macOS and Linux systems. ChemPlasKin has not been tested on Windows. Therefore, it is suggested to use Windows Subsystem for Linux (WSL) on a Windows machine for quick start (check note).
-
Prepare working directories: (eg.
~/Destop/)cd ~/Desktop mkdir ChemPlasKinProject cd ChemPlasKinProject
-
Clone the Repositories
git clone --recursive https://github.com/Cantera/cantera.git git clone https://github.com/ShaoX96/ChemPlasKin.git
Now under
ChemPlasKinProject/you should havecantera/andChemPlasKin/. -
Test Compiling Cantera from Source:
You should be familiar with Compiling Cantera from Source. A Conda environment is recommended for Compilation Requirements. For self-containedness and simplicity, a conda environmentct-CPKcan be created and activated by running (make sure you have installed conda, test by runningconda --version):conda env create -f ChemPlasKin/environment.yaml conda activate ct-CPK
Now you should be able to compile the original Cantera source before making any modifications to it:
cd cantera git checkout 3.0 git submodule update --init --recursive scons buildYou will see "Compilation completed successfully" message upon successful compilation.
-
Obtain external libraries for ChemPlasKin:
-
Create a new branch for Cantera and check (recommended)
git checkout -b for_chemplaskin git branch
-
Fetch the source code of CppBOLOS and muParser and put them under
cantera/ext/bolos/andcantera/ext/muparser/, respectively.cd ext git clone https://github.com/ShaoX96/CppBOLOS.git mv CppBOLOS bolos git clone https://github.com/beltoforion/muparser.git
-
Update
ext/SConscript:cd .. cp ../ChemPlasKin/ext/SConscript ext/SConscript -
Extend Cantera kinetics module
cp ../ChemPlasKin/include/kinetics/*.h include/cantera/kinetics/ cp ../ChemPlasKin/include/base/Solution.h include/cantera/base/ cp ../ChemPlasKin/src/kinetics/*.cpp src/kinetics/ cp ../ChemPlasKin/src/base/Solution.cpp src/base/
-
Stage and Commit Changes (optional)
Make sure you have set your email and name in your Git configuration.
git config --global user.email "your.email@example.com" git config --global user.name "Your Name"
Then commit your changes, for example:
git add . git commit -m "Modify Cantera source for ChemPlasKin usage."
-
Compile new library
scons build
The compiled Cantera library is under
cantera/build/lib. It is linked to ChemPlasKin throughChemPlasKin/CMakeLists.txt. For example on macOS (no action needed):link_directories("../cantera/build/lib") target_link_libraries(ChemPlasKin PRIVATE cantera_shared ${ACCELERATE_FRAMEWORK} Threads::Threads)
-
Build ChemPlasKin
Ensure CMake and Make are properly installed and configured on your system (by testing
cmake --version,make --version) and compile the code:cd ../ChemPlasKin mkdir build cd build cmake .. make
It is recommended to clean the
build/directory if there are build errors, significant changes of your project structure or CMake configuration. -
Run an example: Use
-caseto specify the running case path wherecontrolDictandchemPlasPropertiesfiles are located. Use optional-logflag to control log level:NONE,WARNING,INFO(default) , orDEBUG../ChemPlasKin -case ../examples/H2O2He -log DEBUG
-
Check results:
cd ../examples/H2O2He python plot.py
General Note: If you face difficulties during the compilation process, seek assistance from ChatGPT. It's your best friend.
If you are using Windows Subsystem for Linux (WSL), you may need to ensure GCC and G++ are installed by checking
gcc --version
g++ --versionIf they are missing, install the build-essential package which includes GCC, G++, and other necessary development tools:
sudo apt update
sudo apt install build-essentialTwo input data files, cross section and reaction mechanism, are needed, as specified in chemPlasProperties:
csDataFile "<case>/../../data/LXCat/bolsigdb_H2O2HE.dat";
mechFile "<case>/../../data/PAC_kinetics/ZDPlasKin_kinetics/Mao-H2O2He/H2O2HE_Mao.yaml";The data/ directory contains:
LXCat/: cross section data in LXCat format for CppBOLOSPAC_kinetics/: unified gas-plasma mechanism files in YAML format
An optional parser tool, parsePlasKin.py, is available to convert ZDPlasKin input mechanism files
into the human-readable YAML format automatically.
cd ChemPlasKin/data/PAC_kinetics/ZDPlasKin_kinetics/kineticsParser
python parsePlasKin.py --input "plasmaH2O2.inp" --output "parsedPlasKin.yaml"To support ChemPlasKin and its maintenance, please consider donating via
ChemPlasKin uses the Cantera chemical kinetics software, which is developed and maintained by the Cantera Developers. Cantera is an open-source suite of tools for problems involving chemical kinetics, thermodynamics, and transport processes. More information about Cantera can be found at cantera.org.
ChemPlasKin project is funded by Computational Reacting Flow Laboratory (CRFL) led by Professor Hong G. Im at King Abdullah University of Science and Technology (KAUST), Thuwal 23955-6900, Saudi Arabia.
ChemPlasKin is open-sourced under the LGPLv2 License.
ChemPlasKin integrates Cantera for handling detailed chemistry-plasma kinetics. Users are advised that Cantera is distributed under its own license terms.
- ChemPlasKin paper
- CppBOLOS GitHub
- Bolsig+ Reference Paper: G. J. M. Hagelaar and L. C. Pitchford, "Solving the Boltzmann equation to obtain electron transport coefficients and rate coefficients for fluid models", Plasma Sources Science and Technology, 2005
ChemPlasKin is an independent project that incorporates the Cantera software library. Any issues, bugs, or vulnerabilities found in ChemPlasKin do not necessarily relate to the Cantera software itself.
