You are on page 1of 48

Chapter Four Finite Different Application to Steady State Heat Conduction

Chapter Four FINITE DIFFERENT APPLICATION TO STEADY STATE HEAT


CONDUCTION
Chapter Four Finite Different Application to Steady State Heat Conduction
In this chapter, the modeling of steady state heat conduction problems by the finite
difference technique is discussed. Several illustrative examples are presented in rectangular
and cylindrical coordinates system.
4.1 Steady State Heat Conduction
We begin with the simplest case as shown in Fig. 4.1. Here we only consider a steady state
one-dimensional conduction mode of heat transfer without heat generation. Therefore, the
heat conduction equation reduces to
0
2
2

x
T
(4.1)
We discretize Eq. (4.1) using the finite difference approximation and gives
( )
0
2
2
1 1

+
+
x
T T T
i i i
(4.2)
or
2
1 1 +
+

i i
i
T T
T (4.3)
Note that the central difference with second order accuracy was used to approximate Eq.
(4.1).
Figure 4.1 Heated steel bar
Chapter Four Finite Different Application to Steady State Heat Conduction
By referring to Fig. 4.1, we evaluate the temperature at each nodes using Eq. (4.2) with the
following boundary condition
500
1
T (4.4)
100
4
T (4.5)
and
2
500
2
3 1 3
2
+

T T T
T (4.6)
2
100
2
2 2 4
3
T T T
T
+

+
(4.7)
Equations (4.6) and (4.7) can be easily solved and get
2
3
366.67
233.33
T
T

(4.8)
Next, we consider steady state with no heat generation, two-dimensional heat flow equation
with the following governing equations
0
2
2
2
2

y
T
x
T
(4.9)
Thus, the finite difference approximation for the above equation becomes
( ) ( )
0
2 2
2
, 1 , 1 ,
2
, , 1 , 1

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.10)
If
y x
then
0 4
, 1 , 1 , , 1 , 1
+ + +
+ + j i j i j i j i j i
T T T T T
(4.11)
or
Chapter Four Finite Different Application to Steady State Heat Conduction
( )
4
1 , 1 , , 1 , 1
,
+ +
+ + +

j i j i j i j i
j i
T T T T
T (4.12)
Figure 4.2 Four nodes problem
Another simple example is shown in Figure 4.2 and the four equations for nodes 6, 7, 10
and 11 would be
Node 6
4
500 100
10 7
6
T T
T
+ + +
(4.13)
Node 7
4
500 100
11 6
7
T T
T
+ + +
(4.14)
Node 10
4
100 100
6 11
10
+ + +

T T
T (4.15)
Node 11
Chapter Four Finite Different Application to Steady State Heat Conduction
4
100 100
7 10
11
+ + +

T T
T (4.16)
Since symmetrical boundary condition for the left and right sides
11 10
7 6
T T
T T

(4.17)
and the final results are
150
250
11 10
7 6


T T
T T
(4.18)
4.2 Iterative Methods
For the number of nodes very large, any iterative technique may frequently yield a more
efficient solution. The basis of all iterative methods is that an approximate solution is
guessed for each point at which solution is sought and the values are then repeatedly
updated. One such method is called a Jacobi method. The procedure in Jacobi method is as
follow
1. An initial set of values for the T is assumed. For a large number of nodes,
the T are usually assigned a zero value to start the calculation
2. The new value of the nodal temperature are calculated
3. The process is repeated until successive calculation differs by a sufficient
small amount.
For practice purpose, we return to the first case above and the updating equation for
temperature is
Chapter Four Finite Different Application to Steady State Heat Conduction
2
500
3
2
+

T
T (4.19)
2
100
2
3
T
T
+

(4.20)
Tab. 4.1 shows the solution for the current problem using the Jacobi method
Table 4.1 Solution by Jacobi iteration method
Number of iteration
2
T
3
T
0 0 0
1 250 50
2 275 175
3 337.5 187.5
4 343.75 218.75
5 359.375 221.875
6 360.9375 229.6875
7 364.8438 230.4688
8 365.2344 232.4219

18 366.6653 233.3324
19 366.6662 233.3326
20 366.6667 233.3333
The compute program code written in MATLAB is shown below
%One-dimensional conduction heat transfer without heat generation
%Jacobi method
clear all; clc; close all;
lmax=100;
imax=4;
imm1=imax-1;
t = zeros;
t(1)=500;
Chapter Four Finite Different Application to Steady State Heat Conduction
t(imax)=100;

for l =1:lmax
for i=2:imm1
tnew(i)=(t(i+1)+t(i-1))/2;
end

for i=2:imm1
t(i)=tnew(i);
end

