You are on page 1of 26

Contents

1. Introduction:.................................................................................................................................. 3
2. The Constitutive Equation of the Problem: ................................................................................ 3
3. Explicit Finite Difference Form of the Constitutive Equation: ................................................. 5
4. The Initial Boundary Condition Implemented: ......................................................................... 9
5. Code with Explanation: .............................................................................................................. 10
6. Validation of Code: ..................................................................................................................... 15
7. Sensitivity Analysis of a Code: ................................................................................................... 20
8. Main Model Limitation: ............................................................................................................. 23
9. Conclusion: .................................................................................................................................. 24
10. References:............................................................................................................................... 25
11. Appendix:................................................................................................................................. 26
1. Introduction:

The aim of this project is to find the temperature distribution across a 2D square aluminium
plate numerically and need to compare the solution with analytically derived solution. So this
report splits the aim into several chapters to reach the final solution. Chapter-1 is introduction
which consists of the overall picture of this report. Chapter-2 is the constitutive equation of the
problem, which consists the background study of the problem statement and also includes the
governing equation of problem. Chapter-3 carries the information of the methods to solve
governing equation which includes discretization techniques and its derivation. Also applied
those discretized equation in governing unsteady state heat conduction equation and derived
the stability criteria. In chapter-3 we explained the initial and boundary condition and its
implementation techniques. Chapter-4 consists a matlab code and its explanation for the
analytical and numerical solution and post processing the solution to find the error and plotting
graph, temperature map etc. Chapter-5 is a validation of the code, which consists the results of
the simulation by plotting graphs and temperature maps. Given a detailed explanation of those
results. Chapter-6 is a code sensitive analysis, so we ran the code for different criteria and
analysed the behaviour of the code and its output result to model and find the optimum run
procedure which occupies less memory and more accurate solution. Chapter-7 consists a
limitation involved in theory and code, Because we used approximation theory to discretize the
differential equation and there must be error involved in the process of discretization. So with
the help of chapter-7 we analysed limitations of code as well as theory. Chapter-9 concluded
this report, followed by in chapter10 and 11 is for references and appendix.

2. The Constitutive Equation of the Problem:

Conduction is a process where heat transfer takes place with the help of collision between
atoms/molecules. Thermal conductivity of solid is higher than liquids due to molecules in
solids are close to each other so the rate of collision will be higher in solids. It makes higher
thermal conductivity of solids. Predicting temperature distribution across the material is very
important, because it helps to identify the rate of heat transfer across the system. So that we
will be able to predict the thermal loss or heat gain of the system. In some of the system like
thermal flask or heat exchangers we don’t want any heat to loss to atmosphere, so we use
insulation and by knowing the temperature distribution it helps us to design insulation material
and thickness and also heat loss after implemented insulation. Electronic devices like laptop,
mobile phones which generates heat and with the help of convective exhaust we will be able
to maintain the safe temperature. So if we are able to model the temperature distribution across
the laptops/mobile phones we will be able to predict whether we need any exhaust system or
not. Because some parts in those equipment damages if it reaches particular temperature, based
on heat modelling we can prove that the system will never reach those temperature then we no
need to spend separate economy for those problem. Fourier law of conduction helps to find the
rate of heat transfer across a system, the heat transfer rate is directly proportional to the
temperature gradient which drives the heat to transfer from high temperature to low
temperature. The reciprocal of the constant involved in Fourier law is considered as the
resistance to heat flow. Consider a 1D heat transfer across a slab of thickness dx, the resistance
is dx/k where k is the thermal conductivity of the slab. In case of a cylindrical geometry, the
resistance will be a function of ln(r). So based on the geometry the heat transfer rate also varies.
Another interesting fact about conduction is that, every convective heat transfer is governed by
conduction heat transfer. Consider a hot fluid flow on the cold surface, then due to flow the
heat transfer happens due to convection, but when we go near the surface the velocity of the
fluid layer is zero. Across the layer the heat transfer occurs due to conduction, and the layer
thickness reduces when the convective momentum flow increases which further reduces the
conduction resistance thickness.

The three dimensional unsteady state heat conduction term is represented as,

1 𝜕𝑇
∇2 𝑇 =
𝛼 𝜕𝑡

𝜕 2 𝑇 𝜕 2 𝑇 𝜕 2 𝑇 1 𝜕𝑇
+ + = … … … . . (1)
𝜕𝑥 2 𝜕𝑦 2 𝜕𝑦 2 𝛼 𝜕𝑡

Where

