#calculate the interface temperature
#Initialization of variables
km1=0.62
km2=0.16
km3=0.4
l1=8. #in
l2=4. #in
l3=4. #in
Tf=1600. #F
Tc=100. #F
#calculations
Rw=l1/12./km1 +l2/12./km2 +l3/12./km3
Rb=l1/12./km1
Ti=Tf-Rb/Rw *(Tf-Tc)
#results
print '%s %.1f %s' %("Interface temperature =",Ti,"F")
print '%s' %("The answers might differ a bit from textbook due to rounding off error.")
#calculate the heat flow and the interface temperature
#Initialization of variables
import math
th=350. #F
tc=150. #F
od1=4.5
id1=4.026
od2=6.5
id2=4.5
k1=32.
k2=0.042
#calculations
Q=2*math.pi*(th-tc)/(math.log(od1/id1) /k1 + math.log(od2/id2) /k2)
r1=math.log(od1/id1) /k1
rt=math.log(od1/id1) /k1 + math.log(od2/id2) /k2
ti=th-r1/rt*(th-tc)
#results
print '%s %.1f %s' %("Heat flow =",Q,"Btu/hr")
print '%s %.2f %s' %("\n Interface temperature =",ti," F")
#calculate the net energy exchange in the process
#Initialization of variables
import math
Fa=0.045
l=4. #m
b=4. #m
Fe=1.
Ta=540.+460 #R
Tb=1540.+460 #R
#calculations
A=l*b
Q=0.173*A*Fa*Fe*(math.pow((Tb/100.),4) -math.pow((Ta/100.),4))
Q2=416000.
#results
print '%s %d %s' %("In case 1, Net energy exchange =",Q,"Btu/hr")
print '%s %d %s' %("\n In case 2, Net energy exchange =",Q2,"Btu/hr")
print '%s' %('The answers are a bit different due to rounding off error in textbook')
#calculate the net energy exchange
#Initialization of variables
import math
ea=0.8
eb=0.7
Fa=0.045
l=4. #m
b=4. #m
Fe=1.
Ta=540.+460 #R
Tb=1540.+460 #R
#calculations
A=l*b
ef=ea*eb
Q=0.173*A*Fa*Fe*ef*(math.pow((Tb/100),4) -math.pow((Ta/100),4))
#results
print '%s %d %s' %("Net energy exchange =", Q,"Btu/hr")
print '%s' %('The answers are a bit different due to rounding off error in textbook')
#calculate the inside film coefficient
#Initialization of variables
import math
den=61.995 #lb/cu ft
vel=6 #ft/s
t1=100. #F
t2=160. #F
de=2.067 #in
mu=1.238
pr=3.3
#calculations
G=den*vel*3600.
tm=(t1+t2)/2
hc=0.023*0.377/(de/12.) *math.pow(de/12 *G/mu,0.8) *math.pow(pr,0.4)
#results
print '%s %d %s' %("Inside film coefficient =",hc,"Btu/sq ft hr F")
#calculate the inside film coefficient
#Initialization of variables
import math
d=0.5 #in
tm=1000. #F
v=5#ft/s
k=38.2
den=51.2
mu=0.3
#calculations
Nu=7+ 0.025*math.pow((d/12 *v*den*mu/k*3600),0.8)
h=Nu*k/(d/12.)
#results
print '%s %d %s' %("Inside film coefficient =",h,"Btu/sq ft hr F")
#calculate the convective film coefficient
#Initialization of variables
import math
do=2 #in
tf=120. #F
ti=80. #F
rho=0.0709
g=32.17
bet=1/560.
cp=0.24
mu=0.0461
k=0.0157
d=2. #in
Cd=0.45
#calculations
GrPr=math.pow(d/12.,3) *rho*rho *g*3600*3600. *bet*(tf-ti)*cp/(mu*k)
hc=Cd*k/math.pow(d/12.,(1./4.)) *math.pow(GrPr,(1./4.))
#results
print '%s %.3f %s' %("Convective film coefficient =",hc,"Btu/sq ft hr F")
#calculate the outer film coefficient
#Initialization of variables
import math
tf=220. #F
ti=200. #F
d=2. #in
C=103.7
k=0.394
rho=59.37
hfg=965.2
mu=0.70
#calculations
h=C*math.pow(k*k*k *rho*rho *hfg/((d/12.) *mu*(tf-ti)),(1./4.))
#results
print '%s %d %s' %("Outer film coefficient =",h,"Btu/sq ft hr F")
#calculate the boiling film coefficient
#Initialization of variables
tf=225. #F
a=190.
b=0.043
ti=212. #F
#calculations
hc=a/(1-b*(tf-ti))
hcti=hc*1.25
#results
print '%s %.1f %s' %("For a flat copper plate, boiling film coefficient =",hc," Btu/sq ft hr F")
print '%s %d %s' %("\n For an inclined copper plate, boiling film coefficient =",hcti,"Btu/sq ft hr F")
#calculate the heat transferred per foot length of pipe
#Initialization of variables
import math
Do=2.375 #in
hi=1200.
Di=2.067 #in
km=29.2
h0=1500.
L=2.375 #in
t1=220. #F
t4=140. #F
#calculations
U0= 1/(Do/(Di*hi) + (Do/12. *math.log(Do/Di) /(2*km)) + 1./h0)
Q=U0*L*math.pi*(t1-t4)/12.
#results
print '%s %d %s' %("Heat transferred per foot length of pipe =",Q,"btu/hr")
#calculate the temperature of inner and outer surfaces of pipe
#Initialization of variables
import math
Do=2.375 #in
hi=1200.
Di=2.067 #in
km=29.2
h0=1500.
L=2.375 #in
t1=220. #F
t4=140. #F
#calculations
Re=Do/(Di*hi)
R0=Do/(Di*hi) + (Do/12. *math.log(Do/Di) /(2*km)) + 1./h0
td=Re/R0 *(t1-t4)
ti=t4+td
Req=1./h0
td2=Req/R0 *(t1-t4)
to=t1-td2
#results
print '%s %.1f %s' %("The temperature of the inner surface of pipe =",ti," F")
print '%s %.1f %s' %("\n The temperature of the outer surface of pipe =",to," F")
#calculate the Logarithmic Mean temperature difference
#Initialization of variables
import math
th1=800. #F
th2=300. #F
tc1=100. #F
tc2=400. #F
#calculations
lmtd= ((th1-tc2) - (th2-tc1) )/(math.log((th1-tc2)/(th2-tc1)))
#results
print '%s %d %s' %("Logarithmic Mean temperature difference =",lmtd,"F")
#calculate the True Mean temperature difference
#Initialization of variables
import math
th1=200. #F
th2=100. #F
tc1=80. #F
tc2=110. #F
#calculations
print '%s' %("From the lmtd graph,")
R=(tc1-tc2)/(th2-th1)
P=(th2-th1)/(tc1-th1)
F=0.62
lmtd= F* ((th1-tc2) - (th2-tc1) )/(math.log((th1-tc2)/(th2-tc1)))
#results
print '%s %.1f %s' %("True Mean temperature difference =",lmtd," F")