Week 5.1 - Mid term project - Solving the steady and unsteady 2D heat conduction problem
1. Introduction
The study of heat conduction is crucial in understanding thermal behavior in engineering systems, particularly when analyzing heat transfer in solid bodies. In this assignment, the two-dimensional heat conduction problem is solved for both steady-state and transient conditions using numerical methods implemented in MATLAB.
The domain under consideration is a square plate with Dirichlet boundary conditions applied on all four sides. The main objective is to compare and implement various point-iterative methods—Jacobi, Gauss-Seidel, and Successive Over-Relaxation (SOR)—to solve the steady-state form of the 2D heat conduction equation. Additionally, both explicit and implicit schemes are employed for transient analysis, providing a comprehensive comparison of convergence rates and numerical behavior.
Generalised Heat Conduction Equation In Cartesian Coordinates
∂2/∂x2(T) + ∂2/∂y2(T) + ∂2/∂z2(T) + q/k = 1/α ∂/∂t(T)
Where
T = temperature (K)
q = rate of heat generation (W/m3)
α = thermal diffusivity (m2/s)
2. 2D-Steady-State Heat Conduction with no heat generation
The steady-state solution is obtained by solving the Laplace equation iteratively until convergence:
Governing Differential Equation
∂2/∂x2(T) + ∂2/∂y2(T) = 0
Discretised Governing Differential Equation (Explicit form)
Ti = 1/K((Ti+1 + Ti-1)/ Δx2) + ((Tj+1 + Tj-1)/ Δy2)
Where
K = 2(Δx2 + Δy2/ Δx2 *Δy2)
Matlab Code
Code Explanation:
- Domain Setup:
- A 10×10 spatial grid is created over a 1.0×1.0 m square domain with uniform spacing (dx, dy).
- Initial Conditions:
- The temperature matrix is initialized to 300 K.
- Boundary Conditions:
- Left boundary: 400 K
- Right boundary: 800 K
- Top boundary: 600 K
- Bottom boundary: 900 K
- Corners are averaged to avoid singularities.
- Iteration Methods:
- The user selects a numerical method to solve the discretized Laplace equation.
- Jacobi Method: Uses all old values from the previous iteration.
- Gauss-Seidel Method: Uses the latest available values during the sweep.
- SOR Method: Introduces an over-relaxation factor (ω = 1.2) to accelerate convergence.
- Convergence Criteria:
- The iteration proceeds until the maximum absolute difference between iterations is less than 1e-4.
- Visualization:
- A filled contour plot shows the final temperature distribution.
3. 2D - Transient Heat Conduction Analysis with no heat generation
The transient case solves the full heat conduction equation:
Governing differential equation
∂2/∂x2(T) + ∂2/∂y2(T) + = 1/α ∂/∂t(T)
Discretised Differential equation
Explict
Ti n+1 = Ti n + K1(Ti+1 n – 2Ti n + Ti-1 n) + K2(Tj+1 n – 2Ti n + Tj-1 n)
K1 = α(Δt/ Δx2)
K2 = α(Δt/ Δy2)
Implicit
Ti n+1 = 1/(1 + 2K1 + K2) (Ti n + K1(Ti+1 n+1 + Ti-1 n+1) + K2(Tj+1 n+1 + Tj-1 n+1)
K1 = α(Δt/ Δx2)
K2 = α(Δt/ Δy2)
Two numerical approaches are implemented:
- Explicit Method: Forward time and central space (FTCS)
- Implicit Method: Backward time, solved using iterative solvers
Matlab Code
Code Explanation:
- Domain and Parameters:
- 10×10 grid with dx = dy = 0.1111, thermal diffusivity α = 1.5, and time step dt = 0.1.
- Initialization:
- Initial temperature field set to 300 K.
- Dirichlet boundary conditions same as steady-state case.
- Corner values are averaged for consistency.
- Approach Selection:
- The user chooses between implicit and explicit methods.
- Explicit Method:
- A direct update is done for every time step using FTCS discretization.
- No need for inner iterations.
- Stability depends on time step and spatial resolution.
- Implicit Method:
- For each time step, the temperature field is solved iteratively until convergence.
- The user selects Jacobi, Gauss-Seidel, or SOR to solve the implicit system.
- Convergence for each time step is checked using 1e-4 error tolerance.
- Iteration Counting:
- The total number of iterations (explicit: time steps, implicit: inner solver iterations) is printed for convergence comparison.
- Visualization:
- Final temperature distribution is plotted via a contour plot.
4. Results and Outputs
Steady State
1. Jacobi Method
Iterations = 207
2. Gauss-Seidel Method
Iterations = 111
3. Successive Over-relaxation Method
Iterations = 75
Transient Heat Conduction
1. Implicit Method
1.1 Jacobi Method
Iterations = 2313
1.2 Gauss-Seidel Method
Iterations = 1959
1.3 SOR Method
Iterations = 1845
2. Explicit Scheme
Iterations = 5000
Iterations = 5000
Iteration Summary Table
|
Solver Type |
Method |
Iterations |
|
Steady-State |
Jacobi |
207 |
|
Gauss-Seidel |
111 |
|
|
SOR |
75 |
|
|
Transient (Implicit) |
Jacobi |
2313 |
|
Gauss-Seidel |
1959 |
|
|
SOR |
1845 |
|
|
Transient (Explicit) |
Forward Difference |
5000 |
Conclusion
This study successfully implemented various iterative techniques to solve the 2D heat conduction problem in both steady-state and transient scenarios. The key findings and observations are as follows:
- Temperature Distribution: The temperature contour plots from both steady-state and transient analyses are identical, confirming that the transient solution approaches the same steady-state profile as time progresses.
- Boundary Conditions: The boundary temperatures—top (600 K), bottom (900 K), left (400 K), and right (800 K)—are accurately reflected in the final solution, validating correct implementation of boundary values.
- Solver Efficiency Comparison:
- The number of iterations required by each method follows a clear hierarchy:
Iterations (SOR)<Iterations (Gauss-Seidel)<Iterations (Jacobi)<{Iterations (SOR)} < {Iterations (Gauss-Seidel)} < {Iterations (Jacobi)}
- This pattern holds true for both the steady-state and transient implicit simulations, as shown in the summary table.
- SOR Method Superiority: The Successive Over-Relaxation (SOR) method was consistently the fastest to converge, showcasing the impact of the relaxation factor in accelerating the solution process.
- Gauss-Seidel Efficiency: The Gauss-Seidel method improved convergence over Jacobi by utilizing newly updated values during each iteration cycle.
- Jacobi Method Simplicity vs Speed: While the Jacobi method is conceptually simple and easy to implement, its reliance on old values in all directions results in slower convergence.
- Transient Explicit Stability: The explicit transient scheme, while stable due to a small time step, required many iterations (5000 time steps) to reach the steady state, highlighting its computational cost despite algorithmic simplicity.