ECCOMAS 2024

Enhancing OpenFOAM with Deep Learning for Minimising the Spatial Discretisation Error on Coarse Meshes

  • Gonzalez-Sieiro, Jesus (Basque Center for Applied Mathematics)
  • Pardo, David (Basque Center for Applied Mathematics)
  • Nava, Vincenzo (Basque Center for Applied Mathematics)
  • Calo, Victor (Curtin University)

Please login to view abstract download link

Many Computational Fluid Dynamics (CFD) applications that employ the Finite Volume Method (FVM) require fine spatial discretisations, which are often computationally prohibitive. In these cases, Deep Learning (DL) has emerged as a key technology to enhance traditional algorithms. In this work, we reduce the spatial discretisation error on coarse meshes by learning from fine-mesh data, following a super-resolution approach. Specifically, we embedded a feed-forward neural network in the workflow of a traditional FVM solver to interpolate face velocities from cell centre values. Thus, we obtain a solver-in-the-loop model, whose physics needs to be differentiable to be correctly trained. For that, we use the open-source CFD code OpenFOAM and its discrete adjoint version for the differentiation process. We also developed a fast communication method between TensorFlow (Python) and OpenFOAM (c++) to speed up the training process. We validated our model in the industrial case of a flow past a square cylinder under turbulent conditions, obtaining error reductions up to 50%. The generality of our approach allows a straightforward transfer to real applications, producing results balanced between computational cost and accuracy, which is crucial for early-stage designing processes.