OpenFOAM course for beginners: [0.8ex] Hands-on

31 downloads 0 Views 9MB Size Report
Sep 12, 2018 - Utilise the power of Linux by extensive use of shell commands. • By the end of the ... starting point for learning OpenFOAM. Jibran Haider.
Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

OpenFOAM course for beginners: Hands-on training Jibran Haider Zienkiewicz Centre for Computational Engineering (ZCCE), College of Engineering, Swansea University, UK

https://www.jibranhaider.weebly.com 12 th September 2018

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

1

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Disclaimer

“ This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software and owner of the R R OPENFOAM and OpenCFD trade marks.”

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

2

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Outline

1

Introduction

2

The OpenFOAM code

3

OpenFOAM simulations

4

Programming in OpenFOAM

5

Hands-on training session

6

Conclusions

7

Appendix

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

3

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Outline

1

Introduction My background Course details OpenFOAM preliminaries

2

The OpenFOAM code

3

OpenFOAM simulations

4

Programming in OpenFOAM

5

Hands-on training session

6

Conclusions

7

Appendix

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

4

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Outline

1

Introduction My background Course details OpenFOAM preliminaries

2

The OpenFOAM code

3

OpenFOAM simulations

4

Programming in OpenFOAM

5

Hands-on training session

6

Conclusions

7

Appendix

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

5

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Experience in computational mechanics

Year

Topic

Software

Institution

[2009]

CFD and experimental study of flow over cylindrical fins.

FLUENT

NUST

[2012]

Numerical simulation of sloshing phenomena in complex tanks.

FLOW-3D

Universität Stuttgart & DLR

OpenFOAM

Universität Stuttgart & DLR

OpenFOAM

Swansea University & UPC

[2013]

[2014]

Modeling of phase change phenomena through a liquid-vapor interface in microgravity. A first order hyperbolic framework for large strain fast solid dynamics.

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

6

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Outline

1

Introduction My background Course details OpenFOAM preliminaries

2

The OpenFOAM code

3

OpenFOAM simulations

4

Programming in OpenFOAM

5

Hands-on training session

6

Conclusions

7

Appendix

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

7

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Course details Objectives • Introduce the basics of OpenFOAM. • Signify the advantages of using OpenFOAM. • Utilise the power of Linux by extensive use of shell commands. • By the end of the course, candidates should be able to run OpenFOAM simulations.

Desirable traits • Basic level of programming in C++. • Familiarization with Linux interface. • Fundamentals of Computational Fluid Dynamics (CFD).

During this course we will be using • OpenFOAM Foundation release (version 6). • ParaView (version 5.4.0).

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

8

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Outline

1

Introduction My background Course details OpenFOAM preliminaries

2

The OpenFOAM code

3

OpenFOAM simulations

4

Programming in OpenFOAM

5

Hands-on training session

6

Conclusions

7

Appendix

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

9

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

What is OpenFOAM? Summary • An open source software package. • Released under the GNU General Public License. • Abbreviation of Open Field Operation And Manipulation. • An efficient library of C++ modules. • Based on the cell centered Finite Volume Method. • Extensive CFD and Multi-physics capabilities. • Cross-platform installation. OpenFOAM forks

kC e f k

Ω0e e

F CN e f

• OpenFOAM Foundation release (official standard release). • OpenFOAM + (official development release). • FOAM-extend (community driven development branch).

 This blog post [link] provides plenty of free references available on the web which might be a good starting point for learning OpenFOAM.

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

10

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Key features of OpenFOAM

OpenFOAM is a C++ library of highest quality of programming for solving computational continuum mechanics problems utilising all the features of Objected Oriented Programming (OOP).

Key features of OOP • Abstraction • Inheritance • Polymorphism Objects of different classes respond differently to functions of the same name. Also includes operator overloading. Template metaprogramming • C++ provides template classes. • General features of the template class are passed on to any other class created from it. • This reduces code duplication.

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

11

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Why OpenFOAM?

OpenFOAM

Commercial Software (ANSYS, ABAQUS etc.)

1.

Cost effectiveness

2.

Parallel computing

3.

Source code

4.

Redistribution of code

5.

Collaborative development

6.

Documentation

7.

GUI / user friendliness

X X X X X × ×

× X × × × X X

X

Motivates collaborative and project-driven development.

X

According to the GNU GPL v3, OpenFOAM is free to download, install, use, modify and distribute.

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

12

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Development of OpenFOAM

1989

10th Dec 2004 8th Aug 2011 15th Aug 2012 th

6 Aug 2018

Project was initially started under the title of FOAM at Imperial college, London. The idea was to create a simulation platform more powerful than FORTRAN. Due to its object oriented features C++ was chosen as the programming language. OpenCFD Ltd was founded and first version (v1.0) of OpenFOAM was released under the GNU GPL license. OpenCFD was acquired by Silicon Graphics International (SGI). OpenCFD became a wholly owned subsidiary of ESI group. OpenFOAM v6 was released.

 Henry Weller and Hrvoje Jasak are the main initial contributors to its development.  Several developers from all over the globe have contributed to its development. R  OPENFOAM is a registered trade mark of OpenCFD Limited, producer and distributor of the

OpenFOAM software.

Jibran Haider

(PhD Computational Mechanics)

OpenFOAM course for beginners

13

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Simulation workflow

Solver

Preprocessing

- blockMesh - snappyHexMesh - OpenFOAM utilities - Gmsh - Netgen - Engrid - Tetgen - SALOME - Blender - ANSYS - Star-CCM+ - SOLIDWORKS

- Incompressible - Compressible - Multiphase - Combustion - Heat transfer - Molecular dynamics - Electromagnetics - Solid mechanics

OpenFOAM

Jibran Haider

(PhD Computational Mechanics)

Other open source

Postprocessing

- OpenFOAM utilities - ParaView - VISIT - OpenDX - Netfabb - SALOME - Gnuplot - ANSYS - EnSight - FieldView - Tecplot

Commercial

OpenFOAM course for beginners

14

Introduction

Code

Simulations

Programming

Tutorials

Conclusions

Appendix

Conventions used in this presentation

OpenFOAM terminologies OpenFOAM_terminology

OpenFOAM command for applications OpenFOAM_application

Commands on terminal