end
Tab. 4.2 shows the predicted value of temperature for the case of two-dimensional problem
using the discussed Jacobi iteration method.
Table 4.2 Solution by Jacobi iteration method for two-dimensional problem
Number of iteration
6
T
7
T
10
T
11
T
0 0 0 0 0
1 150 150 50 50
2 200 200 100 100
3 225 225 125 125
4 237.5 237.5 137.5 137.5
5 243.75 243.75 143.75 143.75
6 246.875 246.875 146.875 146.875
After six iterations, the approximate solution is
Chapter Four Finite Different Application to Steady State Heat Conduction
) 150 ( 875 . 146
) 150 ( 875 . 146
) 250 ( 875 . 246
) 250 ( 875 . 246
11
10
7
6

T
T
T
T
(4.21)
with the exact solution shown in parentheses for comparison. More iteration will take us
even nearer to this exact solution.
The compute program code written in MATLAB is shown below
%Two-dimensional conduction heat transfer without heat generation
%Jacobi method
clear all; clc; close all;
lmax=100;
imax=4;
jmax=4;
imm1=imax-1;
jmm1=jmax-1;
t = zeros;
for i=1:imax
t(i,jmax)=500;
t(i,1)=100;
end
for j=1:jmax
t(1,j)=100;
t(imax,j)=100;
end

for l =1:lmax
Chapter Four Finite Different Application to Steady State Heat Conduction

for i=2:imm1
for j=2:jmm1
tnew(i,j)=(t(i+1,j)+t(i-1,j)+t(i,j+1)+t(i,j-1))/4;
end
end

for i=2:imm1
for j=2:jmm1
t(i,j)=tnew(i,j);
end
end

end
Another well-known technique is the Gauss-Seidel iterative method. This method is very
similar to the Jacobi method. The sole different is that, when sequentially iterating with the
update equations, new updated value are used as soon as they are available. Example
calculation for two-dimensional case is shown as follow
4
500 100
10 7
6
T T
T
+ + +

(4.16)
4
500 100
11 6
7
T T
T
+ +

(4.17)
4
100 100
6 11
10
+ + +

T T
T (4.18)
Chapter Four Finite Different Application to Steady State Heat Conduction
4
100 100
7 10
11
+ +

T T
T
(4.19)
Table 4.2 Solution by Gauss-Seidel iteration method
Number of iteration
6
T
7
T
10
T
11
T
0 0 0 0 0
1 150 187.5 87.5 118.75
2 218.75 234.375 134.375 142.18
3 242.18 246.09 146.09 148.05
4 248.05 249.025 149.025 149.51
They can be seen that, after only four iterations, the approximate solution is
) 150 ( 51 . 149
) 150 ( 025 . 149
) 250 ( 025 . 249
) 250 ( 05 . 248
11
10
7
6

T
T
T
T
(4.20)
The compute program code written in MATLAB is shown below
%Two-dimensional conduction heat transfer without heat generation
clear all; clc; close all;
lmax=100;
imax=4;
jmax=4;
imm1=imax-1;
jmm1=jmax-1;
t = zeros;
for i=1:imax
t(i,jmax)=500;
t(i,1)=100;
end
for j=1:jmax
Chapter Four Finite Different Application to Steady State Heat Conduction
t(1,j)=100;
t(imax,j)=100;
end

for l =1:lmax

for i=2:imm1
for j=2:jmm1
tnew(i,j)=(t(i+1,j)+t(i-1,j)+t(i,j+1)+t(i,j-1))/4;
t(i,j)=tnew(i,j);
end
end

end
4.2.1 Boundary treatments
When the solid is exposed to some other type of boundary conditions; i.e convection
boundary condition, the temperature at the surface must be computed differently from the
method given above. To see this, now, let consider a long rectangular bar as shown in Fig.
4.3.
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.3 Two dimensional heat conduction in a bar (Physical problem)
In the absence of heat source, the heat conduction equation for this geometry is given by
0
2
2
2
2

y
T
x
T
(4.21)
The following boundary conditions are applied on the side surfaces of the bar:
0
T T
at x = 0 (4.22)
0

y
T
at y = 0 (4.23)
q
x
T
k

at x = L (4.24)
( )
f
T T h
x
T
k

at y = H (4.25)
Using central difference approximation for the second derivatives, the nodal equation at
point (i,j) is given by
Chapter Four Finite Different Application to Steady State Heat Conduction
( ) ( )
0
2 2
2
, 1 , 1 ,
2
, , 1 , 1

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.26)
If we consider
y x
where
M
H
y
N
L
x , (4.27)
then
0 4
, 1 , 1 , , 1 , 1
+ + +
+ + j i j i j i j i j i
T T T T T
The nodal equations for all interior nodes can now be obtained as follow
4
1 , 1 , , 1 , 1
,
+ +
+ + +

j i j i j i j i
j i
T T T T
T
For deriving the nodal equations of the boundary nodes, the discretized form of the
boundary conditions have to be considered.
Let us employ a uniform square grid as shown in Fig. 4.4.
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.4 Two dimensional heat conduction in a bar (grid)
The prescribed temperature condition at i = 1 becomes
0 , 1
T T
j

for
1 1 + M j
(4.28)
On the bottom surface (
1 j
), the discretised heat conduction equation is determined as
0 4
1 , 0 , 2 , 1 , 1 1 , 1
+ + +
+ i i i i i
T T T T T
(4.29)
Here, it is required to introduce an imaginary node point
0 , i
T
at a distance
y
from the
bottom surface. We know that the insulated boundary can be discretized as
0
2
0 , 2 ,
1 ,

y
T T
y
T
i i
i
(4.30)
or
Chapter Four Finite Different Application to Steady State Heat Conduction
0 , 2 , i i
T T
(4.31)
and we obtain
0 4 2
1 , 2 , 1 , 1 1 , 1
+ +
+ i i i i
T T T T
for N i 2 (4.32)
And therefore
4
2
2 , 1 , 1 1 , 1
1 ,
i i i
i
T T T
T
+ +

+
for N i 2 (4.33)
For the right boundary, the heat flux condition is applied as follow. Consider an imaginary
point outside the boundary, then the discretised form of the boundary condition becomes
q
x
T T
k
x
T
k
j N j N

+
2
, , 2
(4.34)
or
j N j N
T
k
x q
T
, , 2
2
+


+
(4.35)
Combine the above equation for the heat conduction equation for the right boundary node
gives
k
x q
T T T T
j N j N j N j N

+ +
+ + + +
2
4 2
, 1 1 , 1 1 , 1 ,
for
M j 2
(4.36)
and therefore
j N
j N j N j N
j N
T
k
x q
T T T
T
, 1
1 , 1 1 , 1 ,
, 1
4
4
2
2
+
+ + +
+

+ +

for
M j 2
(4.37)
In a similar manner, the nodal equations for the top boundary can be obtained by
discretizing the convective condition using imaginary point
Chapter Four Finite Different Application to Steady State Heat Conduction
( )
f
T T h
y
T
k

(4.38)
or
( )
f
M i M i
T T
k
h
y
T T