𝜕2 𝜕2
• ∇2 is the Laplacian, for a 2D surface ∇2 = +
𝜕𝑥 2 𝜕𝑦 2

• t is time

• T is the temperature

• 𝛼 = 𝑘⁄(𝜌. 𝑐) is the thermal diffusivity [m2.s-1]

• k is the thermal conductivity [W.m-1.K-1]

• 𝜌 the density [kg.m-3]


• 𝑐 the specific heat [J.kg-1.K-1].

The aim of this project is to find the temperature distribution across a 2D square aluminium
plate by using Explicit Finite Difference Method and need to compare with analytical solution
temperature distribution.

We have the analytical solution for equation(1) and it was published by Daileda R.C, 2012.

The following solution derived with the help of separation of variables and eigen value
problem.

∞ 2𝑛𝜋
450 sin ( 3 ) 𝑛𝜋𝑥 𝑛𝜋𝑦
𝑇(𝑥, 𝑦) = 2 ∑ ( 2 . sin ( ) . sinh ( ))
𝜋 𝑛 . sinh(𝑛𝜋) 6 6
𝑛=1

In our simulation we also calculated T(x,y) at every step which we used in numerical method
and compared both the values. The above solution neglected n=0 because the value of
temperature will be 0 at n=0 because of the sin function.

3. Explicit Finite Difference Form of the Constitutive Equation:

First Order:

Forward Finite Difference Method:

Taylor series of f(x) near ‘a’ is,

𝑓 ′ (𝑎) 𝑓 ′′ (𝑎)
𝑓(𝑥) = 𝑓(𝑎) + (𝑥 − 𝑎) + (𝑥 − 𝑎)2 + … … ….
1! 2!

Substitute x=a+∆x,

𝑓 ′ (𝑎) 𝑓 ′′ (𝑎)
𝑓(𝑎 + ∆𝑥) = 𝑓(𝑎) + (𝑎 + ∆𝑥 − 𝑎) + (𝑎 + ∆𝑥 − 𝑎)2 + … … ….
1! 2!

𝑓 ′ (𝑎) 𝑓 ′′ (𝑎)
𝑓(𝑎 + ∆𝑥) = 𝑓(𝑎) + (∆𝑥) + (∆𝑥)2 + … … ….
1! 2!

(𝒇(𝒂 + ∆𝒙) − 𝒇(𝒂))


𝒇′ (𝒂) =
∆𝒙
Backward Finite Difference Method:

Substitute x=a-∆x in Taylor Series,

𝑓 ′ (𝑎) 𝑓 ′′ (𝑎)
𝑓(𝑎 − ∆𝑥) = 𝑓(𝑎) + (𝑎 − ∆𝑥 − 𝑎) + (𝑎 − ∆𝑥 − 𝑎)2 + … … ….
1! 2!

𝑓 ′ (𝑎) 𝑓 ′′ (𝑎)
𝑓(𝑎 − ∆𝑥) = 𝑓(𝑎) + (−∆𝑥) + (−∆𝑥)2 + … … ….
1! 2!

(𝒇(𝒂) − 𝒇(𝒂 − ∆𝒙))


𝒇′ (𝒂) =
∆𝒙

Central Finite Difference Method:

Add the result of first order finite difference(Forward+Backward),

(𝑓(𝑎 + ∆𝑥) − 𝑓(𝑎)) (𝑓(𝑎) − 𝑓(𝑎 − ∆𝑥))


𝑓 ′ (𝑎) + 𝑓 ′ (𝑎) = +
∆𝑥 ∆𝑥

(𝒇(𝒂 + ∆𝒙) − 𝒇(𝒂 − ∆𝒙))


𝒇′ (𝒂) =
𝟐∆𝒙

Second Order Central Difference:

(𝑓(𝑎 + ∆𝑥) − 𝑓(𝑎 − ∆𝑥)) 𝑓 ′′ (𝑎)


𝑓(𝑥) = 𝑓(𝑎) + (𝑥 − 𝑎) + (𝑥 − 𝑎)2 + … … ….
2∆𝑥 2!

Substitute x=a+∆x,

(𝑓(𝑎 + ∆𝑥) − 𝑓(𝑎 − ∆𝑥)) 𝑓 ′′ (𝑎)


𝑓(𝑎 + ∆𝑥) = 𝑓(𝑎) + (𝑎 + ∆𝑥 − 𝑎) + (𝑎 + ∆𝑥 − 𝑎)2 + … … ….
2∆𝑥 2!

𝑓 ′′ (𝑎)
(∆𝑥)2 = (𝑓(𝑎 + ∆𝑥) − 𝑓(𝑎))2 − (𝑓(𝑎 + ∆𝑥) − 𝑓(𝑎 − ∆𝑥)).
2!

