You are on page 1of 12

Computational Fluid Dynamics I! http://users.wpi.edu/~gretar/me612.html!

Computational Fluid Dynamics I!

Numerical Methods ! for ! Elliptic Equations-I !

Grtar Tryggvason! Spring 2010!

Examples of elliptic equations! Direct Methods for 1D problems! Elementary Iterative Methods! Iteration as Time Integration! Example! Boundary Conditions! Convergence of Iterative Methods! !1D Example! !Formal Discussion!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

Elliptic equations often arise due to the application of conservation principles to quantities whose uxes are proportional to their gradient!
! #f F = " S where the ux is given by! F = !" !x #x

One-Dimensional Boundary Value Problems!

! !f !f a + b + cf = s !x !x !x
!f or f given !x

gives!

! !f " =S !x !x

In 2 or 3 dimension:!
! " F = #S % & ) ! " $!f = S F = #$!f ( '

If the transport coefcient is constant:!


!" 2 f = S

!f or f given !x periodic!

Notice that if f is not given on the boundary, f is not uniquely determined!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

Two-Dimensional!

!2 f !2 f + = 0; " 2 f = 0 !x 2 !y 2
" f " f + = S; "x 2 "y 2
2 2

Laplace"s Equation!

Three-Dimensional!

!2 f = S

Poisson"s Equation!

!2 f ! 2 f ! 2 f + + =0 !x 2 !y 2 !z2
!2 f ! 2 f ! 2 f + + =s !x 2 !y 2 !z2

Laplace"s Equation!

! !f ! ! f a + b = S; " # $"f = S !x !x !y ! y
On the boundaries (BC) !

Poisson"s Equation!

f = f 0 ( x, y ) !f = g 0 ( x, y ) !n

Dirichlet! Neumann!

! !f ! !f ! !f a + b + c =s !x !x !y !y !z !z

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

Examples of Elliptic Equations!

" 2T = !

! q k

Steady conduction equation! 2-D stream function equation! Projection method! (Step 2)! Steady state ! advection/diffusion! Biharmonic equation!

$ 2" = #!
"2 hP i, j =

1 " h ! u ti , j #t

One-Dimensional Boundary Value Problems Direct Methods !

u ! "f # " 2 f = 0 !4 f = 0

Computational Fluid Dynamics I! One-Dimensional Boundary Value Problems!

Computational Fluid Dynamics I! One-Dimensional Boundary Value Problems!

!f !2 f "D 2 =0 !x !x

a j f j !1 ! d j f j + c j f j +1 = b j
Write out!

f !f f ! 2 f i + f i!1 U i +1 i!1 ! D i +1 =0 2h h2 R ( f i +1 ! f i!1) ! ( f i +1 ! 2 f i + f i!1 ) = 0 2 ! 1 $ ! 1 $ #1 + R& f i'1 ' 2 f i + #1 ' R& f i +1 = 0 " 2 % " 2 %
a j !1 f j !1 ! d j f j + c j +1 f j +1 = b j

d1 f1 + c1 f 2 a2 f1 + d2 f 2 + c 2 f 3

= b1 = b2

Uh R= D

! aN !1 f N ! 2 + dN !1 f N !1 + c N !1 f N = bN !1 aN f N !1 + dN f N = bN
If the endpoints are given!

b1 = ! a1 f 0 bN = !c N f N +1

Computational Fluid Dynamics I! One-Dimensional Boundary Value Problems!


% solving a tridiagonal system nx=50;r=0.1; a=zeros(nx,1)+(1+r);d=zeros(nx,1)-2;c=zeros(nx,1)+(1-r); b=zeros(nx,1); x=zeros(nx,1); b(nx)=-(1-r); % forward elimination for j=2:nx d(j)=d(j)-(a(j)/d(j-1))*c(j-1); b(j)=b(j)-(a(j)/d(j-1))*b(j-1); x(j)=b(j)/d(j); end % backward substitution for j=nx-1:-1:1 x(j)=(b(j)-c(j)*x(j+1))/d(j); end plot(x)

