0% found this document useful (0 votes)
94 views

CFD Part 5 - 2 FDM Elliptic PDE

Uploaded by

minhminhminhh11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
94 views

CFD Part 5 - 2 FDM Elliptic PDE

Uploaded by

minhminhminhh11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Faculty Name

Prof. A. A. Saati
Finite Difference Method

Parabolic – Elliptic – Hyperbolic


Partial Differential Equations
Finite Difference Method
 Linear Second order PDEs are important sets of
equations that are used to model many systems in many
different fields of science and engineering.

 Classification is important because:


 Each category relates to specific engineering problems.
 Different approaches are used to solve these categories.

 Classification in lecture Part 2, Part 3 & Part 4.1show


that 2nd Order Linear PDE’s as:
Elliptic if B2  4 AC  0
Parabolic if B2  4 AC  0
Hyperbolic if B 2  4 AC  0
4
Elliptic Partial Differential Equations
 Introductory Remarks
 The governing equations of science and engineering such
as in fluid mechanics and heat transfer can be reduced to
elliptic form
 Examples:
 Steady state distribution of heat in a body.
 steady state distribution of electrical charge in a body.
 Velocity potential equation for incompressible.
 Inviscid flow & Stream function.

 Various finite difference of the model elliptic


Differential Equation (PDE) will be investigated.
Introductory Remarks
 Typical elliptic in a 2-D Cartesian system are Laplace’s equation
as first model.
T T
2 2
 2 0
x 2
y
 And Poisson’s equation as second model.
 2T  2T
 2  f ( x, y )
x 2
y
T : steady state temperature at point ( x,y )
f ( x,y ) : heat source (or sink)
A  1, B  0, C  1  B2  4 AC  4  0 Elliptic
 These model equations are used to investigate a variety of
procedures
 Finite Difference Formulations (FDE)
 A grid is used to divide the region of interest.
 Since the PDE is satisfied at each point in the area, it must be
satisfied at each point of the grid.
 A finite difference approximation is obtained at each grid
point.
 Applied the five-point formula to the first model
 2 T ( x, y) Ti 1, j  2Ti , j  Ti 1, j  2 T ( x, y) Ti , j 1  2Ti , j  Ti , j 1
 , 
x 2
x  2
y 2
y 2
Ti , j 1

Ti 1, j Ti , j Ti 1, j

Ti , j 1
 Finite Difference Formulations (Solution Technique)

 2 T ( x, y ) Ti 1, j  2Ti , j  Ti 1, j
 ,
x 2
x  2

 2 T ( x, y ) Ti , j 1  2Ti , j  Ti , j 1

y 2
y  2

 2 T ( x, y )  2 T ( x, y )
  0
x 2
y 2

is approximated by :
Ti 1, j  2Ti , j  Ti 1, j Ti , j 1  2Ti , j  Ti , j 1
 0
x  2
y  2
 Finite Difference Formulations (Solution Technique)

Ti 1, j  2Ti , j  Ti 1, j Ti , j 1  2Ti , j  Ti , j 1


 0
x  2
y  2

( Laplacian Difference Equation )


Assume : x  y  h
 Ti 1, j  Ti 1, j  Ti , j 1  Ti , j 1  4Ti , j  0
 Finite Difference Formulations (Solution Technique)

Ti , j 1

Ti 1, j Ti , j Ti 1, j

Ti , j 1

Ti 1, j  Ti 1, j  Ti , j 1  Ti , j 1  4Ti , j  0


Finite Difference Formulations (FDE)
 A higher order formulation is the nine-point formula
 Central differencing which is 4th -order accurate
 ui 2, j  16ui 1, j  30ui , j  16ui 1, j  ui  2, j
12x 
2

 ui , j 2  16ui , j 1  30ui , j  16ui , j 1  ui , j  2


 0
y  2

 The grid points involved in the equation are shown in the figure
 Example
 It is required to determine the steady state temperature at all points
of a heated sheet of metal. The edges of the sheet are kept at a
constant temperature: 100, 50, 0, and 75 degrees. 10
0
 The sheet is divided to 5X5 grids.
75 50

T1, 4  100 T2, 4  100 T3, 4  100