+
2
, 2 ,
(4.39)
and
( )
f M i M i
T T
k
yh
T T


+
2
, 2 ,
(4.40)
Substituting for this imaginary point temperature in the heat conduction equation give the
nodal equations as follow
f M i M i M i M i
T
k
y h
T
k
y
h T T T

,
_


+ + +
+ + + +
2 2 2 2
1 , , 1 , 1 1 , 1
for N i 2 (4.41)
Next, let consider the corner nodes of the domain. The nodal equations of the corner points
on the prescribed temperature boundary are
0 1 , 1
0 1 , 1
T T
T T
M

+
(4.42)
For the corner node (
1 , 1 + N
), two imaginary points (
0 , 1 + N
) and (
1 , 2 + N
) have to be
considered. The boundary conditions on the lower and the right surfaces are discretised
using these imaginary points. After combining the discretised boundary condition with the
heat conduction equation, the following nodal equation is obtained
k
x q
T T T
N N N

+
+ + 1 , 1 2 , 1 1 ,
2 (4.43)
Similarly, by incorporating the boundary condition of heat flux and convective heat
exchange with the help of two imaginary points, the equation for the node (
1 , 1 + + M N
) is
obtained as
Chapter Four Finite Different Application to Steady State Heat Conduction
k
x q
T
k
y h
T
k
y h
T T
f M N M N M N

+

,
_


+ +
+ + + + 1 , 1 , 1 1 ,
2
(4.44)
The other nodal point equation for corner boundary nodes exposed to ambient temperature
f
T
is shown below

( )
Bi 1
Bi 2
, 1 1 ,
1 , 1
+
+ +

+ +
+ +
f N M N M
N M
T T T
T
where
k
x h
Bi

( )
Bi 3
2 Bi
1 , , 1 , 1 1 ,
,
+
+ + + + +

+ + j i j i j i j i f
j i
T T T T T
T
where
k
x h
Bi
Figure 4.6 Convection boundary nodes
Example 4.1
A 1-by 2-cm ceramic strip (k = 3W/m
o
C,

=1600kg/m
3
and c = 0.8kJ/kg
o
C) is embedded
in a high-thermal-conductivity material as shown in Fig. 4.7 so that the sides are
maintained at a constant temperature of 900
o
C. The bottom surface of the ceramic is
Chapter Four Finite Different Application to Steady State Heat Conduction
insulated, and the top surface is exposed to a convection environment at T = 50
o
C, h =
50W/m
2
. Solve the steady state temperature distribution of the nodes.
Figure 4.7 Heated ceramic strip
Solution
Since the problem is steady state heat conduction without heat generation, the governing
equation is expressed as
0
2
2
2
2

y
T
x
T
(4.45)
and the discretised equation is
( ) ( )
0
2 2
2
, 1 , 1 ,
2
, , 1 , 1

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.46)
Since
y x
and therefore
0 4
, 1 , 1 , , 1 , 1
+ + +
+ + j i j i j i j i j i
T T T T T
(4.47)
or
Chapter Four Finite Different Application to Steady State Heat Conduction
4
1 , 1 , , 1 , 1
,
+ +
+ + +

j i j i j i j i
j i
T T T T
T (4.48)
Let us employ a uniform square grid as shown in Figure below.
Fig. 4.8 Uniform square grid for heated ceramic
For the bottom boundary, the adiabatic boundary condition is applied as follow. Consider
an imaginary point outside the boundary, then the discretised form of the boundary
condition becomes
0 4 2
1 , 2 , 1 , 1 1 , 1
+ +
+ i i i i
T T T T
(4.49)
or
4
2
2 , 1 , 1 1 , 1
1 ,
i i i
i
T T T
T
+ +

+
for
3 , 2 , 1 i
and
1 j
(4.50)
In a similar manner, the nodal equations for the top boundary can be obtained by
discretizing the convective condition using imaginary points and substituting for the
imaginary point temperature in the heat conduction equation. The resulting nodal equations
are
Chapter Four Finite Different Application to Steady State Heat Conduction
f M i M i M i M i
T
k
y h
T
k
y
h T T T

,
_


+ + +
+ + + +
2 2 2 2
1 , , 1 , 1 1 , 1
or (4.51)

,
_


+
+ + +

+ + +
+
k
y
h
T T T T
k
y h
T
M i M i M i f
M i
2 2
2 2
, 1 , 1 1 , 1
1 , for
3 , 2 , 1 i
and
1 + M j
(4.52)
The computer program code written in MATLAB is shown below
clear all;clc;close all;
width = 0.02;
height = 0.01;
h = 50;
k = 3;
t_air = 50;
t_wall = 900;
l=0; %
lmax=100;
imax=5;
jmax=3;
imm1=imax-1;
jmm1=jmax-1;
dx = width/imm1;
dy = height/jmm1;

for j = 1:3
t(1,j) = t_wall;
t(imax,j) = t_wall;
end
Chapter Four Finite Different Application to Steady State Heat Conduction

for l=1:100
for i=2:imm1
j = 1;
tnew=(t(i+1,j)+t(i-1,j)+2.*t(i,j+1))/4;
t(i,j)=tnew;
end

for i=2:imm1
j = 2;
tnew=(t(i+1,j)+t(i,j+1)+t(i,j-1)+t(i-1,j))/4;
t(i,j)=tnew;
end