Computational Fluid Dynamics I! One-Dimensional Boundary Value Problems! Matlab functions! For simple problems MATLAB has a number of functions to deal with matrices.! Help matfun: general! Help sparfun:sparse matrices!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

Solving the Poisson equation!

j+1! j! j-1! i-1 i i+1!

( x, y )

Elementary Iterative Methods !

!2 f !2 f + =S !x 2 !y 2
Applying central differencing!

f i +1, j " 2 f i , j + f i "1, j !x 2

f i , j +1 " 2 f i , j + f i , j "1 !y 2

= Si , j

Computational Fluid Dynamics I! Iterative Method! Discretized Poisson Equation! f i +1, j + f i !1, j + f i , j +1 + f i , j !1 ! 4 f i , j = h 2 Si , j Rearranging for ! f i , j 1 f i, j = [ f i +1, j + f i!1, j + f i, j +1 + f i, j !1 ! h 2 Si, j ] 4

Computational Fluid Dynamics I!

The Jacobi iteration can be improved somewhat by using new values as soon as they become available.! j+1! j! j-1! i-1! i! i+1!
for j=1:m! for i=1:n! iterate! end! end!

f i,nj+1 = f i,nj+1 = f i,nj+1 =

1 n [ f i+1, j + f i!n1, j + f i,nj +1 + f i,nj!1 ! h 2Si, j ] 4 1 n [ f i+1, j + f i!n1,+1j + f i,nj +1 + f i,nj+!11 ! h 2Si, j ] 4

Jacobi ! Gauss-Seidel !

1 n +1 n n +1 2 f i,nj+1 = ( f in +1, j + f i!1, j + f i, j +1 + f i, j !1 ! h S i, j ) 4


From a programming point of view, Gauss-Seidler iteration is even simpler than Jacobi iteration since only one vector with f values is needed.!

! n [ f i+1, j + f i"n1,+1j + f i,nj +1 + f i,nj+"11 " h 2Si, j ] + (1 " ! ) f i,nj SOR ! 4

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

The Gauss-Seidler iteration can be accelerated even further by various acceleration techniques. The simplest one is the Successive Over-Relaxation (SOR) iteration!

The iteration must be carried out until the solution is sufciently accurate. To measure the error, dene the residual:!

f i,nj+1 =

! n n +1 n n +1 2 n ( f i +1, j + f i" 1, j + f i, j +1 + f i, j "1 " h S i, j ) 4 + (1 " ! ) f i,nj

Ri, j =

f i +1, j + f i!1, j + f i, j !1 + f i, j +1 ! 4 f i, j ! Si, j h2

The SOR iteration is very simple to program, just as the Gauss-Seidler iteration. The user must select the coefcient. It must be bounded by 1<#<2. #=1.5 is usually a good starting value.!

At steady-state the residual should be zero. The pointwise residual or the average absolute residual can be used, depending on the problem. Often, simpler criteria, such as the change from one iteration to the next is used!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I! Boundary Value Problems! Jacobi as a time integration! The solution of: !

Iteration versus time integration !

can be thought of as the steady-state solution of !

!2 f ! 2 f + =0 !x 2 !y 2

!f ! 2 f ! 2 f = + !t !x 2 !y 2
Using the discretization derived earlier: !

fi , j ! fi , j fi +1, j + fi !1, j + f i, j !1 + fi, j +1 ! 4 fi, j = "t h2


n n n n n n

n+1

Computational Fluid Dynamics I! Boundary Value Problems! or !

Computational Fluid Dynamics I!

" !t n+1 n fi , j = fi , j + # 2 $ ( f n + f n + f in, j &1 + fi,nj +1 & 4 fin, j ) h % i +1, j i &1, j " t n # "t % n # = $1 ! 4 2 % f + (f + f n + f n + f n ) h & i , j $ h2 & i +1, j i !1, j i, j !1 i, j +1

Rearrange:!

Example !

n+1 i,j

Select the maximum time step:!

