Вы находитесь на странице: 1из 3

Lars Davidson: Numerical Methods for Turbulent Flow

http://www.tfd.chalmers.se/gr-kurs/MTF071 31

TDMA Solver

In this chapter we’ll derive the TDMA (Tri-Diagonal Matrix


Algorithm). The solver is really a formula for recursive use
of solving a matrix equation using Gauss-Elimination. The
finite volume discretization gives a tri-diagonal (the diago-
nal plus two off-diagonals) equation system in 1D, a penta-
diagonal system in 2D, and a septa-diagonal system in 3D.
Some discretization schemes give more diagonals; for ex-
ample, QUICK gives seven in 2D. In this case one can sim-
ply put the two outermost diagonals in the source term, so
that a penta-diagonal equation system is retained.
Below the TDMA for 2D is given in detail, and the ex-
tension to 3D is straight forward.
The 2D discretized equation reads

aP TP = a E TE + aW TW + a N TN + S S + SU :
a T (22)

We rewrite it as

i i
a T = i i+1 + ci Ti;1 + di
b T (23)

and identification gives


ai = aP  bi = aE  ci = aW
di = aN TN + aS TS + SU :

Equation 23 is solved from i = 2 to i = ni ; 1, and i = 1


and i = ni are boundary nodes. We want to write Eq. 23 on
the form

T i = P T i i+1 + Qi: (24)

Chapter 7: TDMA
Lars Davidson: Numerical Methods for Turbulent Flow
http://www.tfd.chalmers.se/gr-kurs/MTF071 32

In order to derive Eq. 24 we write Eq. 23 on matrix form


so that
2 32 3 2 3
a2 ;b2 0 : : : T2 d2 + c2 T1
66 ;c3 a3 ;b3 0 : : : 7
7 6
6 7 6
T3 7 6 d3
7
7
64 0 ;c4 a4 ;b4 0 7 6 7
: : : 5 4 T4 5
= 6
4 d4 7 5
.. .. .. .. .. .. .. ..
. . . . . . . .
(25)

Start by dividing the first row by a2 so that (see Eq. 24)


2 32 3 2 3
1 ;P2 0 : : : T2 Q2
66 ;c3 a3 ;b3 0 : : : 7
7 6
6 7
T3 7
6
6 7
d3 7
64 0 ;c4 a4 ;b4 0 76 7 = 6
: : : 5 4 T4 5 4 d4 7
5
(26)
.. .. .. .. .. .. .. ..
. . . . . . . .

where
2 2 + c2 T1 :
2= 2=
b d
P Q (27)
a2 a2

Now we want to eliminate the c0 s. Multiply row 1 by c3 ,


add it to row 3 and after that divide row 3 by a3 ; c3 P2 . We
obtain

2 32 3 2 3
1 ;P2 0 : : : T2 Q2
66 0 1 ;P3 0 : : : 7
7 6
6 7
T3 7
6
6 7
Q3 7
64 0 ;c4 a4 ;b4 0 76 7 = 6
: : : 5 4 T4 5 4 d4 7
5
(28)
.. .. .. .. .. .. .. ..
. . . . . . . .

where
3 3 + c3 Q2 :
3= 3=
b d

3 ; c3 P2 a3 ; c3 P2
P  Q (29)
a

Chapter 7: TDMA
Lars Davidson: Numerical Methods for Turbulent Flow
http://www.tfd.chalmers.se/gr-kurs/MTF071 33

We see that Eq. 29 becomes an recursive equation for Pi


and Qi on the form

Pi = ; bi
ci Pi;1
 Qi = i +;
d i i;1
c Q

ci Pi;1
: (30)
ai i
a

Now the Pi and Qi coefficients can be computed.

1. for i = 2: use Eq. 27.


2. for i = 3 to i = ni ; 1: use Eq. 30.

Compute T from Eq. 24 starting from i = ni ; 1 to i = 2.

Chapter 7: TDMA

Вам также может понравиться