You are on page 1of 32

Numerical methods in Fluid Mechanics II

1. Curvilinear Grids

Prof. Marc Avila


http://www.avila.lstm.techfak.fau.de

Simulation of turbulent flow: examples

Transitional pipe flow

Rapidly rotating flow in an annular container

Turbulent flow of a liquid metal

Mixing at a T-junction

Computational Fluid Dynamics (CFD)

Fluid flow is described by PDEs

Equations cannot be solved in paper computer

Obtain an approximate numerical solution (program)

Use a discretization method: PDE algebraic eq.

Solution: results at discrete locations in space and


time
The accuracy depends on:

Level of physical description of the model equations

The quality of discretizations used in the simulation

Warning about CFD

CFD is not about:

Generating a grid for some structure (CAD)

Selecting some unknown model provided by the GUI

Running a simulation

Producing a colorful three-dimensional plot

Believing (and making others believe) the result

CFD = Colors for Directors


understand models & equations
assess reliability of a simulation

Learning objectives

Simulation of fluid and heat transport

NMTFD I (Winter):

simple models and laminar flow

NMTFD II (Summer):

turbulent flow + practical simulation

Understand models of fluid and heat transport

Numerical methods:

How they work, how to use them, which one to choose...

Can I believe the results?

Implementation:

3 practical exercises with OpenFOAM + 1 written exercise

Organizational

Lecture: Monday 8:15-9:45 (KS II)

marc.avila@fau.de

Programming: Friday at 10:15-11:45 (00.153-113)

Prof. Dr. Marc Avila


Nan Chen

chennan0528@gmail.com

Exercise: Thursday 10:15-11:45 (T 0.75)

Anna Guseva

anna.guseva@fau.de

Oral exam: (5 ETCS)

Programming assignments: (2,5 ECTS)

10

StudOn

All the material of the lectures and exercises (except


blackboard notes!) can be found here:
http://www.studon.uni-erlangen.de/crs1211238.html

To get access to the course use passwd: CFD2_is_fun


Please actively use the forum for questions, comments
and suggestions about the class

11

Important: account for CIP-Pool Informatik

To be able to work on the computers during the


exercise class, you need a user
How to get a user:

Service of CIP-Pool Informatik daily between 12:00-13:00

12

NMTFD I: Course contents


1. Governing equations and models in fluid mechanics
2. Steady problems: the Finite-Difference Method
3. Steady problems: the Finite-Volume Method
4. Unsteady problems: methods of time integration
5. Solution of the incompressible Navier-Stokes equations
6. Grids and their properties
Momentum conservation:

v
2
( + v v )= g p+ v
t

Mass conservation:

v =0

13

NMTFD II: Course contents


1. Curvilinear grids
2. Turbulent Flows
3. Direct Numerical Simulation (DNS)
4. Reynolds Averaged Navier-Stokes equations (RANS)
5. Large Eddy Simulation (LES)
6. Porous Media
7. Multiphase Flows and Particulate Flows

14

Literature

Numerical methods

Turbulence; Turbulence Simulation

15

Tentative Schedule: lecture

13.04.15: Introduction + Curvilinear grids

20.04.15: Turbulence

27.04.15: Wall-bounded flows

04.05.15: DNS

11-18.05.14: RANS

01-08.06.15: LES

15.06.15: Porous media

22-29.06.14: Multiphase flows

06.07.15: Particulate flows

13.07.15: Selected applications

16

Exercises (starts next week)

Exercise sheet given at the lecture

You work on the exercise at home: groups of two

Each group: present the solution of part of an exercise sheet

Programming (starts this Friday)

Three tasks: hand in a code and report for each task

OpenFOAM Tutorials + Work on the exercise with assistance

2,5 ECTS: you need to secure 200 points


3 x Programming Tasks + 1 x Exercise = 300 points + 100 points
The exercise presentation is compulsory for all groups

17

Outline of the Lecture

Introduction: types of grids

Curvilinear coordinates & coordinate transforms:

Operators:

Gradient, divergence, Laplace, Rotation

Conservation equations in curvilinear coordinates

Physical and Computational space

Mass and momentum conservation

Numerical remarks

18

Grid types
Structured grid

Unstructured grid

Block-structured grid

19

Structured grids

Properties of structured grids:

grid points logically regularly arranged

grid points are uniquely characterized by index triple (i, j, k)

neighborhood relations direct storage efficiency