T1,3 T2,3
T0,3  75 T3,3
T4,3  50
T1, 2 T2, 2
T0, 2  75
T3, 2 T4, 2  50

T1,1 T2,1 T3,1


T0,1  75 T4,1  50

T1,0  0 T2,0  0 T3,0  0


 Example
 First Equation
T1, 4  100 T2, 4  100
T1,3 T2,3
T0,3  75

T1, 2 T2, 2
T0, 2  75

T0,3  T1, 4  T1, 2  T2,3  4T1,3  0


75  100  T1, 2  T2,3  4T1,3  0
 Example
 Another Equation

T1, 4  100 T2, 4  100 T3, 4  100


T1,3 T2,3 T3,3

T1, 2 T2, 2 T3, 2

T1,3  T2,4  T3,3  T2,2  4T2,3  0


T1,3  100  T3,3  T2,2  4T2,3  0
Ti 1, j  Ti 1, j  Ti , j 1  Ti , j 1  4Ti , j  0
T2,3  T0,3  T1, 4  T1, 2  4T1,3  0
T3,3  T1,3  T2, 4  T2, 2  4T2.3  0
T4,3  T2,3  T3, 4  T3, 2  4T3,3  0
T2, 2  T0, 2  T1,3  T1,1  4T1, 2  0
T3, 2  T1, 2  T2,3  T2,1  4T2, 2  0
T4, 2  T2, 2  T3,3  T3,1  4T3, 2  0
T2,1  T0,1  T1, 2  T1, 0  4T1,1  0
T3,1  T1,1  T2, 2  T2,1  4T2,1  0
T4,1  T2,1  T3, 2  T3, 0  4T3,1  0
 Example
 The Rest of the Equations

 4 1 0 1   T1,1   75 
    
1 4 1 0 1   T2,1   0 
 0 1 4 0 0 1   T   50 
   3,1   
1 0 0 4 1 0 1   T1,2   75 
 1 0 1 4 1 0 1  T    0 
   2, 2   
 1 0 1 4 0 0  1  T3,2   50 
  1 0 0 4  1 0   T   175 
   1,3   
  1 0  1 4  1  T2,3  100 
    
  1 0  1 4   3,3  
T 150 
Solution Algorithms
Solution Algorithms

 In general there are two methods of solution for the


system of simultaneous linear algebraic equations
and it is classified as
 Direct methods or
 Iterative methods.
 Solution Algorithms
 Direct method
 Direct method: such as Cramer’s rule and Gaussian
elimination.
 The major disadvantage:
1. Enormous amount of arithmetic operations required to produce a
solution.
2. some advanced direct method require moderate computation time
3. usually these method are limited by one or more restrictions such as
the Cartesian coordinate system, a rectangular domain, the size of
the coefficient matrix, a large storage requirement, boundary
conditions or difficulty of programming
4. Some of the advanced direct methods show promise for
applications and indeed are useful tools.
5. The discussion of these methods is beyond the scope of this
teaching.
 Solution Algorithms
 Iterative methods
 Iterative procedures for system of linear algebraic
equations are simple and easy to program.
 The idea of this method:
1. An initial solution is guessed and new values are
computed:
2. Based on the newly computed values, answer solution
is sought.
3. The procedure is repeated until a specified
convergence criterion has been reached.
4. The various formulations of the iterative method can
be divided into two categories.
 Solution Algorithms

 Iterative methods
 A point iterative method, ( if a formulations results in only
one unknown) the method is similar to the explicit
methods of parabolic equation
 A line iterative method, (if a formulations results in more than
one unknown) the method is similar to the implicit
methods of parabolic equation.
 Some of these iterative methods will now be discussed
 The Jacobi Iteration Method
 The dependent variable at each grid point is solved ( at the new
iteration k+1 level), using initial guessed values or previously
computed values (at the new iteration k level).
 The computation is carried out until a specified convergence
criterion is met
 2u  2u
 2 0
x 2
y
2
 x 
ui 1, j  2ui , j  ui 1, j    ui , j 1  2ui , j  ui , j 1  0
 y 
ui 1, j  ui 1, j   2ui , j 1   2ui , j 1  2(1   2 )ui , j  0

u k 1
i, j 
1
2(1   )
2
u k