𝒇(𝒂 + ∆𝒙) − 𝟐𝒇(𝒂) + 𝒇(𝒂 − ∆𝒙)


𝒇′′ (𝒂) =
(∆𝒙)𝟐
Figure 1:Grids in a square plate(6m×6m)

Fig.1 represents the grids in a square plate of 6m×6m dimension. Each grid in horizontal
direction mentioned by ‘j’ and in vertical direction mentioned as ‘i’. Each timestep we have to
use different mesh like above and it will be represented by ‘k’. Grid spacing in horizontal
direction is represented as ∆x and vertical direction as ∆y and timestep is ∆t.

Finite difference expansion of terms present in heat conduction equation.

𝜕 2 𝑇 𝜕 2 𝑇 1 𝜕𝑇
+ =
𝜕𝑥 2 𝜕𝑦 2 𝛼 𝜕𝑡

𝜕 2 𝑇 𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘)


=
𝜕𝑥 2 ∆𝑥 2

𝜕 2 𝑇 𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘)


=
𝜕𝑦 2 ∆𝑦 2

𝜕𝑇 𝑇(𝑖, 𝑗, 𝑘 + 1) − 𝑇(𝑖, 𝑗, 𝑘)
=
𝜕𝑡 ∆𝑡

Apply all the discretized terms in conduction equation gives,

𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘) 𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘) 1 𝑇(𝑖, 𝑗, 𝑘 + 1) − 𝑇(𝑖, 𝑗, 𝑘)


+ =
∆𝑥 2 ∆𝑦 2 𝛼 ∆𝑡
𝛼∆𝑡
𝑻(𝑖, 𝑗, 𝑘 + 1) = [𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘)]
∆𝑥 2
𝛼∆𝑡
+ [𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘)] + 𝑇(𝑖, 𝑗, 𝑘)
∆𝑦 2

Consider the step size in both the spatial direction is same,

∆𝑥 = ∆𝑦 = ℎ

𝛼∆𝑡
𝑇(𝑖, 𝑗, 𝑘 + 1) = [𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘)]
ℎ2
𝛼∆𝑡
+ [𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘)] + 𝑇(𝑖, 𝑗, 𝑘)
ℎ2

𝑇(𝑖, 𝑗, 𝑘 + 1) = 𝐹0 [𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘)]

+ 𝐹0 [𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘)] + 𝑇(𝑖, 𝑗, 𝑘)

Where, F0=α∆t/h2 and rearranging the above equation gives

1
𝑇(𝑖, 𝑗, 𝑘 + 1) = 𝐹0 [𝑇(𝑖 − 1, 𝑗, 𝑘) − 2𝑇(𝑖, 𝑗, 𝑘) + 𝑇(𝑖 + 1, 𝑗, 𝑘) + 𝑇(𝑖, 𝑗 − 1, 𝑘) − 2𝑇(𝑖, 𝑗𝑘) + 𝑇(𝑖, 𝑗 + 1, 𝑘) + 𝑇(𝑖, 𝑗, 𝑘)]
𝐹0

𝟏
𝑻(𝒊, 𝒋, 𝒌 + 𝟏) = 𝑭𝟎 [𝑻(𝒊 − 𝟏, 𝒋, 𝒌) + 𝑻(𝒊 + 𝟏, 𝒋, 𝒌) + 𝑻(𝒊, 𝒋 − 𝟏, 𝒌) + 𝑻(𝒊, 𝒋 + 𝟏, 𝒌) + ( − 𝟒) 𝑻(𝒊, 𝒋, 𝒌)]
𝑭𝟎

Stability criteria:

1
( − 4) ≥ 0
𝐹0

𝐹0 ≤ 4

𝐹0 > 0

𝟎 > 𝑭𝟎 ≤ 𝟒

𝛼∆𝑡
0> ≤4
ℎ2

ℎ2
0 > ∆𝑡 ≤ 4
𝛼
α is a thermal diffusivity which is fixed, and to choose h we have select a value which should
less than the plate dimension as well as by multiplying with number of grid points to gives the
actual dimension, in this simulation we gave a preference value between 0.05-0.2 m. To find
timestep ∆t, we have to use the above stability criteria.

4. The Initial Boundary Condition Implemented:

Initial Condition:

𝑻(𝒙, 𝒚, 𝟎) = 𝟎; 0<𝑥 < 6&0< 𝑦 <6

