#A large flat wall consists of two well bonded layers of material 8 in thick
#and 1 in thick. The 8 in thick layer is concrete having a k=0.50. and the 1- in
#k=0.02. The surface temp is -20 F. and the surface temp. of concrete is 60 F.
#Find the rate of heat flow per unit area, the temperature at the interface
#between the two layers and the resistances per unit area of the two layers
import math
#initialisation of variables
t= 8. #in
t1= 1. #in
k= 0.50 #Btu/hr ft F
k1= 0.02 #Btu/hr ft F
A= 1 #ft^2
T= 60 #F
T1= -20 #F
#CALCULATIONS
Rc= (t/12.)/(k*A) #Resistance 1
Rf= (t1/12.)/(k1*A) #Resistance 2
R= Rc+Rf #Total resistance
q= (T-T1)/R #Heat
T2= (T+(Rc/Rf)*T1)/(1+(Rc/Rf)) #temp of the interface
#RESULTS
print '%s %.2f' %('Rate of heat flow (Btu/hr) = ',q)
print '%s %.2f' %(' \n Temperature at the interface (F) = ',T2)
raw_input('press enter key to exit')
#A steel pipe of 10 in inside dia. and 0.375 in. wall thickness carries steam
#at 500 f. The pipe is covered by 2 in of insulation to reduce heat losses to
#surroundings at 80 F. It is known from tests that the convection coefficients
#for inside and outside are 2500 and 1.6. to protect personnel it is desired
#that the outside shouldn't exceed 140 f. If ksteel=26. and insulation is 0.045.
#will the 2 in thickness of insulation meet the requirement?
import math
#initialisation of variables
h1= 2500. #Btu/sq ft hr F
r= 10. #in
t= 0.375 #in
Ts= 500. #F
Ta= 80. #F
r2= 5.375 #in
r1= 5. #in
r3= 7.375 #in
kp= 26. #Btu ft/hr
ki= 0.045 #Btu ft/hr
h1= 2500. #Btu/sq ft hr F
h3= 1.6 #Btu/sq ft hr F
r4= 14.750
#CALCULATIONS
R1= 1/(h1*math.pi*(r/12.)) #Resistance 1
Rp= math.log(r2/r1)/(2*math.pi*kp) #Resistance 2
Ri= math.log(r3/r2)/(2*math.pi*ki) #Resistance 3
R3= 1/(h3*math.pi*(r4/12.)) #Resistance 4
R0= R1+Rp+Ri+R3 #Total reistance
T3=Ta+ (Ts-Ta)*R3/R0 #Interface temp.
#RESULTS
print '%s %.6f' %('Temperature at the interface (F) = ',T3)
raw_input('press enter key to exit')
#Lubricating oil is to be cooled from 170 F to 120 F by water ssupplied at 100F.
#Inorder to minimize the water requirement it is desired, if possible to have
#water rise to 140F, the highest permissible temp. The oil flow rate is 40000.
#the oil cp=0.5 and U=120. (b) Find the water flow rate for the counter flow
#operation. (c) Find the heat transfer surface required for the counter flow.
#(d) with the water flow rate found in (b), to what temp. could the oil be
#cooled in a parallel exchanger of unlimited area (e) In the exchanger of (d)
#how much water flow would be required to cool oil to 120F?
import math
#initialisation of variables
wh= 40000. #lb.hr
cph= 0.5 #Btu/lb F
th1= 170. #F
th2= 120. #F
cpc= 1 #Btu/lb F
tc2= 140. #F
tc1= 100. #F
t= 140 #F
U= 120 #Btu/sq ft hr F
#CALCULATIONS
dh= t-th2 #Change in temp. for hot
dc= tc2-tc1 #Change in temp. for cold
wc= (wh*cph*(th1-th2))/(cpc*dc) #weight of cold
dtm= (-(tc1-th2)-(th1-tc2))/math.log((-tc1+th2)/(th1-tc2)) #lmtd
q= wh*cph*(th1-th2) #heat
print(q)
A= q/(U*dtm) #area
th2= ((wh/wc)*(cph/cpc)*th1+tc1)/((wh/wc)*(cph/cpc)+1)#Hot final
wc1= (wh*cph*(th1-th2))/(cpc*(th2-tc1)) #weight of cold final
#RESULTS
print '%s %.2f' %('Water flow rate (lb/hr) = ',wc)
print '%s %.2f' %(' \n Area of heat transfer surface (sq ft) = ',A)
print '%s %.2f' %(' \n temperature of the oil (F) = ',th2)
print '%s %.2f' %(' \n flow rate (lb/hr) = ',wc1*2)
raw_input('press enter key to exit')
#Find the film coefficient for airr flowing at 100 fps thru a tube of 1 in outside
#diameter and 18 gage thickness , if the avg. bulk air temp. is 600F, the pressure
#is 1 atm,a nd the tube wall is 200 F?
import math
#initialisation of variables
Tw= 200. #F
Ta= 600. #F
V= 100 #fps
Di= 0.902 #in
d= 0.0375 #lb/cu ft
u= 0.000020 #lbm/sec
cp= 0.25 #Btu/lb F
k= 0.027 #Btu/sq ft hr
#CALCULATIONS
NRe= (Di*V*d)/(u*12)#Reynolds number
Npr= 0.66 #prandtl number
h= k*0.023*math.pow(NRe,0.8)*math.pow(Npr,0.4)*12/Di
#RESULTS
print '%s %.2f' %('Film coefficient (Btu/sq ft hr F) = ',h)
raw_input('press enter key to exit')
#Find the film coefficient for the conditions of example 5, using eq. 17
import math
#initialisation of variables
Tw= 200 #F
Ta= 600 #F
cpb= 0.25 # Btu/lb F
tf= 0.68
uf= 0.000017 #lbm/sec ft
D= 0.902 #in
V= 100. #fps
d= 0.0375 #lb/cu ft
#CALCULATIONS
Nre= (D/12.)*V*d/uf #reynolds number
Npr= 0.68 #prandtl number
h= cpb*V*3600*d*0.023/(math.pow(Nre,0.2)*math.pow(Npr,(2./3.)))
#RESULTS
print '%s %.2f' %('Film coefficient (Btu/sq ft hr F) = ',h)
raw_input('press enter key to exit')
#An uninsulated 3 in steam pipe passes through a room in which the air and all
#solid surfaces are at an average temp. of 70 F. If the surface temp. of the
#steam pipe is 200F, estimate the heat loss per foot of pipe by radiation and
# compare the relative magnitudes of losses by radiation and by free convection.
import math
#initialisation of variables
A1= 0.916 #ft^2
e1= 0.8
s= 0.173 #BTU s^-1 in^-2 R^-4
T= 200 #F
T1= 70 #F
D= 0.292
#CALCULATIONS
q= (A1/math.pow(10,6))*e1*s*((math.pow((T+460),4)/100.)-(math.pow((T1+460),4)/100.))
hr= q/(A1*(T-T1)) #Coefficient of convection
hc= 0.27*math.pow(((T-T1)/D),0.25) #free convection coefficient
#RESULTS
print '%s %.2f' %('Heat loss (Btu/hr) = ',q)
print '%s %.2f' %(' \n hr (Btu/sq ft hr F) = ',hr)
print '%s %.2f' %(' \n hc (Btu/sq ft hr F) = ',hc)
raw_input('press enter key to exit')
#A peep hole in the furnace wall of 13.5 in thickness is 8 in. square. the inside
#of the furnace is at uniform temp. of 1500 F and the external surroundings are at
#120 F. estimate the rate of heat loss by radiation through the open peep hole?
import math
#initialisation of variables
T= 120. #F
T1= 1500. #F
A= 64./144.
F= 0.86
Fe= 1
s= 0.173 #BTU s^-1 in^-2 R^-4
#CALCULATIONS
q= (A/math.pow(10,6))*F*Fe*s*((math.pow((T1+460),4)/100.)-(math.pow((T+460),4)/100.))
#RESULTS
print '%s %.2f' %('Heat loss (Btu/hr) = ',q)
raw_input('press enter key to exit')