!t 1 = h2 4

fi , j =

n+1

1 n ( f + f n + f n + fn ) 4 i+1, j i !1, j i , j !1 i, j +1

Which is exactly the Jacobi iteration!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

40

!2 f !2 f + =0 !x 2 !y 2
T=1.0!

35

30

25

20

T=0.0!

15

10

10

15

20

25

30

35

40

% two-dimensional steady-state problem by SOR! n=40;m=40;nstep=5000;alpha=0.05;length=2.0;h=length/(n-1);! T=zeros(n,m);bb=1.7;! T(10:n-10,1)=1.0; ! for l=1:nstep,! for i=2:n-1, for j=2:m-1! T(i,j)=bb*0.25*(T(i+1,j)+...! T(i,j+1)+T(i-1,j)+T(i,j-1))+(1.0-bb)*T(i,j);! end,end! % find residual! res=0;! for i=2:n-1, for j=2:m-1! res=res+abs(T(i+1,j)+...! T(i,j+1)+T(i-1,j)+T(i,j-1)-4*T(i,j))/h^2;! end,end! l,res/((m-2)*(n-2)) % Print iteration and residual! if (res/((m-2)*(n-2)) < 0.001), break,end! end;! contour(T);!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

40

35

Average absolute error: 0.001! !Number of iterations! Jacobi: ! 1989! Gauss-Seidler: 986! SOR (1.5): ! SOR (1.7): ! SOR (1.9): ! SOR (1.95): 320! 162! 91! 202!

30

25

20

15

10

10

15

20

25

30

35

40

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

0.8 0.6

Note on Boundary Conditions !

0.4 0.2 0 40 30 20 10 0 0 20 10 30 40

Computational Fluid Dynamics I! Boundary Conditions for Iterative Method! Dirichlet conditions are easily implemented.! For Neumann condition, the simplest approach is !

Computational Fluid Dynamics I!

#f = 0 " f i , 0 ! f i ,1 = 0 (1st order)! #n Update interior points f i ,1 , f i , 2 , f i ,3 , ! and then set! f i , 0 = f i ,1


This generally does not converge.! Instead, incorporate BC directly into the equations!

With only a few exceptions, Iterative Methods are used to solve systems of equations resulting from the discretization of elliptic equations or implicit methods in CFD!

f i,1 =

1 [ f i!1,1 + f i+1,1 + f i,2 + f i,0 ! h 2Si, j ] 4 1 f i,1 = [ f i!1,1 + f i +1,1 + f i,2 ! h 2 Si, j ] 3

= f i ,1

Computational Fluid Dynamics I! http://users.wpi.edu/~gretar/me612.html!

Computational Fluid Dynamics I! Outline!

Numerical Methods ! for ! Elliptic Equations-II !

Grtar Tryggvason! Spring 2010!

Examples of elliptic equations! Direct Methods for 1D problems! Elementary Iterative Methods! Iteration as Time Integration! Example! Boundary Conditions! Convergence of Iterative Methods! !1D Example! !Formal Discussion!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I! Convergence! A One Dimensional Example! An equation in the form!

Convergence of Iterative Methods !

x = F ( x)
can be solved by iterative procedure:!

x n +1 = F ( x n )
for which convergence is achieved when !

x n +1 ! x n

or!

x n +1 "1 < ! xn

When does the iteration converge?!

Computational Fluid Dynamics I! Convergence!


x n +1

Computational Fluid Dynamics I! Convergence! A One Dimensional Example!

dF >1 dx dF <1 dx
x = F ( x)

For the linear equation!

x n +1 = ax n
We must have:!

a !1
The above gure suggests that!
dF !1 dx
xn

for convergence!

for convergence!

Computational Fluid Dynamics I! Convergence! For multidimensional problems we have:!

Computational Fluid Dynamics I! Convergence! Hence it is possible to write !

x ! +1 = Mx !
For symmetric M it can be shown that its eigenvectors form a complete and orthogonal set and span the space of x. It is therefore possible to write: ! as!

