In [1]:

```
# Variables
A = 1. #m**2, area
#for inner layer (cement)
ti = 0.06 #m, thickness
ki = 0.72 #W/m C, thermal conductivity
Ti = -15. #C, temprature
#for middle layer (cork)
tm = 0.1 #m, thickness
km = 0.043 #W/m C, thermal conductivity
#for outer layer(brick)
to = 0.25 #m, thickness
ko = 0.7 #W/m C, thermal conductivity
To = 30. #C, temprature
# Calculation and Results
#Thermal resistance of outer layer #C/W
Ro = to/(ko*A)
#Thermal resistance of middle layer #C/W
Rm = tm/(km*A)
#Thermal resistance of inner layer #C/W
Ri = ti/(ki*A)
Rt = Ro+Rm+Ri
tdf = To-Ti #temp driving force
#(a)
Q = tdf/Rt #rate of heat gain
print "the rate of heat gain is %.2f W"%(Q)
#(b)
#from fig. 2.4
td1 = Q*to/(ko*A) #C temp. drop across the brick layer
T1 = To-td1 #interface temp. between brick and cork
#similarly
td2 = Q*tm/(km*A) #C temp. drop across the cork layer
T2 = T1-td2 #C, interface temp. between cement and cork
print "interface temp. between brick and cork is %.1f C"%(T1)
print "interface temp. between cement and cork is %.1f C"%(T2)
#(c)
Rpo = Ro/Rt #thermal resistance offered by brick layer
Rpm = Rm/Rt #thermal resistance offered by cork layer
Rpi = Ri/Rt #thermal resistance offered by cement layer
print "thermal resistance offered by brick layer is %.1f percent"%(Rpo*100)
print "thermal resistance offered by cork layer is %.1f percent"%(Rpm*100)
print "thermal resistance offered by cement layer is %.1f percent"%(Rpi*100)
#second part
x = 30. #percentage dec in heat transfer
Q1 = Q*(1-x/100) #W, desired rate of heat flow
Rth = tdf/Q1 #C/W, required thermal resistance
Rad = Rth-Rt #additional thermal resistance
Tad = Rad*km*A
print "Additional thickness of cork to be provided = %.1f cm"%(Tad*100)
```

In [2]:

```
# Variables
#outer thickness of brickwork (to) & inner thickness (ti)
to = 0.15 #m thickness
ti = 0.012 #m thickness
#thickness of intermediate layer(til)
til = 0.07 #m thick
#thermal conductivities of brick and wood
kb = 0.70 #W/m celcius
kw = 0.18 #W/m celcius
#temp. of outside and inside wall
To = -15 #celcius
Ti = 21 #celcius
#area
A = 1 #m**2
# Calculations and Results
#(a)
#Thermal resistance of brick , wood and insulating layer
TRb = to/(kb*A) #C/W
TRw = ti/(kw*A) #C/W
TRi = 2*TRb #C/W
#Total thermal resistance
TR = TRb+TRw+TRi #C/W
#Temp. driving force
T = Ti-To #C
#Rate of heat loss
Q = T/TR
print "Rate of heat loss is %.1f W"%(Q)
#(b)thermal conductivities of insulating layer
k = til/(A*TRi)
print "thermal conductivities of insulating layer is %.4f W/m C"%(k)
```

In [5]:

```
import math
# Variables
#Length & Inside rdius of gas duct
L = 1. #m
ri = 0.5 #m radius
#Properties of inner and outer layer
ki = 1.3 #W/m C, thermal conductivity of inner bricks
ti = 0.27 #m, inner layer thickness
ko = 0.92 #W/m C, thermal conductivity of special bricks
to = 0.14 #m, outer layer thickness
Ti = 400. #C, inner layer temp.
To = 65. #C, outer layer temp.
#calculation and Results
r_ = ri+ti #m, outer radius of fireclay brick layer
ro = r_+to #m, outer radius of special brick layer
#Heat transfer resistance
#Heat transfer resistance of fireclay brick
R1 = (math.log(r_/ri))/(2*math.pi*L*ki)
#Heat transfer resistance of special brick
R2 = (math.log(ro/r_))/(2*math.pi*L*ko)
#Total resistance
R = round(R1+R2,4)
#Driving force
T = Ti-To
#Rate of heat loss
Q = T/(R)
print "Rate of heat loss is %d W"%(Q)
#interface temp.
Tif = Ti-(Q*R1)
print "interface temp.is %d C"%(Tif)
#Fractional resistance offered by the special brick layer
FR = R2/(R1+R2)
print "Fractional resistance offered by the special brick layer is %.3f "%(FR)
```

In [6]:

```
import math
# Variables
d1 = 0.06 #m, one end diameter of steel rod
d2 = 0.12 #m,other end diameter of steel rod
l = 0.2 #m length of rod
T2 = 30. #C, temp. at end 2
Q = 50. #W, heat loss
k = 15. #W/m c, thermal conductivity of rod
# Calculation and Results
#T = 265.8-(7.07/(0.06-0.15*x))........(a)
#(a)
x1 = 0
#from eq. (a)
T1 = 265.8-(7.07/(0.06-0.15*x1))
print "The hot end temp. is %.0f C"%(T1)
#(b) from eq. (i)
C = 50 #integration consmath.tant
#from eq. (i)
D1 = -C/(math.pi*d1**2*k) #D = dT/dx, temprature gradient
print "The temprature gradient at hot end is %.1f C/m"%(D1)
#similarly
D2 = -1179 #at x = 0.2m
print "The temprature gradient at cold end is %.0f C/m"%(D2)
#(c)
x2 = 0.15 #m, given,
x3 = l-x2 #m, section away from the cold end
#from eq. (a)
T2 = 265.8-(7.07/(0.06-0.15*x3))
print "the temprature at 0.15m away from the cold end is %.0f C"%(T2)
```

In [7]:

```
import math
# Variables
#inside and outside diameter and Temp. of sphorical vessel
do = 16. #m, diameter
t = 0.1 #m, thick
Ri = do/2 #m, inside radius
Ro = Ri+t #m. outside radius
To = 27. #C, temperature
Ti = 4. #C ammonia
k = 0.02 #W/m C, thermal conductivity of foam layer
# Calculations and Results
#from eq. 2.23 the rate of heat transfer
Q = (Ti-To)*(4*math.pi*k*Ro*Ri)/(Ro-Ri)
print "the rate of heat transfer is %.0f W"%(Q)
#Refrigeration capacity(RC)
#3516 Watt = 1 ton
RC = -Q/3516
print "Refrigeration capacity is %.2f tons"%(RC)
```

In [8]:

```
import math
# Variables
d = 0.05 #m, diameter of rod
l = 0.5 #m, length of rod
T1 = 30. #CTemp. at one end (1)
T2 = 300. #C, temp at other end (2)
# Calculations and Results
x1 = l/2 #m, at mid plane
#temprature distribution ,
#comparing with quadratic eq. ax**2+bx+c
#and its solution as x = (-b+math.sqrt(b**2-4*a*c))/2*a
a = 1.35*10**-4
b = 1
c = -(564*x1+30.1)
T = (-b+math.sqrt(b**2-4*a*c))/(2*a)
print "the temprature midway in the rod at steady state is %.1f C"%(T)
#Temprature gradient at the ends of the rod
x2 = 0 #m, at one end
a1 = 1.35*10**-4
b1 = 1
c1 = -(564*x2+30.1)
T1 = (-b1+math.sqrt(b1**2-4*a1*c1))/(2*a1)
k1 = 202+0.0545*T1
C1 = 113930 #integration consmath.tant from eq. (1)
TG1 = C1/k1 #C/W, temprature gradient, dT/dx
#similarly
x3 = 0.5
a2 = 1.35*10**-4
b2 = 1
c2 = -(564*x3+30.1)
T2 = (-b2+math.sqrt(b2**2-4*a2*c2))/(2*a2)
k2 = 202+0.0545*T2
TG2 = C1/k2
print "Temprature gradient at one end of the rod is %.0f C/W"%(TG1)
print "Temprature gradient at other end of the rod is %.1f C/W"%(TG2)
```

