Closing remarks We have discussed the solution of systems of equations with the TDMA.

7.5.1 Closing remarks We have discussed the solution of systems of equations with the TDMA.

This algorithm is highly economical for tri-diagonal systems. It consists of a forward elimination and a back-substitution stage:

• Forward elimination

– arrange system of equations in the form of (7.2):

− β j φ j −1 +D j φ j − α j φ j+1 =C j – calculate coefficients α j , β j ,D j and C j

– starting at j = 2 calculate A j and C ′ j using (7.6b–c):

and C j ′ =( β j C ′ j −1 +C j )/(D j − β j A j −1 )

– repeat for j = 3 to j = n • Back-substitution

– starting at j = n obtain φ n by evaluating (7.6a):

φ j =A j φ j+1 +C′ j

– repeat for j = n − 1 to j = 2 giving φ n −1 to φ 2 in reverse order

7.6 POINT-ITERATIVE METHODS 223

For two- and three-dimensional problems, the TDMA must be applied iter- atively in a line-by-line fashion, but the spread of boundary information into the calculation domain can be slow. In CFD calculations the convergence rate depends on the sweep direction, with sweeping from upstream to down- stream along the flow direction producing faster convergence than sweeping against the flow or parallel to the flow direction. Convergence problems can

be alleviated by alternating the sweep directions, which is particularly useful in complex three-dimensional recirculating flows, where the dominant flow direction is not known in advance. When overall stability considerations require coupling between the values over the whole calculation domain the TDMA can be unsatisfactory for the solution of discretised equations.

Higher-order schemes for the discretisation process will link each dis- cretisation equation to nodes other than the immediate neighbours. Here, the TDMA can only be applied by incorporating several neighbouring contributions in the source term. This may be undesirable in terms of stab- ility, can impair the effectiveness of the higher-order scheme, and may hinder the implicit nature of the scheme if it is applied in an unsteady flow (see Chapter 8). In the specific case where the system of equations to be solved has the form of a penta-diagonal matrix, as may be the case in QUICK and other higher-order discretisation schemes, there is an alternative solution: a generalised version of the TDMA, known as the penta-diagonal matrix algo- rithm, is available. Basically a sequence of operations is carried out on the original matrix to reduce it to upper triangular form, and back-substitution is performed to obtain the solution. Details of the method can be found in Fletcher (1991). The method is, however, not nearly as economical as the TDMA.

7.6 Point-iterative methods

Point-iterative techniques are introduced by means of a simple example. Consider a set of three equations and three unknowns:

In iterative methods we rearrange the first equation to place x 1 on the left hand side, the second equation to get x 2 on the left hand side, and so on. This yields

We see that unknowns x 1 ,x 2 and x 3 appear on both sides of (7.15). The system of equations can be solved iteratively by substituting a set of guessed initial values for x 1 ,x 2 and x 3 on the right hand side. This allows us to calculate new values of the unknowns on the left hand side of (7.15). The next move is to substitute the new values back into the right hand side and evaluate the unknowns on the left hand side again, which are, if the procedure converges, closer to the true solution of the system of equations. This process is repeated until there is no more change in the solution.

One condition for the iteration process to be convergent is that the matrix must be diagonally dominant (see discussion on boundedness in

224 CHAPTER 7 SOLUTION OF DISCRETISED EQUATIONS

section 5.4.2). When general systems of equations are solved it is sometimes necessary to rearrange the equations, but the finite volume method yields diagonally dominant systems as part of the discretisation process, so this aspect does not require special attention.

The Jacobi and Gauss–Seidel methods apply slightly different substitutions on the right hand side. Below we describe the main features both methods.