x ! +1 = Mx !
! +1 +1 ! ! y1 v1 + y ! 2 v 2 + ! = M( y1 v1 + y 2 v 2 + !) ! = y1 Mv1 + y ! 2 Mv 2 + ! ! = y1 "1v1 + y ! 2 "2 v 2 + !

x = y1v1 + y 2 v 2 + ! = ! y j v j
j

or!
! +1 ! y1 = "1 y1

where!

Mv j = ! j v j

j = 1 M " N

! +1 2

=" y !

! 2 2

Which are the same as for the 1-D example. Therefore:!

!max " 1
for convergence!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I! If !"x = "y = h ! f i +1, j + f i !1, j + f i , j +1 + f i , j !1 ! 4 f i , j = h S i , j


2

More Formal Discussion of Iterative Methods !

0 0 " 1 0 " " " # & f1,1 # & S1,1 # &' 4 1 $S ! $ 1 ' 4 1 0 " 0 1 " " " !$ f ! $ 1, 2 ! $ ! $ 1, 2 ! $ ! ! $0 1 ' 4 1 " " 0 1 " " !$ ! ! ! $ ! $ !$ $ S1, J ! $ ! ! $ f1, J ! $ S 2,1 ! $ ! ! $ f 2,1 ! ! = h2 $ ! $ !$ 0 $ S 2, 2 ! $1 ! $ f 2, 2 ! $ ! ! $0 !$ ! ! 1 ! $ ! $ !$ 0 1 $ ! ! $0 !$ ! ! ! $S ! $ !$ f $ I , J '1 ! $ ! $ I , J '1 ! $ f I ,J " ! $ SI ,J " ! $ !% 0 1 ' 4" % %

Sparse matrix: only 5 non-zero entries in each row!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I!

A few denitions:!

Ultimately, the difference form of the Poisson equation! boils down to solving for!
a 0 0 0 b d 0 0 c$ & e& f& & 0% !0 # a [L] = # #b # "d 0 0 c e 0 0 0 f 0$ & 0& 0& & 0%

!a # 0 [D] = # #0 # "0

0 b 0 0

0 0 c 0

0$ & 0& 0& & d%

!0 # 0 [U ] = # #0 # "0

[ A]f = b
Hence,!

f = [ A] b
!1

Diagonal!

Upper triangular!

Lower! triangular!

Direct method:! - Solving inverse matrix directly (Cramer"s rule)! - Inverting matrix more cleverly (Gaussian elimination)! - Other (L-U decomposition, Thomas algorithm)!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I! Convergence Multi Dimensional -1! General iterative procedure!

Gaussian Elimination! -$ Pivoting: rearranging equations to put the largest! coefcient on the main diagonal.! -$ Eliminate the column below main diagonal.! -$ Repeat until the last equation is reached.! -$ Back-substitution!
a11 f1 + a12 f 2 + !! = c1 a21 f1 + a22 f 2 + !! = c2 " " an1 f1 + an 2 f 2 + !! = cn a11 f1 + a12 f 2 + "" = c1 ! f 2 + "" = c2 a22 ! ! ! f n = cn ann

[ A]f = b
Let!

[ A] = [ A1 ] ! [ A2 ] [ A1 ]f = [ A2 ]f + b

An iterative scheme is constructed as!

[ A1 ]f n +1 = [ A2 ]f n + b
For example, !

-$ Special case: tri-diagonal matrix - Thomas algorithm!

[ A1 ] = [D] = ! [I ], [ A2 ] = [ B] = [ A1] ! [ D] Jacobi ! 4 [ A1 ] = [D] ! [L], [ A2 ] = [U ] Gauss-Seidel !

Computational Fluid Dynamics I! Convergence Multi Dimensional -2!

Computational Fluid Dynamics I! Convergence Multi Dimensional -3! Condition for convergence!

[ A1 ]f n +1 = [ A2 ]f n + b
Requirements:! 1.$ [ A1 ] should be invertible.! 2.$ Iteration should converge, i.e.! lim f n = f
n !"

lim e n = 0
n !"

which requires! lim [ A1 ]


n !"

#1

[ A2 ])