for i=2:imm1
j = jmax;
tnew=((2*h*dy/k).*t_air + t(i-1,j)+t(i+1,j)+2.*t(i,j-1))/
(2*(2+h*dy/k));
t(i,j)=tnew;
end
end
The value of temperature at all nodes after 100 iteration is shown in Table 4.2.
Table 4.2 Temperature distribution for Example 4.1
No. of Node Temperature No. of Node Temperature
1 822.645 5 843.8972
2 801.9496 6 848.7429
Chapter Four Finite Different Application to Steady State Heat Conduction
3 822.6465 7 868.4098
4 858.7429 8 856.1535
9 868.4098
Example 4.2
Consider the square as shown in Fig. 4.9. The left surface is maintained at 100
o
C and the
top surface 500
o
C, while the other two surfaces are exposed to an environment at 100
o
C.
The block is 1m square. Compute the temperature of the various nodes in the figure.
C m W h
2
10 and mC W k 10
Solution
Since the problem is steady state heat conduction without heat generation, the governing
equation is expressed as
0
2
2
2
2

y
T
x
T
(4.53)
and the discretised equation is
( ) ( )
0
2 2
2
, 1 , 1 ,
2
, , 1 , 1

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.54)
Since
y x
and therefore
0 4
, 1 , 1 , , 1 , 1
+ + +
+ + j i j i j i j i j i
T T T T T
(4.55)
Therefore, for the internal nodes the temperature can be calculated by
4
1 , 1 , , 1 , 1
,
+ +
+ + +

j i j i j i j i
j i
T T T T
T (4.56)
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.9 Heated square block
Solution
For the bottom boundary nodes (j =1), since they are exposed to ambient temperature, the
general equation can be written as
0 4
1 0 2 1 1 1 1
+ + +
+ i, i, i, , i , i
T T T T T
(4.57)
From the convective boundary condition, we get
( )
( )
f i
i, i,
T T h
y
T T
k

1 ,
2 0
2
(4.58)
This leads to
( )
2 , 1 , 0
2
i f i i,
T T T
k
yh
T +

(4.59)
Substitute into Eq. (4.58) yields
Chapter Four Finite Different Application to Steady State Heat Conduction
0
2
4
2
2
1 , 2 1 1 1 1

+
,
_

+ +
+ f i i, , i , i
T
k
yh
T
k
yh
T T T
(4.60)
or

,
_

+ + +

+
4
2
2
2
2 1 1 1 1
1 ,
k
yh
T
k
yh
T T T
T
f i, , i , i
i (4.61)
Since the right surface is also exposed to ambient temperature, the equation for the right
boundary nodes (i = imax) can be expressed as
0 4
max 1 max 1 max 1 max 1 max
+ + +
+ + ,j i ,j i ,j i ,j i ,j i
T T T T T
(4.62)
where
( )
( )
f j i
,j i j i
T T h
x
T T
k

+
max,
1 max , 1 max
2
(4.63)
This leads to
( )
j i f j i ,j i
T T T
k
xh
T
, 1 max max, 1 max
2
+
+

(4.64)
Substitute into Eq. (4.62) yields
0 2
2
4
2
1 max 1 max , 1 max max,
+ + +

+
,
_

+ ,j i ,j i j i f j i
T T T T
k
xh
T
k
xh
(4.65)
or

,
_

+ + +

+
4
2
2
2
1 max 1 max 1 max
max,
k
xh
T
k
xh
T T T
T
f ,j i ,j i ,j i
j i (4.66)
Now, we demonstrate the treatment for the bottom right corner node (imax,1).
The discretized equation for this node is expressed as
Chapter Four Finite Different Application to Steady State Heat Conduction
0 4
1 max 0 max 2 max 1 1 max 1 1 max
+ + +
+ , i , i , i , i , i
T T T T T
(4.67)
Here, we need to replace two imaginary nodes (imax+1,1) and (imax, 0). Since the right
and bottom boundary are exposed to the ambient temperature, therefore
( )
2 max, 1 max, 0 max
2
i f i , i
T T T
k
yh
T +

(4.68)
and
( )
1 , 1 max 1 max, 1 1 max
2
+
+


i f i , i
T T T
k
xh
T (4.69)
Substitute Eq. (4.69) and (4.68) into Eq. (4.67) gives
0 2 2
2 2
4
2 2
2 max 1 , 1 max 1 max,
+ +
,
_

+
,
_

, i i f i
T T T
k
yh
k
xh
T
k
yh
k
xh
(4.70)
Then

,
_

+ +
,
_

4
2 2
2 2
2 2
2 max 1 , 1 max
1 max,
k
yh
k
xh
T T T
k
yh
k
xh
T
, i i f
i
(4.71)
The computer program code written in MATLAB is shown below
clear all;clc;close all;
width = 1.00;
height = 1.00;
h = 10;
k = 10;
t_air = 100;
t_left_wall = 100;
t_top_wall = 500;
l=0; %
Chapter Four Finite Different Application to Steady State Heat Conduction
lmax=100;
imax=5;
jmax=5;
imm1=imax-1;
jmm1=jmax-1;
dx = width/imm1;
dy = height/jmm1;

for j = 1:jmax
t(1,j) = t_left_wall;
end

for i = 1:imax
t(i,jmax) = t_top_wall;
end

for l=1:100
for i=2:imm1
for j=2:jmm1
tnew=(t(i+1,j)+t(i-1,j)+t(i,j+1)+t(i,j-1))/4;
t(i,j)=tnew;
end
end

for i=2:imm1
j = 1;
tnew=(t(i+1,j)+t(i-1,j)+2*t(i,j+1)+(2*dy*h*t_air)/k)/
(((2*dy*h)/k)+4);
Chapter Four Finite Different Application to Steady State Heat Conduction
t(i,j)=tnew;
end

for j=2:jmm1
i = imax;
tnew=(t(i,j+1)+t(i,j-1)+2*t(i-1,j)+(2*dx*h*t_air)/k)/
(((2*dx*h)/k)+4);
t(i,j)=tnew;
end
j=1;
i=imax;
tnew=((2*dx*h*t_air)/k + (2*dy*h*t_air)/k +2*t(i-1,j)
+2*t(i,j+1))/((2*dx*h)/k + (2*dy*h)/k+4);
t(i,j)=tnew;
end
Example 4.3
The fin shown in Fig. 4.10 has a base maintained at 300
o
C and is exposed to the convective
environment indicated. Calculate the steady state temperature of the nodes shown in the
figure if k = 1.0W/m
o
C and h = 40W/m
2o
C
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.10 Heated fin exposed to ambient temperature
Since the problem is steady state heat conduction without heat generation, the governing
equation is expressed as
0
2
2
2
2

