In [1]:

```
#cal of rate of heat transfer and temperature at interface of brick and wood
#intiation of all variables
# Chapter 12
import math
print"Example 12.1, Page:483 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 1")
h1=30.;#heat transfer coefficient on side of 50 oc in W/m^2 K
h5=10.;#heat transfer coefficient on side of 20 oc in W/m^2 K
k_brick=0.9;#conductivity of brick in W/m K
k_wood=0.15;#conductivity of wood in W/m K
T1=50.;#temperature of air on one side of wall in degree celcius
T5=20.;#temperature of air on other side of wall in degree celcius
A=100.;#surface area in m^2
deltax_brick=1.5*10**-2;#length of brick in m
deltax_wood=2*10**-2;#length of wood in m
print("here for one dimentional heat transfer across the wall the heat transfer circuit shall comprises of thermal resistance due to convection between air & brick(R1),conduction in brick wall(R2),conduction in wood(R3),and convection between wood and air(R4).Let temperature at outer brick wall be T2 K,brick-wood interface be T3 K,outer wood wall be T4 K")
print("overall heat transfer coefficient for steady state heat transfer(U)in W/m^2 K")
print("(1/U)=(1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5)")
print("so U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))")
U=1/((1/h1)+(deltax_brick/k_brick)+(deltax_wood/k_wood)+(1/h5))
U=3.53;#approx.
Q=U*A*(T1-T5)
print("rate of heat transfer,Q in W="),round(Q,2)
print("so rate of heat transfer=10590 W")
print("heat transfer across states 1 and 3(at interface).")
print("overall heat transfer coefficient between 1 and 3")
print("(1/U1)=(1/h1)+(deltax_brick/k_brick)")
print("so U1=1/((1/h1)+(deltax_brick/k_brick))in W/m^2 K")
U1=1/((1/h1)+(deltax_brick/k_brick))
print("Q=U1*A*(T1-T3)")
T3=T1-(Q/(U1*A))
print("so T3=T1-(Q/(U1*A))in degree celcius"),round(T3,2)
print("so temperature at interface of brick and wood =44.71 degree celcius")
```

In [2]:

```
#cal of rate of heat transfer,temperatures
#intiation of all variables
# Chapter 12
import math
print"Example 12.2, Page:484 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 2")
h1=40;#average heat transfer coefficient at inner surface in KJ/m^2 hr oc
h6=50;#average heat transfer coefficient at outer surface in KJ/m^2 hr oc
deltax_steel=2*10**-3;#mild steel sheets thickness in m
deltax_wool=5*10**-2;#thickness of glass wool insulation in m
k_wool=0.16;#thermal conductivity of wool in KJ/m hr
k_steel=160;#thermal conductivity of steel in KJ/m hr
T1=25;#kitchen temperature in degree celcius
T6=5;#refrigerator temperature in degree celcius
print("here thermal resistances are")
print("R1=thermal resistance due to convection between kitchen air and outer surface of refrigerator wall(T1 & T2)")
print("R2=thermal resistance due to conduction across mild steel wall between 2 & 3(T2 & T3)")
print("R3=thermal resistance due to conduction across glass wool between 3 & 4(T3 & T4)")
print("R4=thermal resistance due to conduction across mild steel wall between 4 & 5(T4 & T5)")
print("R5=thermal resistance due to convection between inside refrigerator wall and inside of refrigerator between 5 & 6(T5 & T6)")
print("overall heat transfer coefficient for one dimentional steady state heat transfer")
print("(1/U)=(1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6)")
print("so U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))in KJ/m^2hr oc")
U=1/((1/h1)+(deltax_steel/k_steel)+(deltax_wool/k_wool)+(deltax_steel/k_steel)+(1/h6))
U=2.8;#approx.
A=4*(1*0.5)
Q=U*A*(T1-T6)
print("rate of heat transfer(Q) in KJ/m^2 hr="),round(Q,2)
print("wall surface area(A) in m^2")
print("so rate of heat transfer=112 KJ/m^2 hr ")
print("Q=A*h1*(T1-T2)=k_steel*A*(T2-T3)/deltax_steel=k_wool*A*(T3-T4)/deltax_wool")
print("Q=k_steel*A*(T4-T5)/deltax_steel=A*h6*(T5-T6)")
T2=T1-(Q/(A*h1))
print("substituting,T2 in degree celcius="),round(T2,1)
print("so temperature of outer wall,T2=23.6 oc")
T3=T2-(Q*deltax_steel/(k_steel*A))
print("T3 in degree= "),round(T3,2)
print("so temperature at interface of outer steel wall and wool,T3=23.59 oc")
T4=T3-(Q*deltax_wool/(k_wool*A))
print("T4 in degree celcius="),round(T4,2)
print("so temperature at interface of wool and inside steel wall,T4=6.09 oc")
T5=T4-(Q*deltax_steel/(k_steel*A))
print("T5 in degree celcius="),round(T5,2)
print("so temperature at inside of inner steel wall,T5=6.08 oc")
```

