You are on page 1of 16

Objective

• Numerical methods
– SIMPLE CFD Algorithm
SIMPLE Semi-Implicit Method for Pressure-Linked Equations

– Define Relaxation
General Transport Equation
unsteady-state
 
H N ρ  ρ div( V)  div (Γ  ,eff grad )  S
τ
W E Equation in the algebraic format:
P
S L a P Φ P  a E Φ E  a W Φ W  a S ΦS  a N Φ N  a H Φ H  a L Φ L  f

We have to solve the system matrix for each time step !

Transient term:

 P   P
ρ ρ
τ τ Are these values for step  or + ?

Unsteady-state 1-D If: -  - explicit method


- + - implicit method
P   P ρVx
ρ  ΦE(or P)  ΦP(or W)  ΓΦ, eff 2ΦP  ΦE  Φ W   SΦ
τ x xx
General Transport Equation unsteady-state

Fully explicit method:

Φ Pτ Δτ  Φ Pτ ρVx τ Γ
ρ
Δτ

Δx
   
Φ P( or E)  Φ τW(or P)  Φ, eff 2Φ Pτ  Φ Eτ  Φ τW  SΦ
ΔxΔx

Φ Pτ Δτ  Φ Pτ ρVx τ Δτ Γ Φ, eff


ρ
Δτ

Δx
  Δτ
Φ P( or E)  Φ τW(or P) ΔxΔx
 
2Φ Pτ Δτ  Φ Eτ Δτ  Φ τWΔτ  SΦ

Or different notation:

Implicit method
Φ τNΔτ  Φ τN ρVx τ Δτ Γ Φ, eff
ρ
Δτ

Δx

Φ N( or N 1)  Φ τN-1(or
Δτ
N) ΔxΔx

2Φ τ  Δτ
N  Φ τ  Δτ
N -1  Φ 
τ  Δτ
N 1  SΦ

For Vx>0 For Vx<0


Steady state vs. Unsteady state
Steady state
Γ
ρVx
Δx
  
Φ N( or N1)  Φ N-1(or N)  Φ, eff 2Φ N  Φ N1  Φ N-1  SΦ
ΔxΔx

a N TN-1  b N TN  c N TN1  f N

We use iterative solver to get solution


Unsteady state

Φ τNΔτ  Φ τN ρVx τ Δτ Γ Φ, eff


ρ
Δτ

Δx

Φ N( or N 1)  Φ τN-1(or
Δτ
N) 

ΔxΔx
 
2Φ τNΔτ  Φ τN-1Δτ  Φ τNΔτ1  SΦ

a N TN-1  b N TN  c N TN1  f N

We use iterative solver to get solution and


We iterate for each time step

Make the difference between


- Calculation for different time step
- Calculation in iteration step
1D example
multiple (N) volumes
N unknowns

1 2 3 i N-1 N

b1Φ1  c1Φ2  f1 Equation for volume 1


N
equations a 2Φ1  b 2Φ 2  c 2Φ3  f 2 Equation for volume 2
a 3Φ 2  b 3Φ 3  c 3Φ 4  f 3
……………………………
a N Φ N-1  b N Φ N  f N

 b1 c1   Φ1   f1 
a  Φ   f 
Equation matrix:  2 b2 c2  2   2 
 ...   ...   ... 
For 1D problem     
 ai bi ci   Φ i    f i 
3-diagonal matrix
 ...   ...   ... 
    
 a N 1 bN 1 cN 1  Φ N 1   f N 1 

 aN bN   Φ N   f N 
3D problem
Equation in the general format:
H N
a P Φ P  a E Φ E  a W Φ W  a S ΦS  a N Φ N  a H Φ H  a L Φ L  f
W P E
S L
Wright this equation for each discretization volume
of your discretization domain
A
60,000 elements
Φ F

60,000 cells (nodes)


N=60,000
60,000 elements

x =

7-diagonal matrix
This is the system for only
one variable ( Φ ) When we need to solve p, u, v, w, T, k, e, C
system of equation is larger
Iteration method
Alternative to use matrix solver tool is to use iterations
You can use excel if you are not familiar with matrix solver tools

General Iteration Procedure:


1) Express equation in explicit form
2) Guess initial values
3) Substitute initial values and calculate new values
4) Substitute new values and calculate newer values
6) Repeat step 4) until convergence is achieved

example
Iterations -residual Value: T1 Residual 2
initial guess 22
2
iteration 1 23 1.00000
iteration 2 23.25 0.25000 2
iteration 3 23.390625 0.14063
Difference of value 2
iteration 4 23.483459 0.09283
between two iteration iteration 5 …… 2
--- 23.96441
Iteration 98 23.96444 0.00003
Numerical instability
divergency

divergence
variable

solution