y
T
x
T
(4.72)
and the discretised equation is
( ) ( )
0
2 2
2
, 1 , 1 ,
2
, , 1 , 1

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.73)
Since
y x
and therefore
( ) ( ) ( ) ( ) ( ) ( ) ( ) 0 2
1 , 1 ,
2
, 1 , 1
2
,
2 2
+ + + + +
+ + j i j i j i j i j i
T T x T T y T x y (4.74)
Then, the temperature at the internal nodes (nodes 5.6 and 7) can be calculated by
( ) ( ) ( ) ( )
( ) ( ) ( )
2 2
1 , 1 ,
2
, 1 , 1
2
,
2
0
x y
T T x T T y
T
j i j i j i j i
j i
+
+ + +

+ +
(4.75)
For the bottom boundary nodes (j =1), since they are exposed to ambient temperature, the
general equation can be written as
( ) ( )
0
2 2
2
1 , 0 , 2 ,
2
1 , 1 , 1 1 , 1

+
+

+
+
y
T T T
x
T T T
i i i i i i
(4.76)
Chapter Four Finite Different Application to Steady State Heat Conduction
From the convective boundary condition, we get
( )
( )
f i
i, i,
T T h
y
T T
k

1 ,
2 0
2
(4.77)
This leads to
( )
2 , 1 , 0
2
i f i i,
T T T
k
yh
T +

(4.78)
Substitute into Eq. (4.76) yields
( ) ( ) ( ) ( ) ( ) ( )
( ) 0
2
2
2
2
2 ,
2
1 , 1 1 , 1
2
1 ,
2 2 2

,
_


+ +
+ +
,
_


+ +
+
f i
i i i
T
k
yh
T x
T T y T
k
yh
x x y
(4.79)
or
( ) ( ) ( )
( ) ( ) ( ) ( )
,
_


+ +

,
_


+ + +

+
k
yh
x x y
T
k
yh
T x T T y
T
f i i i
i
2
2
2
2
2 2 2
2 ,
2
1 , 1 1 , 1
2
1 ,
(4.80)
Since the right surface is also exposed to ambient temperature, the equation for the right
boundary nodes (i = imax) can be expressed as
( ) ( )
0
2 2
2
max, 1 max, 1 max,
2
max, , 1 max , 1 max

+
+

+
+ +
y
T T T
x
T T T
j i j i j i j i j i j i
(4.81)
where
( )
( )
f j i
,j i j i
T T h
x
T T
k

+
max,
1 max , 1 max
2
(4.82)
This leads to
( )
j i f j i ,j i
T T T
k
xh
T
, 1 max max, 1 max
2
+
+

(4.83)
Substitute into Eq. (4.81) yields
Chapter Four Finite Different Application to Steady State Heat Conduction
( ) ( ) ( ) ( ) ( )
( ) ( ) 0
2
2
2
2
1 max, 1 max,
2
, 1 max
2
max,
2 2 2
+ +

,
_

+
,
_

+ +

j i j i
j i f j i
T T x
T T
k
xh
y T x y y
k
xh
(4.84)
or
( ) ( ) ( )
( ) ( ) ( ) ( )

,
_

+ +

+ +
,
_

+
2 2 2
1 max, 1 max,
2
, 1 max
2
max,
2
2
2
2
x y y
k
xh
T T x T T
k
xh
y
T
j i j i j i f
j i
(4.85)
Now, we demonstrate the treatment for the bottom right corner node (imax,1).
The discretized equation for this node is expressed as
( ) ( )
0
2 2
2
1 max, 0 max, 2 max,
2
1 max, 1 , 1 max 1 , 1 max

+
+

+
+
y
T T T
x
T T T
i i i i i i
(4.86)
Here, we need to replace two imaginary nodes (imax+1,1) and (imax, 0). Since the right
and bottom boundary are exposed to the ambient temperature, therefore
( )
2 max, 1 max, 0 max
2
i f i , i
T T T
k
yh
T +

(4.87)
and
( )
1 , 1 max 1 max, 1 1 max
2
+
+


i f i , i
T T T
k
xh
T (4.88)
Substitute Eq. (4.87) and (4.88) into Eq. (4.86) gives
( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) 0 2 2
2 2
2
2 2
2 max,
2
1 , 1 max
2 2 2
1 max,
2 2 2 2
+ +
,
_

,
_

+ +


