Transient CFD - Computational Fluid Dynamics - Lecture Slides, Slides of Fluid Dynamics

These lectures slides are from course Computational Fluid Dynamics. This lecture was delivered by Larry Caretto. Some points from the lecture are: Transient Cfd, Conduction Equation, Ftcs, Crank-Nicholson Equations, Dufort Frankel, Von Neumann Stability, Convection Equation, Transient Convection Diffusion

Typology: Slides

2013/2014

Uploaded on 02/01/2014

savitri_122
savitri_122 🇮🇳

4.6

(14)

184 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Transient CFD April 21, 2010
ME 692 – Computational Fluid Dynamics 1
Transient CFD
Transient CFD
Larry Caretto
Mechanical Engineering 692
Computational Fluid Dynamics
April 21, 2010
2
Introduction
Schedule for last two weeks of
semester
Review transient conduction
Density-based approaches to transient
CFD
Pressure-based approaches to transient
CFD
Fluent options for transient CFD
3
Remainder of Course
April 26-28: Non-uniform grids
May 3-5: Student presentations
Have a total of 150 minutes of class time
for 14 students
Will accept volunteers for May 3 or draw
names out of a hat to balance the
presentations
4
Review Conduction Equation
Apply difference formulas derived
for ordinary derivatives to partial
derivatives
•Grids x
i= x0+ iΔt and tn= t0+ nΔt
Try finite difference expressions
below to get explicit finite-
difference equation
n
i
x
T
t
T
=
2
2
α
])[(
)(
2
)( 2
2
11
2
21 xO
x
TTT
x
T
andtO
t
TT
t
Tn
i
n
i
n
i
n
i
n
i
n
i
n
i
Δ+
Δ
+
=
Δ+
Δ
=
+
+
5
Explicit (FTCS) Method
() ()
()
n
i
n
i
n
i
n
i
n
i
n
i
n
iTfTTfT
x
t
TT
x
t
T21
)(
2
1
)( 11
2
11
2
1++=
Δ
Δ
++
Δ
Δ
=++
+
αα
Method just derived is called explicit
method; can solve one equation at a time
Tni-1 TinTni+1
--------------------
Tin+1
•T
in+1 does not depend on other T values
at the new time step (n+1)
2
)( x
t
fΔ
Δ
α
ff
1-2f
6
Stability of Explicit Method
If the values of Ti+1 and Ti-1 are fixed an
increase in Tinshould increase Tin+1
If f is greater than 0.5, an increase in Tin
will cause a decrease in Tin+1
We can avoid this incorrect result by
keeping f = αΔt/(Δx)20.5
This imposes a time step limit that may
be less than the limit required for
accuracy in the solution
(
)
()
n
i
n
i
n
i
n
iTfTTfT 21
11
1++= +
+
pf3
pf4
pf5

Partial preview of the text

Download Transient CFD - Computational Fluid Dynamics - Lecture Slides and more Slides Fluid Dynamics in PDF only on Docsity!

Transient CFDTransient CFD

Larry Caretto

Mechanical Engineering 692

Computational Fluid Dynamics

April 21, 2010

2

Introduction

  • Schedule for last two weeks of

semester

  • Review transient conduction
  • Density-based approaches to transient

CFD

  • Pressure-based approaches to transient

CFD

  • Fluent options for transient CFD

3

Remainder of Course

  • April 26-28: Non-uniform grids
  • May 3-5: Student presentations
    • Have a total of 150 minutes of class time for 14 students
    • Will accept volunteers for May 3 or draw names out of a hat to balance the

presentations

4

Review Conduction Equation

  • Apply difference formulas derived

for ordinary derivatives to partial

derivatives

  • Grids xi = x 0 + iΔt and t (^) n = t 0 + nΔt
  • Try finite difference expressions

below to get explicit finite-

difference equation

n

x i

T

t

T

2

2

[( ) ] ( )

2 ( ) 2 1 12 2

1 2 O x x

T T T x

T O t and t

T T t

T

n i

n i

n i

n

i

n i

n i

n

i

  • Δ Δ

  • − = ∂

  • Δ Δ

∂ (^) + −

5

Explicit (FTCS) Method

( ) ( ) ( )

n i

n i

n i

n i

n i

n i

n i T fT T fT x

t T T x

t T 1 2 ( )

2 1 ( )

2 1 1 2 1 1

1 ⎟⎟ = + + − ⎠

⎞ ⎜⎜ ⎝

Δ

Δ

    • − Δ

Δ = (^) + − + −

  • α α
  • Method just derived is called explicit

method; can solve one equation at a time

Tni-1 Tin^ Tni+

● Tin+

  • Tin+1^ does not depend on other T values

at the new time step (n+1)

2

( x )

t

f

α

f f

1-2f

6

Stability of Explicit Method

  • If the values of Ti+1 and Ti-1 are fixed an

increase in Tin^ should increase Tin+

  • If f is greater than 0.5, an increase in Tin

will cause a decrease in Tin+

  • We can avoid this incorrect result by

keeping f = αΔt/(Δx) 2 ≤ 0.

  • This imposes a time step limit that may

be less than the limit required for

accuracy in the solution

( ) ( )

n i

n i

n i

n

Ti fT 1 T 1 1 2 fT

1

7

Crank-Nicholson Method

  • Seek more accurate time derivative
  • Provides implicit method
    • Value of T (^) in+1^ depends on T (^) in+1^ and T (^) in-
    • More work per step, but can take longer

time steps with this method

  • Apply to diffusion equation at time n + 1/

2

1

2

2 2

1 2 2 1

1

[( )] [( )]

2

2

    • +^ +

  • Δ = Δ

  • Δ = Δ

n

i

n i

n i

n i

n i

n

i x

T O t t

T T O t t

T T

t

T α

8

Crank-Nicholson Equations

=

− −

− −

− −

− − −

− − −

− −

n N

n N

n N

n

n

n n

n N

n N

n

n

n

R fT

R

R

R

R fT

T

T

T

T

T

f f

f f

f f

f f f

f f f

f f

1

2

3

2

1 0

1 1

1 2

1 3

1 2

1 1

0 0 0 0 21

0 0 0 0 21

0 0 21 0 0

0 21 0 0

21 0 0 0

21 0 0 0 0

M

M M

M

L

L

M M M M O M M

L

L

L

  • Consider case where boundary

temperatures T 0 and TN are specified

  • Rewrite equations in matrix form to

show tridiagonal structure

[ ]

n i

n i

n i

n Ri = fT + 1 + T − 1 + 2 ( 1 − f ) T

f = αΔt/(Δx) 2

f ≥ 1

9

Crank Nicholson Results

  • Results for α = 1, L = 1, Δx = 0.01, Δt =

0.0005, f = αΔt/(Δx) 2 = 5

n = 6 t = 0.003 0 141.46 177.47 298.2 397.

n = 5 t = 0.0025 0 56.79 252.91 334.12 422.

n = 4 t = 0.002 0 203.86 209.57 347.52 473.

n = 3 t = 0.0015 0 25.7 320.81 439.19 533.

n = 2 t = 0.001 0 352.75 305.27 440.73 599.

n = 1 t = 0.0005 0 -73.35 423.96 690.85 834.

n = 0 t = 0+ 0 1000 1000 1000 1000

t = 0 1000 1000 1000 1000 1000

x = 0 x = .01 x = .02 x = .03 x =.

i = 0 i = 1 i = 2 i = 3 i = 4

10

Crank Nicholson Results III

Error t = 0.0125 0 0.216 0.272 0.212 0.

Exact t = 0.0125 0 50.43 100.66 150.48 199.

n = 25 t = 0.0125 0 50.21 100.93 150.27 199.

n = 24 t = 0.012 0 51.73 102.36 153.78 203.

n = 23 t = 0.0115 0 52.22 105.35 156.49 208.

n = 22 t = 0.011 0 54.19 106.68 160.64 212.

n = 21 t = 0.0105 0 54.43 110.47 163.53 217.

n = 20 t = 0.01 0 57.1 111.53 168.52 222.

n = 19 t = 0.0095 0 56.86 116.5 171.59 228.

n = 18 t = 0.009 0 60.65 117 177.71 234.

x = 0 x = .01 x = .02 x = .03 x =.

i = 0 i = 1 i = 2 i = 3 i = 4

11

Fully Implicit Method

  • Discretize diffusion equation at t (^) n+

[( ) ] ( )

2 ( ) 2 2

1 1 1

1 1

1

2

(^112) O x x

T T T x

T O t and t

T T t

T (^) in in in

n

i

n i

n i

n

i

  • Δ Δ

  • − = ∂

  • Δ Δ

∂ (^) ++ −+ +

[( ),( )] 0 ( )

(^2 ) 2

1 1 1

1 1

(^11)

2

(^12)

  • Δ Δ = Δ

  • − − Δ

∂ − ∂

O t x x

T T T

t

T T

x

T t

T

n i

n i

n i

n i

n i

n

i

n

i

α α

n i

n i

n i

n

− fTi + + fT − fT = T

1 1

1 1

1 (^12 )

  • Tridiagonal system of equations
  • Almost same work as CN and no

spurious oscillations, but less accuracy

12

DuFort Frankel

  • Rearrange and introduce f = αΔt/(Δx) 2

(^1 12) ( 1 1 1 1 ) 2 ( 1 1 1 1 ) ( )

(^2) + −

  • − + − − = + − − Δ

Δ i n −^ in = Tin Tin Tin Tin fTin Tin Tin Tin x

t T T

α

( 1 + 2 f ) T (^) i n +^1 = Tin −^1 ( 1 − 2 f ) + 2 f ( T (^) in + 1 + Tin − 1 )

  • Result is explicit for values at time n+
  • Explicit start required to get first set of

values at time n-

19

von Neumann Results

  • Explicit (FTCS) method
    • G ≤ 1 if f ≤ 0.
  • Crank-Nicholson method

1 4 sin

2

Δ x

G e f

at^ β m

1 2 sin

1 2 sin

2

2

Δ

x

f

x

f

G e

m

m

at

Unconditionally stable

20

Convection Equation

  • Lax’s Method is stable if the Courant

number, NC = cΔx/Δt ≤ 1

[ ]

[ ]

n i

n i

n i

n n i

i u u

x

u u c t

u 1 1

1 1 1

[ 1 ( 1 )sin( )] 1

2 2

Δ

G e NC mx

at

x

u c t

u

21

Transient Convection Diffusion

  • Stability of FTCS algorithm

2

2

x x

c t

∂ φ α

φ φ

n k

n k

n k

n k

n k

n k

n k x

t

x

ct φ φ φ

α φ φ φ φ 2 2

1 1 2 1 1

1

  • − Δ

( ) x

x

ct x i x

t G β m β m

α 1 2 2 1 cos sin Δ

  • Stability requires cΔt/Δx ≤ 1, αΔt/(Δx) 2 ≤

0.5 and Pe cell = cΔx/α ≤ 2

  • Last equation is limit for central difference 22

Density-based Solvers

  • Typically used for compressible flows in

aerodynamics calculations

  • Split stress term, σij , into sum of pressure

and viscous stress, τij = σij + Pδij

ij i

j

j

i ij x

u

x

u τ μ +κ− μΔ δ ⎥

j i

ij

i j

j i j B x x

p

x

uu

t

u ρ

ρ ρ τ

∂ =− ∂

23

Density-based Solvers II

  • Equation without summation convention

x

xj yj zj

j

j j j j

B

x x y z

p

z

wu

y

vu

x

uu

t

u

x

yx zx

xx

B

z

wu

y

vu

x

uu p

t

u

  • General

direction j

equation

  • x-direction

equation

24

Density-based Solvers III

  • Cast continuity, momentum, total

energy, and species balance into form

of vector equation

H

U E F G

t x y z

  • Each conservation equation is one

component of the vector equation

  • Get components by reviewing equations

25

Density-based Solvers IV

H

U E F G

t x y z

6

5

4

3

2

1

() 6

5

4

3

2

1

()

2 ( )

h

h

h

h

h

h

r

uB vB wB

B
B
B
U
U
U
U
U
U
W

e V

w

v

u

K

x y z

z

y

x

K

ρ

ρ

ρ

ρ

ρ

ρ

ρ

ρ

ρ

ρ

U H

26

Density-based Solvers V

H

U E F G

t x y z

6

5

4

3

2

1

() ()

2 [ ( / 2 ) ]

e

e

e

e

e

e

uW j

u e V p u v w q

wu

uv

uu p

u

K x

K

xx xy xz x

xz

xy

xx

ρ

ρ τ τ τ

ρ τ

ρ τ

ρ τ

ρ

E

27

Density-based Solvers VI

H

U E F G

t x y z

6

5

4

3

2

1

() ()

2

[ ( / 2 ) ]

f

f

f

f

f

f

vW j

e V p u v w q

wv

v

vv p

uv

v

K y

K

yx yy yz y

yz

yy

yx

F

28

Density-based Solvers VII

H

U E F G

t x y z

6

5

4

3

2

1

() ()

2 [ ( / 2 ) ]

g

g

g

g

g

g

wW j

w e V p u v w q

ww p

vw

uw

w

K z

K

zx zy zz z

zz

zy

zx

G

29

Density-based Solvers VIII

H

U E F G

t x y z

  • Compute vectors E , F , G , and H from

flow variables and use numerical

integration over time step to get U

  • Update flow variables from components

of U vector, Uk.

  • These are not velocity components
  • Details next chart

30

Density-based Solvers IX

( )

1

() 6

2 4

2 3

2 2 2 1 1

5

1

4

1

3

1

2

1

U
U
W
U U U
U U
U

e

U
U

w

U
U

v

U
U

u

U

K

37

Pressure-based Solvers VI

  • Use steady-state results

[ ( ) ( ) ]

Δ

Δ

V

V

Pt t Pt

S dV x x y y

dV y

v

x

u

t

V

( )

, ,

φ φ μ

φ μ

ρφ ρφ ρφ ρφ

[( ) ( ) ]

( )

, ,

φ

a a a a a S

t

V

N N S S E E W W P P

Pt t Pt

38

Pressure-based Solvers VII

  • Transient finite-volume equation

[ ( ) ( ) ]

( )

, ,

φ

a a a a a S

t

V

N N S S E E W W P P

Pt t Pt

()

      • − , + =

φ aN φ (^) N aS φ S aE φ E aW φ W aPtransient φ P Stransient

t

V
S S

t

V

a a

Pt transient

Pt t P transient P Δ

,+ Δ () () , ,

ρ φ φ ρφ

39

What is Time Average?

  • Have same choices used for conduction

equation

  • Explicit – use values at old time step
  • Implicit – use values at new time step
  • Crank-Nicholson – use average of values at old and new time steps
  • Can also use more accurate time

derivatives

  • Fluent has various options

40

41

Explicit or Implicit?

  • Explicit stability limits on time step (set

by the local Courant number, uΔx/α)

  • The Δt required for stability is usually

much lower than the Δt for accuracy

  • Implicit algorithms will generally take

less computer time

  • Moving waves ( e. g. shock waves)

require small time steps so that explicit

algorithms are preferred here

  • Available in Fluent only with density solver

42

Other Fluent Options

  • Non-iterative time advancement –

simplifies iterations to reduce computer

time for solution

  • Does not do “outer” iteration
  • Frozen-flux formulation uses aK

coefficients from previous time step

  • Does not update during iterations
  • Another item to save computer time