Adi algorithm...numerical analysis

4
  6-19 Chapter 6 Boundary-Value Problems 6.4 The Alternatin g Direction Implicit (ADI) Method When the partial differential equation 2 u = 0 is solved by the finite difference method, the resulting coefficient matrix is spare. The sparseness increases as the number of nodes increases. If there are 21 nodes, 81% of the coefficients are zeros; if there are 105 nodes, 96% are zeros. The system of equations for the one-dimensional case always has a tridiagonal coefficient matrix for which the efficient Thomas algorithm can be used. The  ADI  method can be applied for the two or three-dimensional system to get a tridiagonal coefficient matrix. We will use a two dimensional example of the Laplace equation 2 u = 0 Using finite difference, the value at the node (i, j) for iteration (m+1) is given as ) 1 ( , m   j i u  = 4 1 [  ) ( 1 , m   j i u  + ) ( 1 , m   j i u  + ) ( , 1 m   j i u  + ) ( , 1 m   j i u ] We now add and subtract ) ( , m   j i u from this equation to yield ) 1 ( , m   j i u  = ) ( , m   j i u  + 4 1 [  ) ( 1 , m   j i u  + ) ( 1 , m   j i u  + ) ( , 1 m   j i u  + ) ( , 1 m   j i u   4  ) ( , m   j i u ] or equivalently ) 1 ( , m   j i u   ) ( , m   j i u  = 4 1 {[  ) ( 1 , m   j i u   2  ) ( , m   j i u + ) ( 1 , m   j i u ] + [  ) ( , 1 m   j i u   2  ) ( , m   j i u  + ) ( , 1 m   j i u ]} Each iteration is considered to be a two-step procedure wherein the first step advances to the (m+ 2 1 ) level and the second step to the ( m+1) level. First step: ) 2 / 1 ( , m   j i u   ) ( , m   j i u  = 4 1 {[  ) 2 / 1 ( 1 , m   j i u   2  ) 2 / 1 ( , m   j i u + ) 2 / 1 ( 1 , m   j i u ] + [  ) ( , 1 m   j i u   2  ) ( , m   j i u  + ) ( , 1 m   j i u ]} Second step: ) 1 ( , m   j i u   ) 2 / 1 ( , m   j i u  = 4 1 {[  ) 2 / 1 ( 1 , m   j i u   2  ) 2 / 1 ( , m   j i u + ) 2 / 1 ( 1 , m   j i u ] + [  ) 1 ( , 1 m   j i u   2  ) 1 ( , m   j i u  + ) 1 ( , 1 m   j i u ]}

description

numerical analysis, iterative solution, FDM, SOR

Transcript of Adi algorithm...numerical analysis

  • 6-19

    Chapter 6

    Boundary-Value Problems

    6.4 The Alternating Direction Implicit (ADI) Method

    When the partial differential equation 2u = 0 is solved by the finite difference method, the resulting coefficient matrix is spare. The sparseness increases as the number of nodes

    increases. If there are 21 nodes, 81% of the coefficients are zeros; if there are 105 nodes,

    96% are zeros. The system of equations for the one-dimensional case always has a

    tridiagonal coefficient matrix for which the efficient Thomas algorithm can be used. The ADI

    method can be applied for the two or three-dimensional system to get a tridiagonal

    coefficient matrix. We will use a two dimensional example of the Laplace equation

    2u = 0

    Using finite difference, the value at the node (i, j) for iteration (m+1) is given as

    )1(,m

    jiu = 4

    1[ )( 1,

    m

    jiu + )(

    1,

    m

    jiu + )(

    ,1

    m

    jiu + )(

    ,1

    m

    jiu ]

    We now add and subtract )(,m

    jiu from this equation to yield

    )1(,m

    jiu = )(

    ,

    m

    jiu + 4

    1[ )( 1,

    m

    jiu + )(

    1,

    m

    jiu + )(

    ,1

    m

    jiu + )(

    ,1

    m

    jiu 4)(

    ,

    m

    jiu ]

    or equivalently

    )1(,m

    jiu )(

    ,

    m

    jiu = 4

    1{[ )( 1,

    m

    jiu 2)(

    ,

    m

    jiu + )(

    1,

    m

    jiu ] + [)(

    ,1

    m

    jiu 2)(

    ,

    m

    jiu + )(

    ,1

    m

    jiu ]}

    Each iteration is considered to be a two-step procedure wherein the first step advances to the

    (m+2

    1) level and the second step to the (m+1) level.

    First step:

    )2/1(,m

    jiu )(

    ,

    m

    jiu = 4

    1{[ )2/1( 1,

    m

    jiu 2)2/1(

    ,

    m

    jiu + )2/1(

    1,

    m

    jiu ] + [)(

    ,1

    m

    jiu 2)(

    ,

    m

    jiu + )(

    ,1

    m

    jiu ]}

    Second step:

    )1(,m

    jiu )2/1(

    ,

    m

    jiu = 4

    1{[ )2/1( 1,

    m

    jiu 2)2/1(

    ,

    m

    jiu + )2/1(

    1,

    m

    jiu ] + [)1(

    ,1

    m

    jiu 2)1(

    ,

    m

    jiu + )1(

    ,1

    m

    jiu ]}

  • 6-20

    The ADI method produces a tridiagonal set of equations at the (m+1/2) level. The equations

    can be solved along all rows of the grid, one row at a time. Once, all nodes have been

    elevated to the (m+1/2) level, a similar procedure for the column of nodes is applied. A two-

    step iteration is completed when the new values )1(,m

    jiu are calculated.

    Example 6.4-1 _____________________________________________________

    Assuming two dimensional, steady-state conduction, determine the temperature of nodes 1,

    2, 3, and 4 in the square shape subjected to the uniform temperature shown.

    50 200

    100

    300

    50 200

    100

    300

    1 2

    3 4

    1,0 1,1 1,2 1,3

    2,0 2,1 2,2 2,3

    0,1 0,2

    3,1 3,2

    Figure 6.4-1 The nodes in a two dimensional, steady-state conduction.

    Solution

    The two-dimensional heat conduction equation for steady state, no heat generation, and k

    independent of temperature is given as

    2

    2

    x

    u

    +

    2

    2

    y

    u

    = 0

    The ADI method will be applied to solve this problem

    )1(,m

    jiu )(

    ,

    m

    jiu = 4

    1{[ )( 1,

    m

    jiu 2)(

    ,

    m

    jiu + )(

    1,

    m

    jiu ] + [)(

    ,1

    m

    jiu 2)(

    ,

    m

    jiu + )(

    ,1

    m

    jiu ]}

    Let )( 1,1mu = 100, )( 2,1

    mu = 150, )( 1,2mu = 150, and )( 2,2

    mu = 250

    First step calculation with row 1 and row 2:

    )2/1(,m

    jiu )(

    ,

    m

    jiu = 4

    1{[ )2/1( 1,

    m

    jiu 2)2/1(

    ,

    m

    jiu + )2/1(

    1,

    m

    jiu ] + [)(

    ,1

    m

    jiu 2)(

    ,

    m

    jiu + )(

    ,1

    m

    jiu ]}

    Node (1,1): )2/1( 1,1mu 100 =

    4

    1{[ )2/1( 2,1

    mu 2 )2/1( 1,1mu + 50] + [100 2(100) + 150]}

  • 6-21

    1.5 )2/1( 1,1mu 0.25 )2/1( 2,1

    mu = 125

    Node (1,2): )2/1( 2,1mu 150 =

    4

    1{[200 2 )2/1( 2,1

    mu + )2/1( 1,1mu ] + [100 2(150) + 250]}

    0.25 )2/1( 1,1mu + 1.5 )2/1( 2,1

    mu = 212.5

    The two nodes in row 1 are solved with the following results

    )2/1( 1,1mu = 110, and )2/1( 2,1

    mu = 160

    Node (2,1) )2/1( 1,2mu 150 =

    4

    1{[ )2/1( 2,2

    mu 2 )2/1( 1,2mu + 50] + [100 2(150) + 300]}

    1.5 )2/1( 1,2mu 0.25 )2/1( 2,2

    mu = 187.5

    Node (2,2) )2/1( 2,2mu 250 =

    4

    1{[200 )2/1( 2,2

    mu + )2/1( 1,2mu ] + [150 2(250) + 300]}

    0.25 )2/1( 1,2mu + 1.5 )2/1( 2,2

    mu = 287.5

    The two nodes in row 2 are solved with the following results

    )2/1( 1,2mu = 161.43, and )2/1( 2,2

    mu = 218.57

    Second step calculation with column 1 and column 2:

    )1(,m

    jiu )2/1(

    ,

    m

    jiu = 4

    1{[ )2/1( 1,

    m

    jiu 2)2/1(

    ,

    m

    jiu + )2/1(

    1,

    m

    jiu ] + [)1(

    ,1

    m

    jiu 2)1(

    ,

    m

    jiu + )1(

    ,1

    m

    jiu ]}

    Node (1,1) )1( 1,1mu 110 =

    4

    1{[160 2(110)+ 50] + [100 2 )1( 1,1

    mu + )1( 1,2mu ]}

    1.5 )1( 1,1mu 0.25 )1( 1,2

    mu = 132.5

    Node (2,1) )1( 1,2mu 161.43 =

    4

    1{[218.57 2(161.43)+ 50] + [ )1( 1,1

    mu 2 )1( 1,2mu + 300]}

    0.25 )1( 1,1mu + 1.5 )1( 1,2

    mu = 222.86

    The two nodes in column 1 are solved with the following results

  • 6-22

    )1( 1,1mu = 116.33, and )1( 1,2

    mu = 167.96

    Node (1,2) )1( 2,1mu 160 =

    4

    1{[200 2(160)+ 110] + [100 2 )1( 2,1

    mu + )1( 2,2mu ]}

    1.5 )1( 2,1mu 0.25 )1( 2,2

    mu = 182.5

    Node (2,2) )1( 2,2mu 218.57 =

    4

    1{[200 2(218.57)+ 161.43] + [ )1( 2,1

    mu )1( 2,2mu + 300]}

    0.25 )1( 2,1mu + 1.5 )1( 2,2

    mu = 274.64

    The two nodes in column 2 are solved with the following results

    )1( 2,1mu = 156.53, and )1( 2,2

    mu = 209.18

    Table 6.4-1 lists the temperatures before and after one ADI iteration.

    Table 6.4-1 )(

    ,

    m

    jiu (left side) and )1(

    ,

    m

    jiu (right-side)

    i\j 0 1 2 3 i\j 0 1 2 3

    0 100 100 0 100 100 1 50 100 150 200 1 50 116.33 156.53 200 2 50 150 250 200 2 50 167.96 209.18 200 3 300 300 3 300 300