# Eng9977 - CFD Appendix

1

1
1.1

Program Hints
How to Test a TDMA
For nodes i = 1 ! n: 1. De…ne a temperature distribution, i.e. specify the values of Ti . 2. Specify the values of the coe¢ cients aEi and aWi . 3. Set: aPi = aEi + aWi 4. De…ne: bi = aPi Ti aEi Ti+1 aWi Ti
1

This is a re-arranged version of the discretized equation for one-dimensional heat conduction. The bi terms have been de…ned such that all discretized equations will be satis…ed when the correct T distribution is used. 5. Set the T …eld to some incorrect value. 6. Solve using the TDMA. The solver should return the initially speci…ed T distribution.

1.2

Using a TDMA in Two-Dimensions
The discretized equations for two-dimensional heat conduction have the following form: aPi;j Ti;j = aEi;j Ti+1;j + aNi;j Ti;j +1 + aWi;j Ti
1;j

+ aSi;j Ti;j

1

+ bi;j

Note: the equation becomes tridiagonal along an i line when o¤-line terms are lumped into a b term: aPi;j Ti;j = aEi;j Ti+1;j + aWi;j Ti 1;j + bi;j where: bi;j = bi;j + aNi;j Ti;j +1 + aSi;j Ti;j The T terms are the latest available values. A TDMA can be used on each i line with latest available o¤-line terms lumped into b . The solver would have to include iterations as the tridiagonal form of the discretized equation at each node would not be strictly correct as incorrect (or unconverged) values of o¤-line temperatures are included.
1

j Ti 1. 6. j = 1 ! m: 1. .CFD Appendix 2 The convergence rate of the solver can be increased by following the same procedure for the j lines: aPi.j +1 aWi. i.j Ti.j Ti.e.3 How to Test a Two-Dimensional TDMA For nodes i = 1 ! n. The solver should return the initially speci…ed T distribution.j and a TDMA would be used on each j line with latest available o¤-line terms lumped into b .j aNi.j = aNi. Set the T …eld to some incorrect value.j and aSi. 2. De…ne a temperature distribution. The sweeps of the i and j lines would continue until a converged solution is obtained.j Ti.j +1 + aSi. The bi.j + aSi.j = bi.j terms have been de…ned such that all discretized equations will be satis…ed when the correct T distribution is used.j .j . aWi. 3.j 4.j 1 + bi.j aEi.j + aNi.j Ti 1.j Ti. 5.j = aEi. specify the values of Ti.j Ti.j Ti. aNi.j + aWi.j Ti+1.j aSi. 1.Eng9977 . Set: aPi.j + aEi.j Ti+1.j . Specify the values of the coe¢ cients aEi.j . Solve using the TDMA.j where: bi.j 1 This is a re-arranged version of the discretized equation for two-dimensional heat conduction.j + aWi.j = aPi. De…ne: bi.

To validate the program you can test it against known solutions: h(1) W m2 C 1010 1010 1010 1010 1010 1010 50 10 1010 10 10 Tf (1) ( C) 0 100 100 0 100 100 0 20 100 0 h(n) W m2 C 1010 1010 1010 1010 1010 1010 10 50 10 10 100 Tf (n) ( C) 0 100 0 100 100 100 20 0 1012 0 k W m C q _ W m3 100 100 100 100 100 100 100 100 100 100 0 0 0 0 105 105 0 0 105 105 The analytical solution is: T (x) = qL _ 2 2k 1 x2 L2 + Ts.1 h2 (Ts.Eng9977 .1 ) 2L (3) .1 ) 2L (2) qL _ " qs.1 + Ts.2 Ts.2 Ts. For a convection boundary condition the same expression can be used but the surface temperatures are de…ned through energy balances at the two surfaces: h1 (T1.2 Ts.2 are known.1 ) 2L k (Ts.1 ) 2L k (Ts.2 + 2 L 2 (1) when the two surface temperatures.. Ts. Does it work? Before applying your program to a problem (or trying to sell it) you have to be sure it works.1 x Ts.4 How to Test a 1D Steady-State Heat Conduction Program So.you have written your program to solve steady-state one-dimensional heat conduction problems.1 ) = qL _ T1. _ 2 = qL k (Ts.2 And for a speci…ed heat ‡ ux: " qs..1 and Ts. 1 = Ts.2 Ts.CFD Appendix 3 1.2 ) = qL _ k (Ts.2 Ts.