Chapter 03:Multidimensional steady-state heat conduction

Ex3.1:pg-92

In [1]:
import math
 
print"Introduction to heat transfer by S.K.Som, Chapter 3, Example 1"
#Length and breadth is given as 1 unit (Gemoetry is Square)
L = 1;#length
#Problem can be divided into two modules
#Solution to module 1 is given by Eq. 3.21, considering the first three terms
#n is the looping parameter
#theta is the non dimensional temperature defined as ((T-100)/100) where T is actual temperature in degree Celcius.
#Initialising theta as zero
theta = 0;
for n in range(1,3):
  theta = theta+((2/math.pi)*((math.sin((n*math.pi)/2)*math.sinh((n*math.pi)/2))*((-1)**(n+1)+1)))/(n*math.sinh(n*math.pi));
 
#Solution to module 2 is given by Eq. 3.24, considering the first three terms
for n in range(1,3):
  theta2 = theta+(((3*2)/math.pi)*((math.sin((n*math.pi)/2)*math.sinh((n*math.pi)/2))*((-1)**(n+1)+1)))/(n*math.sinh(n*math.pi));
 
#Calculating value of temperature from the value of theta
#Temperature in degree celcius
print"Temperature at the centre in Degree C is"
T = theta*100+100
print"T=",T
Introduction to heat transfer by S.K.Som, Chapter 3, Example 1
Temperature at the centre in Degree C is
T= 125.371641666

Ex3.2:pg-94

In [2]:
import math
 
print"Introduction to heat transfer by S.K.Som, Chapter 3, Example 2"
#Temperature in K at four edges are given
#Theta is non dimensional temperature defined as ((T-300)/100) where T is actual temperature in K.
#Given length as well as the breadth of square plate is ''a''
#Problem can be divided into two modules
#Solution to module 1 is given by Eq. 3.23
#Solution of first module is non dimensional temperature theta1
#theta1=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi))
#Solution to module 2 is given by Eq. 3.24
#Solution of second module is non dimensional temperature theta2
#theta2=math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))
#Therefore
print"Steady state non dimensional temperature is"
print"theta=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi)) + math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))"
#At the centre, x coordinate and y coordinate in unit are
#x=a/2, y=a/2
#Non dimensional temperature at centre point
theta = (2*math.sinh(math.pi/2))/math.sinh(math.pi)+math.sinh(math.pi/2)/math.sinh(math.pi);
#Temperature in K at centre point
print"theta=",theta
print"Temperature in K at centre point"
T = theta*100+300
print"T=",T
 Introduction to heat transfer by S.K.Som, Chapter 3, Example 2
Steady state non dimensional temperature is
theta=2*math.sinh(pi*y/a)*math.sin(pi*x/a)/(math.sinh(pi)) + math.sinh(pi*x/a)*math.sin(pi*y/a)/(math.sinh(pi))
theta= 0.597805223008
Temperature in K at centre point
T= 359.780522301

Ex3.3:pg-96

In [14]:
import math
import numpy
 
print"Introduction to heat transfer by S.K.Som, Chapter 3, Example 3"
#internodal distance in x direction in m
deltax = 1.0/4;
#internodal distance in y direction in m
deltay = 1.0/4;
#Air temperature in degree K
Tinfinity = 400;
#Heat transfer coefficient in W/(m**2*K)
h = 10;
#T1, T2, T3, T4, T5, T6, T7, T8 are nodal temperatures in degree K.
#T is the temperature matrix and is transpose of [T1 T2 T3 T4 T5 T6 T7 T8]
#using Nodal Equations, we have Coefficeint Matrix A as
A = [[-4,1,0,0,1,0,0,0],[1,-4,1,0,0,1,0,0],[0,1,-4,1,0,0,1,0],[2,0,0,0,-4,1,0,0],[0,2,0,0,1,-4,1,0],[0,0,2,0,0,1,-4,1],[0,0,2,-6,0,0,0,1],[0,0,0,2,0,0,2,-6]]#Coefficient matrix B
B = [[-1200],[-600],[-600],[-600],[0],[0],[-1400],[-800]]


