The OpenFOAM adapter
What is this?
This preCICE adapter is a plug-in (function object) for OpenFOAM, which can work with any recent version of OpenFOAM (.com / .org, see supported OpenFOAM versions). It supports fluid-structure interaction (fluid part), conjugate heat transfer (fluid and solid parts), and fluid-fluid simulations, while it is also easily extensible. Besides surface coupling, the adapter also supports volume coupling (overlapping domains).
What can it do?
This adapter has been demonstrated on different use cases (conjugate heat transfer, fluid-structure interaction, fluid-fluid coupling, and CFD-DEM), both in 2D (3D with one layer of cells in the z-axis) and 3D, and both for flow and solid OpenFOAM-based solvers (see tutorials). The fields to read/write are provided by different adapter modules that one needs to configure and are described in the following tables.
Legend on locations to read/write:
- N: Mesh nodes (surface coupling)
- F: Face centers (surface coupling)
- C: Cell centers (volume coupling)
- *: Mesh connectivity supported (for, e.g., nearest-projection mapping)
Regarding nearest-projection mapping, note that, for consistent data (e.g., displacement), it only makes sense that the writing participant provides mesh connectivity. For conservative data (e.g., forces), it only makes sense that the reading participant provides mesh connectivity.
Module: Conjugate heat transfer
| Field | Write | Read | Config prefix |
|---|---|---|---|
| Heat flux | N*, F | F | Heat-Flux |
| Heat transfer coefficient | N*, F | F | Heat-Transfer-Coefficient |
| Sink temperature | N*, F | F | Sink-Temperature |
| Temperature | N*, F, C | F, C | Temperature |
All fields are supported for both flow (compressible/incompressible) and basic (e.g., laplacianFoam) solvers.
OpenFOAM provides temperature on face centers and cell centers. For mesh nodes (with mesh connectivity enabled), the adapter interpolates from the faces to the nodes. Similarly, heat flux, heat transfer coefficient, and sink temperature are computed on the face centers and interpolated to the mesh nodes when mesh connectivity is enabled.
Module: Fluid-structure interaction
| Field | Write | Read | Config prefix |
|---|---|---|---|
| Displacement: absolute | N*, F* | N, F | Displacement |
| Displacement: relative | - | N, F | DisplacementDelta |
| Force | F (flow solvers) | F | Force |
| Stress | F (flow solvers) | - | Stress |
Displacement reading and writing are supported for both flow (compressible or incompressible) and structure solvers.
For mesh nodes, the pointDisplacement field is used; for face centers, the cellDisplacement field is used.
Only flow solvers can write forces or stresses. Solid solvers can read forces, but not stresses.
Originally, only flow OpenFOAM solvers have been considered. Reading more fields and providing connectivity by solid solvers can still be implemented.
Module: Fluid-fluid coupling
| Field | Write | Read | Config prefix |
|---|---|---|---|
| Drag force | F, C | F, C | DragForce |
| Momentum: explicit | F, C | F, C | ExplicitMomentum |
| Momentum: implicit | F, C | F, C | ImplicitMomentum |
| Phase flux | F | F | Phi |
| Volume fraction | F, C | F, C | Alpha |
| Phase fraction gradient | F | F | AlphaGradient |
| Pressure | F, C | F, C | Pressure |
| Pressure: full gradient | F, C | F | PressureGradientFull |
| Pressure: surface-normal gradient | F | F | PressureGradient |
| Temperature | F | F | FlowTemperature |
| Temperature surface-normal gradient | F | F | FlowTemperatureGradient |
| Velocity | F, C | F, C | Velocity |
| Velocity surface-normal gradient | F | F | VelocityGradient |
All fields assume a flow solver, and some of these fields are mainly meant for a CFD-DEM coupling (DragForce, ExplicitMomentum, ImplicitMomentum).
Try
Here you will find how to get the adapter, how to configure a case, how to extend the adapter to cover additional features, as well as a few notes on supported OpenFOAM versions.
Learn
Apart from following the documentation here, you will also often find us in OpenFOAM-related conferences. Before diving into preCICE and the OpenFOAM adapter for the first time, you may want to watch the recording of our training session from the 15th OpenFOAM Workshop:
Cite
Please cite this adapter using our reference paper in the OpenFOAM Journal [1]. See the preCICE literature guide for more details.
History
This project is actively maintained on precice/openfoam-adapter. Current maintainers: @MakisH and @DavidSCN.
This adapter was developed as part of Gerasimos Chourdakis’ master’s thesis [2]. It is based on previous work by Lucia Cheung (master’s thesis [3], in cooperation with SimScale).
The fluid-structure interaction module was developed in close collaboration between Gerasimos Chourdakis and Derek Risseeuw (TU Delft), in the context of the master’s thesis of the latter [4]. We would also like to thank David Schneider (Univ. Siegen / TUM) and Maximilian Müller (TU Braunschweig) for sharing the code and experience of their similar previous work.
The fluid-fluid coupling module was added by Gerasimos Chourdakis, in the context of his dissertation. #67. Further contributions in this direction by Markus Mühlhäußer (master’s thesis [5], related publication [6]).
The volume coupling functionality was contributed by Tina Vladimirova, in the context of her interdisciplinary project [7], based on previous work by various community contributors.
The adapter is easily extensible.
Related literature
- Chourdakis, G., Schneider, D., & Uekermann, B. (2023). OpenFOAM-preCICE: Coupling OpenFOAM with External Solvers for Multi-Physics Simulations. OpenFOAM® Journal, 3, 1–25. DOI: 10.51560/ofj.v3.88
- Gerasimos Chourdakis. A general OpenFOAM adapter for the coupling library preCICE. Master’s thesis, Department of Informatics, Technical University of Munich, 2017. URL: MediaTUM
- Lucia Cheung Yau. Conjugate heat transfer with the multiphysics coupling library preCICE. Master’s thesis, Department of Informatics, Technical University of Munich, 2016. URL: MediaTUM
- Derek Risseeuw. Fluid Structure Interaction Modelling of Flapping Wings. Master’s thesis, Faculty of Aerospace Engineering, Delft University of Technology, 2019. URL: TUDelft
- Markus Mühlhäußer. Partitioned flow simulations with preCICE and OpenFOAM. Master’s thesis, School of Computation, Information and Technology, Technical University of Munich, 2022. URL: MediaTUM
- Mühlhäußer, M., Chourdakis, G., & Uekermann, B. (2023). Partitioned flow simulations with preCICE and OpenFOAM. Proceedings of the ECCOMAS Coupled Problems 2023. DOI: 10.23967/c.coupled.2023.014
- Tina Vladimirova. Design, implementation, and validation of a volume coupling extension for the OpenFOAM-preCICE adapter. IDP report, School of Computation, Information and Technology, Technical University of Munich, 2023. URL: MediaTUM