Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

PythonFOAM: In-situ data analyses with OpenFOAM and Python

Journal Article · · Journal of Computational Science
 [1];  [2];  [1];  [1];  [3]
  1. Argonne National Laboratory (ANL), Lemont, IL (United States). Argonne Leadership Computing Facility (ALCF)
  2. Argonne National Laboratory (ANL), Lemont, IL (United States); University of Illinois at Urbana-Champaign, IL (United States)
  3. Argonne National Laboratory (ANL), Lemont, IL (United States)

Here, we outline the development of a general-purpose Python-based data analysis tool for OpenFOAM. Our implementation relies on the construction of OpenFOAM applications that have bindings to data analysis libraries in Python. Double precision data in OpenFOAM is cast to a NumPy array using the NumPy C-API and Python modules may then be used for arbitrary data analysis and manipulation on flow-field information. We highlight how the proposed wrapper may be used for an in-situ online singular value decomposition (SVD) implemented in Python and accessed from the OpenFOAM solver PimpleFOAM. Here, 'in-situ' refers to a programming paradigm that allows for a concurrent computation of the data analysis on the same computational resources utilized for the partial differential equation solver. In addition, to demonstrate parallel deployments, we deploy a distributed SVD, which collects snapshot data across the ranks of a distributed simulation to compute the global left singular vectors. Crucially, both OpenFOAM and Python share the same message passing interface (MPI) communicator for this deployment which allows Python objects and functions to exchange NumPy arrays across ranks. Subsequently, we provide scaling assessments of this distributed SVD on multiple nodes of Intel Broadwell and KNL architectures for canonical test cases such as the large eddy simulations of a backward facing step and a channel flow at friction Reynolds number of 395. Finally, we demonstrate the deployment of a deep neural network for compressing the flow-field information using an autoencoder to demonstrate an ability to use state-of-the-art machine learning tools in the Python ecosystem.

Research Organization:
Argonne National Laboratory (ANL), Lemont, IL (United States)
Sponsoring Organization:
USDOE Office of Science (SC), Advanced Scientific Computing Research (ASCR); Margaret Butler Fellowship
Grant/Contract Number:
AC02-06CH11357
OSTI ID:
1909464
Journal Information:
Journal of Computational Science, Journal Name: Journal of Computational Science Vol. 62; ISSN 1877-7503
Publisher:
ElsevierCopyright Statement
Country of Publication:
United States
Language:
English

References (20)

Analysis of viscous fluid flow in a pressure-swirl atomizer using large-eddy simulation journal April 2019
A tensorial approach to computational continuum mechanics using object-oriented techniques journal January 1998
Quantifying model form uncertainty in Reynolds-averaged turbulence models with Bayesian deep neural networks text January 2018
Approximate partitioned method of snapshots for POD journal December 2016
Simulating coastal engineering processes with OpenFOAM® journal January 2013
Inlet conditions for large eddy simulation: A review journal April 2010
Modeling of turbulent separated flows using OpenFOAM journal July 2013
An aerodynamic design optimization framework using a discrete adjoint approach with OpenFOAM journal May 2018
dsmcFoam+: An OpenFOAM based direct simulation Monte Carlo solver journal March 2018
Quantifying model form uncertainty in Reynolds-averaged turbulence models with Bayesian deep neural networks journal April 2019
Viscoelastic flow analysis using the software OpenFOAM and differential constitutive equations journal December 2010
MPI for Python journal September 2005
Numerical investigation of wave–structure interaction using OpenFOAM journal September 2014
Nonlinear mode decomposition with convolutional neural networks for fluid dynamics journal November 2019
Array programming with NumPy journal September 2020
Convolutional neural network and long short-term memory based reduced order surrogate for minimal turbulent channel flow journal February 2021
Reduced-order modeling of advection-dominated systems with recurrent neural networks and convolutional autoencoders journal March 2021
CFD Simulation of Boiling Flows Using the Volume-of-Fluid Method within OpenFOAM journal November 2009
CNN-LSTM based reduced order modeling of two-dimensional unsteady flows around a circular cylinder at different Reynolds numbers journal December 2020
ParaView Catalyst: Enabling In Situ Data Analysis and Visualization
  • Ayachit, Utkarsh; Bauer, Andrew; Geveci, Berk
  • Proceedings of the First Workshop on In Situ Infrastructures for Enabling Extreme-Scale Analysis and Visualization - ISAV2015 https://doi.org/10.1145/2828612.2828624
conference January 2015

Cited By (1)