In [3]:

```
import math
from scipy.integrate import quad
# Variables
#temprature distribution in wall
t = 0.3 #m, thickness of wall
k = 23.5 #W/m c thermal conductivity of wall
# Calculations and Results
x1 = 0
T1 = 600+2500*x1-12000*x1**2 #C, at surface
x2 = 0.3
T2 = 600+2500*x2-12000*x2**2 #C, at x = 0.3
def f3(x):
return 600+2500*x-12000*x**2
Tav = 1/t* quad(f3,0,0.3)[0]
print "At the surface x = 0, the temp. is %.0f C"%(T1)
print "At the surface x = 0.3m, the temp. is %.0f C"%(T2)
print "Rhe average temprature of the wall is %.0f C"%(Tav)
#(b)
#for maximum temprature D = 0
x3 = 2500/24000.
print "The maximum temprature occurs at %.3f m"%(x3)
Tmax = 600+2500*x3-12000*x3**2
print "The maximum temp. is %.0f C"%(Tmax)
#(c)
D1 = 2500-24000*x1 #at x = 0, temprature gradient
Hf1 = -k*D1 #W/m**2, heat flux at left surface(x = 0)
D2 = 2500-24000*x2 #at x = 0.3, temprature gradient
Hf2 = -k*D2 #W/m**2, heat flux at right surface(x = 0.3)
print "heat flux at left surface is %.0f W/m**2"%(Hf1)
print "heat flux at right surface is %.0f W/m**2"%(Hf2)
#(d)
Qt = Hf2-Hf1 #W/m**2, total rate of heat loss
Vw = 0.3 #m**3/m**2, volume of wall per unit surface area
Hav = Qt/Vw #W/m**3, average volumetric rate
print "The average volumetric rate if heat genaration is %.0f W/m**3 "%(Hav)
```

In [10]:

```
import math
# Variables
ka = 24 #W/mC thermal conductivitiy of material A
tA = 0.1 #m, thickness of A material
kB = 230 #W/mC thermal conductivity of metl B
kC = 200 #W/mC thermal conductivity of metal C
tB = 0.1 #m, thickness of B metal
tC = 0.1 #m, thickness of C metal
TBo = 100 #C, outer surface temp. of B wall
TCo = 100 #C, outer surface temp. of C wall
Q = 2.5*10**5 #W/m**3, heat generated
# Calculations and Results
#At D = 0
x = 2175./10416
print "The maximum temp. will occur at a position %.3f m"%(x)
x1 = x
TA = -5208*x1**2+2175*x1-74.5
print "The maximum temprature is %.1f C"%(TA)
```

In [11]:

```
import math
# Variables
di = 0.15 #m, inner diameter
do = 0.3 #m, outer diameter
Q1 = 100.*10**3 #W/,m**3,inner rate of heat generation
Q2 = 40.*10**3 #W/m**3, outer rate of heat generation
Ti = 100. #C, temp.at inside surface
To = 200. #C, temp. at outside surface
k1 = 30. #W/m C, thermal conductivity of material for inner layer
k2 = 10. #W/m C, thermal conductivity of material for outer layer
# Calculations and Results
#T1 = 364+100*math.log(r)-833.3*r**2 (1)
#T2 = 718+216*math.log(r)-1000*r**2 (2)
#(b)from eq. 1
r = math.sqrt(100./2*833.3)
print "This radial position does not fall within layer 1. Therefore no temprature maximum occurs in this layer."
#similarly
print " Similarly no temprature maximum occurs in layer 2."
ro = di # m, outer boundary
Tmax = To
print "The maximum temprature at the outer boundary is %.0f C"%(Tmax)
```