#Therefore the temperature matrix is
T = numpy.linalg.inv(A)*B;
#Temperature at nodal points in degree K
print"Temperatures at nodal points in degree K"
print"T1 in degree K"
T1 = T[0]
print T1
print"T2 in degree K"
T2 = T[1]
print T2
print"T3 in degree K"
T3 = T[2]
print T3
print"T4 in degree K"
T4 = T[3]
print T4
print"T5 in degree K"
T5 = T[4]
print T5
print"T6 in degree K"
T6 = T[5]
print T6
print"T7 in degree K"
T7 = T[6]
print T7
print"T8 in degree K"
T8 = T[7]
print T8
Introduction to heat transfer by S.K.Som, Chapter 3, Example 3
Temperatures at nodal points in degree K
T1 in degree K
[ 398.67699539  155.83601706   66.53320567  119.43598224   79.06693359
   40.99573505   14.15266777    9.19140047]
T2 in degree K
[  77.91800853  232.60510053   92.0706763    39.53346679   80.21585865
   48.72486726   19.11393507   11.30646706]
T3 in degree K
[  33.26660284   92.0706763   237.56636783   20.49786753   48.72486726
   82.33092523   46.76647228   21.51623292]
T4 in degree K
[  14.15266777   38.22787014   93.53294456    9.19140047   22.61293411
   43.03246584  124.91948821   27.99199234]
T5 in degree K
[-0. -0. -0. -0. -0. -0. -0. -0.]
T6 in degree K
[-0. -0. -0. -0. -0. -0. -0. -0.]
T7 in degree K
[  95.65671512  227.3827139   384.21098442   77.62207329  214.83157803
  554.32152494  100.40908695  109.12176865]
T8 in degree K
[  24.51040125   60.30115763  114.75324223   18.87022369   50.97049352
  124.71059274   74.64531291  166.55931761]

Ex3.5:pg-98

In [33]:
import math
import numpy
 
print"Introduction to heat transfer by S.K.Som, Chapter 3, Example 5"
#Thermal conductivity of aluminium in W/(m*K)
k = 200.0
#Diameter in m
d = 20*(10**(-3));
#Length of fin in m
L = 0.2;
#Wall temperature in degree C
Tw = 400.0;
#Air temperature in degree C
Tinfinity = 30;
#Heat transfer coefficient in W/(m**2*K)
h = 40.0;
#internodal distance in x direction in m
deltax = L/5;
#Node 1 temperature is equal to  wall temperature in degree C
T1 = Tw;
#using Nodal Equations, we have Coefficeint Matrix A as
A = [[2.064,-1,0,0,0],[-1,2.064,-1,0,0],[0,-1,2.064,-1,0],[0,0,-1,2.064,-1],[0,0,0,-1,1.032]]
#Coefficient matrix B
B = [401.92,1.92,1.92,1.92,0.96]
#T2, T3, T4, T5, T6 are nodal temperature in degree C
#T is the temperature matrix and is transpose of [T2 T3 T4 T5 T6]
#Therefore the temperature matrix is
T = numpy.linalg.inv(A)**B;
#Temperature at nodal points in degree C
print"Temperatures at nodal points in degree C"
print"T2 in degree C"
T2 = T[0]
print T2
print"T3 in degree C"
T3 = T[1]
print T3
print"T4 in degree C"
T4 = T[2]
print T4
print"T5 in degree C"
T5 = T[3]
print T5
print"T6 in degree C"
T6 = T[4]
print T6
Introduction to heat transfer by S.K.Som, Chapter 3, Example 5
Temperatures at nodal points in degree C
T2 in degree C
[  1.83976243e-36   4.79441040e-01   3.66134997e-01   3.07581515e-01
   5.38080937e-01]
T3 in degree C
[  1.46972670e-67   1.92742646e+00   1.47191880e+00   1.23652483e+00
   1.07886949e+00]
T4 in degree C
[  4.52446173e-92   1.47191880e+00   3.54032873e+00   2.97414801e+00
   1.67320356e+00]