i 1, j  u k
i 1, j   2
u k
i , j 1  u k

i , j 1 
 The Jacobi Iteration Method
 Now let x  y , then   1
 And the Jacobi equation reduce to

uk 1
i, j
1 k

 ui 1, j  uik1, j  uik, j 1  uik, j 1
4

 Before proceeding with other iterative methods, the analogy
between this iterative method and parabolic equation is
investigated
 Consider the following parabolic equation:

u  2u  2u
 2 2
t x y
 The Jacobi Iteration Method
 The explicit formulation of the finite difference equation (FTCS)
is: k 1 k
ui , j  ui , j uik1, j  2uik, j  uik1, j uik, j 1  2uik, j  uik, j 1
 
t x  2
y 2
or
t t
uik, j 1  uik, j  u k
 2 u k
 u k
  u k
 2 u k
 ui , j 1 
k

x 2 i 1, j i, j i 1, j


y 2 i , j 1 i, j

 For simplicity, assume that x  y ; then


k 1
u u k t
u k
  u k
 4 u k
 u k
 u k

i, j
x 
i, j 2 i 1, j i 1, j i, j i , j 1 i , j 1

 If t /( x ) 2  0.25 a stable solution is obtained; then let2


t /( x )  0.25
uk 1
i, j
k1 k
i, j
4

 u  ui 1, j  uik1, j  4uik, j  uik, j 1  uik, j 1 
 Gauss-Seidel Iteration Method
 It is an improve of the Jacobi method by using the newly
computed values of the dependent variable
 increases the convergence rate
 and lead to less computation time

k 1
u
i, j 
1
2(1   )
2
u k

i 1, j  u k 1
i 1, j   2
u k
i , j 1  u k 1

i , j 1 
 Gauss-Seidel Iteration Method
 For the computation of the first point, say (2,2)

u k 1
2, 2 
1
2(1   )
2
u k

3, 2  u1, 2   2
u k

2 , 3  u2 ,1 
 (5-13)
 Where u2,1 & u1, 2 are B.C
 Gauss-Seidel Iteration Method
 Now, for point (3,2)

uk 1
3, 2 
1
2(1   )
2
u 
4, 2  u2, 2   2
 
u3,3  u3,1 

 In this equation u3,1 is provided by the B.C
 And u4 ,2 & u3,3 are taken from the previous computation;
 But u2,2 is given by the previous equation (5-13)
 Thus, ( see Figure )

k 1
u
3, 2 
1
2(1   )
2
u k
4, 2 u k 1
2, 2   2
u3, 3  u3,1 
k

 Gauss-Seidel Iteration Method
 Finally, the general formulation provides the equation

uk 1
i, j 
1
2(1   )
2
u k

i 1, j  u k 1
i 1, j   2
u k
i , j 1  u k 1

i , j 1 
(5-15)

 This is a point iteration method, since only one unknown is


being required
 The Line Gauss-Seidel Iteration method
 2u  2u
 The five-point formula to the first model  2 0
x 2
y

ui 1, j  2ui , j  ui 1, j ui , j 1  2ui , j  ui , j 1


 0
 Lead to x  2
y  2

 In this formulation, shows three unknown at (i  1, j ), (i, j ) and (i  1, j )


 The formulation becomes

uik11, j  2(1   2 )uik, j 1  uik11, j    2uik, j 1   2uik, j 11

 This equation, applied to all i at constant j,


 Results in a system of linear equations, and can be solved by
using a tridiagonal matrix coefficient. see the following figure
 This method converges faster than the point Gauss-Seidel by
about a factor of ½.
 It requires more computation time per iteration
 This method is recommended for problems in which the value
of the dependent variable changes more rapidly in one
direction.
 Point Successive Over-Relaxation (PSOR)
 First, consider the point Gauss-Seidel iteration method.

k 1
u
i, j 
1
2(1   )
2
u k
i 1, j  uk 1
i 1, j   2
u k
i , j 1  ui , j 1 
k 1

 Adding uik, j  uik, j to the right-hand side and collecting terms,

uk 1
i, j u k 1
2(1   2 )
i, j u k
i 1, j  
u k 1
i 1, j   2
u k
i , j 1  u k 1
i , j 1   2 (1   2
) u k
i, j 
 To accelerate the solution the bracket term is multiplied by ,
