Problem 2 (40 pts)
Solve numerically the 2D Heat Transfer equation:
∇²T = f
on a square domain [0,1] using the following boundary conditions:
T(x,0) = T(x,1) = T(0,y) = T(1,y) = 0
with a constant sink term f = 1 and for y = 0.0, x = 0.0
The analytical solution is given as:
T(x,y) = ∑ ∑ (1/nm) sin(nπx) sin(mπy) exp(-((nπ)²+(mπ)²)t)
With P = 55, and n, m = 1, 3, 5, 7.
a) Discretize the PDE using a central difference scheme to generate a set of algebraic equations. Write the expressions for each coefficient array, including boundary nodes.
b) Solve the resulting penta-diagonal matrix on three different grids [ni, nj] = [21,21], [41,41], [81,81] using the ADI-TDMA algorithm. State what condition was used for stopping the iterative solver. Plot the temperature contours for each grid and show the differences of the numerical to the analytical solution on additional contours. Compute the L∞ norm error in the domain, plot the errors vs. grid sizes on a log-log scale, and discuss your findings. (Hint: you may want to adjust the stopping criteria to see how the errors changed).
c) Solve the resulting matrix on the grid [41,41] using the Jacobi, Gauss-Seidel, and SOR methods, respectively. Write down the expression of the temperature at node (i, j) and iteration n+1, in terms of its neighboring nodes for each method. Using the same criterion in b) to stop the iterative solvers. Use a table to list the final iteration counts for each method. Monitor the value of T(0.5,0.5) for the three iterative methods and discuss your findings. (Hint: plot T(0.5,0.5) values vs. iteration counts from all three iterative methods in a single figure). (Use commands in Matlab to obtain the CPU time). For the SOR method, investigate the effect of the relaxation factor on the convergence (Hint: choose several factors in the range of [1.5,2]).