All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM: To solve the 2D heat conduction equation for steady and unsteady state by using the point iterative technique to using method of t Jacobi, gauss seidel, and successive over-relaxation for both implicit and explict method. Explanation: Heat Conduction: Heat conduction is the flow of thermal energy…
JAYA PRAKASH
updated on 02 Sep 2022
clear all
close all
clc
n = 10;
x = linspace(0,1,n);
y = linspace(0,1,n);
dx = x(2) - x(1);
dy = dx;
nt = 1000;
dt = 0.02;
a = 1200;
k1 = (a*dt)/(dx^2);
k2 = (a*dt)/(dy^2);
CFL = k1+k2;
T = 300*ones(n,n);
T(1,:) = 600; % Top Boundary Temp. in Kelvin
T(end,:) = 900; % Bottom Boundary Temp. in Kelvin
T(:,1) = 400; % Left Boundary Temp. in Kelvin
T(:,end) = 800; % Right Boundary Temp. in Kelvin
T(1,1) = 500; % Top - Left corner Temp. in Kelvin
T(1,end) = 700; % Top - Right corner Temp. in Kelvin
T(end,1) = 650; % Bottom - Left corner Temp. in Kelvin
T(end,end) = 850; % Bottom - Right corner Temp. in Kelvin
jacobi_iter = 0;
jacobi_error = 9e9;
tol = 1e-4;
Told = T;
T_previous = Told;
term1 = (1+2*k1+2*k2)^(-1);
term2 = (k1*term1);
term3 = (k2*term1);
tic
for k = 1:nt
while jacobi_error > tol
for i = 2:(n-1)
for j = 2:(n-1)
H = Told(i-1,j)+Told(i+1,j);
V = Told(i,j-1)+Told(i,j+1);
T(i,j) = (T_previous(i,j)*term1)+(H*term2)+(V*term3);
end
end
jacobi_iter = jacobi_iter + 1;
jacobi_error = max(max(abs(Told-T)));
Told = T;
time_jc = toc;
end
T_previous = T;
end
figure(1)
contourf(x,y,T,'Showtext','on')
colormap(jet)
colorbar
xlabel('X Axis')
ylabel('Y Axis')
title(['Unsteady state Implicit Jacobi = ' num2str( jacobi_iter) ' Iteration'])
clear all
close all
clc
n = 10;
x = linspace(0,1,n);
y = linspace(0,1,n);
dx = x(2) - x(1);
dy = dx;
nt = 1000;
dt = 0.02;
a = 1200;
k1 = (a*dt)/(dx^2);
k2 = (a*dt)/(dy^2);
CFL = k1+k2;
T = 300*ones(n,n);
T(1,:) = 600; % Top Boundary Temp. in Kelvin
T(end,:) = 900; % Bottom Boundary Temp. in Kelvin
T(:,1) = 400; % Left Boundary Temp. in Kelvin
T(:,end) = 800; % Right Boundary Temp. in Kelvin
T(1,1) = 500; % Top - Left corner Temp. in Kelvin
T(1,end) = 700; % Top - Right corner Temp. in Kelvin
T(end,1) = 650; % Bottom - Left corner Temp. in Kelvin
T(end,end) = 850; % Bottom - Right corner Temp. in Kelvin
gauss_iter = 0;
gauss_error = 9e9;
tol = 1e-4;
Told = T;
T_previous = Told;
term1 = (1+2*k1+2*k2)^(-1);
term2 = (k1*term1);
term3 = (k2*term1);
tic
for k = 1:nt
while gauss_error > tol
for i = 2:(n-1)
for j = 2:(n-1)
H = T(i-1,j)+T(i+1,j);
V = T(i,j-1)+T(i,j+1);
T(i,j) = (T_previous(i,j)*term1)+(H*term2)+(V*term3);
end
end
gauss_iter = gauss_iter + 1;
gauss_error = max(max(abs(Told-T)));
Told = T;
time_gs = toc;
end
T_previous = Told;
end
figure(1)
contourf(x,y,T,'Showtext','on')
colormap(jet)
colorbar
xlabel('X Axis')
ylabel('Y Axis')
title(['UNSTEADY STATE IMPLICIT GAUSS SEIDEL = ' num2str( gauss_iter) ' Iteration'])
clear all
close all
clc
n = 10;
x = linspace(0,1,n);
y = linspace(0,1,n);
dx = x(2) - x(1);
dy = dx;
nt = 1000;
dt = 0.02;
a = 1200;
k1 = (a*dt)/(dx^2);
k2 = (a*dt)/(dy^2);
CFL = k1+k2;
T = 300*ones(n,n);
T(1,:) = 600; % Top Boundary Temp. in Kelvin
T(end,:) = 900; % Bottom Boundary Temp. in Kelvin
T(:,1) = 400; % Left Boundary Temp. in Kelvin
T(:,end) = 800; % Right Boundary Temp. in Kelvin
T(1,1) = 500; % Top - Left corner Temp. in Kelvin
T(1,end) = 700; % Top - Right corner Temp. in Kelvin
T(end,1) = 650; % Bottom - Left corner Temp. in Kelvin
T(end,end) = 850; % Bottom - Right corner Temp. in Kelvin
SOR_iter = 0;
SOR_error = 9e9;
tol = 1e-4;
Told = T;
T_previous = Told;
term1 = (1+2*k1+2*k2)^(-1);
term2 = (k1*term1);
term3 = (k2*term1);
w = 2/(1+sin(pi*dx)); % Relaxation parameter for SOR Method
%w = 1.2;
%%
tic
for k = 1:nt
while SOR_error > tol
for i = 2:(n-1)
for j = 2:(n-1)
H = T(i-1,j)+T(i+1,j);
V = T(i,j-1)+T(i,j+1);
T(i,j) = w*((T_previous(i,j)*term1)+(H*term2)+(V*term3)) - (w-1)*T(i,j);
end
end
SOR_iter = SOR_iter + 1;
SOR_error = max(max(abs(Told-T)));
Told = T;
time_sor = toc;
end
T_previous = T;
end
figure(1)
contourf(x,y,T,'Showtext','on')
colormap(jet)
colorbar
xlabel('X Axis')
ylabel('Y Axis')
title(['UNSTEADY STATE FOR IMPLICIT SOR = ' num2str( SOR_iter) ' Iteration'])
Unsteady state implicit SOR:
EXPLANATION:
Here, We find the Iteration and errors from the each results
Sr. No. |
Method |
Iterations |
Errors |
1. |
Steady State (Jacobi) |
207 |
9.48e-05 |
2. |
Steady State (Gauss-Seidel) |
111 |
9.586e-05 |
3. |
Steady State (SOR) |
29 |
8.57e-05 |
4. |
Unsteady state Explicit |
- |
0 |
5. |
Unsteady state Implicit (Jacobi) |
206 |
9.83e-05 |
6. |
Unsteady state Implicit (Gauss-Seidel) |
111 |
9.32e-05 |
7. |
Unsteady state Implicit (SOR) |
29 |
7.71e-05
|
CONCLUSION:
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 - Simulating Combustion of Natural Gas.
Simulating Combustion of Natural Gas Aim: To Perform a combustion simulation on the combustor model and plot the variation…
17 Jan 2023 06:37 PM IST
Week 9 - Parametric study on Gate valve.
Gate Valve Parametric Study Objectives To perform the parametric study on the gate valve by simulating the opening of gate valve ranging from 10mm to 80mm. To obtain the mass flow rate for each design point. Calculate the flow factor and…
16 Dec 2022 07:47 PM IST
Week 6 - CHT Analysis on a Graphics card
AIM: To perform steady-state conjugate heat transfer analysis on Graphics Card. To find the effect of different velocities on the temperature. Objectives: Run the simulation by varying the velocity from 1m/sec to 5m/sec for at least 3 velocities and discuss the results. Find out the maximum temperature…
03 Nov 2022 09:12 AM IST
Week 5 - Rayleigh Taylor Instability
Aim - To conduct the Rayleigh Taylor CFD simulation. OBJECTIVE: What are some practical CFD models that have been based on the mathematical analysis of Rayleigh Taylor waves? In your own words, explain how these mathematical models have been adapted for CFD calculations. Perform the Rayleigh Taylor…
26 Oct 2022 05:35 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.