T5 in degree C
[  6.50142301e-108   1.23652483e+000   2.97414801e+000   5.91733919e+000
   2.36010173e+000]
T6 in degree C
[  2.06473580e-113   1.16395938e+000   2.79961015e+000   5.57008016e+000
   3.18199172e+000]

Ex3.6:pg-104

In [40]:
import math
 
print"Introduction to heat transfer by S.K.Som, Chapter 3, Example 6"
#Thermal conductivity of concrete in W/mK
k = 2;
#Length in m
L = 0.2;
#Breadth in m
b = 0.2;
#Depth in m
d = 0.2;
#Temperature of hot gas in chimney in degree C
Tg = 400;
#Air temperature in degree C
Tinfinity = 20;
#internodal distance in x direction in m
deltax = 0.1;
#internodal distance in y direction in m
deltay = 0.1;
#Heat transfer coefficient in W/(m**2*K)
h = 20;
#T1, T2, T3, T4, T5, T6, T7, T8, T9 are nodal temperatures in degree K.
#T is the temperature matrix and is transpose of [T1 T2 T3 T4 T5 T6 T7 T8 T9]
#using Nodal Equations, we have Coefficeint Matrix A as
A = numpy.array([[1,0,-4,2,0,1,0,0,0],[0,1,1,-4,1,0,1,0,0],[0,0,0,2,-4,0,0,2,0],[-3,1,1,0,0,0,0,0,0],[0,0,1,0,0,-3,1,0,0],[0,0,0,2,0,1,-6,1,0],[0,0,0,0,2,0,1,-6,1],[0,0,0,0,0,0,0,1,-2],[1,-4,0,2,0,0,0,0,0]]);
#Coefficient matrix B
B = numpy.array([0,0,0,-400,-20,-40,-40,-20,-400]);
#Therefore the temperature matrix is
T = numpy.linalg.inv(A)*B;
#Temperature at nodal points in degree C
print"Temperatures at nodal points in degree C"
print"T1 in degree C"
T1 = T[0]
print T1
print"T2 in degree C"
T2 = T[1]
print T2
print"T3 in degree C"
T3 = T[2]
print T3
print"T4 in degree C"
T4 = T[3]
print T4
print"T5 in degree C"
T5 = T[4]
print T5
print"T6 in degree C"
T6 = T[5]
print T6
print"T7 in degree C"
T7 = T[6]
print T7
print"T8 in degree C"
T8 = T[7]
print T8
print"T9 in degree C"
T9 = T[8]
print T9
Introduction to heat transfer by S.K.Som, Chapter 3, Example 6
Temperatures at nodal points in degree C
T1 in degree C
[  -0.           -0.           -0.          186.04651163    1.86046512
    2.79069767    1.86046512    0.46511628   74.41860465]
T2 in degree C
[  -0.           -0.           -0.           74.41860465    1.69263965
    3.56988732    2.51738192    0.62934548  157.39630784]
T3 in degree C
[ -0.          -0.          -0.          83.72093023   3.88875569
   4.80220571   3.06401343   0.76600336  65.85950611]
T4 in degree C
[ -0.          -0.          -0.          55.81395349   2.45504675
   5.7444258    4.10453129   1.02613282  77.58331335]
T5 in degree C
[ -0.          -0.          -0.          37.20930233   1.77415488
   4.6199952    7.34116519   1.8352913   51.37856629]
T6 in degree C
[ -0.          -0.          -0.          37.20930233   8.78446416
   4.92927356   2.18652601   0.5466315   33.8527931 ]
T7 in degree C
[ -0.          -0.          -0.          27.90697674   2.46463678
   9.98561496   3.49556461   0.87389115  35.69887317]
T8 in degree C
[ -0.          -0.          -0.          18.60465116   1.09326301
   3.49556461  10.57779909   2.64444977  25.17381923]
T9 in degree C
[ -0.          -0.          -0.           9.30232558   0.5466315
   1.74778231   5.28889954  11.32222489  12.58690961]