print"\t example 9.1 \t"
print"\t approximate values are mentioned in the book \t"
#given
T1=245; # inlet hot fluid,F
T2=95; # outlet hot fluid,F
t1=85; # inlet cold fluid,F
t2=95; # outlet cold fluid,F
W=9872; # lb/hr
w=78500; # lb/hr
#solution
from math import log
print"\t 1.for heat balance \t"
print"\t for ammonia gas \t"
c=0.53; # Btu/(lb)*(F)
Q=((W)*(c)*(T1-T2)); # Btu/hr
print"\t total heat required for ammonia gas is : Btu/hr \t",Q
print"\t for water \t"
c=1; # Btu/(lb)*(F)
Q=((w)*(c)*(t2-t1)); # Btu/hr
print"\t total heat required for water is : Btu/hr \t",Q
delt1=T2-t1; #F
delt2=T1-t2; # F
print"\t delt1 is : F \t",delt1
print"\t delt2 is : F \t",delt2
LMTD=((delt2-delt1)/((2.3)*(log(delt2/delt1))));
print"\t LMTD is : F \t",LMTD
R=((T1-T2)/(t2-t1));
print"\t R is : \t",R
S=((t2-t1)/(T1-t1));
print"\t S is : \t",S
print"\t FT is 0.837 \t" # from fig 18
delt=(0.837*LMTD); # F
print"\t delt is : F \t",delt
Tc=((T2)+(T1))/2; # caloric temperature of hot fluid,F
print"\t caloric temperature of hot fluid is : F \t",Tc
tc=((t1)+(t2))/2; # caloric temperature of cold fluid,F
print"\t caloric temperature of cold fluid is : F \t",tc
print"\t hot fluid:shell side,ammonia at 83psia \t"
ID=23.25; # in
C=0.1875; # clearance
B=12; # baffle spacing,in
PT=0.937;
As=((ID*C*B)/(144*PT)); # flow area,ft**2,from eq 7.1
print"\t flow area is : ft**2 \t",As
Gs=(W/As); # mass velocity,lb/(hr)*(ft**2),from eq 7.2
print"\t mass velocity is : lb/(hr)*(ft**2) \t",Gs
mu1=0.012*2.42; # at 170F,lb/(ft)*(hr), from fig.15
De=0.55/12; # from fig.28,ft
Res=((De)*(Gs)/mu1); # reynolds number
print"\t reynolds number is : \t",Res
jH=118; # from fig.28
k=0.017; # Btu/(hr)*(ft**2)*(F/ft),from table 5
Z=0.97; # Z=(Pr*(1/3)) prandelt number
ho=((jH)*(k/De)*(Z)*1); # using eq.6.15,Btu/(hr)*(ft**2)*(F)
print"\t individual heat transfer coefficient is : Btu/(hr)*(ft**2)*(F) \t",ho
print"\t cold fluid:inner tube side,water \t"
Nt=364;
n=8; # number of passes
L=8; #ft
at1=0.302; # flow area, in**2,from table 10
at=((Nt*at1)/(144*n)); # total area,ft**2,from eq.7.48
print"\t flow area is : ft**2 \t",at
Gt=(w/(at)); # mass velocity,lb/(hr)*(ft**2)
print"\t mass velocity is : lb/(hr)*(ft**2) \t",Gt
V=(Gt/(3600*62.5)); # fps
print"\t V is : fps \t",V
mu2=0.82*2.42; # at 90F,lb/(ft)*(hr),from fig 14
D=(0.62/12); # ft,from table 10
Ret=((D)*(Gt)/mu2); # reynolds number
print"\t reynolds number is : \t",Ret
hi=900; # using fig 25,Btu/(hr)*(ft**2)*(F)
print"\t hi is : Btu/(hr)*(ft**2)*(F) \t",hi
ID=0.62; # ft
OD=0.75; #ft
hio=((hi)*(ID/OD)); # using eq.6.5
print"\t Correct hi0 to the surface at the OD is : Btu/(hr)*(ft**2)*(F) \t",hio
Uc=((hio)*(ho)/(hio+ho)); # clean overall coefficient,Btu/(hr)*(ft**2)*(F)
print"\t clean overall coefficient is : Btu/(hr)*(ft**2)*(F) \t",Uc
A2=0.1963; # actual surface supplied for each tube,ft**2,from table 10
A=(Nt*L*A2); # ft**2
print"\t total surface area is : ft**2 \t",A
UD=((Q)/((A)*(delt)));
print"\t actual design overall coefficient is : Btu/(hr)*(ft**2)*(F) \t",UD
Rd=((Uc-UD)/((UD)*(Uc))); # (hr)*(ft**2)*(F)/Btu
print"\t actual Rd is : (hr)*(ft**2)*(F)/Btu \t",Rd
print"\t pressure drop for annulus \t"
f=0.00162; # friction factor for reynolds number 40200, using fig.29
Ds=23.25/12; # ft
phys=1;
N=(12*L/B); # number of crosses,using eq.7.43
print"\t number of crosses are : \t",N
rowgas=0.209;
print"\t rowgas is lb/ft**3 \t",rowgas
s=rowgas/62.5;
print"\t s is \t",s
delPs=((f*(Gs**2)*(Ds)*(N))/(5.22*(10**10)*(De)*(s)*(phys))); # using eq.7.44,psi
print"\t delPs is : psi \t",delPs
print"\t allowable delPs is 2 psi \t"
print"\t pressure drop for inner pipe \t"
f=0.000225; # friction factor for reynolds number 21400, using fig.26
s=1;
D=0.0517; #ft
phyt=1;
delPt=((f*(Gt**2)*(L)*(n))/(5.22*(10**10)*(D)*(s)*(phyt))); # using eq.7.45,psi
print"\t delPt is : psi \t",round(delPt,1)
X1=0.090; # X1=((V**2)/(2*g)), for Gt 1060000,using fig.27
delPr=((4*n*X1)/(s)); # using eq.7.46,psi
print"\t delPr is : psi \t",round(delPr,1)
delPT=delPt+delPr; # using eq.7.47,psi
print"\t delPT is : psi \t",round(delPT,1)
print"\t allowable delPT is 10 psi \t"
#end