i i f
i
T x T y T
k
yh
x
k
xh
y
T x y
k
yh
x
k
xh
y
(4.89)
Then
Chapter Four Finite Different Application to Steady State Heat Conduction
( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( )

,
_

+ +

+ +
,
_

2 2 2 2
2 max,
2
1 , 1 max
2 2 2
1 max,
2
2 2
2 2
2 2
x y
k
yh
x
k
xh
y
T x T y T
k
yh
x
k
xh
y
T
i i f
i
(4.90)
Finally, since the problem is symmetric at the horizontal centerline of the fin, the
temperature at the top boundary nodes (node 1,2 and 3) can be set equal to the temperature
at the bottom boundary nodes.
The computer program code written in MATLAB is shown below
clear all;clc;close all;
width = 0.08;
height = 0.02;
h = 40;
k = 1;
t_air = 20;
t_left_wall = 300;
l=0; %
lmax=100;
imax=5;
jmax=3;
t(1:imax,1:jmax)=zeros;
imm1=imax-1;
jmm1=jmax-1;
dx = width/imm1;
dy = height/jmm1;

for j = 1:jmax
Chapter Four Finite Different Application to Steady State Heat Conduction
t(1,j) = t_left_wall;
end

for l=1:100
for i=2:imm1
j=2;
tnew=((t(i+1,j)+t(i-1,j))*dy^2 +...
(t(i,j+1)+t(i,j-1))*dx^2)/(2*(dy^2+dx^2));
t(i,j)=tnew;
end

for i=2:imm1
j = 1;
tnew=((t(i+1,j)+t(i-1,j))*dy^2 +
(2*t(i,j+1)+(2*dy*h*t_air)/k)*dx^2)/(2*(dy^2+dx^2)+((2*dy*h)/k)*dx^2);
t(i,j)=tnew;
end

for i=2:imm1
t(i,jmax)=t(i,1);
end

for j=2:jmm1
i = imax;
tnew=((t(i,j+1)+t(i,j-1))*dx^2 + (2*t(i-1,j)
+(2*dx*h*t_air)/k)*dy^2)/(2*(dy^2+dx^2)+((2*dx*h)/k)*dy^2);
t(i,j)=tnew;
end
Chapter Four Finite Different Application to Steady State Heat Conduction
j=1;
i=imax;
tnew=(2*(t(i-1,j)*dy^2+t(i,j+1)*dx^2) +...
(2*h*(dx*dy^2+dy*dx^2)/k)*t_air)/((2*h*(dx*dy^2+dy*dx^2)/k)
+2*(dy^2+dx^2));
t(i,j)=tnew;

t(imax,jmax)=t(imax,1);

end
4.3 Steady State Heat Conduction in Cylindrical Geometries.
Sometimes, it is desired to consider the governing equations expressed in the cylindrical
coordinate due to the nature of the problem. However, few modifications have to be made
for the finite different formulation in cylindrical geometries. To see this, let consider heat
conduction in a cylindrical geometry with the computational grids as shown below
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.10 Grid for radial conduction in a cylinder
Here, we consider one-dimensional heat conduction in radial direction and the governing
equations reduced to
0
1
2
2

r
T
r r
T
(4.91)
Let the surface of the cylinder be maintained at a temperature of
S
T
. For an axisymmetric
problem in cylindrical geometry, it can be shown that 0 r T at 0 r .
Now, consider a radial grid with constant size r . At a node i, the discretized form of the
heat conduction becomes
0
2
2
1 1
2
1 1

+
+ +
r r
T T
r
T T T
i
i i i i i
(4.92)
For the surface node (N+1), the prescribed temperature condition gives
S N
T T
+1
(4.93)
Chapter Four Finite Different Application to Steady State Heat Conduction
The so called LHospital rule has to be applied at the center of r = 0 to avoid 1/r
approaches

as follow
2
2
1
r
T
r
T
r

(4.94)
Therefore, the equation becomes
0 2
2
2

r
T
(4.95)
Therefore discretized equation at r = 0 is
0
2
2
2
1 0 2

+
r
T T T
(4.96)
Note that we consider an imaginary node at i = 0. This imaginary term can be replaced by
considering the boundary condition at r = 0
0
2
0 2

r
T T
(4.97)
which gives
2 0
T T
(4.98)
Then at the r = 0 boundary condition, we obtain
2 1
T T (4.99)

Example 4.4
Consider a problem of heat conduction as shown in figure below. The inner side is heated
to the temperature of 30
o
C and outer side is heated to temperature of 150
o
C. Determine the
temperature distribution between these two boundaries.
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.11 Differentially heated 1D bar.
Solution
The discretized equation is given as
0
2
2
1 1
2
1 1

+
+ +
r r
T T
r
T T T
i
i i i i i
(4.100)
And the equation for the internal nodes is given by
( )
i
i i i i
i
r
T T
r
T T
T
4 2
1 1 1 1 + +

+
+

(4.101)
Let r = 0.5m and mesh size is (M = 5), therefore
1 . 0
5
5 . 0
r (4.102)
The total number of grid points is M+1=6
The computer program code written in MATLAB is given as below
clear all;clc;close all;
radius = 0.5;
mesh = 5;
deltaR = radius/mesh;
l = 0; %
lmax=100;
rmax=mesh+1;
Chapter Four Finite Different Application to Steady State Heat Conduction
t(1) = 30;
t(rmax) = 150;

for l =1:lmax
for r = 2:rmax-1
tnew(r) = (t(r+1)+t(r-1))/2 - deltaR*(t(r+1)-t(r-1))/(4*(r-
1)*deltaR);
t(r) = tnew(r);
end
end
The temperature distribution at steady state is obtained as in Tab. 4.3
Table 4.3 Temperature distribution for Example 4.4
Node 1 Node 2 Node 3 Node 4 Node 5 Node 6
30.0 34.8 49.2 73.2 106.8 150.0
Example 4.5
Consider a problem of heat conduction as shown in figure below. The inner side is
maintained at 50
o
C and outer side is exposed to ambient temperature of 30
o
C and h =
50W/m
2
. Determine the temperature distribution between these two boundaries. (Consider
k = 30W/m
o
C)
Chapter Four Finite Different Application to Steady State Heat Conduction
Figure 4.12 1D heated cylindrical bar exposed to ambient temperature.
Solution
Here, we consider one-dimensional heat conduction in radial direction and the governing
equations reduced to
0
1
2
2

r
T
r r
T
(4.103)
The discretized form of the governing equation is written as
0
2
2
1 1
2
1 1

+
+ +
r r
T T
r
T T T
i
i i i i i
(4.104)
and the equation for the internal nodes is given by
( )
i
i i i i
i
r
T T
r
T T
T
4 2
1 1 1 1 + +


+

0 (4.105)
For the internal surface node, the prescribed temperature condition gives
C T
0
1
500 (4.106)
Due to the convective heat transfer condition at the end point given as
( )
f w
T T h
r
T
k

(4.107)
Discretise the above equation with central difference leads to
( )
f i
i i
T T
k
h
r
T T

+
max
1 max 1 max
2
(4.108)
or
( )
1 max max 1 max
2
+
+


i f i i
T T T
k
rh
T (4.109)
Substitute Eq. (4.109) into the discretized governing equation gives
Chapter Four Finite Different Application to Steady State Heat Conduction
0 2
2
2
2
1 max
2
max
2
+

,
_

,
_

i imac f imac i
imac
imac
T r T
k
h r
k
rh
r T
k r
h r
k
rh
r
(4.110)
or

,
_

,
_

2
2
2
2
max
2
max
1 max max
2
max
max
k r
h r
k
rh
r
T r T
k
h r
k
rh
r
T
i
i
i i f i
i
(4.111)
The computer program code written in MATLAB is given as below
clear all; clc; close all;
radius = 0.5;
mesh = 5;
imax = mesh+1;
deltaR =radius/mesh;
t(1:imax) = zeros;
maxiter = 10000;
tf = 30;
h=50;
k=30;


t(1) = 50;

for iter = 1:maxiter
for i = 2:imax-1
tnew(i) = (t(i+1)+t(i-1))/2 + deltaR*(t(i+1)-t(i-1))/...
(4*(i-1)*deltaR);
Chapter Four Finite Different Application to Steady State Heat Conduction
end

i = imax;
ri=(i-1)*deltaR;
tnew(i)=((ri*2*deltaR*h+deltaR^2*h)*tf/k + 2*ri*t(i-1))/...
(ri*2*deltaR*h/k + deltaR^2*h/k +2*ri);

for i = 2:imax
t(i)=tnew(i);
end
end
4.3.1 Two-Dimensional Steady State Heat Conduction in Cylindrical Geometry.
The governing equation for 2D steady state heat conduction in cylindrical geometry is
given as
0
1 1
2
2
2 2
2

T
r r
T
r r
T
(4.112)
Let imax and jmax be the number of nodes in the r and directions respectively. Using the
double notation, the discretized form of the governing equation at node (i,j) is given by
0
2
2
2
2 2
, 1 , 1 , , 1 , 1
2
, , 1 , 1

+
+

+
+ + +

i
j i j i j i
i
j i j i j i j i j i
r
T T T
r r
T T
r
T T T
(4.113)
Let the surface temperature be specified as
s j i
T T
max,
(4.114)
Chapter Four Finite Different Application to Steady State Heat Conduction
for each angle
j

. At the center r = 0, it is not possible to apply the LHospital rule. On


this mesh, the heat conduction in Cartesian coordinates which is discretized as
0
2 2
2
0
2
0

+
+

+
r
T T T
r
T T T
S N W E
(4.115)
is used. Here we consider that
r y x
Problem 4.6
The temperature at the surface of half cylinder is fixed at 100
o
C while the lower surface is
maintained at 300
o
C. Compute the temperature for nodes shown in Figure 4.13
Figure 4.13 Differentially heated surface of half cylinder
Solution
The governing equation for this case can be written as
0
1 1
2
2
2 2
2

T
r r
T
r r
T
(4.116)
Applying second order central difference and Eq. (4.116) can be discretized into the
following algebraic expression as follow
Chapter Four Finite Different Application to Steady State Heat Conduction
0
2
2
2
2 2
, 1 , 1 , , 1 , 1
2
, , 1 , 1

+
+

+
+ + +

i
j i j i j i
i
j i j i j i j i j i
r
T T T
r r
T T
r
T T T
(4.117)
For the internal nodes, Eq. (4.117) can be rewritten as
1 ,
2 2 2
2
1 ,
2 2 2
2
, 1
2 2 2
2 2 2
, 1
2 2 2
2 2 2
,
4 4
2
4 4
2
4 4
2
4 4
2
+
+
+

+
+

+
+

+
+
+

j i
i
j i
i
j i
i
i i
j i
i
i i
j i
T
r r
r
T
r r
r
T
r r
r r r
T
r r
r r r
T


(4.118)
or
1 , 1 , , 1 , 1 , + +
+ + +
j i j i j i j i j i
CT CT BT AT T
(4.119)
where
2 2 2
2
2 2 2
2 2 2
2 2 2
2 2 2
4 4
2
4 4
2
4 4
2
r r
r
C
r r
r r r
B
r r
r r r
A
i
i
i i
i
i i
+

+
+


(4.120)
The computer program code written in MATLAB is given as below
clear all;clc;close all;
radius = 0.05;
theta = pi;
k = 20;
t_wall1 = 100;
t_wall2 = 300;
l=0;
lmax=10000;
imax=3;
Chapter Four Finite Different Application to Steady State Heat Conduction
jmax=7;
imm1=imax-1;
jmm1=jmax-1;
dr = radius/imm1;
dthe = theta/jmm1;
t(imax,jmax)=zeros;


%boundary condition
for j = 1:jmax
t(imax,j) = t_wall1;
end

for i = 1:imm1
t(i,1) = t_wall2;
t(i,jmax) = t_wall2;
end

t0 = 300;
for l=1:lmax
for i=1:imm1
for j = 2:jmm1
A = (2*((i*dr)^2)*(dthe^2)+(i*dr)*dr*(dthe^2))/(4*((i*dr)^2)*dthe^2
+4*dr^2);
B = (2*((i*dr)^2)*(dthe^2)-(i*dr)*dr*(dthe^2))/(4*((i*dr)^2)*dthe^2
+4*dr^2);
C = 2*(dr^2)/(4*((i*dr)^2)*dthe^2 + 4*dr^2);

Chapter Four Finite Different Application to Steady State Heat Conduction
if i == 1
tnew(i,j)=A*t(i+1,j) + B*t0 +C*t(i,j+1)+C*t(i,j-1);
else
tnew(i,j)=A*t(i+1,j) + B*t(i-1,j) +C*t(i,j+1)+C*t(i,j-1);
end
t(i,j)=tnew(i,j);
end
end

end

disp(t)
Problem 4.7
The half cylinder has . / 3 m W k
o
C and is exposed to the convection environment at 20
o
C.
The lower surface is maintained at 100
o
C. Compute the temperature for nodes shown in
Figure 4.14
Figure 4.14 Heated half cylinder and exposed to ambient temperature
Chapter Four Finite Different Application to Steady State Heat Conduction
Solution
The governing equation for this case can be written as
0
1 1
2
2
2 2
2

T
r r
T
r r
T
(4.121)
Applying second order central difference, Eq. (4.121) can be discretized into the following
algebraic expression as follow
0
2
2
2
2 2
, 1 , 1 , , 1 , 1
2
, , 1 , 1

+
+

+
+ + +

i
j i j i j i
i
j i j i j i j i j i
r
T T T
r r
T T
r
T T T
(4.122)
For the internal nodes, Eq. (4.122) can be rewritten as
1 , 1 , , 1 , 1 , + +
+ + +
j i j i j i j i j i
CT CT BT AT T
(4.123)
where A, B and C are expressed in Eq. (4.120)
Fig. 4.15 Coordinates of node and the center and its neighbor
At the center node of the surface, we have to consider a Cartesian based governing
equation which is
0
2
2
2
2

y
T
x
T
(4.124)
After discretization, Eq. (4.124) becomes (See Fig. 4.15)
( )
0
2 2
2
0 2 1 max , 1
2
0 max , 1 1 , 1

+
+

+
+
r
T T T
r
T T T
j N j
(4.125)
Here
r y x
Chapter Four Finite Different Application to Steady State Heat Conduction
Then
( )
4
2 1 max , 1 max , 1 1 , 1
0
+
+ + +

j N j
T T T T
T (4.126)
Since the boundary is exposed to the ambient temperature where
( )
f
T T h
y
T
k

0
(4.127)
or
( )
( )
f
j N
T T
k
h
y
T T

+
0
2 1 max , 1
2
(4.128)
and therefore
( )
( )
f j N
T T
k
yh
T T


+ 0 2 1 max , 1
2
(4.129)
Substitute into Eq. (4.128) and rearrange gives
( )

,
_

+ + +

+
k
yh
T
k
yh
T T T
T
f j j
2
1 4
2
2
2 1 max , 1 max , 1 1 , 1
0 (4.130)
Here,
r y
then
( )

,
_

+ + +

+
k
rh
T
k
rh
T T T
T
f j j
2
1 4
2
2
2 1 max , 1 max , 1 1 , 1
0 (4.131)
The discretized equation for the top boundary nodes can be written as
0 , 2 , 1 , 1 1 , 1 1 , i i i i i
CT CT BT AT T + + +
+
(4.132)
Since these boundary nodes are exposed to the ambient temperature where
Chapter Four Finite Different Application to Steady State Heat Conduction
( )
f w
T T
k
h
r
T

(4.133)
or in discretized form, Eq. (4.133) becomes
( )
f i
i
i i
T T
k
h
r
T T

1 ,
2 , 0 ,
2
(4.134)
and therefore
( )
f i i i i
T T
k
h
r T T
1 , 2 , 0 ,
2 (4.135)
Substitute Eq. (4.135) into Eq. (4.134) yields
1
]
1

