First Lecture on cfd

Post on 19-Jul-2016

26 views 7 download

description

cfd

Transcript of First Lecture on cfd

TMMV08 Computational fluid dynamics

Jonas Lantz

jonas.lantz@liu.se

• Lectures

• Computer sessions

• Assignments:

– Intro to CFD (CFX)

– Forward-facing step (CFX)

– 1D convection-diffusion transport (Matlab)

– RANS derivation

– Flow around simplified car model (CFX)

Organization

• Jonas Lantz: examiner, lecturer, labs

• Matts Karlsson: lecturer

• Magnus Andersson: course assistant

• Anna Wahlund: administration

• Invited Guests

Personnel

• An introduction to Computational Fluid Dynamics –The Finite Volume Method, HK Versteeg & W Malalasekera, PEARSON/PRENTICE HALL, 2nd Edition, 2007

ISBN: 978-0-13-127498-3

• Journal papers

• Assignment descriptions

• Tutorials, ANSYS material.

Literature

Course web page

http://www.iei.liu.se/mvs/utbildning/avancerade-kurser/tmmv08?l=en … Or google: TMMV08, first hit

Contains: assignments, tutorials, additional material, this lecture, etc…

Assignments Assignment Name Available from Due Points

1 Intro to CFX Now 27/1 PASS/FAIL

2 Forward-facing step 30/1 10/2 1,2

3 1D convection- diffusion 6/2 24/2 1,2

4 RANS derivation 20/2 3/3 PASS/FAIL

5 Ahmed car model 20/2 22/3* 3,6,9

*mandatory lecture 13/3 13.15-17.00 Points Grade

0-4 FAIL

5-7 3

8-9 4

10-13 5

Time budget:

Lectures 30 h + labs 56 h + own time = 160 h (6 ECTS credits)

Day Type,

Time

Teacher,

Room

Content

Tue

21/1

Lecture

10-12

JL

A33

Course intro, assignments, etc., Intro to CFX, assignment 1,

Classification of physical behaviors, chapter 1 and 2.6

Wed

22/1

Lecture

08-10

MK

A33

Governing equations, continuity, chapter 2

Thu

23/1

Lab

17-21

JL

VALHALL

Assignment 1: introduction to CFX, tutorials

Mon

27/1

Lab

17-21

JL

VALHALL

Assignment 1: introduction to CFX, tutorials

Tue

28/1

Lecture

10-12

MK

A33

Governing Equations, momentum, chapter 2

Wed

29/1

Lecture

8-10

JL

A34

CFD: best practice, verification and validation

tips and tricks, chapter 10

Thu

30/1

Lecture

13-17

JL

A33

CFD: Live demo, how-to

Introduction to Assignment 2

Thu

30/1

Lab

17-21

JL/MA

VALHALL

Assignment 2: Forward-facing step (CFX)

Mon

3/2

Lab

17-21

JL/MA

VALHALL

Assignment 2: Forward-facing step (CFX)

Thu

6/2

Lecture

13-17

JL

A34

Transport eqn. Basic numerics, Discretization schemes,

Diffusion + Convection/Diffusion, assignment 3, chapter 4 and 5

Thu

6/2

Lab

17-21

JL/MA

VALHALL

Assignment 2: Forward-facing step (CFX)

Mon

10/2

Lab

17-21

JL/MA

VALHALL

Assignment 3: 1D-CD (Matlab)

Wed

12/2

Lecture

8-10

JL

A33

Discretization schemes, Diffusion + Convection/Diffusion

Finite volumes , chapter 4 and 5

Thu

13/2

Lecture

13-17

JL

BL32

Turbulence, intro and modeling, RANS eqns. Tensor notation, chapter 3

Thu

13/2

Lab

17-21

JL/MA

ALFHEIM

Assignment 3: 1D-CD (Matlab)

Mon

17/2

Lab

17-21

JL/MA

ALFHEIM

Assignment 3: 1D-CD (Matlab)

Tue

