Couple Openfoam with Other Solvers for Multi-Physics Simulations Using Precice

Couple Openfoam with Other Solvers for Multi-Physics Simulations Using Precice

Couple OpenFOAM with other solvers for Multi-Physics simulations using preCICE Gerasimos Chourdakis et al. Technical University of Munich Department of Informatics Chair of Scientific Computing in Computer Science October 24, 2018 ESI OpenFOAM conference in Germany | Oct. 23-25, 2018 Multi-physics simulations Conjugate Heat Transfer: Three (coupled) simulations: Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE2 Multi-physics simulations Fluid-Structure Interaction: Two (coupled) simulations: Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE3 Overview solver adapterlibprecice structure fluid solver solver OpenFOAM CalculiX SU2 Code_Aster foam-extend FEniCS in-house commercial solver solver Ateles (APES) API in: ANSYS Fluent Alya System C / C++ COMSOL Carat++ Fortran FEAP FASTEST Python Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE4 Overview solver adapterlibprecice structure fluid solver A Coupling Library for Partitioned Multi-Physics Simulations solver OpenFOAM CalculiX SU2 Code_Aster ... foam-extend FEniCS ... coupling schemes communication in-house commercial solver solver data mapping time interpolation Ateles (APES) API in: ANSYS Fluent Alya System C / C++ COMSOL Carat++ Fortran FEAP FASTEST Python Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE5 Overview solver adapterlibprecice structure fluid solver A Coupling Library for Partitioned Multi-Physics Simulations solver OpenFOAM CalculiX SU2 Code_Aster ... foam-extend FEniCS ... coupling schemes communication in-house commercial solver solver data mapping time interpolation Ateles (APES) API in: ANSYS Fluent Alya System C / C++ COMSOL Carat++ Fortran FEAP FASTEST Python Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE5 How to couple my own solver? 1 precice::SolverInterface precice("FluidSolver",rank,size); 2 precice.configure("precice-config.xml"); 3 precice.setMeshVertices(); 4 precice.initialize(); 5 6 while(precice.isCouplingOngoing()) { // main time loop 7 solve(); 8 9 precice.writeBlockVectorData(); 10 precice.advance(); 11 precice.readBlockVectorData(); 12 13 endTimeStep(); // e.g. write results, increase time 14 } 15 16 precice.finalize(); Timesteps, most arguments and less important methods omitted. Full example in the wiki. Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE6 Adapting an OpenFOAM solver 1 /* Start the solver */ 18 /* solve the equations */ 2 19 #include "rhoEqn.H" 3 20 while (pimple.loop()) 4 21 { 5 22 ... 6 Info<<"\nStarting time loop\n" << endl; 23 } 7 while (runTime.run()) { 24 8 #include "readTimeControls.H" 25 9 #include "compressibleCourantNo.H" 26 10 #include "setDeltaT.H" 27 11 28 12 29 13 30 14 31 15 runTime++; 32 runTime.write(); 16 33 } 17 34 18 35 19 /* continue --> */ 36 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE7 Adapting an OpenFOAM solver 1 /* Start the solver */ 18 /* solve the equations */ 2 /* Adapter: Initialize coupling 19 #include "rhoEqn.H" 3 calls precice->initialize() */ 20 while (pimple.loop()) 4 adapter.initialize(); 21 { 5 22 ... 6 Info<<"\nStarting time loop\n" << endl; 23 } 7 while (runTime.run()) { 24 8 #include "readTimeControls.H" 25 9 #include "compressibleCourantNo.H" 26 10 #include "setDeltaT.H" 27 11 28 12 29 13 30 14 31 15 runTime++; 32 runTime.write(); 16 33 } 17 34 18 35 19 /* continue --> */ 36 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE7 Adapting an OpenFOAM solver 1 /* Start the solver */ 18 /* solve the equations */ 2 /* Adapter: Initialize coupling 19 #include "rhoEqn.H" 3 calls precice->initialize() */ 20 while (pimple.loop()) 4 adapter.initialize(); 21 { 5 22 ... 6 Info<<"\nStarting time loop\n" << endl; 23 } 7 while (adapter.isCouplingOngoing()) { 24 8 #include "readTimeControls.H" 25 9 #include "compressibleCourantNo.H" 26 10 #include "setDeltaT.H" 27 11 28 12 29 13 30 14 31 15 runTime++; 32 runTime.write(); 16 33 } 17 34 18 35 19 /* continue --> */ 36 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE7 Adapting an OpenFOAM solver 1 /* Start the solver */ 18 /* solve the equations */ 2 /* Adapter: Initialize coupling 19 #include "rhoEqn.H" 3 calls precice->initialize() */ 20 while (pimple.loop()) 4 adapter.initialize(); 21 { 5 22 ... 6 Info<<"\nStarting time loop\n" << endl; 23 } 7 while (adapter.isCouplingOngoing()) { 24 8 #include "readTimeControls.H" 25 /* Adapter: Write in buffers */ 9 #include "compressibleCourantNo.H" 26 adapter.writeCouplingData(); 10 #include "setDeltaT.H" 27 11 28 /* Adapter: advance the coupling 12 29 calls precice->advnace() */ 13 30 adapter.advance(); 14 31 15 runTime++; 32 runTime.write(); 16 33 } 17 /* Adapter: Receive coupling data */ 34 18 adapter.readCouplingData(); 35 19 /* continue --> */ 36 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE7 An adapted OpenFOAM solver 1 /* Start the solver */ 18 /* solve the equations */ 2 /* Adapter: Initialize coupling 19 #include "rhoEqn.H" 3 calls precice->initialize() */ 20 while (pimple.loop()) 4 adapter.initialize(); 21 { 5 22 ... 6 Info<<"\nStarting time loop\n" << endl; 23 } 7 while (adapter.isCouplingOngoing()) { 24 8 #include "readTimeControls.H" 25 /* Adapter: Write in buffers */ 9 #include "compressibleCourantNo.H" 26 adapter.writeCouplingData(); 10 #include "setDeltaT.H" 27 11 28 /* Adapter: advance the coupling 12 /* Adapter: Adjust solver time */ 29 calls precice->advnace() */ 13 adapter.adjustSolverTimeStep(); 30 adapter.advance(); 14 31 15 runTime++; 32 runTime.write(); 16 33 } 17 /* Adapter: Receive coupling data */ 34 18 adapter.readCouplingData(); 35 19 /* continue --> */ 36 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE7 Duplicated development effort OpenFOAM (and family) adapters for preCICE David Blom, 2017 (TU` Delft) FSI, foam-extend Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE8 Duplicated development effort OpenFOAM (and family) adapters for preCICE David Blom, Lucia Cheung Yau, 2017 (TU` Delft) 2016 (TUM) FSI, foam-extend CHT, OpenFOAM Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE8 Duplicated development effort OpenFOAM (and family) adapters for preCICE David Blom, Lucia Cheung Yau, 2017 (TU` Delft) 2016 (TUM) FSI, foam-extend CHT, OpenFOAM David Schneider, Kevin Rave, 2018 2017 unpublished work (Univ. Siegen) (Univ. Siegen) FSI, foam-extend CHT, foam-extend All these adapters are bound to specific solvers! Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE8 Duplicated development effort OpenFOAM (and family) adapters for preCICE David Blom, Lucia Cheung Yau, 2017 (TU` Delft) 2016 (TUM) FSI, foam-extend CHT, OpenFOAM David Schneider, Kevin Rave, 2018 2017 unpublished work (Univ. Siegen) (Univ. Siegen) FSI, foam-extend CHT, foam-extend All these adapters are bound to specific solvers! ! We need an official, general adapter! Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE8 Before: Working and validated prototypes Image from desertcart.ae. Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE9 Before: Working and validated prototypes Image from desertcart.ae. Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE9 Now: A user-friendly, plug-and-play adapter The human-like figure is a property of ikea.com. Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE 10 Overview solver adapterlibprecice structure fluid solver A Coupling Library for Partitioned Multi-Physics Simulations solver OpenFOAM CalculiX SU2 Code_Aster ... foam-extend FEniCS ... coupling schemes communication in-house commercial solver solver data mapping time interpolation Ateles (APES) API in: ANSYS Fluent Alya System C / C++ COMSOL Carat++ Fortran FEAP FASTEST Python Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE 11 1 // system/controlDict OpenFOAM config file 2 functions 3 { 4 preCICE_Adapter 5 { 6 type preciceAdapterFunctionObject; 7 libs ("libpreciceAdapterFunctObj.so"); 8 } 9 } 1 // 0/T OpenFOAM config file 2 interface 3 { 4 type fixedValue; 5 value uniform 300; 6 } 7 // other types: fixedGradient, mixed Coupling boundary patches, problem & solver type: precice-adapter-config.yml Todo: Convert to an OpenFOAM dictionary. Isolating the adapter: Function Objects 1 /* Start the solver */ 2 3 Info<<"\nStarting time loop\n"<< endl; 4 while (runTime.run()) { 5 #include "readTimeControls.H" 6 #include "compressibleCourantNo.H" 7 #include "setDeltaT.H" 8 9 runTime++; 10 11 /* solve the equations */ 12 #include "rhoEqn.H" 13 while (pimple.loop()) 14 { 15 ... 16 } 17 18 runTime.write(); 19 } 20 21 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE 12 1 // 0/T OpenFOAM config file 2 interface 3 { 4 type fixedValue; 5 value uniform 300; 6 } 7 // other types: fixedGradient, mixed Coupling boundary patches, problem & solver type: precice-adapter-config.yml Todo: Convert to an OpenFOAM dictionary. Isolating the adapter: Function Objects 1 /* Start the solver */ 1 // system/controlDict OpenFOAM config file 2 2 functions 3 Info<<"\nStarting time loop\n"<< endl; 3 { 4 while (runTime.run()) { 4 preCICE_Adapter 5 #include "readTimeControls.H" 5 { 6 #include "compressibleCourantNo.H" 6 type preciceAdapterFunctionObject; 7 #include "setDeltaT.H" 7 libs ("libpreciceAdapterFunctObj.so"); 8 8 } 9 runTime++; 9 } 10 11 /* solve the equations */ 12 #include "rhoEqn.H" 13 while (pimple.loop()) 14 { 15 ... 16 } 17 18 runTime.write(); 19 } 20 21 /* Finalize */ Gerasimos Chourdakis (TUM) | Couple OpenFOAM using preCICE 12 Isolating the adapter: Function Objects 1 /* Start the solver

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