Table of Contents
Fetching ...

Combining Machine Learning with Computational Fluid Dynamics using OpenFOAM and SmartSim

Tomislav Maric, Mohammed Elwardi Fadeli, Alessandro Rigazzi, Andrew Shao, Andre Weiner

TL;DR

OpenFOAM-based CFD simulations face data-exchange and compute-heterogeneity challenges when integrating with ML at scale. The authors adopt a loosely coupled CFD+ML framework using SmartSim as an orchestration layer and SmartRedis as an in-memory data hub, bridging OpenFOAM with ML backends through a lightweight API; they also illustrate a distributed SVD workflow where the data matrix $X \\in \\mathbb{R}^{M\\times N}$ is partitioned into $S$ blocks and merged to recover the global SVD. Three educational use cases—Bayesian optimization for turbulence parameters, partitioned SVD on streaming CFD data, and AI-in-the-loop mesh motion with an ANN—demonstrate the approach on heterogeneous HPC resources. The work provides open-source implementations, an OpenFOAM sub-module, and tutorials to accelerate adoption of scalable CFD+ML workflows.

Abstract

Combining machine learning (ML) with computational fluid dynamics (CFD) opens many possibilities for improving simulations of technical and natural systems. However, CFD+ML algorithms require exchange of data, synchronization, and calculation on heterogeneous hardware, making their implementation for large-scale problems exceptionally challenging. We provide an effective and scalable solution to developing CFD+ML algorithms using open source software OpenFOAM and SmartSim. SmartSim provides an Orchestrator that significantly simplifies the programming of CFD+ML algorithms and a Redis database that ensures highly scalable data exchange between ML and CFD clients. We show how to leverage SmartSim to effectively couple different segments of OpenFOAM with ML, including pre/post-processing applications, solvers, function objects, and mesh motion solvers. We additionally provide an OpenFOAM sub-module with examples that can be used as starting points for real-world applications in CFD+ML.

Combining Machine Learning with Computational Fluid Dynamics using OpenFOAM and SmartSim

TL;DR

OpenFOAM-based CFD simulations face data-exchange and compute-heterogeneity challenges when integrating with ML at scale. The authors adopt a loosely coupled CFD+ML framework using SmartSim as an orchestration layer and SmartRedis as an in-memory data hub, bridging OpenFOAM with ML backends through a lightweight API; they also illustrate a distributed SVD workflow where the data matrix is partitioned into blocks and merged to recover the global SVD. Three educational use cases—Bayesian optimization for turbulence parameters, partitioned SVD on streaming CFD data, and AI-in-the-loop mesh motion with an ANN—demonstrate the approach on heterogeneous HPC resources. The work provides open-source implementations, an OpenFOAM sub-module, and tutorials to accelerate adoption of scalable CFD+ML workflows.

Abstract

Combining machine learning (ML) with computational fluid dynamics (CFD) opens many possibilities for improving simulations of technical and natural systems. However, CFD+ML algorithms require exchange of data, synchronization, and calculation on heterogeneous hardware, making their implementation for large-scale problems exceptionally challenging. We provide an effective and scalable solution to developing CFD+ML algorithms using open source software OpenFOAM and SmartSim. SmartSim provides an Orchestrator that significantly simplifies the programming of CFD+ML algorithms and a Redis database that ensures highly scalable data exchange between ML and CFD clients. We show how to leverage SmartSim to effectively couple different segments of OpenFOAM with ML, including pre/post-processing applications, solvers, function objects, and mesh motion solvers. We additionally provide an OpenFOAM sub-module with examples that can be used as starting points for real-world applications in CFD+ML.
Paper Structure (18 sections, 12 equations, 7 figures, 1 table, 2 algorithms)

This paper contains 18 sections, 12 equations, 7 figures, 1 table, 2 algorithms.

Figures (7)

  • Figure 1: Online ML approximation of CFD results from OpenFOAM in SmartSim. Full lines represent transitions between algorithm steps, dashed lines are database operations.
  • Figure 2: A bidirectional CFD+ML algorithm with OpenFOAM and SmartSim. PDE solution block is ommitted in the CFD algorithm for brevity, full lines represent transitions between algorithm steps, dashed lines are database operations.
  • Figure 3: The magnitude of the velocity from the large-eddy simulation (LES) of the Pitz and Daily case (a), the Reynolds-Averaged Navier Stokes using the default $k-\epsilon$ coefficients (b), and the optimal coefficients (c). Note that for the LES simulation, the plotted field is the large-scale U that has had the eddy components filtered out.
  • Figure 4: Comparative ParaView visualization of the first 4 left singular vectors (columns of $\mathbf{U}$); each subplot shows the magnitude of the respective vector field.
  • Figure 5: Mesh deformation using Artificial Neural Networks.
  • ...and 2 more figures