DeepFlame is a computational fluid dynamics suite for single or multiphase, laminar or turbulent reacting flows at all speeds with machine learning capabilities. It aims to provide an open-source platform bringing together the individual strengths of OpenFOAM, Cantera and pyTorch libraries for machine learning assisted reacting flow simulations. It is also has the scope to incorporate next-generation heterogenous supercomputing and AI acceleration infrustructures such as GPU and FPGAs.
OpenFOAM-7, Cantera C++ lib 2.6.0, Torch C++ lib 1.11.0
- Native Cantera reader for chemical mechanisms in
.cti
,.xml
or.ymal
formats - Full compatiblity with Cantera's
UnityLewis
,Mix
andMulti
transport models - Zero-dimensional constant pressure or constant volume reactor solver
df0DFoam
- Pressued-based low-Mach number reacting flow solver
dfLowMachFoam
- Density-based high-speed reacting flow solver
dfHighSpeedFoam
- Two-phase Lagrangian/Euler spray reacting flow solver
dfSprayFoam
- Cantera's native SUNDIALS CVODE solver for chemical reaction rate evaluation
- Torch's tensor operation functionality for neutral network I/O and calculation
- Interface for DNN model to obtain chemical reaction rates
- Multiple example and tutorial cases with
Allrun
andAllclean
scripts- 0D Perfectly Stirred Reactor
- 1D Freely Propagating Premixed Flame
- 2D Lifted Partially Premixed Triple Flame
- 3D Taylor-Green Vortex with Flame
- 1D Detotation Wave in Homogeneous Premixed Mixture
- 3D Aachen Bomb Spray Flame
The installation of DeepFlame is simple and requires OpenFOAM-7, LibCantera and LibTorch .
- Install OpenFOAM-7 (if not already installed)
- Source your OpenFOAM via the default path below (or your own path for OpenFOAM bashrc)
source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc
- Install LibCantera via conda
conda create -n libcantera
conda activate libcantera
conda install -c conda-forge boost fmt libcantera-devel
Note: Check your Miniconda3/envs/libcantera directory and make sure the install was successful (lib/ include/ etc. exist).
- Clone the DeepFlame repository
git clone https://github.com/deepmodeling/deepflame-dev.git
cd deepflame-dev
- Install precompiled LibTorch
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.11.0%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-1.11.0+cpu.zip -d thirdParty
- Install DeepFlame
. install.sh
Note: Some compiling issues may happen due to system compatability. Instead of using conda installed Cantera C++ lib and the downloaded Torch C++ lib, try to compile your own Cantera and Torch C++ libraries.
- Source your OpenFOAM, for example (depends on your OpenFOAM path):
source $HOME/OpenFOAM/OpenFOAM-7/etc/bashrc
- Source deepflame-dev/bashrc, for example (depends on your DeepFlame path):
source $HOME/deepflame-dev/bashrc
- Go to an example case directory, for example:
cd $HOME/deepflame-dev/examples/zeroD_cubicReactor/H2/cvodeSolver
./Allrun
Note: For the example cases with torchSolver, an additional DNN model file in the .pt
format is required. Please contact the developers if you would like a test run.
If you use DeepFlame for a publication, please use the citation:
DeepFlame: A computational fluid dynamics suite for multiphase turbulent reacting flows at all speeds with machine learning. URL:https://github.com/deepmodeling/deepflame-dev, 2022.