computational science and engineering (international ... ?· computational science and engineering...

Download Computational Science and Engineering (International ... ?· Computational Science and Engineering (International…

Post on 29-Jun-2018

213 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Computational Science and Engineering(International Masters Program)

    Technische Universitt Mnchen

    Masters Thesis

    A general OpenFOAM adapter for thecoupling library preCICE

    Gerasimos Chourdakis

  • Computational Science and Engineering(International Masters Program)

    Technische Universitt Mnchen

    Masters Thesis

    A general OpenFOAM adapter for the coupling librarypreCICE

    Author: Gerasimos Chourdakis1st examiner: Univ.-Prof. Dr. Hans-Joachim Bungartz2nd examiner: Univ.-Prof. Dr. rer. nat. habil. Miriam MehlAssistant advisor: Dr. rer. nat. Benjamin UekermannSubmission Date: October 29, 2017

  • I hereby declare that this thesis is entirely the result of my own work except where otherwiseindicated. I have only used the resources given in the list of references.

    October 29, 2017 Gerasimos Chourdakis

  • Acknowledgments

    First and foremost, I would like to deeply thank my supervisor, Benjamin Uekermann, forhis support. His vivid interest on the topic and his very helpful advices made my thesis avery pleasant learning experience.

    Additionally, I would like to thank Luca Cheung Yau, whose excellent work I had thechallenging mission to continue. Her aid in the beginning of my Thesis was invaluable. Ialso want to thank Babak Gholami for kindly providing us with the results of Lucas thesis,which was written in cooperation with SimScale GmbH.

    The tools I used in my thesis, mainly preCICE and OpenFOAM, are developed asfree/open source software. They are also based on other free software projects, includ-ing the Doxygen documentation generator. Projects like these make me feel very glad ofthe free software community and I hope that my contribution will also be useful.

    The TUM English Writing Center helped me improve my understanding of the Englishlanguage and the clarity of my prose. I am very thankful for the time they devoted to meduring the Thesis Writers Workshop, as well as to our individual appointments.

    My Masters studies were financially aided by a scholarship from the German AcademicExchange Service (DAAD) and I am very grateful of their support.

    Finally, I owe my deepest gratitude to my friends and family, whose endless support wascrucial for my studies. Special thanks go to my parents and to my friend Myrto, who werethere when their support was needed the most.

    vii

  • Abstract

    Simulating multiple interacting phenomena at the same time can help us predict their effectsmore precisely. It is possible to perform a multi-physics simulation by coupling pieces ofsingle-physics simulation software with preCICE, a free library for black-box, partitionedsurface coupling. An adapter connects a solver to preCICE, allowing preCICE to accessthe required data elements and steer the coupled simulation. Individual solvers of thecomputational fluid dynamics simulation software OpenFOAM have been adapted in thepast, but there is still a need for a flexible adapter that would be ready to work with anyOpenFOAM solver, in order to eliminate the duplication of development effort and improvethe user experience.

    This thesis presents a general, solver-agnostic preCICE adapter for OpenFOAM, whichrequires no changes in the individual solvers. The adapter can be loaded at runtime using theexisting controlDict configuration file. A wide variety of standard solvers are supported,while the proposed design makes the adapter compatible with any similar in-house solver.While we focus on conjugate heat transfer, the adapter is extensible to other types ofproblems, such as mechanical fluid-structure interaction.

    The adapter is an OpenFOAM function object: a shared library whose methods are calledfrom predefined points in a solvers code. The boundary conditions are general and do notbind to specific solvers, but support a wide range of compressible or incompressible flowsolvers, as well as basic solvers. The required fields and parameters are drawn from theobject registry or provided in a separate adapter configuration file. This thesis continuesprevious work on solver adaptation to preCICE and the proposed adapter is validatedagainst the (already validated) previous adapters.

    ix

  • Contents

    Acknowledgements. vii

    Abstract. ix

    Contents. xi

    1. Introduction. 1

    2. Tools . 52.1. preCICE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.1.1. Equation coupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.2. Data mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.3. Communication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1.4. Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1.5. Application programming interface. . . . . . . . . . . . . . . . . . . . 132.1.6. Available adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    2.2. OpenFOAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.2.1. Structure of a solver. . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.2.2. A language for equations . . . . . . . . . . . . . . . . . . . . . . . . . 192.2.3. Manipulating fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.2.4. Creating new applications . . . . . . . . . . . . . . . . . . . . . . . . . 212.2.5. Injecting code at runtime: function objects . . . . . . . . . . . . . . . 212.2.6. The registry of objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.2.7. Physical models and solvers of interest. . . . . . . . . . . . . . . . . . 24

    3. Conjugate heat transfer. 293.1. Mechanisms of heat transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.2. Parameters of heat transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.3. Coupling approaches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    4. Previous work. 334.1. Available OpenFOAM adapters for preCICE . . . . . . . . . . . . . . . . . . . 33

    4.1.1. Previous CHT adapters . . . . . . . . . . . . . . . . . . . . . . . . . . 334.1.2. Previous FSI adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.1.3. Other adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

    xi

  • Contents

    4.2. Other approaches. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.2.1. MpCCI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.2.2. The OpenFOAM CHT solvers. . . . . . . . . . . . . . . . . . . . . . . 384.2.3. SimpleFsi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    5. Implementation. 415.1. Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

    5.1.1. Objectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.1.2. Proposed solution and challenges. . . . . . . . . . . . . . . . . . . . . 425.1.3. Reused elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    5.2. The function object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435.3. The adapters core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    5.3.1. Interfaces and Coupling data users . . . . . . . . . . . . . . . . . . . . 435.3.2. Steering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.3.3. Adjusting the solvers time step . . . . . . . . . . . . . . . . . . . . . . 455.3.4. Checkpointing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455.3.5. Error handling and output . . . . . . . . . . . . . . . . . . . . . . . . 47

    5.4. Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495.4.1. Activating the adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . 495.4.2. The adapters configuration file . . . . . . . . . . . . . . . . . . . . . . 505.4.3. Optional parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    5.5. The CHT module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515.5.1. Coupling data users for CHT . . . . . . . . . . . . . . . . . . . . . . . 515.5.2. Additional parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

    5.6. Designed with extensibility in mind . . . . . . . . . . . . . . . . . . . . . . . . 55

    6. Validation. 576.1. Flow over a heated plate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    6.1.1. buoyantPimpleFoam laplacianFoam coupling . . . . . . . . . . . . . 586.1.2. buoyantBoussinesqPimpleFoam laplacianFoam coupling . . . . . . . 616.1.3. buoyantSimpleFoam CalculiX coupling . . . . . . . . . . . . . . . . . 63

    6.2. Tube-and-shell heat exchanger. . . . . . . . . . . . . . . . . . . . . . . . . . 65

    7. Conclusions. 69

    Appendix. 70

    A. Compatible OpenFOAM versions. 71A.1. Porting to a different OpenFOAM version. . . . . . . . . . . . . . . . . . . . 72A.2. Known differences among OpenFOAM versions. . . . . . . . . . . . . . . . . 73

    A.2.1. OpenFOAM v5 OpenFOAM v4 . . . . . . . . . . . . . . . . . . . . . 73

    xii

  • Contents

    A.2.2. OpenFOAM v4 OpenFOAM v3 . . . . . . . . . . . . . . . . . . . . . 73A.2.3. Older versions of OpenFOAM and other variants. . . . . . . . . . . . 74

    B. OpenFOAM function objects - details. 75

    C. Previous CHT adapters - details. 81C.1. Implementation details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81C.2. Using case files prepared for the old adapters . . . . . . . . . . . . . . . . . . 81

    Bibliography. 85

    xiii

  • 1. Introduction

    Multiple phenomena take place in nature simultaneously, yet we often simulate every prob-lem as if it were driven only by the laws of fluids, the laws of solids, or

Recommended

View more >