+ + +

,
_

+ f i i i i
i
i
T
k
h
Cr CT BT AT
h Cr k
k
T

2 2
2
2 , 1 , 1 1 , 1 1 ,
(4.136)
The computer program code written in MATLAB is given as below
clear all;clc;close all;
radius = 0.05;
theta = pi;
k = 3;
t_wall1 = 100;
tf = 20;
h=50;
imax=3;
jmax=7;
imm1=imax-1;
jmm1=jmax-1;
dr = radius/imm1;
dthe = theta/jmm1;
t(imax,jmax)=zeros;

%boundary condition
for j = 1:jmax
t(imax,j) = t_wall1;
end

for l=1:100000
t0 = (t(1,1)+ t(1,jmax)+2*t(1,(jmax+1)/2)+2*dr*h*tf/k)/(4+
2*dr*h/k);
for i=1:imm1
Chapter Four Finite Different Application to Steady State Heat Conduction
for j = 1:jmax
A = (2*((i*dr)^2)*(dthe^2)+(i*dr)*dr*(dthe^2))/
(4*((i*dr)^2)*dthe^2 +4*dr^2);
B = (2*((i*dr)^2)*(dthe^2)-(i*dr)*dr*(dthe^2))/
(4*((i*dr)^2)*dthe^2 +4*dr^2);
C = 2*(dr^2)/(4*((i*dr)^2)*dthe^2 + 4*dr^2);

if i == 1 && j == 1
tnew(i,j)=(A*t(i+1,j) + B*t0
+2*C*t(i,j+1)+2*C*(i*dr)*dthe*h*tf/k)/...
(1+2*C*(i*dr)*dthe*h/k);
elseif i ==1 && j~=1 && j~=jmax
tnew(i,j)=A*t(i+1,j) + B*t0 +C*t(i,j+1)+C*t(i,j-1);
elseif j ==1 && i ~=1
tnew(i,j)=(A*t(i+1,j) + B*t(i-1,j)
+2*C*t(i,j+1)+2*C*(i*dr)*dthe*h*tf/k)/...
(1+2*C*(i*dr)*dthe*h/k);
elseif i ==1 && j ==jmax
tnew(i,j)=tnew(1,1);
elseif i ~=1 && j == jmax
tnew(i,j)=tnew(2,1);
else
tnew(i,j)=A*t(i+1,j) + B*t(i-1,j)
+C*t(i,j+1)+C*t(i,j-1);
end
t(i,j)=tnew(i,j);
end
end
end

disp(t')

You might also like