Solving the Partitioned Heat Equation Using Fenics and Precice

Solving the Partitioned Heat Equation Using Fenics and Precice

Solving the Partitioned Heat Equation Using FEniCS and preCICE Benjamin Rüth1, Peter Meisrimel2, Philipp Birken2, Benjamin Uekermann1 1Technical University of Munich Department of Informatics Chair of Scientific Computing 2Lund University Mathematics (Faculty of Sciences) Numerical Analysis Siegen, Germany November 29, 2018 Agenda Partitioned Approach Heat Equation with FEniCS Coupling with preCICE Results Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE2 Agenda A few Disclaimers: Partitioned Approach This talk is not • a talk about FEM • a talk about coupling algorithms Heat Equation with FEniCS • a talk with proper mathematical notation Coupling with preCICE Results Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE2 Agenda A few Disclaimers: Partitioned Approach This talk is not • a talk about FEM • a talk about coupling algorithms Heat Equation with FEniCS • a talk with proper mathematical notation I will talk about Coupling with preCICE • software • the partitioned approach • where you can find my code Results • how you can use my code Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE2 Basic idea: • reuse existing solvers • combine single-physics to solve multi-physics OF CCX OF • only exchange "black-box" information What we do today: • couple with preCICE library • use FEniCS as a solver for toy problem Partitioned Approach Coupled problems shell and tube heat exchanger using OpenFOAM and CalculiX1 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) | Solving the Partitioned Heat Equation Using FEniCS and preCICE3 What we do today: • couple with preCICE library • use FEniCS as a solver for toy problem Partitioned Approach Coupled problems shell and tube heat exchanger using OpenFOAM and CalculiX1 Basic idea: • reuse existing solvers • combine single-physics to solve multi-physics OF CCX OF • only exchange "black-box" information 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) | Solving the Partitioned Heat Equation Using FEniCS and preCICE3 Partitioned Approach Coupled problems shell and tube heat exchanger using OpenFOAM and CalculiX1 Basic idea: • reuse existing solvers • combine single-physics to solve multi-physics OF CCX OF • only exchange "black-box" information What we do today: • couple with preCICE library • use FEniCS as a solver for toy problem 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) | Solving the Partitioned Heat Equation Using FEniCS and preCICE3 OpenFOAM FEniCS Adapter libprecice Adapter Partitioned Approach preCICE1 Features • communication • coupling schemes • mapping • time interpolation github.com/precice • official adapters for OpenFOAM, SU2,... 1Bungartz, H.-J., et al. (2016). preCICE – A fully parallel library for multi-physics surface coupling. 2Uekermann, B., et al. (2017). Official preCICE Adapters for Standard Open-Source Solvers. Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE4 Partitioned Approach preCICE1 Adapter2 • access preCICE API • isolated layer between solver and preCICE • support component exchangeability • don’t change existing (reliable, well-tested) github.com/precice code OpenFOAM FEniCS Adapter libprecice Adapter 1Bungartz, H.-J., et al. (2016). preCICE – A fully parallel library for multi-physics surface coupling. 2Uekermann, B., et al. (2017). Official preCICE Adapters for Standard Open-Source Solvers. Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE4 ! You can do a lot of things with FEniCS! My goal: Develop an official preCICE adapter for FEniCS. Partitioned Approach FEniCS1 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) | Solving the Partitioned Heat Equation Using FEniCS and preCICE5 Partitioned Approach FEniCS1 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 • ... ! You can do a lot of things with FEniCS! My goal: Develop an official preCICE adapter for FEniCS. 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) | Solving the Partitioned Heat Equation Using FEniCS and preCICE5 Partitioned Approach Toy problem: Partitioned Heat Equation (0;1) (xc;1) (xc;1) (2;1) preCICE ΓD ΓN (0;0) (xc;0) (xc;0) (2;0) Partitioned heat equation / transmission problem already discussed in literature (e.g.1 or 2). 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.). Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE6 FEniCS Ingredients 1. Solve Dirichlet Problem D(uD) 2. Compute heat flux D(uD) = qN 3. Solve Neumann Problem N (qN) = uD Heat Equation with FEniCS Partitioned Heat Equation get Ω1: uD = u1(x;y) set Ω2: u2(x;y) = uD Dirichlet BC heat equation on Ω1 heat equation on Ω2 ¶ u1 ¶ u2 ¶ t = ∆u1 + f ¶ t = ∆u2 + f Neumann BC Ω ¶ u1 ( ; ) = Ω = ¶ u2 ( ; ) set 1: ¶~n x y qN get 2: qN ¶~n x y Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE7 Heat Equation with FEniCS Partitioned Heat Equation get Ω1: uD = u1(x;y) set Ω2: u2(x;y) = uD Dirichlet BC heat equation on Ω1 heat equation on Ω2 ¶ u1 ¶ u2 ¶ t = ∆u1 + f ¶ t = ∆u2 + f Neumann BC Ω ¶ u1 ( ; ) = Ω = ¶ u2 ( ; ) set 1: ¶~n x y qN get 2: qN ¶~n x y FEniCS Ingredients 1. Solve Dirichlet Problem D(uD) 2. Compute heat flux D(uD) = qN 3. Solve Neumann Problem N (qN) = uD Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE7 Heat Equation with FEniCS 1. Solve Dirichlet Problem D(uD) Heat Equation ¶ u = ∆u + f in Ω ¶ t u = u0(t) on ¶Ω Solution of Poisson equation. Figure from 1. 1Logg, A., Mardal, K. A., & Wells, G. N. (2012). Automated solution of differential equations by the finite element method. Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE8 Analytical Solution If right-hand-side f = b − 2 − 2a we get u = 1 + x2 + ay 2 + bt. weak form in FEniCS F = u*v*dx + dt*dot(grad(u),grad(v))*dx - (u_n+dt*f)*v*dx Remark: Tutorial from the FEniCS tutorial book1 Heat Equation with FEniCS 1. Solve Dirichlet Problem D(uD) Discretization • implicit Euler: uk − uk−1 = ∆uk + f k dt • trial space: 1 u 2 Vh ⊂ V = v 2 H (Ω) : v = u0 on ¶Ω • test space: 1 v 2 V^h ⊂ V = v 2 H (Ω) : v = 0 on ¶Ω • weak form: Z Z (uk v + dt∇uk · ∇v)dx = uk−1 + dt f k vdx Ω Ω 1Langtangen, H. P., & Logg, A. (2016). Solving PDEs in Python - The FEniCS Tutorial I (1st ed.). Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE9 weak form in FEniCS F = u*v*dx + dt*dot(grad(u),grad(v))*dx - (u_n+dt*f)*v*dx Remark: Tutorial from the FEniCS tutorial book1 Heat Equation with FEniCS 1. Solve Dirichlet Problem D(uD) Discretization • implicit Euler: uk − uk−1 = ∆uk + f k dt • trial space: 1 u 2 Vh ⊂ V = v 2 H (Ω) : v = u0 on ¶Ω • test space: 1 v 2 V^h ⊂ V = v 2 H (Ω) : v = 0 on ¶Ω • weak form: Z Z (uk v + dt∇uk · ∇v)dx = uk−1 + dt f k vdx Ω Ω Analytical Solution If right-hand-side f = b − 2 − 2a we get u = 1 + x2 + ay 2 + bt. 1Langtangen, H. P., & Logg, A. (2016). Solving PDEs in Python - The FEniCS Tutorial I (1st ed.). Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE9 Heat Equation with FEniCS 1. Solve Dirichlet Problem D(uD) Discretization • implicit Euler: uk − uk−1 = ∆uk + f k dt • trial space: 1 u 2 Vh ⊂ V = v 2 H (Ω) : v = u0 on ¶Ω • test space: 1 v 2 V^h ⊂ V = v 2 H (Ω) : v = 0 on ¶Ω • weak form: Z Z (uk v + dt∇uk · ∇v)dx = uk−1 + dt f k vdx Ω Ω Analytical Solution If right-hand-side f = b − 2 − 2a we get u = 1 + x2 + ay 2 + bt. weak form in FEniCS F = u*v*dx + dt*dot(grad(u),grad(v))*dx - (u_n+dt*f)*v*dx Remark: Tutorial from the FEniCS tutorial book1 1Langtangen, H. P., & Logg, A. (2016). Solving PDEs in Python - The FEniCS Tutorial I (1st ed.). Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE9 Heat Equation with FEniCS 2. Compute heat flux D(uD) = qN Overall Heat Flux Z ¶ u Q = −K ds (K : Thermal Conductivity) ΓN ¶~n Elementwise Heat Flux1 Z k Z k ¶ u k k−1 k k mi = vi ds = u vi − u vi + dt ∇u · ∇vi − dt f vi dx ΓN ¶~n Ω k qN = −K ∑vi mi i Q ΓN ΓN qN 1Toselli, A., & Widlund, O. (2005). Domain Decomposition Methods - Algorithms and Theory (1st ed.). p.3 f. Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE 10 Heat Equation with FEniCS 3. Solve Neumann Problem N (qN) = uD Neumann BC: Modified weak form Z Z Z k k k−1 k (u v + dt∇u · ∇v)dx = u + dt f vdx + qNv ds Ω Ω ΓN Benjamin Rüth (TUM) | Solving the Partitioned Heat Equation Using FEniCS and preCICE 11 preCICE Ingredients 1.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    42 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us