In [3]:

```
#cal of heat loss per meter from pipe and quality of steam
#intiation of all variables
# Chapter 12
import math
print"Example 12.3, Page:486 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 3")
k_insulation=0.3;#thermal conductivity of insulation in KJ/m hr oc
k_pipe=209;#thermal conductivity of pipe in KJ/m hr oc
T1=300;#temperature of inner surface of steam pipe in degree celcius
T3=50;#temperature of outer surface of insulation layer in degree celcius
r1=15*10**-2/2;#steam pipe inner radius without insulation in m
r2=16*10**-2/2;#steam pipe outer radius without insulation in m
r3=22*10**-2/2;#radius with insulation in m
m=0.5;#steam entering rate in kg/min
print("here,heat conduction is considered in pipe wall from 1 to 2 and conduction through insulation between 2 and 3 of one dimentional steady state type.")
print("Q=(T1-T3)*2*%pi*L/((1/k_pipe)*log(r2/r1)+(1/k_insulation*log(r3/r2)))in KJ/hr")
L=1;
Q=(T1-T3)*2*math.pi*L/((1/k_pipe)*math.log(r2/r1)+(1/k_insulation*math.log(r3/r2)))
print("so heat loss per meter from pipe in KJ/hr="),round(Q,2)
Q=5*Q
print("heat loss from 5 m length(Q) in KJ/hr"),round(5*1479.34,2)
print("enthalpy of saturated steam at 300 oc,h_sat=2749 KJ/kg=hg from steam table")
hg=2749;
print("mass flow of steam(m)in kg/hr")
m=m*60
print("final enthalpy of steam per kg at exit of 5 m pipe(h)in KJ/kg")
h=hg-(Q/m)
print("let quality of steam at exit be x,")
print("also at 300oc,hf=1344 KJ/kg,hfg=1404.9 KJ/kg from steam table")
hf=1344;
hfg=1404.9;
print("h=hf+x*hfg")
x=(h-hf)/hfg
print("so x=(h-hf)/hfg"),round(x,4)
print("so quality of steam at exit=0.8245")
```

In [4]:

```
#cal of amount of heat transfer and heat flux
#intiation of all variables
# Chapter 12
import math
print"Example 12.4, Page:487 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 4")
r1=150.*10**-2/2;#inner radius in m
r2=200.*10**-2/2;#outer radius in m
k=28.;#thermal conductivity in KJ m hr oc
T1=200.;#inside surface temperature in degree celcius
T2=40.;#outer surface temperature in degree celcius
print("considering one dimensional heat transfer of steady state type")
Q=(T1-T2)*4*math.pi*k*r1*r2/(r2-r1)
print("for sphere(Q)=(T1-T2)*4*%pi*k*r1*r2/(r2-r1) in KJ/hr"),round(Q,2)
print("so heat transfer rate=168892.02 KJ/hr")
Q/(4*math.pi*r1**2)
print("heat flux in KJ/m^2 hr="),round(Q/(4*math.pi*r1**2),2)
print("so heat flux=23893.33 KJ/m^2 hr")
```

In [5]:

```
#cal of heat transfer rate
#intiation of all variables
# Chapter 12
import math
print"Example 12.5, Page:487 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 5")
T1=25.;#room temperature in degree celcius
T4=2.;#winter outside temperature in degree celcius
h1=10.;#heat transfer coefficient on inner window surfaces in W/m^2 oc
h4=30.;#heat transfer coefficient on outer window surfaces in W/m^2 oc
k=0.78;#thermal conductivity of glass in W/m^2 oc
A=75.*10**-2*100.*10**-2;#area in m^2
deltax=10.*10**-3;#glass thickness in m
print("R1=thermal resistance for convection heat transfer between inside room (1)and inside surface of glass window(2)=1/(h1*A)")
print("R2=thermal resistance for conduction through glass between inside of glass window(2)to outside surface of glass window(3)=deltax/(k*A)")
print("R3=thermal resistance for convection heat transfer between outside surface of glass window(3)to outside atmosphere(4)=1/(h4*A)")
print("total thermal resistance,R_total=R1+R2+R3 in oc/W")
R_total=1/(h1*A)+deltax/(k*A)+1/(h4*A)
Q=(T1-T4)/R_total
print("so rate of heat transfer,Q=(T1-T4)/R_total in W"),round(Q,2)
print("heat transfer rate from inside of room to inside surface of glass window.")
R1=(1/7.5);
T2=T1-Q*R1
print("Q=(T1-T2)/R1")
print("so T2=T1-Q*R1 in degree celcius"),round(T2,2)
print("Thus,inside surface of glass window will be at temperature of 9.26 oc where as room inside temperature is 25 oc")
```