18/2

Lecture

10-12

JL

A33

Turbulence, RANS

Law-of-the-wall, chapter 3

Thu

20/2

Lecture

13-17

JL

A33

Turbulence, RANS, Law-of-the-wall , chapter 3

Intro to Assignment 4 and 5

Thu

20/2

Lab

17-21

JL/MA

BIFROST

Assignment 3: 1D-CD (Matlab)

Mon

24/2

Lab

17-21

JL/MA

ALFHEIM

Assignment 5: Ahmed (CFX)

Tue

25/2

Lecture

10-12

<extra>

Wed

26/2

Lecture

8-10

<extra>

Thu

27/2

Lecture

13-17

BL32

<extra>

Thu

27/2

Lab

17-21

JL/MA

BIFROST

Assignment 5: Ahmed (CFX)

Mon

3/3

Lab

17-21

JL/MA

ALFHEIM

Assignment 5: Ahmed (CFX)

Tue

4/3

Lecture

10-12

<extra>

Wed

5/3

Lecture

8-10

<extra>

Thu

6/3

Lecture

13-17

A35

<extra>

Thu

6/3

Lab

17-21

JL/MA

BIFROST

Assignment 5: Ahmed (CFX)

Mon

10/3

Lab

17-21

JL/MA

ALFHEIM

Assignment 5: Ahmed (CFX)

Tue

11/3

Lecture

10-12

<extra>

Wed

12/3

Lecture

8-10

<extra>

Thu

13/3

Lecture

13-17

JL

A33

ANSYS Presentation + other companies

Poster presentation Ahmed, closing

Note: lectures with content <extra> will not be given, unless stated otherwise.

Assignment 1, intro to CFX

Intro to programs Tutorials Easy questions

Assignment 2, Forward-facing step First ‘real’ simulation Compare with measurements Report

1p: perform simulations, discuss results

2p: above + excellent discussion and convincing arguments that your simulations are accurate.

Assignment 3, Convection-diffusion

Your own implementation Follow example in course book Numerical schemes Report

1p: working code and discussion on numerical schemes

2p: above + quantification of accuracy

Assignment 4, RANS derivation (in x)

No scheduled time, do it at home Hand in derivation

Assignment 5: vehicle aerodynamics Ahmed Body – simplified car model

Assignment 5: vehicle aerodynamics

Compare with wind tunnel data Design challenge - spoiler Present own poster for invited guests + report 3p: basic simulation + spoiler 6,9p: dig deeper into a topic of your own choice.

So…. Lets start!

(with a brief introduction to CFD)

• Stationary / Transient • Laminar / Turbulent • Compressible / Incompressible • Subsonic / Supersonic • Inviscid / Viscous • Internal / External • Heat transfer

Conduction Convection Radiation

Recap: Fluid flow characteristics

Recap: Fluid Mechanics (more in next lecture)

Conservation of mass and momentum:

The Navier-Stokes equations

(stationary, incompressible,…)

CFD: trying to solve the Navier-Stokes equations

• No known analytical solution exist (?) • Resort to numerical methods to solve the PDEs:

• Finite differences • Finite elements • Finite volumes

Wikipedia: CFD is a branch of fluid mechanics that uses numerical methods and algorithms to solve and analyze problems that involve fluid flows.

Approximations of the governing equations

CFD - ColorFul Display?

Space shuttle re-entry

Turbulent blood flow in the human body

Jonas Lantz 18

Weather prediction

Jonas Lantz 19

CFD - ColorFul Display?

Limitations of CFD

• Physical models CFD solutions rely upon physical models of real world processes (turbulence, compressibility, chemistry, multiphase flow, etc.). The CFD solutions can only be as accurate as the physical models on they are based • Boundary conditions The accuracy of the CFD solution is only as good as the initial/boundary conditions provided to the numerical model (type/value) • Numerical errors Discretization errors due to approximations in the numerical models. (goes to zero as the grid is refined) Convergence errors Round off errors • User Errors

