DeepFlame: A deep learning empowered open-source platform for reacting flow simulations

Runze Mao,Minqi Lin,Yan Zhang,Tianhan Zhang,Zhi-Qin John Xu,Zhi X. Chen
DOI: https://doi.org/10.1016/j.cpc.2023.108842
2022-10-15
Abstract:In this work, we introduce DeepFlame, an open-source C++ platform with the capabilities of utilising machine learning algorithms and pre-trained models to solve for reactive flows. We combine the individual strengths of the computational fluid dynamics library OpenFOAM, machine learning framework Torch, and chemical kinetics program Cantera. The complexity of cross-library function and data interfacing (the core of DeepFlame) is minimised to achieve a simple and clear workflow for code maintenance, extension and upgrading. As a demonstration, we apply our recent work on deep learning for predicting chemical kinetics (Zhang et al. Combust. Flame vol. 245 pp. 112319, 2022) to highlight the potential of machine learning in accelerating reacting flow simulation. A thorough code validation is conducted via a broad range of canonical cases to assess its accuracy and efficiency. The results demonstrate that the convection-diffusion-reaction algorithms implemented in DeepFlame are robust and accurate for both steady-state and transient processes. In addition, a number of methods aiming to further improve the computational efficiency, e.g. dynamic load balancing and adaptive mesh refinement, are explored. Their performances are also evaluated and reported. With the deep learning method implemented in this work, a speed-up of two orders of magnitude is achieved in a simple hydrogen ignition case when performed on a medium-end graphics processing unit (GPU). Further gain in computational efficiency is expected for hydrocarbon and other complex fuels. A similar level of acceleration is obtained on an AI-specific chip - deep computing unit (DCU), highlighting the potential of DeepFlame in leveraging the next-generation computing architecture and hardware.
Fluid Dynamics
What problem does this paper attempt to address?
This paper attempts to address the problem of improving computational efficiency and accuracy in reactive flow simulations. Specifically, the paper introduces an open-source C++ platform called DeepFlame, which combines the advantages of the computational fluid dynamics library OpenFOAM, the machine learning framework Torch, and the chemical kinetics program Cantera. It utilizes machine learning algorithms and pre-trained models to accelerate reactive flow simulations. ### Background and Problem 1. **High computational resource demand**: Direct numerical simulation (DNS) of reactive flows requires a large amount of computational resources, especially when involving multi-scale, multiphase, and multi-species physical and chemical processes. 2. **Limitations of existing tools**: - OpenFOAM's ordinary differential equation (ODE) solver performance is poor when dealing with chemical reactions, and the transport model is overly simplified, leading to significant errors in simulation results. - The evaluation of chemical source terms is the most time-consuming part, typically accounting for more than 80% of the total computation time. ### Solution 1. **Integration of existing libraries**: DeepFlame integrates the advantages of libraries such as OpenFOAM, Cantera, and PyTorch, using the CVODE solver, detailed transport models, and deep learning algorithms to assist in reactive flow simulations. 2. **Introduction of machine learning**: Combining heterogeneous computing technology, deep learning algorithms are used to accelerate the evaluation of chemical source terms. 3. **Optimization of computational efficiency**: Methods such as dynamic load balancing (DLB) and adaptive mesh refinement (AMR) are implemented to further improve computational efficiency. ### Main Contributions 1. **Open-source platform**: DeepFlame is an open-source platform that facilitates interdisciplinary research and code development. 2. **Efficient simulation**: Through deep learning methods, a two-order-of-magnitude acceleration effect is achieved, especially on mid-range graphics processing units (GPUs). 3. **Extensive validation**: The platform's accuracy and efficiency are validated through a series of classic cases, including convection-diffusion-reaction algorithms for both steady-state and transient processes. ### Conclusion The DeepFlame platform successfully addresses the issues of computational efficiency and accuracy in reactive flow simulations by integrating existing computational fluid dynamics, machine learning, and chemical kinetics tools. The platform not only performs well in simple hydrogen ignition cases but also has the potential to further improve computational efficiency in complex fuel simulations.