29
Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul, Sophie Porter, Svetlana Aleksandrova and Steve Benjamin

Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

  • Upload
    vobao

  • View
    251

  • Download
    8

Embed Size (px)

Citation preview

Page 1: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Open Source Computational Fluid

Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Sophie Porter, Svetlana Aleksandrova and Steve Benjamin

Page 2: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Outline

Introduction

Computational Fluid Dynamics (CFD)

Introduction to OpenFOAM

Getting started (Myths)

Some examples

Page 3: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Introduction and motivation

Why open source?

Challenges?

Motivation? To promote the use of OpenFOAM and encourage its use by the light aircraft

design “community” by providing practical advice to avoid typical pitfalls and

stressing benefits

Page 4: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Computational Fluid Dynamics

• Firstly, the equations that describe the system are derived and/or approximated

• This requires significant mathematical understanding

• System understanding is also essential

• Equations are discretised in space (approximation)

• For example:

• Take a reference frame

• And the actual solution of the system

• Choose discrete points of interest in space

• CFD finds the solution to this discrete system

• We are left with an approximated solution

• Limitation?

• We do not know the solution…

• …so the next shape could also be a solution!

Space

Velocity

Page 5: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Computational Fluid Dynamics

Mesh and boundary conditions

Free-stream

Aerofoil (wall) Inlet Outlet

Free-stream

Page 6: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Approaches used in CFD

• DNS Direct Numerical Simulation

• Very good results

• Extremely expensive

• Used for mostly for fundamental research

• Not suitable for engineering applications

• LES Large Eddy Simulation

• Less expensive than DNS as some flow features are modelled (below inertial sub-

range)

• Difficult to set up i.e. especial boundary conditions and filters

• Practical engineering problems have been solved successfully but mostly research

• Future?

Copyright © Dr Humberto Medina

Page 7: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Approaches used in CFD

• DES Detached Eddy Simulation • Mixed approached

• Slightly less expensive than LES

• Implementation of new models is still a challenge

• RANS Reynolds-Averaged Navier-Stokes • Industry standard

• Inexpensive for most engineering applications

• Well established with numerous models available

• Limited to steady state solutions

• Requires a significant modelling effort to close the system of equations

Page 8: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Approaches used in CFD

RANS

LES

DNS

RANS

LES

DNS

100% modelled turbulence

Turbulence model required

Industrial “workhorse”

Large scales of turbulence (resolved)

Small scales of turbulence (modelled)

Restrictive industrial applications

100% resolved turbulence

Strictly restrictive to industrial

applications for at least the next few

decades

Increasing computational cost &

method accuracy

▬ Figure 2: RANS, LES & DNS comparison - zpg flat plate

Page 9: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

The classic CFD workflow

Page 10: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Introduction to OpenFOAM

• Collection of libraries (c++)

• Open source and free to use (GNU GPL) • Large user base

• Development managed by the OpenFOAM Foundation

• Users can contribute new code

• Fast (very fast) development

• Bug reporting system and GIT repositories make code

traceable and trackable

• Offers many, many features! (see paper & website)

Page 11: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Introduction to OpenFOAM

• If OpenFOAM is that great why is not everyone using it?

• Steep learning curve

• No native Graphical User Interface (GUI)

• Case configuration via text files

• It offers so much freedom that it can be overwhelming for

new users

• Native mesh generation tools are powerful but need

refinement

• Pre-processing a current bottleneck of the purely open

source CFD solution (but some very capable solutions do

exist!!!)

Page 12: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 1: Linux is inaccessible

Myth 2: No documentation

Myth 3: No mesh generation tools

Myth 4: No Graphical User Interface (GUI)

Myth 5: Difficult to post-process

Page 13: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 1: Linux is inaccessible Many Linux distribution e.g. Ubuntu, Fedora, Debian, Mint, etc.

• Ubuntu download and installation

http://www.ubuntu.com/download/desktop

• Introduction to the Linux terminal

https://help.ubuntu.com/community/UsingTheTerminal

• Community support

https://help.ubuntu.com/ (Ubuntu, similar sites for other distros)

Page 14: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 1: Linux is inaccessible

Page 15: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 2: No documentation Sources of information (incl. unofficial)

• Official documentation

http://cfd.direct/openfoam/user-guide/

• Source code information

http://www.openfoam.org/docs/cpp/ (under modules)

https://github.com/OpenFOAM (GitHub repositories)

• Community support

http://www.cfd-online.com/ (CFD online forum)

Page 16: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 3: No mesh generation tools Virtually all commercial mesh generators can be used.

• Some open-source alternatives

– OpenFOAM (blockMesh and snappyHexMesh)

– cfMesh has enormous potential (issues with boundary layer generation)

– Netgen algorithm is versatile (GUI not intuitive)

– SALOME the most complete solution (some RAM memory issues)

• Includes a very capable CAD module

Page 17: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 3: No mesh generation tools (Salome)

Page 18: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 4: No GUI available (Helyx-os)

Page 19: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Myth 5: Difficult to post-process (ParaView)

Page 20: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Page 21: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Page 22: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Page 23: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Getting started (Myths)

Page 24: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Post-processing

Page 25: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Examples: Plat plate

back

inle

t

wall (plate) leading edge

x

y z

freestream freestream

outl

et

front

U: Dirichlet condition

p: Neumann condition

Turbulent quantities: Dirichlet condition

U: Neumann condition

p: Dirichlet condition

Turbulent quantities: Neumann condition

U: Dirichlet (no slip) condition

p: Neumann condition

Turbulent quantities: Dirichlet condition

U: Neumann condition

p: Neumann condition

Turbulent quantities: Neumann condition

Boundary Conditions

Page 26: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Examples: Plat plate

Skin friction prediction over a flat plate • 3% Turbulence intensity level

• Experimental results (ERCOFTAC)

Launder-Sharma K-Epsilon K-Omega Transition Model (Walters 2008)

Page 27: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Examples: Porous medium

𝑈𝑠

Δ𝑃

𝑆 = − 𝜇𝐷 +1

2𝜌𝑈𝐹 𝑈

Δ𝑃

𝐿= 𝛼𝑈𝑠 + 𝛽𝑈𝑠

2

Page 28: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Examples: Planar diffuser

𝑆 = − 𝜇𝐷 +1

2𝜌𝑈𝐹 𝑈

Page 29: Open Source Computational Fluid Dynamics using OpenFOAM. Humberto... · Open Source Computational Fluid Dynamics using OpenFOAM Humberto Medina, Abhinivesh Beechook, Jonathan Saul,

Any Questions?