Professional Documents
Culture Documents
Elliptic equations often arise due to the application of One-Dimensional Boundary Value Problems!
conservation principles to quantities whose fluxes are
proportional to their gradient! ∂ ∂f ∂f
∂
a + b + cf = s
∂f ∂x ∂x ∂x
F = −S where the flux is given by! F = −α
∂x ∂x
∂ ∂f
gives! α =S
∂x ∂x ∂f ∂f
or f given or f given
∂x ∂x
In 2 or 3 dimension:! If the transport periodic!
coefficient is constant:!
∇ ⋅ F = −S ⎫
⎬ ⇒ ∇ ⋅ α∇f = S Notice that if f is not given on the boundary, f is not
F = −α∇f ⎪⎭ α∇ 2 f = S uniquely determined!
Two-Dimensional!
∂2 f ∂2 f Laplaceʼs Equation! Three-Dimensional!
+ = 0; ∇ 2 f = 0
∂x 2 ∂y 2 ∂2 f ∂ 2 f ∂ 2 f
+ + =0 Laplaceʼs Equation!
∂ f ∂ f
2 2 ∂x 2 ∂y 2 ∂z2
+ = S; ∇2 f = S Poissonʼs Equation!
∂x 2 ∂y 2 ∂2 f ∂ 2 f ∂ 2 f
∂ ∂f ∂ ∂ f + + =s Poissonʼs Equation!
a + b = S; ∇ ⋅ φ∇f = S ∂x 2 ∂y 2 ∂z2
∂x ∂x ∂y ∂ y
∂ ∂f ∂ ∂f ∂ ∂f
f = f 0 ( x, y ) Dirichlet! a + b + c =s
On the ∂x ∂x ∂y ∂y ∂z ∂z
∂f
boundaries (BC)! = g 0 ( x, y ) Neumann!
∂n
Computational Fluid Dynamics I
Computational Fluid Dynamics I
∇4 f = 0 Biharmonic equation!
a j f j −1 − d j f j + c j f j +1 = b j
∂f ∂2 f
U −D 2 =0
∂x ∂x Write out!
f −f f − 2 f i + f i−1 d1 f1 + c1 f 2 = b1
U i+1 i−1 − D i+1 =0 a2 f1 + d2 f 2 + c 2 f 3 = b2
2h h2
R
( f i+1 − f i−1) − ( f i+1 − 2 f i + f i−1 ) = 0
2 R=
Uh aN −1 f N −2 + dN −1 f N −1 + c N −1 f N = bN −1
⎛ 1 ⎞ ⎛ 1 ⎞ D aN f N −1 + dN f N = bN
⎜1+ R⎟ f i−1 − 2 f i + ⎜1− R⎟ f i+1 = 0
⎝ 2 ⎠ ⎝ 2 ⎠
If the endpoints b1 = −a1 f 0
a j−1 f j−1 − d j f j + c j +1 f j +1 = b j are given!
bN = −c N f N +1
plot(x)
Computational Fluid Dynamics I
Computational Fluid Dynamics I
=
Δt h2
or !
⎛ Δt
fi , j = fi , j + ⎝ 2 ⎞⎠ ( fi +1, j + fi −1, j + f i, j −1 + fi, j +1 − 4 fi, j )
n+1 n n n n n n
h
Rearrange:! Example!
⎛ Δt n ⎛ Δt
= ⎝ 1− 4 2 ⎞⎠ fi , j + ⎝ 2 ⎞⎠ ( fi +1, j + fi −1, j + fi, j −1 + fi, j +1)
n+1 n n n n
fi,j
h h
Δt 1
Select the maximum time step:! =
h2 4
fi , j =
n+1
( f + f n + f n + fn )
1 n
4 i+1, j i −1, j i , j −1 i, j +1
Which is exactly the Jacobi iteration!
40
35
Jacobi: ! 1989! 25
Gauss-Seidler: 986!
20
5 10 15 20 25 30 35 40
1 Note on Boundary
0.8
0.6
Conditions!
0.4
0.2
0
40
30 40
30
20
20
10
10
0 0
a ≤1
xn for convergence!
The above figure suggests that!
dF
≤1 for convergence!
dx
Computational Fluid Dynamics I
Computational Fluid Dynamics I
Convergence! Convergence!
for convergence!
⎡− 4 1 0 0 1 0 ⎤ ⎡ f1,1 ⎤ ⎡ S1,1 ⎤
⎢ 1 − 4 1 0 0 1 ⎥⎢ f ⎥ ⎢S ⎥
⎢ ⎥ ⎢ 1, 2 ⎥ ⎢ 1, 2 ⎥
More Formal ⎢0
⎢
1 − 4 1 0 1 ⎥⎢ ⎥
⎥⎢ ⎥
⎢ ⎥
⎢ ⎥
⎢ ⎥ ⎢ f1, J ⎥ ⎢ S1, J ⎥
Discussion of ⎢
⎢
⎥ ⎢ f 2,1 ⎥
⎥⎢
⎢ S 2,1 ⎥
⎥ = h2 ⎢ ⎥
⎢1 0 ⎥ ⎢ f 2, 2 ⎥ ⎢ S 2, 2 ⎥
Iterative Methods! ⎢0
⎢
⎢0
1
0 1
⎥⎢ ⎥
⎥⎢
⎥⎢ ⎥
⎥
⎢ ⎥
⎢
⎢ ⎥
⎥
⎢ ⎥⎢ f ⎥ ⎢S ⎥
⎢ ⎥ ⎢ I , J −1 ⎥ ⎢ I , J −1 ⎥
⎣⎢ 0 1 − 4⎦⎥ ⎣⎢ f I , J ⎦⎥ ⎣⎢ S I , J ⎦⎥
⎡a 0 0 0⎤ ⎡0 a b c⎤ ⎡0 0 0 0⎤ [ A]f = b
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
0 b 0 0⎥ 0 0 d e⎥ a 0 0 0⎥
[D] = ⎢⎢ [U ] = ⎢⎢ [L] = ⎢⎢
Hence,!
f = [ A] b
−1
0 0 c 0⎥ 0 0 0 f⎥ b c 0 0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣0 0 0 d⎦ ⎣0 0 0 0⎦ ⎣d e f 0⎦
Direct method:!
Upper - Solving inverse matrix directly (Cramerʼs rule)!
Diagonal! Lower!
triangular! - Inverting matrix more cleverly (Gaussian elimination)!
triangular!
- Other (L-U decomposition, Thomas algorithm)!
Computational Fluid Dynamics I
Computational Fluid Dynamics I
Convergence – Multi Dimensional -1!
4 M N⎦ m = 1, n = 1
1⎡π2 π2 ⎤
[ A1 ] = [ I]
−1
≅ 1− ⎢ 2 + 2 ⎥ +
4 ⎣M N ⎦
and using a discrete analog of separation of variables, !
it can be shown that the eigenvalues of [A2 ] are! Thus, for a large matrix, λmn ,max is only slightly less!
1⎡ mπ nπ ⎤ than unity.!
λmn = ⎢cos + cos , m = 1, , M − 1, n = 1, , N − 1
2⎣ M N ⎥⎦
Very slow convergence!
Therefore, λmn ≤ 1 and the Jacobi method converges.!
Computational Fluid Dynamics I
Computational Fluid Dynamics I
Convergence – Gauss-Seidel -1! Convergence – Gauss-Seidel -2!
4 2
1⎡ π π⎤
[ A1 ] = [D] − [L], [ A2 ] = [U ] λmn ,max = cos + cos ⎥
4 ⎢⎣ M N⎦
Example: Poisson Equation (2nd order CD, uniform mesh) ! Convergence of SOR!
f i +1, j + f i −1, j + f i , j +1 + f i , j −1 − 4 f i , j = h 2 Si , j From! [D]f˜ = [ L]f˜ + [U ]f n + b
G-S! f n +1 = f n + β (f˜ − f n )
[D]f˜ = [ L]f˜ + [U ]f n + b
~ n +1
Eliminating f and solving for !f
[ f i−1, j + f i,nj−1+1 + f i+1,n j + f i,nj +1 − h 2Si, j ]
1 n +1
f i,nj+1 = [ M ] SOR
4
For the discretized Poission operator, it can be shown that For problems with irregular geometry and non-uniform !
that eigenvalues of the SOR matrix are:! mesh, β opt must be found by trial and error.!
µ1/ 2 =
1
2
[λβ + λ2β 2 − 4 (β −1) ] Typical Comparison Chart !
where λ is an eigenvalue of the Jacobi matrix !
[ M ] J = [D] ([ L] + [U ])
−1
λmax (µ max ) Iterations!
Note that µ = λ
2
if β = 1 (Gauss-Seidel) ! Jacobi! 0.9945! 1250!
Gauss-Seidel! 0.9890! 625!
Minimum µ occurs at!
Typically!
2 SOR! 0.7906! 29!
β opt = β opt ≈ 1.7 ~ 1.9
1+ 1− λ 2
max Ferziger, J. H., Numerical Method for Engineering Application (1981)!
λmax ≈ 1
Convergence of ADI!
ADI for! f i,nj+1 − f i,nj = αΔt [δxx f + δyy f ] − S
αΔt n
- Iteration parameter ρ n = usually varies with iteration!
is written as! 2
- For example (Wachspress)!
αΔt
f n +1/ 2 − f n = 2
2h
[( f n +1/ 2
i+1, j − 2 f i,nj+1/ 2 + f i−1,
n +1/ 2 n n n
]
j ) + ( f i, j +1 − 2 f i, j + f i, j−1 ) − S i,′ j
ρ k αΔt k
(k −1)/ (n −1)
⎛a⎞
= = b⎜ ⎟ , k = 1, , n
αΔt
f n +1 − f n +1/ 2 = 2
2h
[( f n +1/ 2
i+1, j − 2 f i,nj+1/ 2 + f i−1,
n +1/ 2 n +1 n +1 n +1
]
j ) + ( f i, j +1 − 2 f i, j + f i, j−1 ) − S i,′′ j
h2 2h 2 ⎝b⎠
a lower bound eigenvalue!
or! b upper bound eigenvalue!
(1− ρnδxx ) f n +1/ 2 = (1+ ρnδyy ) f n − Si,′ j ⎛ αΔt n ⎞
⎜ ρn = ⎟ - Comparison with SOR is difficult!
⎝ 2 ⎠
(1− ρ δ ) fn yy
n +1
= (1+ ρ nδxx ) f n +1/ 2
− Si,′′ j
- ADI can be efficient if appropriate parameters are found.!
Computational Fluid Dynamics I