Using FEniCS and OpenFOAM for the simulation of conjugate heat transfer in a partitioned fashion Benjamin Rüth 1 , Peter Meisrimel 2 , Philipp Birken 2 , Gerasimos Chourdakis 1 , Benjamin Uekermann 3 1 Technical University of Munich Department of Informatics Chair of Scientific Computing 2 Lund University Mathematics (Faculty of Sciences) Numerical Analysis 3 Eindhoven University of Technology Department of Mechanical Engineering Energy Technology GAMM Annual 2019 Vienna, Austria February 19, 2019
32
Embed
Using FEniCS and OpenFOAM for the simulation of conjugate heat … · 2019-02-18 · Using FEniCS and OpenFOAM for the simulation of conjugate heat transfer in a partitioned fashion
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Using FEniCS and OpenFOAM for the simulation of
conjugate heat transfer in a partitioned fashion
Benjamin Rüth1, Peter Meisrimel2, Philipp Birken2, Gerasimos Chourdakis1, Benjamin Uekermann3
1Technical University of MunichDepartment of InformaticsChair of Scientific Computing
2Lund UniversityMathematics (Faculty of Sciences)Numerical Analysis
3Eindhoven University of TechnologyDepartment of Mechanical EngineeringEnergy Technology
GAMM Annual 2019Vienna, AustriaFebruary 19, 2019
Partitioned ApproachCoupled Problem
shell and tube heat exchanger using OpenFOAM and CalculiX1
Basic idea:• reuse existing solvers• combine single-physics to solve multi-physics• only exchange "black-box" information
OF CCX OF
1Figure from Rusch, A., Uekermann, B. Comparing OpenFOAM’s Intrinsic Conjugate Heat Transfer Solver with preCICE-Coupled
Simulations. Technical Report, 2018.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 2
Partitioned ApproachCoupled Problem
shell and tube heat exchanger using OpenFOAM and CalculiX1
Basic idea:• reuse existing solvers• combine single-physics to solve multi-physics• only exchange "black-box" information
OF CCX OF
1Figure from Rusch, A., Uekermann, B. Comparing OpenFOAM’s Intrinsic Conjugate Heat Transfer Solver with preCICE-Coupled
Simulations. Technical Report, 2018.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 2
preCICEA Plug-and-Play Coupling Library
fluid solver
adap
ter
libprecice
solve
r
OpenFOAMSU2foam-extend
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 3
preCICEA Plug-and-Play Coupling Library
fluid solver
adap
ter
structuresolver
libprecice
solve
r
OpenFOAMSU2foam-extend
CalculiXCode_AsterFEniCSdeal-iiMBDyn
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 3
preCICEA Plug-and-Play Coupling Library
in-housesolver
fluid solver
adap
ter
structuresolver
libprecice
commercialsolver
solve
r
OpenFOAMSU2foam-extend
CalculiXCode_AsterFEniCSdeal-iiMBDyn
ANSYS FluentCOMSOL
API in: C++C
PythonFortran
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 3
preCICEA Plug-and-Play Coupling Library
in-housesolver
fluid solver
adap
ter
structuresolver
libprecice
coupling schemes
data mapping
. . .
. . .
communication
time interpolation
A Coupling Library for PartitionedMulti-Physics Simulations
commercialsolver
solve
r
OpenFOAMSU2foam-extend
CalculiXCode_AsterFEniCSdeal-iiMBDyn
ANSYS FluentCOMSOL
API in: C++C
PythonFortran
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 3
preCICEUnique Selling Points (USPs)
1. Scalability2. Robust quasi-Newton coupling3. Coupling of arbitrary many components
(arbitrary many = more than two)4. Minimally-invasive coupling5. Open-source, community
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 4
preCICEContributors
Miriam Mehl Florian Lindner Amin Totounferoush Kyle Davis Alexander RuschU Stuttgart U Stuttgart U Stuttgart U Stuttgart ETH Zürich
Hans Bungartz Benjamin Rüth Gerasimos Chourdakis Frédéric Simonis Benjamin UekermannTUM TUM TUM TUM TU/e
Previous and additional contributors:
• Bernhard Gatzhammer, Klaudius Scheufele, Lucia Cheung, Alexander Shukaev, Peter Vollmer, Georg Abrams, AlexTrujillo, Dmytro Sashko, David Sommer, David Schneider, Richard Hertrich, Saumitra Joshi, Peter Meisrimel, DerekRisseeuw, Rafal Kulaga, Ishaan Desai . . .
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 5
preCICEUsers• LSM & STS, U Siegen, Germany
• SC & FNB, TU Darmstadt, Germany
• SCpA, CIRA, Italy
• Cardiothoracic Surgery, UFS, South Africa
• A*STAR, Singapore
• NRG, Petten, The Netherlands
• Aerodynamics & Wind Energy (KITE Power), TU Delft, The Nether-lands
• Mechanical and Aeronautical Eng., University of Manchester, UK
Software• open-source (GPLv3)• widely used for CFD• ready-to-use solvers• C++, Libraries with C++ API• can be used for HPC• main: openfoam.com (ESI/OpenCFD)• also popular: openfoam.org
(The OpenFOAM Foundation)
An FVM framework for PDEs• CFD, Heat Transfer, ...• Meshing• Solving• Post-Processing• ... OpenFOAM User Guide2
Software• open-source (LGPLv3)• extensive documentation• Python and C++ API• can be used for HPC• www.fenicsproject.org
Computing platform for solving PDEs
• Definition of weak forms• Finite Element basis functions• Meshing• Solving• ... FEniCS book2
1Alnaes, M. S., et al. (2015). The FEniCS Project Version 1.5.2Logg, A., Mardal, K. A., & Wells, G. N. (2012). Automated solution of differential equations by the finite element method.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 10
Partitioned heat equation / transmission problem already discussed in literature (e.g.1 or 2).
• in precice/tutorials
• today: only use left half of the domain + FEniCS adapter
• for details see 3.
1Monge, A. (2018). Partitioned methods for time-dependent thermal fluid-structure interaction. Lund University.2Toselli, A., & Widlund, O. (2005). Domain Decomposition Methods - Algorithms and Theory (1st ed.).3Rüth, B. et al. (2018). Solving the Partitioned Heat Equation Using FEniCS and preCICE. GAMM CSE Workshop 2018.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 11
1Cheung Yau, L. (2016). Conjugate Heat Transfer with the Multiphysics Coupling Library preCICE.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 12
Flow over plateOpenFOAM-OpenFOAM vs. OpenFOAM-FEniCS
OpenFOAM-OpenFOAM• Fluid from openfoam-adapter/tutorials• Solid from openfoam-adapter/tutorials• precice-config.xml from openfoam-adapter/tutorials
OpenFOAM-FEniCS• Fluid from openfoam-adapter/tutorials• Solid/heat.py from precice/tutorials• precice-config.xml from openfoam-adapter/tutorials
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 13
Flow over plateOpenFOAM-OpenFOAM vs. OpenFOAM-FEniCS
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1300
301
302
303
304
305
306
307
308
309
310
FE-OF
OF-OFTC = 310
T∞ = 300
xb
T b
Tb on Solid domain for both setups.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 14
Comparison to literatureVynnycky 1
Problem setup from 1 Results from 1
Re = 500, Pr = 0.01, λ = 0.25
1Vynnycky, M., et al. (1998). Forced convection heat transfer from a flat plate: the conjugate problem.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 15
Comparison to literaturepreCICE vs. Vynnycky
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
FE-OFOF-OF
Vynnycky
θb =TC−TT∞−TC
TC = 310
T∞ = 300
xb
θb
θb on Solid domain for both setups.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 16
Comparison to literatureDifferent SetupsCheung1 vs. Vynnycky2
no-slip
TC = 310
slipq = 0
no-slipq = 0
slipq = 0
u∞ = 0.1T∞ = 300
outflowq = 0
1Cheung Yau, L. (2016). Conjugate Heat Transfer with the Multiphysics Coupling Library preCICE.2Vynnycky, M., et al. (1998). Forced convection heat transfer from a flat plate: the conjugate problem.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 17
Comparison to literatureDifferent SetupsCheung1 vs. Vynnycky2
no-slip
TC = 310
slipq = 0
slipq = 0
slipq = 0
u∞ = 0.1T∞ = 300
outflowT∞ = 300
1Cheung Yau, L. (2016). Conjugate Heat Transfer with the Multiphysics Coupling Library preCICE.2Vynnycky, M., et al. (1998). Forced convection heat transfer from a flat plate: the conjugate problem.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 17
Summary & Outlook
FEniCS + OpenFOAM
• FEniCS or OpenFOAM are used for heat equation in solid domain• heat.py is only a proof-of-concept• laplacianFoam more advanced• OpenFOAM’s buoyantPimpleFoam solves flow + energy transport in fluid domain.• preCICE couples the solvers with identical precice-config.xml• Tutorial can be found atgithub.com/precice/tutorials/CHT/flow-over-plate/buoyantPimpleFoam-fenics
Quantitative assessment• good agreement of FEniCS + OpenFOAM with OpenFOAM + OpenFOAM• analytic solution and simulation do not match
Outlook• more FEniCS tutorials (FEniCS + X)• FEniCS-based solvers as CBC.Block, CBC.RANS and CBC.Solve1
• FEniCS or OpenFOAM are used for heat equation in solid domain• heat.py is only a proof-of-concept• laplacianFoam more advanced• OpenFOAM’s buoyantPimpleFoam solves flow + energy transport in fluid domain.• preCICE couples the solvers with identical precice-config.xml• Tutorial can be found atgithub.com/precice/tutorials/CHT/flow-over-plate/buoyantPimpleFoam-fenics
Quantitative assessment• good agreement of FEniCS + OpenFOAM with OpenFOAM + OpenFOAM• analytic solution and simulation do not match
Outlook• more FEniCS tutorials (FEniCS + X)• FEniCS-based solvers as CBC.Block, CBC.RANS and CBC.Solve1
• FEniCS or OpenFOAM are used for heat equation in solid domain• heat.py is only a proof-of-concept• laplacianFoam more advanced• OpenFOAM’s buoyantPimpleFoam solves flow + energy transport in fluid domain.• preCICE couples the solvers with identical precice-config.xml• Tutorial can be found atgithub.com/precice/tutorials/CHT/flow-over-plate/buoyantPimpleFoam-fenics
Quantitative assessment• good agreement of FEniCS + OpenFOAM with OpenFOAM + OpenFOAM• analytic solution and simulation do not match
Outlook• more FEniCS tutorials (FEniCS + X)• FEniCS-based solvers as CBC.Block, CBC.RANS and CBC.Solve1
• Reproducing Vynnycky’s results (github.com/precice/tutorials/issues/22)1Logg, A., Mardal, K. A., & Wells, G. N. (2012). Automated solution of differential equations by the finite element method. Lecture
Notes in Computational Science and Engineering.
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 18
Flexible: Couple your own solver with any otherEasy: Add a few lines to your codeReady: Out-of-the box support for many solversFast: Fully parallel, peer-to-peer, designed for HPCStable: Implicit coupling, accelerated with Quasi-NewtonMulti-coupling: Couple more than two solversFree: LGPL3, source on GitHub
www.precice.org github.com/precice7 @preCICE_org9 Mailing-list, Gitter Literature Guide on wiki
Benjamin Rüth (TUM) | Using FEniCS and OpenFOAM for CHT in a partitioned fashion 19