convergence

iteration
Navier Stokes Equations
Continuity equation
v x v y v z
  0
x y z This velocities that constitute advection coefficients: F=rV
Momentum x
v x v x v x v x p  2vx  2vx  2vx
ρ(  vx  vy  vz )    μ 2  μ 2  μ 2  SM x
τ x y z x x y z
Momentum y
v y v y v y v yp 2vy 2vy 2vy
ρ(  vx  vy  vz )    μ 2  μ 2  μ 2  SM y  ρ g (T  T )
τ x y z y x y z
Momentum z
v z v z v z v z p  2 vz  2 vz  2 vz
ρ(  vx  vy  vz )    μ 2  μ 2  μ 2  SM z
τ x y z z x y z
Pressure is in momentum equations
which already has one unknown

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

1) find velocities that constitute in advection coefficients


2) link pressure field with continuity equation
Pressure and velocities in NS
equations
How to find velocities that constitute in advection coefficients?

v x v x v x v x p  2vx  2vx  2vx


ρ(  vx  vy  vz )    μ 2  μ 2  μ 2  SM x
τ x y z x x y z

a P Vx, P  a E Vx, E  a W Vx, W  a S Vx, S  a N Vx, N  a H Vx, H  a L Vx, P L  f

 Vx  Vy  Vz For the first step use Initial guess


aP  6 r And for next iterative steps use
x 2
x the values from previous iteration
 Vx 
aE   r , a  
x 2 x x 2
W

................................
Pressure and velocities in NS
equations
How to link pressure field with continuity equation?
SIMPLE (Semi-Implicit Method for Pressure-Linked Equations ) algorithm
v x v x v x v x p  2vx  2vx  2vx
ρ(  vx  vy  vz )    μ 2  μ 2  μ 2  SM x
τ x y z x x y z
W x P x E

p Pw – Pe (PW  PP )/2 – (PP  PE )/2 (PW – PE )/2 x


    Aw Ae
x x x x Aw=Ae=Aside

(PW – PE )/2
a P Vx P  a E Vx E  a W Vx W  a SVx S  a N Vx N  a H Vx H  a L Vx L  f  Aside
x
We have two additional equations for y and x directions

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
SIMPLE algorithm
Guess 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:


(PW – PE )/2
x: a P Vx P  a E Vx E  a W Vx W  a SVx S  a N Vx N  a H Vx H  a L Vx L  f  Aside
x
y: ………………..
z: ………………..

Solution is: V *x P , V *x E , V *x W , V *x S , V *x N , V *x H , V *x L

2) The pressure and velocity correction

P = P* + P’ P’ – pressure correction For all nodes E,W,N,S,…


V = V* + V’ V’ – velocity correction

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


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

4) Solve T , k , e equations
SIMPLE algorithm
start
Guess p*
p=p*

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

no Converged
(residual check)
yes
end
Other methods

SIMPLER
SIMPLEC variation of SIMPLE
PISO

COUPLED - use Jacobeans of nonlinear velocity functions to form


linear matrix ( and avoid iteration )
Relaxation
Relaxation with iterative solvers: divergence
variable

When the equations are nonlinear


solution
it can happen that you get divergency
in iterative procedure for solving considered
time step convergence

Solution is Under-Relaxation:
iteration
Y*=f·Y(n)+(1-f)·Y(n-1) Y – considered parameter , n –iteration , f – relaxation factor
Value which is should be used for the next iteration
For our example Y*in iteration 101=f·Y(100)+(1-f) ·Y(99)

f = [0-1] – under-relaxation -stabilize the iteration


f = [1-2] – over-relaxation - speed-up the convergence

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


Example of relaxation
(example from homework assignment)
Example: Advection diffusion equation, 1-D, steady-state, 4 nodes
a N TN-1  b N TN  c N TN1  f N
1) Explicit format:
TN  1 / b N f N  a N /b N TN-1  c N /b N TN1 1 2 3 4
2) Guess initial values:
T10  ..., T20  .., T30  .., T40  ..
3) Substitute and calculate:
T11  1 / b1f1  c1/b1T 0 2
T1 2  1 / b 2 f 2  a 2 /b 2 T11  c 2 /b 2 T 0 3 T11  ..., T21  .., T31  .., T41  ..
T13  1 / b 3 f 3  a 3 /b 3 T1 2  c 3 /b 3 T 0 4
T1 4  1 / b 4 f 4  a 4 /b 4 T13 T11r  fT11  (1 - f)T10 , T21r  fT21  (1 - f)T20 , ....
4) Substitute and calculate: T12  ..., T22  .., T32  .., T42  ..

Substitute and calculate: T12r  fT12  (1 - f)T11 , T22r  fT22  (1 - f)T21 , ....
………………………….

You might also like