Types of structured grids:

Orthogonal grids (Cartesian, polar,...)

Non-orthogonal, contour adapted grids

20

Structured grids: orthogonal curvilinear grids

Cartesian
grid

Curvilinear (polar)
grid

Ideal for staggered grids

21

Generalized curvilinear grids


Curvilinear contour-adapted (boundary-fitted)
grid
U

Generalized curvilinear non-orthogonal


coordinates

( x , y , z)( , , )

22

Coordinate transformations
Physical space / Computational space (2D)

( x , y)( , )

23

Coordinate transformations
Physical space / Computational space (3D)

( x , y , z)( , , )

24

Advantages of generalized coordinates

Dense grids in regions with steepest gradients (walls)

Allow for time-depending grids (e.g. piston motion)

Structured grids computational efficiency:

Indexing direct addressing, no lists of relationships

Algebraic systems with regular sparsity patterns

( x , y , z)( , , )
or with different notation:

( x1, x 2, x 3 )(1, 2, 3 )

25

Cartesian to cylindrical coordinates


P-Space

( x , y)(r ,)

C-Space
2
Discretize:

r1

r2

, , ...
r

r1

r2

r
We can discretize the equations in C-Space
We need the equations stated in polar coordinates!

26

Generalized coordinates: formulation

The coordinates are defined by the transformation:


General

x 1 = x1 (1, 2, 3 )
x 2 = x 2 (1, 2, 3 )
x 3 = x 3 (1, 2, 3 )
Or in index notation:

x i =x i ( j )

Example: cylindrical

x=r cos
y=r sin
z=

27

Jacobian of the transformation

The transformation is characterized by the Jacobian:

( )

x1
1
xi
x2
J =det
=det
j
1
x3
1

( )

x1
2
x2
2
x3
2

x1
3
x2
3
x3
3

* Example: derivative of a scalar; cylindrical coordinates

28

Gradient of a scalar (pressure in the NS)

29

= j = ij
xi j xi j J

xi
Where here ij is the cofactor of
j
For example in 2D we obtain:

= 1 y y
x J

in J

* Exercise: obtain this result at home

Divergence operator (mass conservation)

30

Cartesian velocity vector: u i =(u , v , w)


u i u v w u i ij
= +
+
=
xi x y z j J

The velocity components above are Cartesian we


want to use the contravariant velocity field U i =(U ,V , W )
For example in cylindrical coordinates:
u

ur
u

U i =(U ,V , W )=(u r , u , u )

31

Contravariant velocity field

1
U =u
+v
+w
= ( u 11 +v 21 +w 31 )
x
y
z J

1
V =u
+v
+w
= ( u 12 +v 22 +w 32 )
x
y
z J

1
W =u
+v
+w
= ( u 13 + v 23 +w 33 )
x
y
z J

Index notation:

1
U i = (u k ki )
J

ui 1
Divergence:
=
Ui J )
(

xi J
i

* Example: cylindrical coordinates

32

Laplace operator

Use: 2 = ,

[ ( )]

= 1
B kj
xi xi J j k
J

( )

B kj =ki ji

Terms with B kj , k j multiply terms like

(mixed derivatives) numerical problems*


If the coordinates are orthogonal:

B kj =0, if k j

* Mixed derivatives have unconventional stencils, which makes the linear


systems poorly conditioned because of off-diagonal elements

Advection-diffusion equation

Using the previous results we can now write:

)]

B ki

J
U i J
= q J
( )+
i
k J
t

33

34

Navier-Stokes

Mass conservation:
U J =0
i ( i )

Momentum conservation:

u j
p
J
+
u j U i J ) =
ij
(
i
t i
u j B km
u n kj i n

m k J
i k J

] [

Practical notes

For moderately complex geometries, it will be very


efficient to work with curvilinear coordinates
We just need to compute the metrics: , J
ji
Advantage: using contravariant velocities it is
straightforward to work with staggered grids
Nonorthogonal grids: mixed derivatives appear
because of the diffusion term
...iterative solvers may not converge

35

Final comments

For moderately complex problems, where high


efficiency is needed curvilinear coordinates

Curv. coord. can be used in block-structured grids

For this, specialized codes are typically developed

Generic problems in engineering Cartesian


coordinates on non-orthogonal collocated grids
Algorithms like SIMPLE need to be modified for nonorthogonal grids

36

You might also like