=0

This is achieved if the modulus of the eigenvalues are ! less than unity.! Therefore, the convergence condition becomes:!

Dene error at n-th iteration:! e n = f ! f n

[ A1 ]e n +1 = [ A2 ]e n
e n +1 = [ A1 ]
!1

[ A2 ]e n
n

# = "i

max

!1

e n = [ A1 ]

!1

[ A2 ])

e0

" Spectral radius of convergence! !i Eigenvalues of matrix![ A1 ]!1 [ A2 ]

Computational Fluid Dynamics I! Convergence Jacobi Method -1! Jacobi Iteration Method for Poisson Equation! !(2nd order central difference with uniform mesh)! 1 n n n 2 f i,nj+1 = [ f in +1, j + f i!1, j + f i, j +1 + f i, j !1 ! h S i, j ] 4

Computational Fluid Dynamics I! Convergence Jacobi Method -2! For a large matrix!

*mn ,max =

1& ) )# cos + cos ! 2$ M N" %

largest eigenvalues for! m = 1, n = 1

[ A1 ]

!1

= [ I]

and using a discrete analog of separation of variables, ! it can be shown that the eigenvalues of [A2 ] are!

1&)2 )2 # ( 1' $ 2 + 2 ! +! 4 %M N "

)mn

1' m( n( $ = %cos + cos , m = 1, ! , M ! 1, n = 1, ! , N ! 1 2& M N " #

Thus, for a large matrix, !mn ,max is only slightly less! than unity.! ! Very slow convergence!

Therefore,

"mn ! 1 and the Jacobi method converges.!

Computational Fluid Dynamics I! Convergence Gauss-Seidel -1! Gauss-Seidel Iteration Method for Poisson Equation! !(2nd order central difference with uniform mesh)! 1 n +1 n n +1 2 f i,nj+1 = [ f in +1, j + f i!1, j + f i, j +1 + f i, j !1 ! h S i, j ] 4

Computational Fluid Dynamics I! Convergence Gauss-Seidel -2! It can be shown that the eigenvalues of matrix! [ A1 ] [ A2 ] are simply square of the eigenvalues of Jacobi method !
!1

[ A1 ] = [D] ! [L], [ A2 ] = [U ]
"4 0 0 $ $!1 4 0 $ 0 !1 4 $ $ 0 0 !1 $" " " $ #0 ! !
n +1% "0 0%" f1,1 '$ n +1' $ 0'$ f1,2 ' $0 0'$ " ' $0 '=$ '$ 0'$ " ' $" ! " '$ " ' $" ' $ '$ 0 !1 4&# f In,J+1& #0

