All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Problem Statement: - For A 2D surface maintained at a certain temperature at its edges. Solve using Iteration Methods(Jacobi, Gauss-Seidel, and S.O.R. using Gauss-Seidel) for Temperature distribution due to Heat Conduction that can be observed for the following States: - 1. Transient State until Steady State is Achieved…
Aditya Aanand
updated on 09 Sep 2022
Problem Statement: -
For A 2D surface maintained at a certain temperature at its edges. Solve using Iteration Methods(Jacobi, Gauss-Seidel, and S.O.R. using Gauss-Seidel) for Temperature distribution due to Heat Conduction that can be observed for the following States: -
1. Transient State until Steady State is Achieved
2. Steady State
The Given Temperature Maintained at the edges are as follows
TTop=600K,TBottom=900K,TLeft=400K,andTRight=800K
Solution: -
1. AIM: -
A. To Solve 2D heat Conduction Equation for Steady and Transient State using Iterative Solver( Jacobi, Gauss-Seidel and Successive Over-Relaxation)
2. Given: -
A. Ttop=600K
B. TBottom=900K
C. TLeft=400K
D. TRight=800K
3. Assumed: -
A. 2D Transient Heat Conduction→∂T∂t−α(∂2T∂x2+∂2T∂y2)=0
B. 2D Steady Heat Conduction→∂2T∂x2+∂2T∂y2=0
C. Dimensions of Surface ⇒length=1mandWidth=1m
D. Number of Nodes in each Direction = 51
E. Using the Following notation for Tni,j
where i,j→xandy positions of Node
n→time Step iteration
4. Deriving Numerical Methods: -
A. 2D Steady Heat Conduction: -
For 2D Steady Heat Conduction, ∂2T∂x2+∂2T∂y2=0
First Order Numerical Method,
⇒(Tni+1,j−2Tni,j+Tni−1,jdx2)+(Tni,j+1−2Tni,j+Tni,j−1dy2)=0
⇒2Tni,j(1dx2+1dy2)=(Tni+1,j+Tni−1,jdx2)+(Tni,j+1+Tni,j−1dy2)
⇒2Tni,j(dx2+dy2dx2dy2)=(Tni+1,j+Tni−1,jdx2)+(Tni,j+1+Tni,j−1dy2)
⇒Tni,j=12[(Tni+1,j+Tni−1,jdx2+dy2)dy2+(Tni,j+1+Tni,j−1dx2+dy2)dx2]
Let dy2dx2+dy2 be k1andLet dx2dx2+dy2 be k2
⇒Tni,j=12[(Tni+1,j+Tni−1,j)k1+(Tni,j+1+Tni,j−1)k2]
Now,
For dx=151−1anddy=151−1
k1=(dy=150)2(dx=150)2+(dy=150)2=12
k2=(dx=150)2(dx=150)2+(dy=150)2=12
⇒Tni,j=12[(Tni+1,j+Tni−1,j)(k1=12)+(Tni,j+1+Tni,j−1)(k2=12)]
Hence,
Tni,j=Tni+1,j+Tni−1,j4+Tni,j+1+Tni,j−14
2D Steady State Heat Conduction Equation | Tni,j=Tni+1,j+Tni−1,j4+Tni,j+1+Tni,j−14 |
B. 2D Transient Heat Conduction: -
For 2D Steady Heat Conduction, ∂T∂t−α(∂2T∂x2+∂2T∂y2)=0
First Order Numerical Method,
⇒(Tn+1i,j−Tni,jdt)−α[(Tn+1i+1,j−2Tn+1i,j+Tn+1i−1,jdx2)+(Tn+1i,j+1−2Tn+1i,j+Tn+1i,j−1dy2)]=0
⇒Tn+1i,j−Tni,j=(dt)α[(Tn+1i+1,j−2Tn+1i,j+Tn+1i−1,jdx2)+(Tn+1i,j+1−2Tn+1i,j+Tn+1i,j−1dy2)]
⇒Tn+1i,j=Tni,j+(dt)α[(Tn+1i+1,j−2Tn+1i,j+Tn+1i−1,jdx2)+(Tn+1i,j+1−2Tn+1i,j+Tn+1i,j−1dy2)]
⇒Tn+1i,j(1+2(dt)α(1dx2+1dy2))=Tni,j+(dt)α[(Tn+1i+1,j+Tn+1i−1,jdx2)+(Tn+1i,j+1+Tn+1i,j−1dy2)]
As, CFLx=α(dt)dx2 and CFLy=α(dt)dy2
For Stable Numerical Method CFL<1
Now,
Let α(dt)dx2=k1
Let α(dt)dy2=k2
Let 1+2(dt)α(1dx2+1dy2)=k3
⇒k3=1+2(k1+k2)
Hence,
⇒Tn+1i,j(k3)=Tni,j+k1(Tn+1i+1,j+Tn+1i−1,j)+k2(Tn+1i,j+1+Tn+1i,j−1)
⇒Tn+1i,j=1k3[Tni,j+k1(Tn+1i+1,j+Tn+1i−1,j)+k2(Tn+1i,j+1+Tn+1i,j−1)]
2D Unsteady State Heat Conduction Equation | Tn+1i,j=1k3[Tni,j+k1(Tn+1i+1,j+Tn+1i−1,j)+k2(Tn+1i,j+1+Tn+1i,j−1)] |
5. Explanation Code: -
A. 2D Steady-State Heat Conduction: -
i. Section 1(Defining Variables)
a. Defining Geometry of Surface
→Defined Length and Width
→Defined nodes along x and y
→Defined dx and dy based on nodes and Dimension
→Created X and Y Vectors with the geometric distance of each node
b. Defining Boundary Condition and Initial Surface Temperature
→Defined each node of Surface to be at 500 K
→Defined Top, Bottom, Left, and Right Nodes at a Certain Temperature and the Corners as the average of adjacent nodes.
c. Variables for Iteration
→Defined Set the tolerance for the Temperature change to be 10−5
→Defined initial error = 1
→Defined iteration counter and set value = 0
d. Method Selection
→Defined a Variable "Method" whose value is used to select the method for iteration
1 - Jacobi Method, 2 - Gauss-Siedel, and 3 - S.O.R. with Gauss-Siedel(ω=1.95)
ii. Section 2(Computation)
a. Using Jacobi
→ Checked if Method Selected is Jacobi using the "Method" Variable
→ displayed that the iteration in use is Jacobi
→ Created a While loop with condition that the loop terminates after (error for Temperature < Tolerance of Temperature)
→ Applied Jacobi Iteration on each Node for Value of Temperature based on the derived formula.
→ Updated Value of error of Temperature that is maximum error Node calculated from Tnew−Told
b. Using Gauss-Siedel
→ Checked if Method Selected is Gauss-Siedel using the "Method" Variable
→ displayed that the iteration in use is Gauss-Siedel
→ Created a While loop with condition that the loop terminates after (error for Temperature < Tolerance of Temperature)
→ Applied Gauss-Siedel Iteration on each Node for Value of Temperature based on the derived formula.
→ Updated Value of error of Temperature that is maximum error Node calculated from Tnew−Told
c. Using S.O.R. using Gauss-Siedel
→ Checked if Method Selected is S.O.R. using Gauss-Siedel using the "Method" Variable
→ displayed that the iteration in use is S.O.R. using Gauss-Siedel
→ Created a While loop with condition that the loop terminates after (error for Temperature < Tolerance of Temperature)
→ Applied S.O.R. using Gauss-Siedel Iteration on each Node for Value of Temperature based on the derived formula.
→ Updated Value of error of Temperature that is maximum error Node calculated from Tnew−Told
iii. Section 3(OUTPUT and Plotting)
→ displaying the Total number of iterations
→ Displaying the latest updated error
→ Plotted the Graph of Temperature Distribution
B. 2D UnSteady-State Heat Conduction: -
i. Section 1(Defining Variables)
a. Defining Geometry of Surface
→Defined Length and Width
→Defined nodes along x and y
→Defined dx and dy based on nodes and Dimension
→Created X and Y Vectors with the geometric distance of each node
b. Defining Boundary Condition and Initial Surface Temperature
→Defined each node of Surface to be at 500 K
→Defined Top, Bottom, Left, and Right Nodes at a Certain Temperature and the Corners as the average of adjacent nodes.
c. Variables for Iteration
→Defined Set the tolerance for the Temperature change to be 10−4
→Defined initial error = 1
→Defined iteration counter and set value = 0
d. Time Step Variable
→Defined value of CFL = 0.9
→Defined α=1.2
→Calculated dt
→Defined k1, k2 and k3
→Defined total time Step and a Vector to define each time step
e. Method Selection
→Defined a Variable "Method" whose value is used to select the method for iteration
1 - Jacobi Method, 2 - Gauss-Siedel, and 3 - S.O.R. with Gauss-Siedel(ω=1.44)
ii. Section 2(Computation)
a. Time Marching Loop
→ Defined a for loop from 1 to total time steps
→ Recorded current value of T in Tt Matrix
→ Created a While Loop based on error value and Tolerance Value
→ Selected Each node and based on the value of "Method" Selected each iteration and applied formula based on derivation.
→ Within each time Step Plotted the Change in temperature
→ Placed a Break Command which is based on Tolerance of Temperature and breaks the loop when Stability is Reached.
iii. Section 3(OUTPUT)
→ Displayed The Type of Iteration under use
→ Displayed the Total number of Iterations and Total Time taken to reach Stability.
6. Code: -
A. 2D Steady-State Heat Conduction: -
% 2D Steady State Heat Conduction using Iterative Methods
clear all
close all
clc
%% Defining Variables
% Geometry of Surface
L = 1;
W = 1;
Node_x = 51;
Node_y = 51;
dx = L/(Node_x-1);
dy = W/(Node_y-1);
X = [0:dx:L];
Y = [0:dy:W];
% Boundary Conditions and Initial Surface Temperature
T = 500*ones(Node_x,Node_y);
T_top = 600;
T_bottom = 900;
T_left = 400;
T_right = 800;
T(2:(Node_x -1),Node_y) = T_top;
T(2:(Node_x - 1),1) = T_bottom;
T(1,2:(Node_y - 1)) = T_left;
T(Node_x,2:(Node_y -1)) = T_right;
T(1,1) = 0.5*(T(1,2)+T(2,1));
T(Node_x,Node_y) = 0.5*(T(Node_x,(Node_y-1))+T((Node_x-1),Node_y));
T(Node_x,1) = 0.5*(T(Node_x,2)+T((Node_x-1),1));
T(1,Node_y) = 0.5*(T(1,(Node_y-1))+T(2,Node_y));
% Variables for Iterations
Tol_T = 1e-5;
err_T = 1;
iter = 0;
% Method Selection
% 1 - Jacobi,
% 2 - Gauss-Siedel
% 3 - S.O.R. with Gauss-Siedel
Method = 2;
%% Computation
% Using Jacobi
if Method == 1
disp('Iteration Method in Use is Jacobi')
while (err_T > Tol_T)
iter = iter+1;
T_old = T;
for i = 2:(Node_x - 1)
for j = 2:(Node_y - 1)
T(i,j) = 0.25*(T_old(i+1,j) + T_old(i-1,j) + T_old(i,j+1) + T_old(i,j-1));
end
end
err_T = max(abs(T - T_old),[],'all');
end
end
% Using Gauss-Siedel
if Method == 2
disp('Iteration Method in Use is Gauss-Siedel')
while (err_T > Tol_T)
iter = iter+1;
T_old = T;
for i = 2:(Node_x - 1)
for j = 2:(Node_y - 1)
T(i,j) = 0.25*(T(i+1,j) + T(i-1,j) + T(i,j+1) + T(i,j-1));
end
end
err_T = max(abs(T - T_old),[],'all');
end
end
% Using S.O.R. and Gauss-Siedel
if Method == 3
disp('Iteration Method in Use is S.O.R.')
omega_val = 1.95;
disp(['Value of Omega = ',num2str(omega_val)])
while (err_T > Tol_T)
iter = iter+1;
T_old = T;
for i = 2:(Node_x - 1)
for j = 2:(Node_y - 1)
T(i,j) = T(i,j)*(1-omega_val) + (omega_val)*0.25*(T(i+1,j) + T(i-1,j) + T(i,j+1) + T(i,j-1));
end
end
err_T = max(abs(T - T_old),[],'all');
end
end
%% OUTPUT and Plotting
disp(['Total Iteration = ',num2str(iter)])
disp(['Error = ',num2str(err_T)])
colormap(jet);
contourf(X,Y,T');
colorbar
title('Temperature Distribution','FontSize',16)
xlabel('Length of Surface(m)','Color',[0.15 0.5 0.5],'FontSize',14)
ylabel('Width of Surface(m)','Color',[0.15 0.5 0.5],'FontSize',14)
B. 2D UnSteady-State Heat Conduction: -
% 2D Un-Steady State Heat Conduction using Iterative Methods
clear all
close all
clc
%% Defining Variables
% Geometry of Surface
L = 1;
W = 1;
Node_x = 51;
Node_y = 51;
dx = L/(Node_x-1);
dy = W/(Node_y-1);
X = [0:dx:L];
Y = [0:dy:W];
% Boundary Conditions and Initial Guess
T = 500*ones(Node_x,Node_y);
T_top = 600;
T_bottom = 900;
T_left = 400;
T_right = 800;
T(2:(Node_x -1),Node_y) = T_top;
T(2:(Node_x - 1),1) = T_bottom;
T(1,2:(Node_y - 1)) = T_left;
T(Node_x,2:(Node_y -1)) = T_right;
T(1,1) = 0.5*(T(1,2)+T(2,1));
T(Node_x,Node_y) = 0.5*(T(Node_x,(Node_y-1))+T((Node_x-1),Node_y));
T(Node_x,1) = 0.5*(T(Node_x,2)+T((Node_x-1),1));
T(1,Node_y) = 0.5*(T(1,(Node_y-1))+T(2,Node_y));
% Variables for Iterations
Tol_T = 1e-4;
err_T = 1;
iter = 0;
% Time Step Variables
CFL = 0.9;
alp = 1.2;
dt = CFL*(dx^2)/alp;
k1 = CFL;
k2 = CFL;
k3 = 1 + 2*k1 + 2*k2;
t_steps = 1500;
total_t = [0:dt:(t_steps*dt)];
% Method Selection
% 1 - Jacobi,
% 2 - Gauss-Siedel
% 3 - S.O.R. with Gauss-Siedel
Method = 3;
omega_val = 1.44;
%% Computation
% Time Marching Loop
for t_count = 1:t_steps
T_t = T;
% Iteration using Gauss-Siedel
err_T = 1;
while (err_T > Tol_T)
iter = iter+1;
T_old = T;
for i = 2:(Node_x - 1)
for j = 2:(Node_y - 1)
if Method == 1
T(i,j) = (T_t(i,j) + k1*(T_old(i+1,j) + T_old(i-1,j) + T_old(i,j+1) + T_old(i,j-1)))/k3;
end
if Method == 2
T(i,j) = (T_t(i,j) + k1*(T(i+1,j) + T(i-1,j) + T(i,j+1) + T(i,j-1)))/k3;
end
if Method == 3
T(i,j) = T(i,j)*(1 - omega_val) + (omega_val)*(T_t(i,j) + k1*(T(i+1,j) + T(i-1,j) + T(i,j+1) + T(i,j-1)))/k3;
end
end
end
err_T = max(abs(T - T_old),[],'all');
end
% Plotting after each Iteration
colormap(jet);
contourf(X,Y,T');
colorbar
title(['Temperature Distribution at time = ',num2str(total_t(t_count)),'sec'],'FontSize',12)
xlabel('Length of Surface(m)','Color',[0.15 0.5 0.5],'FontSize',14)
ylabel('Width of Surface(m)','Color',[0.15 0.5 0.5],'FontSize',14)
pause(0.05)
err_T_t = max(abs(T - T_t),[],'all');
% Breaking Time Marching if Change become less than Tolerance
if err_T_t < Tol_T
break
end
end
%% OUTPUTS
if Method == 1
disp('The Iteration method in use was Jacobi')
end
if Method == 2
disp('The Iteration method in use was Gauss-Siedel')
end
if Method == 3
disp('The Iteration method in use was S.O.R. with Gauss-Siedel')
disp(['Value of Omega for S.O.R. = ',num2str(omega_val)])
end
disp(['Total Iteration = ',num2str(iter)])
disp(['Total Time for reaching Stability = ',num2str(total_t(t_count)),'sec'])
7. OUTPUTS and Plots Generated: -
A. 2D Steady-State Heat Conduction: -
i. Plot Generated: -
B. 2D UnSteady-State Heat Conduction: -
i. Initial Temperature Distribution
ii. Final Temperature Distribution
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Week 10 - Heat Transfer Analysis on BTMS for 4X2 Battery Set using Ansys
AIM:- A. To Perform a Heat Transfer Analysis on A battery set by Inlet Velocities and Gap Between the Batteries. B. The Explain the Relevant Results Generated by the Analysis. Given:- A. The Battery Set Geometry: - The Following are the Parameters for the Battery Set: - i. The…
05 Nov 2022 03:19 PM IST
Week 9 - Parametric study on Gate valve.
AIM: - A. To Perform Simulation on the Gate Valve by Setting the Opening from 10% to 80% B. To Calculate the Mass Flow rate and the Flow Factor for each Case Given: - A. The Given CAD Models of Gate Valves: - …
31 Oct 2022 12:05 PM IST
Week 8 - Simulating Cyclone separator with Discrete Phase Modelling
AIM: - A. To Perform the Analysis of the Given Cyclone separator for different particle sizes and different inlet speeds. B. To Explain the relevant theories and to explain the generated results Given and Assumed: - A. The Geometry of the Given CAD Model: - B. Material and their Properties:…
30 Oct 2022 07:43 AM IST
Week 6 - CHT Analysis on a Graphics card
Problem Statement: - Perform a Steady State CHT analysis on the Given Graphic Card Model for 3 inlet Velocities 1 m/sec, 3 m/sec, and 5 m/sec for Course and Fine Mesh. Create an appropriate Mesh, define appropriate Materials for each Component and Perform a mesh-independent Study. Expected Results: - 1. Explain…
23 Oct 2022 08:49 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.