OpenONDA: A Python Interface for In-Line Control of OpenFOAM Solvers
DOI:
https://doi.org/10.51560/ofj.v6.151Keywords:
Vortex formation, Software coupling, Python wrapper, Scientific Computing, pimpleFoamAbstract
This work introduces and demonstrates a Python wrapper for controlling and externally coupling OpenFOAM's PIMPLE-based solver with other solvers and libraries via encapsulation. The proposed framework integrates a custom, stepwise implementation of OpenFOAM's pimpleFoam solver into a Python interface, enabling in-line solver advancement and providing high-level methods for mesh manipulation, boundary condition management, and interaction with scientific computing tools such as NumPy and SciPy. To demonstrate its potential for external coupling of OpenFOAM via Python, the framework is applied to computational fluid dynamics problems with analytically derived boundary conditions, highlighting generalizable coupling and data management strategies across diverse flow scenarios. The selected test cases include (i) vortex-filament flow, (ii) vortex-ring flow, (iii) doublet flow with coupled computational domains, and (iv) moving dipole flow in a non-inertial reference frame. These cases address key challenges such as dynamic meshes, multiple OpenFOAM instances, and non-inertial effects. Additionally, this paper details the data exchange methodology and workflow, assessing the effectiveness of the proposed approach for scriptable coupling and management of OpenFOAM within Python.
Downloads
Additional Files
Published
Issue
Section
License
Copyright (c) 2026 Flavio A. C. Martins, Alexander van Zuijlen, Carlos S. Ferreira

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.