Initial condition represents at time t=0, the temperature across x and y at all location considered
to be zero. The constraints are x greater than 0 and less than 6, y greater than 0 and less than 6.

Boundary Conditions:

x-direction

𝑻(𝟎, 𝒚, 𝒕) = 𝟎
} 0≤ 𝑦 ≤ 6&0≤ 𝑡
𝑻(𝟔, 𝒚, 𝒕) = 𝟎
≤ 𝑡ℎ𝑒𝑟𝑚𝑎𝑙 𝑒𝑞𝑢𝑖𝑙𝑖𝑏𝑟𝑖𝑢𝑚

Boundary condition in x direction represents at x=0 & 6, and y varies from 0 to 6 and at any
time t, the temperature is 0.

y-direction

𝑻(𝒙, 𝟎, 𝒕) = 𝒇(𝒙)
} 0 ≤ 𝑥 ≤ 6 & 0 ≤ 𝑡 ≤ 𝑡ℎ𝑒𝑟𝑚𝑎𝑙 𝑒𝑞𝑢𝑖𝑙𝑖𝑏𝑟𝑖𝑢𝑚
𝑻(𝒙, 𝟔, 𝒕) = 𝟎

Where,

𝟏𝟐. 𝟓𝒙 0≤𝑥≤4
𝒇(𝒙) = {
−𝟐𝟓𝒙 + 𝟏𝟓𝟎 4<𝑥≤6

Boundary condition in y direction represents at y=0, and x varies from 0 to 6 and at any time t,
the temperature is f(x). f(x) is 12.5x when x is less greater or equal to 0 and less than 4, f(x) is
-25x+150 when x is greater than 4 and less than or equal to 6. At y=6, and x varies from 0 to 6
and at any time t, the temperature is 0.

The above conditions with equation will be solved and compared both by numerically and
analytically.
5. Code with Explanation:

clear all;
%Defining grid dimensions dx and dy
dx=100;
while dx<=0||dx>6
dx=input("Give grid spacing for dx, Length of the plate is 6(Preferably
give between 0.05-0.2)");
end
%Nx and Ny represents number of nodal points in x and y direction
respectively
Nx=6/dx;
Nhx=4/dx;
dy=dx;
Ny=6/dy;
%Defining properties of aluminium
%Density
rho=2.8*10^3;
%Heat capacity
cp=795;
%Thermal conductivity
cond=143;
%Thermal diffusivity reciprocal
C=rho*cp/cond;
%Stability criteria and finding dt
timechange=dx^2*C;
%timech_norm represents the maximum choose-able dt
timech_norm=timechange*0.25;
%Asking dt from user
dt=timech_norm+100;
while dt<=0||dt>=timech_norm
dt=input(sprintf('Give grid spacing for dt and the value should be less
than %d and greater than 0:',timech_norm));
end

%Initial condition
for i=2:1:Nx
for j=2:1:Ny
T(i,j,1)=0;
end
end
k=0;
check=1;
%Temperature simulation from time 0 to equilibrium
%While loop will run until the value of ‘check’ will be greater than 4
while check<=4
k=k+1;
%Boundary condition x direction
for i=1:1:(Ny+1)
T(i,1,k)=0;
T(i,Ny+1,k)=0;
end
%Boundary condition y direction
for j=1:1:(Nhx+1)
T(1,j,k)=12.5*dx*(j-1);
T(Nx+1,j,k)=0;
end

for j=Nhx+2:1:(Nx+1)
T(1,j,k)=-25*dx*(j-1)+150;
T(Nx+1,j,k)=0;
end

%Temperature calculation in all nodes


%With the help of discritized equation this loop will calculate the
temperature
for i=2:1:Nx
for j=2:1:Ny
T(i,j,(k+1))=T(i,j,k)+dt/(C*dx^2)*(T(i-1,j,k)-
2*T(i,j,k)+T(i+1,j,k))+dt/(C*dy^2)*(T(i,j-1,k)-2*T(i,j,k)+T(i,j+1,k));
end
end
%Tolerance to break the loop to reach equilibrium
%Once the ‘eps’ value will be less than 0.000001 then the check exceeds
4 then the while loop breaks
if k>5
eps=T(:,:,k)-T(:,:,k-1);
if all(eps<0.000001)
check=6;
else
check=1;
end
else
end
end
%Equilibrium time calculation and printing in output
%For every while loop step the value of ‘k’ added by 1 which finally
multiplied with timestep gives the overall time or equilibrium time
Eq_time=k*dt;
fprintf("Time=%d sec\n",Eq_time);
%Numerical solution graph plotting
%plot xa vs T(:,:,k) represents plotting graph between x direction
temperature distribution at equilibrium time
xa=0:dx:6;
plot(xa,T(:,:,k));
titletext=sprintf('Numerical(h=%.2f m, dt=%d sec)',dx,dt);
%Labelling title, xaxis and yaxis for the graph
title(titletext);
xlabel('plate length(y-direction)');
ylabel('Temperature');
%Displaying the equilibrium time on graph with preferred location
noteText = {sprintf('Time=%d sec',Eq_time)};
noteX = 0.6; % X-coordinate of the note
noteY = 0.8; % Y-coordinate of the note
annotation('textbox', [noteX, noteY, 0.1, 0.1], 'String', noteText,
'FitBoxToText', 'on');
%Temperature Map
figure;
contourf(xa,xa,T(:,:,k));
colorbar;
title(titletext);
xlabel('plate length(x direction)');
ylabel('Plate length(y direction)');
noteText = {sprintf('Time=%d sec',Eq_time)};
noteX = 0.5; % X-coordinate of the note
noteY = 0.8; % Y-coordinate of the note
annotation('textbox', [noteX, noteY, 0.1, 0.1], 'String', noteText,
'FitBoxToText', 'on');

%Analytical solution starts


%Found the temperature at every nodal location by using Daileda.R.C
analytical solution
q=100;
for i=1:1:Nx+1
for j=1:1:Ny+1
Ta(i,j)=0;
for n=1:1:q

Ta(i,j)=sin(2*n*pi()/3)/(n^2*sinh(n*pi()))*sin(n*pi()*dx*(j-
1)/6)*sinh(n*pi()*dy*(i-1)/6)+Ta(i,j);
end
Ta(i,j)=Ta(i,j)*450/(pi()^2);
end
end

for i=1:1:Nx+1
Tane(i,:)=Ta(Nx+2-i,:);
end
%Analytical solution graph plotting
%New figure for analytical solution
figure;
%plot xa vs Ta represents plotting analytical solution graph between x
direction temperature distribution at equilibrium
plot(xa,Tane);
title('Analytical');
xlabel('plate length(y-direction)');
ylabel('Temperature');
%Temperature Map
figure;
contourf(xa,xa,Tane);
colorbar;
caxis([0,50]);
xlabel('plate length(x direction)');
ylabel('Plate length(y direction)');
title('Analytical');
q=100;
%Error calculation for the comparison between numerical and analytical
Tsub=Ta(:,:)-T(:,:,k);
for i=1:Nx+1
for j=1:Ny+1
Te(i,j)=(Tane(i,j)-T(i,j,k))/(Tane(i,j));
end
end
%summing up error in all the nodes and averaging to display as a average
error
sum=0;
for i=2:Nx
for j=2:Ny
sum=(abs(Te(i,j))+sum);
end
end
sum=sum*100/((Nx-1)*(Ny-1));
%Printing error percentage at the output
fprintf("Error percentage=%d",sum);

%Plotting graph in x direction


for i=1:1:Nx+1
for j=1:1:Ny+1
Ty(i,j,k)=T(j,i,k);
Tya(i,j)=Ta(j,i);
end
end

%Numerical x direction graph plot


figure;
ya=0:dx:6;
plot(ya,Ty(:,:,k));
titletext=sprintf('Numerical(h=%.2f m, dt=%d sec)',dy,dt);
title(titletext);
xlabel('plate length(x-direction)');
ylabel('Temperature');
noteText = {sprintf('Time=%d sec',Eq_time)};
noteX = 0.15; % X-coordinate of the note
noteY = 0.8; % Y-coordinate of the note
annotation('textbox', [noteX, noteY, 0.1, 0.1], 'String', noteText,
'FitBoxToText', 'on');
%Analytical x direction graph plot
figure;
plot(ya,Tya);
title('Analytical');
xlabel('plate length(x-direction)');
ylabel('Temperature');

6. Validation of Code:

Figure 2:Matlab simulaton output for this simulation

Figure 3:Numerical Soln Temp Map


Figure 4:Temperature Map for analytical soln

Figure 5:Relation between plant length(x-direction) vs temperature-Numerical-Equilibrium


Figure 6:Relation between plant length(x-direction) vs temperature-Analytical-Equilibrium

Figure 7:Relation between plant length(y-direction) vs temperature-Numerical-Equilibrium


Figure 8:Relation between plant length(y-direction) vs temperature-Analytical-Equilibrium

Fig.3 shows the temperature distribution of a square plate at equilibrium(numerical), the


maximum temperature showing at the boundary(x=4 and y=0). There are 10 curves/strips
propagates from maximum temperature curve with unequal width, this is due to the loss of
temperature gradient while moving away from source line(y=0). The width of the strip is
increasing when moving outwards from the maximum temperature strip. The formation of
curves/strips due to the boundary condition at y=0 is a function of x, so this distribution makes
the formation of curved strips. The maximum temperature in each curve is shifting towards left
side which is due to unequal distribution of temperature on both sides of the maximum
temperature point.

Fig.4 shows the temperature distribution of a square plate at equilibrium(analytical), the profile
looks similar to the numerical solution. Both graphs are perfectly matching.

Fig.5 shows the output window of our simulation. It initially ask the step size in x direction and
we should give value between 0.05-0.2 m.,I given 0.1 m. And it will ask for the timestep dt and
it will show the allowable range which calculated based on the stability analysis. The shown
allowable value should be less than 31.13 sec, I given 20. Then it will generate two graph(Fig.2
and Fig.3) and also it generated the simulation ending time. And the simulation ending time
follows the criteria that all the temperature values in spacial direction from previous to current
timestep should be less than 10-6. Also it shows the error% between numerical and analytical
solution. And the displayed error is 0.02996%.

Fig.6 shows the relation between plate length across x direction vs temperature at last timestep
based on numerical simulation. The given step size in x direction is 0.1 m, and the timestep is
20 sec. The simulated result at 258040 sec by following the tolerance criteria as the temperature
value from previous to current timestep should be less than 10-6. The graph shows different
layers of parabola with one triangle. The triangle shape line represents exactly at the wall(x,
y=0) and the line just below the triangle line represents 0.1 m away from the wall. So it shows
the temperature distribution across the plate. At the wall(x,y=0), the temperature is maximum
at 4th m. Once it moves away from the wall, the maximum temperature shifts towards x=3m.
The reason of shifting in negative direction because the triangle right slope(negative slope
modulus) is higher than left slope(positive slope modulus). So the temperature gradient is
higher in right part and the temperature gradient in lower in left part. To equate the effect,
maximum temperature shifting towards left when it moves along y-direction.

Fig.7 shows the graph of analytical solution. It matching with the numerical solution. We
plotted this graph similar way of fig.2 plotting by considering special coordinates step size is
0.1 m. And the error by comparing the numerical and analytical calculation is 0.02996%,
which displayed in the output of the simulation.

Fig.8 shows the relation between plate length across y direction vs temperature at equilibrium
based on numerical solution. The temperature is maximum at y=0 and minimum at y=6. The
graph looks like a family of exponential curve moving down and eventually become a straight
line.

Fig.9 shows the graph of analytical solution of all x curves in y direction. It matching with the
numerical solution. We plotted this graph similar way of fig.4 plotting by considering special
coordinates step size is 0.1 m.

∆x ∆y ∆t Tolerance Equil. Time Equil. Error


0.1 m 0.1 m 20 sec 10-6 258040 sec 0.02996%,

We have simulated the temperature across the square block of dimension 6m×6m and having
thermal diffusivity of 6.42×10-5 m2/s. We used Explicit Finite Difference Method for
simulation, and the simulated value matching with the analytical result with an error of
0.02996%. The given x and y direction grid spacing is 0.1 m, and time step is 20 sec. The
equilibrium reached at 258040 sec by following the tolerance criteria as the temperature value
from previous to current timestep should be less than 10-6. The temperature distribution of x in
y=0 is shown as a triangle in Fig.2 and 3. The downward parabolic profile keeps expanding its
axis while moving away from the wall in y direction and become zero by convert itself into a
horizontal straight line. Each parabolic line has a spacing 0.1 m in y direction. Also we analyzed
the temperature distribution in y direction. The graph looks like a family of exponential curve
moving down and eventually become a straight line. Also we compared the temperature map
between analytical and numerical solution, where the maximum temperature showing at the
boundary(x=4 and y=0). There are 10 curves/strips propagates from maximum temperature
curve with unequal width, this is due to the loss of temperature gradient while moving away
from source line(y=0). The maximum temperature in each curve is shifting towards left side
which is due to unequal distribution of temperature on both sides of the maximum temperature
point. The numerical solution based on Explicit finite difference method by combining with
Fourier number stability criteria perfectly works for unsteady 2D heat conduction problem.

7. Sensitivity Analysis of a Code:

Sensitivity analysis is performed to analyse the behavior of the code to the system, it helps to
find the suitable operating point of the code so that we will get a good result at optimum
memory usage. Here we have performed sensitivity analysis by varying,

(i) Timestep
(ii) Equilibrium tolerance
(iii) Step size

to find equilibrium time by keeping all other parameters constant.


h=0.5, tol=0.0001
250000

200000
y = 28186ln(x) + 43759
R² = 1
150000
Eq.time

100000

50000

0
0 100 200 300 400 500 600 700 800 900
timestep

Figure 9:Relation between timestep(s) vs eq.time(s)

h=1, dt=500
400000
350000
y = -28409ln(x) - 38700
300000
R² = 0.9998
250000
Eq.time

200000
150000
100000
50000
0
-0.02 0 0.02 0.04 0.06 0.08 0.1 0.12
tol

Figure 10:Relation between eq.tolerance vs eq.time


dt=150, tol=0.001
380000
370000 y = 10548x2 - 14024x + 318189
360000 R² = 0.9948

350000
Eq.time

340000
330000
320000
310000
300000
0 0.5 1 1.5 2 2.5 3 3.5
h

Figure 11:Relation between step size vs eq.time

Fig.9 shows the relation between timestep(x axis) vs equilibrium time(y axis), in which the
timestep varies from 25-800 sec and the computed equilibrium time varies from 134225-
232000 sec. The graph shows a logarithmic fit between x and y axis with a relation,
y=28186(ln(x))+43759 and R2=1. When the timestep increases, the time taken to reach
equilibrium also increases which is due to the convergence in each timestep reduces when we
increase timestep. So convergence in each timestep affects the overall equilibrium
convergence.

Fig.10 shows the relation between tolerance(x axis) vs equilibrium time(y axis), in which the
tolerance varies from 0.000001-0.1 and the computed equilibrium time varies from 355000-
29500 sec. The graph shows a logarithmic fit between x and y axis with a relation, y=-
28490(ln(x))-38700 and R2=0.9998. When the tolerance increases, the time taken to reach
equilibrium decreases because when tolerance increase which means we are stopping the
simulation at less convergence. So time takes for less convergence less than the time taken for
high convergence.

Fig.11 shows the relation between step size(x axis) vs equilibrium time(y axis), in which the
tolerance varies from 0.2-3m and the computed equilibrium time varies from 315000 to 370800
sec. The graph shows a quadratic fit between x and y axis with a relation, y=10548x2-
14024x+318189 and R2=0.9948. When the step increases, the time taken to reach equilibrium
decreases because when tolerance increase which is due to the convergence in each step reduces
when we increase stepsize. So convergence in each stepsize affects the overall equilibrium
convergence.

8. Main Model Limitation:

Limitation due to numerical method:

We have used first order forward finite difference method and second order finite difference
method approximation, the truncation error of both the method is of the order of h(timestep).
So with the help of numerical stability(Fourier number limitation) we handled those truncation
error. Also we increased the precision of decimal points and checked the equilibrium time for
different simulation, we didn’t find any variation in the final result which ensuring the round
off error not creating any problem. Geometry is not complex at all, because we used 2D square
plate, so it is easy to draw grids in the geometry and we used uniform structured geometry. But
problem came in the boundary condition at y=0, because f(x) is different when x<4 and x>=4.
So when we solving for different step size like 1.5m, it is difficult to apply boundary condition
on the uniform structured grids so we neglected the sensitivity analysis at 1.5 and 2.5m.

Limitation due to coding:

For comparing the analytical and numerical values, we used the following error calculation

𝑠𝑢𝑚 𝑜𝑓 𝑒𝑟𝑟𝑜𝑟𝑠 𝑖𝑛 𝑎𝑙𝑙 𝑛𝑜𝑑𝑒𝑠


𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝐸𝑟𝑟𝑜𝑟% = × 100
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑛𝑜𝑑𝑒𝑠

Average error will calculate the error in all nodal points and average those error by diving
number of considered nodes and the code we made which display the average error in output
window.
h=1, dt=500
100

Average Error% 80

60

40

20

0
-0.02 0 0.02 0.04 0.06 0.08 0.1 0.12
-20
Tolerance

Figure 12:Relation between tolerance vs average error%

Fig shows the relation between tolerance and average error%, by keeping less tolerance we will
be able to increase the solution accuracy. The tolerance varies from 0.1-10-6 and respectively
the average error computed as 92.64-0.03%. So based on the above graph we proves that the
numerical solution value will have a potential to match with analytical solution accurately.

Calculation of error in each node,

𝐴𝑛𝑎𝑙𝑦𝑡𝑖𝑐𝑎𝑙 𝑣𝑎𝑙𝑢𝑒 − 𝑁𝑢𝑚𝑒𝑟𝑖𝑐𝑎𝑙 𝑣𝑎𝑙𝑢𝑒


𝐸𝑟𝑟𝑜𝑟 =
𝐴𝑛𝑎𝑙𝑦𝑡𝑖𝑐𝑎𝑙 𝑣𝑎𝑙𝑢𝑒

Error in each node we calculated by finding the difference between analytical and numerical
value and divided by analytical value.

9. Conclusion:

To fulfil the project aim is to find the temperature distribution across a 2D square aluminium
plate by using Explicit Finite Difference Method. We considered a aluminium square plate of
dimension 6m×6m and having a thermal diffusivity of 6.42×10-5 m2/s, initially at t=0 we kept
one end of the y(y=0) having a temperature distribution in x-direction and remaining all points
temperature kept zero. During t>0, the heat starts diffusing throughout the material by
conduction alone. There is no external source/sink term and we allow the system to reach
equilibrium. For solving for a equilibrium we used numerical method analysis for solving heat
conduction equation in both x and y direction with respect to time. We adapted Explicit Finite
Difference Method for discretization and solved the discretized equation at all nodal points on
x, y and t. In this simulation we used nodal points ∆x=∆y and it will be in the range of 0.05m-
0.2m(suggested) but we can use any value between the plate dimension. Used Fourier number
as stability criteria followed for finding allowable timestep ∆t. Also calculated the analytical
solution of the same problem and the equation was published by Daileda R.C, 2012. In our
sample calculation, given x and y direction grid spacing is 0.1 m, and time step is 20 sec. The
equilibrium reached at 258040 sec by following the tolerance criteria as the temperature value
from previous to current timestep should be less than 10-6. The numerical results match with
the analytical solution with an error 0.02996%. The temperature distribution of x in y=0 is
shown as a triangle in Fig.5(Numerical plot) and 6(Analytical plot). So the numerical solution
based on Explicit finite difference method by combining with Fourier number stability criteria
perfectly works for unsteady 2D heat conduction problem. We plotted the temperature
map(Fig-3 and 4) for both numerical and analytical solution, the maximum temperature
showing at the boundary(x=4 and y=0). There are 10 curves/strips propagates from maximum
temperature curve with unequal width, this is due to the loss of temperature gradient while
moving away from source line(y=0). The width of the strip is increasing when moving
outwards from the maximum temperature strip. The formation of curves/strips due to the
boundary condition at y=0 is a function of x, so this distribution makes the formation of curved
strips. The maximum temperature in each curve is shifting towards left side which is due to
unequal distribution of temperature on both sides of the maximum temperature point. Overall
the analytical solution perfectly matching with the numerical solution. Also we have performed
sensitivity analysis by varying the parameters of timestep, step size and timestep to find the
equilibrium time for all the cases. We found the relation between all the parameters with
equilibrium time as, Eq.time=28186(ln(timestep))+43759, Eq.time=-28490(ln(tolerance))-
38700, y=10548(step_size)2-14024(step_size)+318189. Also we analysed the limitations of
code and theory. In code we found that the numerical exactly matching to the analytical solution
with very less error%. In theory the formation of truncation error, round off error and stability
are handled well and it doesn’t affected the accuracy of simulation.

10. References:
[1]. R.W. Hamming, ‘Numerical Methods for Scientists and Engineers’, Mc-Graw-Hill
Publications, 2nd edition, 1973.
[2]. Croft D.R. Lilley D.G. ,’Heat Transfer Calculations Using Finite Differences’, London,
Applied Science Publications Ltd, 1977.
[3]. Daileda R.C. ,’The Two Dimensional Heat Equation’, Trinity University, San Antonio,
Texas, USA, March-6, 2012

11. Appendix:
Sensitive analysis:
h(m) dt(sec) Eq.time(sec)

0.5 800 232000

0.5 600 223800


0.5 400 212800
0.5 200 193400
0.5 100 173800
0.5 50 154000
0.5 25 134225
Table.1: Sensitive analysis by varying timestep

h(m) tolerance Eq.time(sec) Error%


1 0.1 29500 92.64
1 0.01 90000 71.75
1 0.001 156000 18.83
1 0.0001 222500 1.92
1 0.00001 288500 0.15
1 0.000001 355000 0.03
Table.2: Sensitive analysis by varying tolerance

h dt Eq.time
3 150 370800
2 150 333300
1 150 312450
0.5 150 316350
0.25 150 315150
0.2 150 315000
Table.3: Sensitive analysis by varying step size

You might also like