lecture objectives:

15
Lecture Objectives: Explicit vs. Implicit Residual, Stability, Relaxation Simple algorithm

Upload: mary-gomez

Post on 01-Jan-2016

11 views

Category:

Documents


0 download

DESCRIPTION

Lecture Objectives:. Explicit vs. Implicit Residual, Stability, Relaxation Simple algorithm. General Transport Equation unsteady-state 1-D. Fully explicit method:. Implicit method:. Value form previous time step (known value). Make the difference between - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture Objectives:

Lecture Objectives:

Explicit vs. Implicit

Residual, Stability, Relaxation

Simple algorithm

Page 2: Lecture Objectives:

General Transport Equation unsteady-state 1-D

Fully explicit method:

Implicit method:

ΦΔττ

WΔττ

EΔττ

Peff Φ,Δττ

P(or W)Δττ

P)or E(x

τP

ΔττP SΦΦ2Φ

ΔxΔx

Γ ΦΦ

Δx

ρV

Δτ

ΦΦρ

ΦτW

τE

τP

eff Φ,τP(or W)

τP)or E(

xτP

ΔττP SΦΦ2Φ

ΔxΔx

Γ ΦΦ

Δx

ρV

Δτ

ΦΦρ

Value form previous time step (known value)

Make the difference between - Calculation for different time step- Calculation in iteration step

Page 3: Lecture Objectives:

source1N1NNp

1-NNx

NN qTTT2xx

k/c TT

x

ρVTT

ρ

Explicit:

Unsteady state Advection diffusion equation, 1-D

Rarely used due to the problem with stability of calculation

To achieve stable calculation should be very small

NNN T/aa-f/aT/aaT/aaT NNoN1N1N1-NN1-N

NNN Ta-fTaTaTa No11N1-N1-NN

Page 4: Lecture Objectives:

Unsteady state Advection diffusion equation, 1-D

source1N1NN1-NNx

NN qTTT2xx

k/cp TT

x

ρVTT

ρ

Implicit:

Iterative method:

NNN Ta-fTaTaTa No11N1-N1-NN

NNN T/aa-f/aT/aaT/aaT NNoN1N1N1-NN1-N

Explicit format (to solve system of equations)

2) Guess initial values: ..T ..,T ..,T ...,T 04

03

02

01

3) Substitute and calculate:

4….) Iterate for considered time stepIn iteration substitute only these values

Make the difference between iteration and calculation for next time step

Page 5: Lecture Objectives:

ResidualExample:

x-exp(1/x)-2=0

Find x using iteration

Explicit form 1:

x=exp(1/x)+2

Explicit form 2:

x=1/(ln(x)-ln(2))

Solution process:

Guess x0

Iteration :

x1=exp(1/x0)+2 , R1=x1-x0

X2=exp(1/x1)+2 , R2=x2-x1

……..…….

Not all iteration process converge!

See the example for the same equation

Page 6: Lecture Objectives:

Convergence example

Explicit form 2:

x=1/(ln(x)-ln(2)

Page 7: Lecture Objectives:

Residual calculation for CFD

• Residual for the cell

Rijk=kijk-k-1

ijk

• Total residual for the simulation domain

Rtotal=Rijk|

• Scaled (normalized) residual R=Rijk|/F

iteration

cell positionVariable: p,V,T,…

For all cells

Flux of variable used for normalizationVary for different CFD software

Page 8: Lecture Objectives:

RelaxationRelaxation with iterative solvers:

When the equations are nonlinearit can happen that you get divergency in iterative procedure for solving consideredtime step

Under-Relaxation is often required when you have nonlinear equations!

iteration

convergence

variabledivergence

solution

Solution is Under-Relaxation:

Y*=f·Y(n)+(1-f)·Y(n-1) Y – considered parameter , n –iteration , f – relaxation factor

For our example Y*in iteration 101=f·Y(100)+(1-f) ·Y(99)

f = [0-1] – under-relaxation -stabilize the iterationf = [1-2] – over-relaxation - speed-up the convergence

Value which is should be used for the next iteration

Page 9: Lecture Objectives:

Example of relaxation(example from homework 3 assignment)

N1NNNN1-NN fTcTbTa

Example: Advection diffusion equation, 1-D, steady-state, 4 nodes

1NNN1-NNNNNN T/bcT/bafb/1T 1 2 3 4

1) Explicit format:

2) Guess initial values:

..T ..,T ..,T ...,T 04

03

02

01

3) Substitute and calculate:

20

111111 T/bcfb/1T

30

2211

222221 T/bcT/bafb/1T

40

3321

333331 T/bcT/bafb/1T

31

444441 T/bafb/1T

..T ..,T ..,T ...,T 14

13

12

11

Substitute and calculate:4) ..T ..,T ..,T ...,T 24

23

22

21

………………………….

.... ,f)T-(1fTT ,f)T-(1fTT 02

12

1r2

01

11

1r1

.... ,f)T-(1fTT ,f)T-(1fTT 12

22

2r2

11

21

2r1 Substitute and calculate:

Page 10: Lecture Objectives:

Navier Stokes Equations

0z

v

y

v

x

v zyx

)(Sz

y

x

y

p)

z

vv

y

vv

x

vv

τ

vρ( yM2

y2

2

y2

2

y2

yz

yy

yx

y

TTgρ

xM2x

2

2x

2

2x

2x

zx

yx

xx S

z

y

x

x

p)

z

vv

y

vv

x

vv

τ

vρ(

zM2z

2

2z

2

2z

2z

zz

yz

xz S

z

y

x

z

p)

z

vv

y

vv

x

vv

τ

vρ(

In order to use linear equation solver we need to solve two problems:

1) find velocities that constitute in advection coefficients2) link pressure field with continuity equation

This velocities that constitute advection coefficients: F=V

Pressure is in momentum equations which already has one unknown

Continuity equation

Momentum x

Momentum y

Momentum z

Page 11: Lecture Objectives:

Pressure and velocities in NS equations

How to find velocities that constitute advection coefficients?

xM2x

2

2x

2

2x

2x

zx

yx

xx S

z

y

x

x

p)

z

vv

y

vv

x

vv

τ

vρ(

fVaVaVaVaVaVaVaLPx,LHx,HNx,NSx,SWx,WEx,EPx,P

................................

a ,V

a

VVV6a

2Wx

2E

zyx

2P

xxx

xx

For the first step use Initial guessAnd for next iterative steps usethe values from previous iteration

Page 12: Lecture Objectives:

Pressure and velocities in NS equations

How to link pressure field with continuity equation?

SIMPLE (Semi-Implicit Method for Pressure-Linked Equations ) algorithm

The momentum equations can be solved only when the pressure field is given or is somehow estimated. Use * for estimated pressure and the corresponding velocities

P EW

x

x x

xxx

)/2P– (P

)/2P (P– )/2P (P

P– P

x

p EWEPPWew

xM2x

2

2x

2

2x

2x

zx

yx

xx S

z

y

x

x

p)

z

vv

y

vv

x

vv

τ

vρ(

sideEW

LxLHxHNxNSxSWxWExEPxP

)/2P– (P fVaVaVaVaVaVaVa A

x

AeAw

Aw=Ae=Aside

We have two additional equations for y and x directions

Page 13: Lecture Objectives:

SIMPLE algorithmGuess pressure field: P*W, P*P, P*E, P*N , P*S, P*H, P*L

1) For this pressure field solve system of equations:

Solution is:

sideEW

LxLHxHNxNSxSWxWExEPxP

)/2P– (P fVaVaVaVaVaVaVa A

xx:

y:

z:

………………..………………..

LxHxNxSxWxExPx *V,*V,*V,*V,*V,*V,*V

P = P* + P’

2) The pressure and velocity correction

P’ – pressure correction

V = V* + f(P’)

For all nodes E,W,N,S,…

V’ – velocity correction

Substitute P=P* + P’ into momentum equations (simplify equation) and obtain

3) Substitute V = V* + f(P’) into continuity equation solve P’ and then V

V’=f(P’)

V = V* + V’

4) Solve T , k , equations

Page 14: Lecture Objectives:

SIMPLE algorithm

Step1: solve V* from momentum equations

Step2: introduce correction P’ and express V = V* + f(P’)

Step3: substitute V into continuity equation solve P’ and then V

Step4: Solve T , k , e equations

Guess p*

start

end

Converged (residual check)

yes

no

p=p*

Page 15: Lecture Objectives:

Other methods

SIMPLERSIMPLEC variation of SIMPLEPISO

COUPLED - use Jacobeans of nonlinear velocity functions to form linear matrix ( and avoid iteration )