lecture objectives:
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 PresentationTRANSCRIPT
Lecture Objectives:
Explicit vs. Implicit
Residual, Stability, Relaxation
Simple algorithm
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
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
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
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
Convergence example
Explicit form 2:
x=1/(ln(x)-ln(2)
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
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
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:
Navier Stokes Equations
0z
v
y
v
x
v zyx
)(Sz
vμ
y
vμ
x
vμ
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
vμ
y
vμ
x
vμ
x
p)
z
vv
y
vv
x
vv
τ
vρ(
zM2z
2
2z
2
2z
2z
zz
yz
xz S
z
vμ
y
vμ
x
vμ
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
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
vμ
y
vμ
x
vμ
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
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
vμ
y
vμ
x
vμ
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
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
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*
Other methods
SIMPLERSIMPLEC variation of SIMPLEPISO
COUPLED - use Jacobeans of nonlinear velocity functions to form linear matrix ( and avoid iteration )