You! Knowledge of CFD and fluid mechanics is very important in order to get an accurate simulation.

Jonas Lantz 20

Theoretical Fluid dynamics The foundation. Everyone HAS to learn it Experimental Fluid dynamics (XFD) Usually, everyone believes it except the person that conducted the experiment Computational Fluid dynamics (CFD) Usually, no one believes it except the person that performed the calculations As an engineer you should know the pro’s and con’s of all three methods, and should be in a position to assess which one is best under the circumstances.

Words of wisdom

Jonas Lantz 21

Jonas Lantz 22

Words of wisdom (2)

CFD requires:

Knowledge

CFD requires:

Knowledge, skill

CFD requires:

Knowledge, skill and gut feeling

CFD in Practice

Drawing/CAD Create geometry

Mesh

Solver settings: Boundary conditions Numerical accuracy Flow models Fluid …

Run the simulation

Post-process results Report

How to

Jonas Lantz 27

Already know?

CFD

http://www.bakker.org/

Mesh Fill the computational domain with mesh cells, where the governing equations are solved. The mesh represents the spatial resolution of the simulation

Jonas Lantz 28

Mesh terminology

Jonas Lantz 29

http://www.bakker.org/

Tetrahedrons

Polyhedrons

Running the simulation

Convergence criteria, “accuracy tolerance” (here 1e-4)

The lines represent the solution of conservation of mass (1 eqn) and conservation of momentum (3 eqns)

Jonas Lantz 31

Running the simulation (2)

Simulation time: 15 min on a laptop - several weeks (months) on > 1000 CPUs Advanced fluid models (turbulence/chemical) require more CPU & memory compared to simpler models (laminar flow). Normally have to make a tradeoff between the spatial and temporal accuracy (mesh and time step) with available computational resources (and license cost (!))

http://www.nsc.liu.se

CPU Power ↔ Resolution

Jonas Lantz 32

Post-processing Obtained directly: Stream lines Path lines Velocity vectors Pressure contours Wall shear stress Forces on/in walls Wall motion Concentration Shock waves Temperature … Derived parameters: pressure drop loss coefficients turbulent quantities Cd, Cl, Cm,… … Animations

Jonas Lantz 33

Drawing/CAD Create geometry

Mesh

Solver settings: Boundary conditions Numerical accuracy Flow models Fluid …

Run the simulation

Post-process results Report

Mesh independency study

Verification: Do the results make sense? Are the trends right? Does it agree with previous calculations on similar configurations?

Validation: Does the result agree with theory or experiment?

How to (2)

Jonas Lantz 34

Mesh independency study

Must always be done in order to ensure that the spatial resolution is sufficient. Evaluate parameter of interest on each mesh (e.g. drag coefficient of car, Cd) Never compare with experimental data until you have a mesh independent result

Mesh 1 Mesh 2 Mesh 3

Cd = 0.40 Cd = 0.32 Cd = 0.31

20% difference (!?)

3 % difference (ok?) 35

Fluid-structure interaction (FSI)

Simulations commonly assumes rigid walls – valid assumption?

start Fluid solver Results

convergence

advance in time

Normal CFD simulation with rigid walls

Jonas Lantz 36

Fluid-structure interaction (FSI)

Simulations commonly assumes rigid walls – valid assumption? In FSI simulations, the wall motion due to flow motion and pressure is computed. Obtains both motion and strain/stress in the wall Need two solvers: one for fluid simulation and one for solid (wall) simulation

start Fluid solver Results

convergence

advance in time

Solid solver

convergence

combined convergence

FSI simulation Adds approx. 10-100x more simulation time ( = weeks!)

Jonas Lantz 37

Multiphysics! Require both solid and fluid mechanics

What is the drag coefficient Cd of a T-Rex dinosaur ?

With CFD we can finally compute things that have troubled mankind for centuries…

http://www.bakker.org/

http://www.bakker.org/

http://www.bakker.org/

http://www.bakker.org/