In [6]:

```
#cal of heat transfer rate
#intiation of all variables
# Chapter 12
import math
print"Example 12.6, Page:488 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 6")
D=4*10**-2;#inner diameter in m
L=3;#length in m
V=1;#velocity of water in m/s
T1=40;#mean temperature in degree celcius
T2=75;#pipe wall temperature in degree celcius
k=0.6;#conductivity of water in W/m
Pr=3;#prandtl no.
v=0.478*10**-6;#viscocity in m^2/s
print("reynolds number,Re=V*D/v")
Re=V*D/v
print("subsituting in Nu=0.023*(Re)^0.8*(Pr)^0.4")
print("or (h*D/k)=0.023*(Re)^0.8*(Pr)^0.4")
print("so h=(k/D)*0.023*(Re)^0.8*(Pr)^0.4 in W/m^2 K")
h=(k/D)*0.023*(Re)**0.8*(Pr)**0.4
print("rate of heat transfer due to convection,Q in W ")
Q=h*(math.pi*D*L)*(T2-T1)
print("Q=h*A*(T2-T1)="),round(Q,2)
print("so heat transfer rate=61259.38 W")
```

In [7]:

```
#cal of surface area
#intiation of all variables
# Chapter 12
import math
print"Example 12.7, Page:489 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 7")
m=0.5;#hot gases flowing rate in kg/s
T1=500;#initial temperature of gas in degree celcius
T2=150;#final temperature of gas in degree celcius
Cg=1.2;#specific heat of gas in KJ/kg K
Cw=4.18;#specific heat of water in KJ/kg K
U=150;#overall heat transfer coefficient in W/m^2 K
mw=1;#mass of water in kg/s
T3=10;#water entering temperature in degree celcius
print("Let the temperature of water at exit be T")
print("Heat exchanger,Q=heat rejected by glasses=heat gained by water")
print("Q=m*Cg*(T1-T2)=mw*Cw*(T-T3)")
print("so T=T3+(m*Cg*(T1-T2)/(mw*Cw))in degree celcius")
T=T3+(m*Cg*(T1-T2)/(mw*Cw))
print("and Q in KJ")
Q=m*Cg*(T1-T2)
print("deltaT_in=T1-T3 in degree celcius")
deltaT_in=T1-T3
print("deltaT_out=T2-T in degree celcius")
deltaT_out=T2-T
print("for parallel flow heat exchanger,")
print("LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree celcius")
LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)
print("also,Q=U*A*LMTD")
A=Q*10**3/(U*LMTD)
print("so A=Q/(U*LMTD) in m^2"),round(A,3)
print("surface area,A=5.936 m^2")
```

In [8]:

```
#cal of surface area
#intiation of all variables
# Chapter 12
import math
print"Example 12.8, Page:490 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 8")
mc=20;#mass of oil in kg/min
Tc_out=100;#initial temperature of oil in degree celcius
Th_in=30;#final temperature of oil in degree celcius
Th_out=25;#temperature of water in degree celcius
Cpc=2;#specific heat of oil in KJ/kg K
Cph=4.18;#specific heat of water in KJ/kg K
mh=15;#water flow rate in kg/min
U=25;#overall heat transfer coefficient in W/m^2 K
print("This oil cooler has arrangement similar to a counter flow heat exchanger.")
print("by heat exchanger,Q=U*A*LMTD=mc*Cpc*(Tc_out-Th_in)=mh*Cph*(Tc_in-Th_out)")
print("so Q in KJ/min")
Q=mc*Cpc*(Tc_out-Th_in)
print("and T=Th_out+(Q/(mh*Cph))in degree celcius")
T=Th_out+(Q/(mh*Cph))
print("LMTD=(deltaT_in-deltaT_out)/log(deltaT_in/deltaT_out)in degree ")
print("here deltaT_in=Tc_out-T in degree celcius")
deltaT_in=Tc_out-T
print("deltaT_out=Th_in-Th_out in degree celcius")
deltaT_out=Th_in-Th_out
print("so LMTD in degree celcius")
LMTD=(deltaT_in-deltaT_out)/math.log(deltaT_in/deltaT_out)
print("substituting in,Q=U*A*LMTD")
A=(Q*10**3/60)/(U*LMTD)
print("A=(Q*10^3/60)/(U*LMTD)in m^2"),round(A,2)
print("so surface area=132.85 m^2")
```

In [9]:

```
#cal of heat loss per unit area by radiation
#intiation of all variables
# Chapter 12
import math
print"Example 12.9, Page:490 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 9")
T1=(1200+273);#temperature of body in K
T2=(600+273);#temperature of black surrounding in K
epsilon=0.4;#emissivity of body at 1200 degree celcius
sigma=5.67*10**-8;#stephen boltzman constant in W/m^2 K^4
print("rate of heat loss by radiation(Q)=wpsilon*sigma*A*(T1^4-T2^4)")
print("heat loss per unit area by radiation(Q)in W")
Q=epsilon*sigma*(T1**4-T2**4)
print("Q="),round(Q,2)
```

In [10]:

```
#cal of temperature at interface
#intiation of all variables
# Chapter 12
import math
print"Example 12.10, Page:491 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 10")
V=16.;#voltage drop in V
I=5.;#current in cable in A
r2=8.*10.**-3/2.;#outer cable radius in m
r3=3.*10.**-3/2.;#copper wire radius in m
k=0.16;#thermal conductivity of copper wire in W/m oc
L=5.;#length of cable in m
h1=15.;#heat transfer coefficient of cable in W/m^2 oc
T1=40.;#temperature of surrounding in degree celcius
print("Let us carry out one dimentional analysis for steady state.Due to flow of electricity the heat generated can be given as:")
print("Q=V*I in W")
Q=V*I
print("For steady state which means there should be no change in temperature of cable due to electricity flow,the heat generated should be transferred out to surroundings.Therefore,heat transfer across table should be 80 W")
print("surface area for heat transfer,A2=2*%pi*r*L in m^2")
A2=2.*math.pi*r2*L
A2=0.125;#approx.
print("R1=thermal resistance due to convection between surroundings and cable outer surface,(1-2)=1/(h1*A2)")
print("R2=thermal resistance due to conduction across plastic insulation(2-3)=log(r2/r3)/(2*%pi*k*L)")
print("Total resistance,R_total=R1+R2 in oc/W")
R_total=(1/(h1*A2))+(math.log(r2/r3)/(2.*math.pi*k*L))
print("Q=(T3-T1)/R_total")
T3=T1+Q*R_total
print("so T3 in degree celcius="),round(T3,2)
print("so temperature at interface=125.12 degree celcius")
rc=k/h1
print("critical radius of insulation,rc in m="),round(rc,2)
print("rc in mm"),round(rc*1000,2)
print("This rc is more than outer radius of cable so the increase in thickness of insulation upon rc=110.66 mmwould increase rate of heat transfer.Doubling insulation thickness means new outer radius would be r1=1.5+5=6.5 mm.Hence doubling(increase) of insulation thickness would increase heat transfer and thus temperature at interface would decrease if other parameters reamins constant.")
print("NOTE=>In this question value of R_total is calculated wrong in book,hence it is correctly solve above,so the values of R_total and T3 may vary.")
```

In [11]:

```
#cal of heat transferred per unit length
#intiation of all variables
# Chapter 12
import math
print"Example 12.11, Page:492 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 11")
r_wire=3;#radius of electric wire in mm
k=0.16;#thermal conductivity in W/m oc
T_surrounding=45;#temperature of surrounding in degree celcius
T_surface=80;#temperature of surface in degree celcius
h=16;#heat transfer cooefficient in W/m^2 oc
print("for maximum heat transfer the critical radius of insulation should be used.")
print("critical radius of insulation(rc)=k/h in mm")
rc=k*1000/h
print("economical thickness of insulation(t)=rc-r_wire in mm")
t=rc-r_wire
print("so economical thickness of insulation=7 mm")
print("heat convected from cable surface to environment,Q in W")
L=1;#length in mm
Q=2*math.pi*rc*L*h*(T_surface-T_surrounding)*10**-3
print("Q="),round(Q,1)
print("so heat transferred per unit length=35.2 W")
```

In [12]:

```
#cal of heat exchange
#intiation of all variables
# Chapter 12
import math
print"Example 12.12, Page:492 \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 12 Example 12")
T1=(-150+273);#temperature of air inside in K
T2=(35+273);#temperature of outer surface in K
epsilon1=0.03;#emissivity
epsilon2=epsilon1;
D1=25*10**-2;#diameter of inner sphere in m
D2=30*10**-2;#diameter of outer sphere in m
sigma=2.04*10**-4;#stephen boltzmann constant in KJ/m^2 hr K^4
print("heat transfer through concentric sphere,Q in KJ/hr ")
A1=4*math.pi*D1**2/4;
A2=4*math.pi*D2**2/4;
Q=(A1*sigma*(T1**4-T2**4))/((1/epsilon1)+((A1/A2)*((1/epsilon2)-1)))
print("Q="),round(Q,2)
print("so heat exchange=6297.1 KJ/hr")
```