the relaxation parameter.

uk 1
i, j u k
i, j
2(1   2
)
u k
i 1, j  uik11, j   2 uik, j 1  uik, j 11   2(1   2 )uik, j 
 Theorems can show that 0 < ω < 2 is a condition for a scheme to
converge.
 If we choose 0    1 the solution called under-relaxation,
and the convergence will be slower
 If   1 we just have the Gauss-Seidel iteration method.
 If we choose 1    2 it is called successive over-relaxation
 The formulation is rearranged as

uk 1
i, j  (1   )u 
k
i, j
2(1   2
)
k
u
i 1, j 
 uik11, j   2 uik, j 1  uik, j 11 

 What is the optimum value of the relaxation parameter


 There is no general guideline exists for computing the optimum
 For the solution of elliptic equations in rectangular domain
subject to Dirichlet boundary conditions with constant step sizes
is
2  2 1 a
opt 
a
2
      
 cos IM  1    cos JM  1  
2

a    
 1   2

 

 In general, opt cannot be determined easily.


 therefore, for most cases, numerical experiment is performed.
 Line Successive Over-Relaxation (LSOR)
 The line Gauss-Seidel iteration method can be accelerated by
introducing a relaxation parameter, and rearranging the terms results
in

uik11, j  2(1   2 )uik, j 1  uik11, j    2 (uik, j 1  uik, j 11 )

uik11, j  2(1   2 )uik, j 1  uik11, j 


 
 (1   ) 2(1   2 ) uik, j 1   2 (uik, j 1  uik, j 11 )

 There is no simple way to determine the value of optimum 


 in practice, trial and error is used to compute opt for particular
problem
 The Alternating Direction Implicit (ADI)
Method
 An iteration cycle is considered complete once the resulting tri-
diagonal system is solved for all the rows and then followed by
columns, or vice versa.
 For the first model the FDE takes the form

uik11, /j 2  2(1   2 )uik, j 1 / 2  uik11, /j 2    2 (uik, j 1  uik, j 11/ 2 )

 2uik, j 11  2(1   2 )uik, j 1   2uik, j 11  uik11, /j 2  uik11, j


 The first equation is solved implicitly for the unknown in the x-
direction
 The second equation is solved implicitly for the unknown in the y-
direction
 The solution procedure and the grid point in the equations are
shown in the following figure.
 The solution procedure can be accelerated by introducing a
relaxation parameter  into ADI equations.
 The resulting formulations are:

uik11, /j 2  2(1   2 )uik, j 1 / 2  uik11, /j 2 


 
 (1   ) 2(1   2 ) uik, j   2 (uik, j 1  uik, j 11/ 2 )

 2uik, j 11  2(1   2 )uik, j 1   2uik, j 11 


 
 (1   ) 2(1   2 ) uik, j 1 / 2   (uik11, /j 2  uik11, j )

 Numerical experimentation is often performed to obtain the best


value of  for the faster convergence.
 The methods which have been investigated are the basic methods
of solution for elliptic equations.
 Application
 Steady 2-D heat conduction equation is:

 2u  2u
 2 0
x 2
y
 The imposed boundary conditions are:

y0 T  T1
x0 T  T2
yH T  T3
xL T  T4
L IM 
Convergence criterion:
H JM 
ERRORMAX =
y 
ERROR < ERRORMAX
x 
j JMM1
 i  IMM1

T1  ERROR   ABS(T
i 2
k 1
i, j  Ti ,kj ) 
T2  j 2

T3 
T4 
Ti  Initial guess
 Summary
 After studying the FDM Elliptic PDE, you should be able to
do the following:
 Describe:
a) The five-point formula
b) The Jacobi iteration method
c) The point Gauss-Seidel iteration method
d) The line Gauss-Seidel iteration method
e) The point successive over-relaxation (PSOR) method
f) The line successive over-relaxation (PSOR) method
g) The ADI method
 Solve the problems for Chapter Five
Home Work
Problems
END OF
Finite Difference Method

Parabolic – Elliptic – Hyperbolic


Partial Differential Equations

You might also like