(mn ,max =

1& ' '# cos + cos ! 4$ M N" %

0 0 0 4

! ! ! !

n % " S1,1 % 0 ! 0%" f1,1 $ ' '$ n ' 0 ! 0'$ f1,2 ' $ S1,2 ' 1 ! 0'$ " ' 2 $ " ' '! h $ ' '$ " " '$ " ' $ " ' $ " ' " 0 " '$ " ' $ ' '$ n ' 0 0 0 ! 0&# f M #SM ,N & ,N &

1 0 0 "

0 1 0 "

Thus, Gauss-Seidel method is twice as fast as the ! Jacobi method.!

A1!

A2!

Computational Fluid Dynamics I! Successive Overrelaxation - 1! Successive Overrelaxation! Consider the Gauss-Seidel method!

Computational Fluid Dynamics I! Successive Overrelaxation - 2! Hence, SOR rst uses Gauss-Seidel to compute ! ~ intermediate solution, !f

([D] ! [L])f n +1 = [U ]f n + b
If Gauss-Seidel is an attempt to change the solution as!

([D] ! [L])f = [U ]f n + b

= [ L ]f + [U ]f + b or! [ D]f
n

Then accelerate the next iteration solution !

n +1

=f +d
n

! + (1 " ! ) f n ! " f n = !f f n +1 = f n + ! f

Accelerate the change by introducing a parameter!

Combining the two steps !

f n + 1 = f n + ! d, ! > 1

f n +1 =

! ([L]f + [U ]f n + b) + (1 " ! )f n c
since ! [ D] = c [ I ]

Computational Fluid Dynamics I! Successive Overrelaxation - 3! Example: Poisson Equation (2nd order CD, uniform mesh) !

Computational Fluid Dynamics I! Successive Overrelaxation - 4! Convergence of SOR! From!

f i +1, j + f i !1, j + f i , j +1 + f i , j !1 ! 4 f i , j = h 2 Si , j
G-S!

= [ L ]f + [U ]f n + b [D]f

f i,nj+1 =
Combining!

1 n +1 [ f i!1, j + f i,nj+!11 + f in+1, j + f i,nj +1 ! h 2Si, j ] 4

" fn) f n +1 = f n + ! (f ~ n +1 Eliminating f and solving for !f [ M ] SOR


f n +1 = [ I ] ! " [ D]

= [ L ]f + [U ]f n + b [D]f

f n +1 =

! ([L]f + [U ]f n + b) + (1 " ! )f n c

n +1 i, j

! n +1 n 2 n % = # fi "1, j + fi ,nj+"11 + fi n + 1, j + fi , j + 1 " h Si , j & + (1 " ! ) fi , j 4$

!1 [L]) " [D] b Convergence depends on the eigenvalues of! [ M ] SOR

!1

[L]) {(1 ! " )[ I] + " [D] [U ]} f n


!1 !1

+ [ I ] ! " [ D]

!1

!1

Computational Fluid Dynamics I! Successive Overrelaxation - 5! For the discretized Poission operator, it can be shown that that eigenvalues of the SOR matrix are:!

Computational Fluid Dynamics I! Successive Overrelaxation - 6! For problems with irregular geometry and non-uniform ! mesh, ! opt must be found by trial and error.! Typical Comparison Chart !

1/ 2 =

where ! is an eigenvalue of the Jacobi matrix ! !1 [ M ] J = [D] ([ L] + [U ]) Note that = !


2

1 !" + !2" 2 # 4 (" # 1) 2

! !max ( max ) Iterations Jacobi! Gauss-Seidel! 0.9945 ! 0.9890 ! 0.7906 ! 1250 ! 625 ! 29 !

if ! = 1 (Gauss-Seidel) ! Typically!
2 max

Minimum occurs at!

" opt =

2 1+ 1# !

" opt ! 1.7 ~ 1.9

SOR!

"max ! 1

Ferziger, J. H., Numerical Method for Engineering Application (1981)!

Computational Fluid Dynamics I! http://users.wpi.edu/~gretar/me612.html!

Computational Fluid Dynamics I! Outline!

Numerical Methods ! for ! Elliptic Equations-III !

Grtar Tryggvason! Spring 2010!

Examples of elliptic equations! Direct Methods for 1D problems! Elementary Iterative Methods! Iteration as Time Integration! Example! Boundary Conditions! Convergence of Iterative Methods! !1D Example! !Formal Discussion! SOR on vector computers!

Computational Fluid Dynamics I!

Computational Fluid Dynamics I! Coloring Scheme (Red & Black)! In large computer application (vector or parallel platform),! SOR faces difculties in using constantly updated values. ! Remedy: Two separate grid system (red & black)! do i =1, nx, 2! ! f i, j = [ f i"1, j + f i, j "1 + f i +1, j + f i, j +1 4 !h 2 Si, j ] + (1 ! " ) f i, j enddo! do i=2, nx, 2! ! f i, j = [ f i"1, j + f i, j "1 + f i +1, j + f i, j +1 4 !h 2 Si, j ] + (1 ! " ) f i, j enddo!

SOR on Vector Computers!

Computational Fluid Dynamics I! Successive Line Overrelaxation (SLOR) - 1! Line Relaxation Method (Line Gauss-Seidel Method)!

Computational Fluid Dynamics I! Successive Line Overrelaxation (SLOR) - 2! SLOR = Line Relaxation + Overrelaxation! Apply line relaxation for intermediate solution!

f i,nj+1 =

1 n +1 [ f i!1, j + f i,nj+!11 + f in+1, j + f i,nj +1 ! h 2Si, j ] 4

Old! New! New! Old! New!

Adding one more coupling ! 1 n +1 n +1 n +1 n 2 f i,nj+1 = [ f i! 1, j + f i, j !1 + f i +1, j + f i, j +1 ! h S i, j ] 4

1 1 n +1 !1 f f i!1, j + f [ f i, j!1 + f i,nj +1 ! h 2Si, j ] i, j i +1, j = 4 4 4 and then overrelax ! !

Old! New! New! New! New!

1 n +1 1 n +1 1 n +1 n +1 ! f i! f i +1, j = [ f i, j !1 + f i,nj +1 ! h 2 Si, j ] 1, j + f i, j ! 4 4 4


! Thomas algorithm !

+ (1 " ! ) f n f i,nj+1 = ! f i, j i, j
which is no more complicated than line relaxation. !

Computational Fluid Dynamics I! Successive Line Overrelaxation (SLOR) - 3! Notes on SLOR! -$ Exact eigenvalues are unknown.! -$ To ensure convergence, !" ! 2 -$ Converges approximately twice as fast as Gauss-Seidel.! -$ May be faster than pointwise SOR, but each iteration! takes longer with Thomas algorithm.! -$ Improved convergence is due to the direct effect of the! boundary condition in each row.!

Computational Fluid Dynamics I! Alternating-Direction Implicit - 1! ADI for elliptic equation is analogous to ADI in parabolic! equation! # !2 f !2 f & !f ="% 2 + 2 ()S !t !y ' $ !x In discrete form!

f i,nj+1 ! f i,nj = "#t [$xx f + $yy f ] + S


and take it to the limit to obtain the steady solution.!
& 'f # $ = 0! % 't "

Computational Fluid Dynamics I! Alternating-Direction Implicit - 2! ADI for!

Computational Fluid Dynamics I! Alternating-Direction Implicit - 3! Convergence of ADI!

f i,nj+1 ! f i,nj = "#t [$xx f + $yy f ] ! S

is written as! "#t f n +1/ 2 ! f n = 2 2h


"#t f n +1 ! f n +1/ 2 = 2 2h

[( f [( f

n +1/ 2 i +1, j

n +1/ 2 n n n $, j ! 2 f i,nj+1/ 2 + f i! 1, j ) + ( f i, j +1 ! 2 f i, j + f i, j !1 ) ! S i n +1/ 2 n +1 n +1 n +1 $$ ! 2 f i,nj+1/ 2 + f i! 1, j ) + ( f i, j +1 ! 2 f i, j + f i, j !1 ) ! S i ,j

"!t n -$ Iteration parameter # n = usually varies with iteration! 2 -$ For example (Wachspress)!

n +1/ 2 i +1, j

or!

(1 ! "n#xx ) f n +1/ 2 = (1 + "n#yy ) f n ! Si$, j

(1 ! " # ) f
n yy

n +1

= (1 + " n#xx ) f

n +1/ 2

! Si$$ ,j

('t n # & $ )n = ! 2 " %

* k )'t k &a# = = b$ ! , k = 1, ! , n h2 2h 2 %b" a lower bound eigenvalue! b upper bound eigenvalue!


-$ Comparison with SOR is difcult! -$ ADI can be efcient if appropriate parameters are found.!

(k (1)/ (n (1)

Computational Fluid Dynamics I!

Although the iterative methods discussed here are important for understanding iterative methods, they are rarely used for practical applications due to their slow convergence rate.! The exception is the SOR method, which was widely used in the 70"s and early 80"s. Due to its simplicity, it is an excellent choice during code development or for runs where programming time is of more concern than computer time. !

You might also like