Chapter5: Heat Exchangers

Example no:5.1,Page no:5.22

In [156]:
#Harpin exchanger
import math
#Variable declaration
Di=35.0       #[mm]
Di=Di/1000      #[m]
Do=42.0       #[mm]
Do=Do/1000      #[m]
#for benzene
mb_dot=4450.0     #[kg/h]
Cpb=1.779       #[kJ/(kg.K)]
t2=322.0          #[K]
t1=300.0  #[K]

#Calculation
Q=mb_dot*Cpb*(t2-t1)        #for benzene in [kJ/h]
#For toulene
T1=344.0  #[K]
T2=311.0      #[K]
Cpt=1.842       #[kJ/kg.K]
mt_dot=Q/(Cpt*(T1-T2))      #[kg/h]
Q=Q*1000.0/3600           #[W]
#Hot fluid(toluene)
#Cold fluid(benzene)
dT1=22.0      #[K]
dT2=11.0      #[K]
dTlm=(dT1-dT2)/(math.log(dT1/dT2))       #[K]
#Clod fluid:Inner pipe,benzene
Di=0.035        #[m]
Ai=(math.pi/4)*Di**2     #Flow area[sq m]
Gi=mb_dot/Ai        #Mass velocity [kg/m**2.h]
Gi=Gi/3600          #[kg/m**2.s]
mu=4.09*10**-4       #[kg/(m.s)]
Nre=Di*Gi/mu        #Reynolds number
Cp=Cpb*10**3         #[J/(kg.K)]
k=0.147             #[W/m.K]
Npr=Cp*mu/k         #Prandtl number
hi=(k/Di)*0.023*(Nre**0.8)*(Npr**0.4)     #[W/sq m.K]
hio=hi*Di/Do            #[W/sq m.K]
D1=0.042                #Outside dia of inside pipe[mm]
D2=0.0525           #Inside dia of outside pipe[m]
De=round((D2**2-D1**2)/D1,4)           #[m]
aa=math.pi*(D2**2-D1**2)/4           #Flow area[sq m]
Ga=mt_dot/aa        #Mass velocity in [kg/m**2.h]
Ga=Ga/3600          #[kg/m**2.s]
mu=5.01*10**-4       #[kg/(m.s)]
Nre=De*Ga/mu        #Reynolds number
Npr=Cp*mu/k     #Prandtl number
ho=(k/De)*0.023*(Nre**0.8)*(Npr**0.3)     #[W/sq m.K]
Uc=1.0/(1.0/ho+1.0/hio)       #[W/sq m.K]
Rdi=1.6*10**-4           #Fouling factor [m**2.K/W]
Rdo=1.6*10**-4           #Fouling factor[m**2.K/W]
Rd=Rdi+Rdo              #(m**2.K/W)
Ud=1.0/(1.0/Uc+Rd)          #[W/sq m.K]
A=Q/(Ud*dTlm)           #sq m
ex=0.136                    #[sq m]
l=A/ex                  #m
tl=12       #Total length of one harpin of 6m [m]

#Result
print"Required surface is fulfilled by connecting",round(l/tl),"(three) 6m harpins in series"
0.0236
Required surface is fulfilled by connecting 3.0 (three) 6m harpins in series

Example no:5.2,Page no:5.26

In [1]:
#Length of pipe
import math

#Variable declaration
ma_dot=300.0*1000.0/24          #Mass flow rate of acid in [kg/h]
mw_dot=500.0*1000.0/24          #Mass flow rate of water in [kg/h]
Cp1=1.465                    #[kJ/kg.K]
T1=333.0                      #[K]
T2=313.0                      #[K]
Q=ma_dot*Cp1*(T1-T2)         #[kJ/h]
Q=Q*1000.0/3600.0               #[W]
Cp2=4.187                   #[kJ/kg.K]
t1=288.0                      #[K]

#Calculation
t2=(Q/(mw_dot*Cp2))+t1       #[K]
dT1=T1-t2                   #[K]
dT2=T2-t1                   #[K]    
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
dTlm=32.26              #Approximation in [K]
#Inner pipe
m_dot=12500.0                 #[kg/h]
Di=0.075                    #[m]
Ai=(math.pi/4.0)*Di**2             #[sq m]
G=ma_dot/Ai                 #[kg/m**2.h]
G=G/3600                    #[kg/m**2.s]
mu=0.0112                   #[kg/m.s]
k=0.302                     #W/(m.K)
Nre=Di*G/mu                 #Reynold number
Npr=Cp1*10**3*mu/k                #Prandtl number
hi=(k/Di)*0.023*(Nre**0.8)*(Npr**0.3)     #W/sq m.K
Do=0.1                      #[m]
hio=hi*Di/Do                #W/sq m.K
D1=0.1                      #[m]
D2=0.125                    #[m]
De=(D2**2-D1**2)/D1           #[m]
Aa=(math.pi/4)*(D2**2-D1**2)      #[sq m]
Ga=mw_dot/Aa                #[kg/m**2.h]
Ga=Ga/3600                  #[kg/sq m.s]
mu=0.0011                   #[kg/m.s]
Nre=De*Ga/mu                #Reynolds number
k=0.669                     #for water
Npr=Cp2*10**3*mu/k                 #Prandtl number
ho=(k/De)*0.023*(Nre**0.8)*Npr**0.4    #[W/sq m.K]
xw=(Do-Di)/2                     #[m]
Dw=(Do-Di)/math.log(Do/Di)           #[m]
kw=46.52                    #thermal conductivity of wall in [W/m.K]
Uc=1.0/(1.0/ho+1.0/hio+xw*Do/(kw*Dw))  #[W/sq m.K]
Ud=Uc                       #As dirt factor values are not given
round(Ud,1)
#Ud=195.32           #Approximation
A=Q/(Ud*dTlm)             #[sq m]
L=A/(math.pi*Do)                #[sq m]

#Result
print"Area =",round(A,2),"m**2,\nLength fo pipe required =",round(L,2),"m(approx)"
Area = 16.15 m**2,
Length fo pipe required = 51.41 m(approx)

Example no:5.3,Page no:5.29

In [48]:
#Double pipe heat exchanger
import math

#Variable declaration
me_dot=5500.0          #[kg/h]
me_dot1=me_dot/3600          #[kg/s]
Di=0.037         #I.D of inner pipe in [m]
Ai=(math.pi/4)*Di**2         #[sq m]
G=me_dot1/Ai             #[kg/sq m.s]
mu=3.4*10**-3             #[Pa.s] or [kg/(m.s)]
Nre=Di*G/mu             #Reynolds number
Cp=2.68          #[kJ/kg.K]
Cp1=Cp*10**3          #[J/kgK]
k=0.248          #[W/m.K]

#Calculation
Npr=Cp1*mu/k     #Prandtl number
#Nre is greater than 10,000,Use Dittus-Boelter eqn:
Nnu=0.023*(Nre**0.8)*(Npr**0.3)       #Nusselt number
hi=k*Nnu/Di                 #[W/sq m.K]
T2=358.0          #[K]
T1=341          #[K]
Cp2=1.80            #[kJ/kg.K]
t2=335              #[K]
t1=303.0              #[K]
mt_dot=me_dot*Cp*(T2-T1)/(Cp2*(t2-t1))  #[kg/h]
mt_dot=mt_dot/3600                      #[kg/s]
D1=0.043                #[m]
D2=0.064            #Inside dia of outer pipe
De=(D2**2-D1**2)/D1           #Equivalent diameter [m]
Aa=math.pi/4*(D2**2-D1**2)         #[sq m]
Ga=mt_dot/Aa                    #kg/(sq m.s)
mu2=4.4*10**-4                    # Viscosity of toluene Pa.s
k2=0.146                    #For toluene [W/m.K]
Cp2=1.8*10**3            #J/kg.K
Nre=De*Ga/mu2            #Reynolds number
Npr=Cp2*mu2/k2          #Prandtl number
Nnu=0.023*Nre**0.8*Npr**0.4       #Nusselt number
ho=k2*Nnu/De                     #W/(sq m.K)
Dw=(D1-Di)/math.log(D1/Di)             #[m]
x=0.003                     #Wall thickness in [m]
Uo=1.0/(1.0/ho+(1.0/hi)*(D1/Di)+(x*D1/(46.52*Dw)))     #[W/sq m.K]
dT1=38.0      #[K]
dT2=23      #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)                 #[K]
Q=me_dot1*Cp*(T2-T1)       #[kJ/s]
Q=Q*1000                #[J/s]
L=Q/(Uo*math.pi*D1*dTlm)    #[m]

#Result
print"Total lenggth of double pipe heat exchanger is",round(L,1),"m"
Total lenggth of double pipe heat exchanger is 36.9 m

Example no:5.4,Page no:5.35

In [3]:
#Parallel flow arrangement
import math
#Variable declaration
mc_dot=1000.0         #[kg/h]
mc_dot=mc_dot/3600      #[kg/s]
mh_dot=250.0          #[kg/h]
mh_dot=mh_dot/3600  #[kg/s]
Cpc=4187.0          #[J/(kg.K)]
Cph=3350        #[W/K]

#Calculation
w=mc_dot*Cpc        #[W/K]
l=mh_dot*Cph        #[W/K]
C=mh_dot*Cph/(mc_dot*Cpc)
U=1160.0      #[W/sq m.K]
A=0.25      #Heat transfer surface for exchanger in [sq m]
ntu=U*A/(mh_dot*Cph)    #
E=(1-math.exp(-ntu*(1+C)))/(1+C)     #Effectiveness of heat exchanger
T1=393.0      #Inlet temperature in [K]
t1=283      #Cooling water [K]
T2=T1-E*(T1-t1)     #Outlet T of hot liquid 

t2=C*(T1-T2)+t1     #[K]

#Result
print"Effectiveness of heat exchanger is ",round(E,3)
print"Outlet temperature of hot liquid is ",round(T2,1),"K(",round(T2,1)-273,"degree C)"
print"Outlet temperature of water is ",round(t2,2),"K(",round(t2,2)-273,"degree C)"
Effectiveness of heat exchanger is  0.647
Outlet temperature of hot liquid is  321.9 K( 48.9 degree C)
Outlet temperature of water is  297.23 K( 24.23 degree C)

Example no:5.5,Page no:5.36

In [4]:
#Counter flow exchanger
import math
#Variable declaration
Cpc=4187.0                #Specific heat of water in [J/(kg.K)]
Cph=2000.0                #Sp heat of oil in [J/(kg.K)]
mc_dot=1300.0/3600        #[kg/s]
mh_dot=550.0/3600         #[kg/s]
w=mc_dot*Cpc        #[W/K]
o=mh_dot*Cph        #[W/K]

#Calculation
#Heat capacity of rate of hot fluid is smaller than water
U=1075.0          #[W/sq m.K]
A=1.0       #[sq m]
ntu=(U*A)/(mh_dot*Cph)    
C=mh_dot*Cph/(mc_dot*Cpc)   
E=(1-math.exp(-ntu*(1-C)))/(1-C*math.exp(-ntu*(1-C)))     #Effeciency
T1=367.0          #[K]
t1=288.0          #[K]
T2=T1-E*(T1-t1)                 #Outlet temperature [K]
T2=round(T2,2)
#T2=291.83                   #Approximated in book without precise calculation
t2=C*(T1-T2)+t1                 #[K]
Q=mh_dot*Cph*(T1-T2)            #[W]

#Result
print"Effectiveness of exchanger is",round(E,4)
print"Outlet temperature of oil is",T2,"K(",T2-273,"degree C)"
print"Outlet temperature of water is",round(t2,2),"K(",round(t2,2),"degree C)"
print"Rate of heat transfer is",round(Q,1),"W"
Effectiveness of exchanger is 0.9512
Outlet temperature of oil is 291.85 K( 18.85 degree C)
Outlet temperature of water is 303.19 K( 303.19 degree C)
Rate of heat transfer is 22962.5 W

Example no:5.6,Page no:5.37

In [62]:
#LMTD approach
import math

#Variable declaration

#LMTD Approach
Cph=4187.0            #[J/(kg.K)]
mh_dot=600.0/3600     #Hot side flow rate [kg/s]
mc_dot=1500.0/3600        #[kg/s]
Cpc=Cph             #[J/kg.K]
T1=343.0              #[K]
T2=323.0              #[K]

#Calculation
Q=mh_dot*Cph*(T1-T2)    #[W]
t1=298.0                  #[K]
t2=(mh_dot*Cph*(T1-T2))/(mc_dot*Cpc)+t1 #[K]
dT1=45.0      #[K]
dT2=17.0          #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)         #[K]
hi=1600.0         #Heat transfer coeff in [W/sq m.K]
ho=hi           #[W/sq m.K]
U=1.0/(1.0/hi+1.0/ho)     #[W/sq m.K]
A=Q/(U*dTlm)        #[sq m]

#Effectiveness-NTU approach
#hot water:
h=mh_dot*Cph            #[W/K]
c=mc_dot*Cpc            #[W/K]
#Heat capacity rate of hot fluid is small
C=mh_dot*Cph/(mc_dot*Cpc)       #
E=(T1-T2)/(T1-t1)       #Effectiveness
#for paralell flow:
ntu=-math.log(1-E*(1+C))/(1+C)       
A2=(ntu*mh_dot*Cph)/U    #[sq m]
t2=C*(T1-T2)+t1         #[K]

#Result
print"By LMTD approach area of heat exchanger is",round(A,3),"m^2"
print"By Ntu approach Area of heat exchanger is",round(A,3),"m^2"
print"Outlet temperature of cold water=",t2,"K(",t2-273,"degree C)"
By LMTD approach area of heat exchanger is 0.607 m^2
By Ntu approach Area of heat exchanger is 0.607 m^2
Outlet temperature of cold water= 306.0 K( 33.0 degree C)

Example no:5.7,Page no:5.39

In [5]:
#Shell and tube exchanger
import math

#Variable declaration
mw_dot=10.0           #[kg/s]
Cpw=4.187           #[kJ/(kg.K)]
t2=318.0              #[K]
t1=295              #[K]
Q=mw_dot*Cpw*(t2-t1)    #[kJ/s]
Q=Q*1000                #W
dT1=98.0              #[K]
dT2=75              #[K]

#Calculation
dTlm=(dT1-dT2)/math.log(dT1/dT2)         #[K]
hi=850.0          #[W/sq m.K]
id=0.027            #Inside dia[m]
od=0.031                 #Outside dia [m]
hio=hi*id/od            #[W/sq  m.K]
ho=6000.0     #Heat transfer coefficients[W/sq m.K]
Uo=1.0/(1.0/ho+1.0/hio)       #[W/sq m.K]
Ao=Q/(Uo*dTlm)          #[sq m]
L=4.0         #Length [m]
n=Ao/(math.pi*od*L)         #[No. of tubes]

#Result
print"Number of tubes required =",round(n)
Number of tubes required = 44.0

Example no:5.8,Page no:5.40

In [74]:
#Order of Scale resistance
import math

#Variable declaration
mdot=7250            #Nitrobenzene in shell in [kg/h]
Cp=2.387             #[kJ/(kg.K)]
mu=7*10**-4           #Pa.s
k=0.151              #[W/m.K]
T1=400.0               #[K]
T2=317.0               #[K]
t1=305.0               #[K]
t2=345.0               #[K]

#Calculation
dT1=T1-t2              #[K]
dT2=T2-t1              #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #[K]
Q=mdot*Cp*(T1-T2)   #[kJ/h]
Q=Q*1000.0/3600           #[W]
n=166.0                    #no of tubes
L=5.0                      #[m]
Do=0.019                 #[m]
Di=0.015                 #[m]
Ao=n*math.pi*Do*L           #[sq m]
Uo=Q/(Ao*dTlm)          #[W/sq m.K]
Ud=Uo
#Shell side heat transfer coefficient
Pt=0.025                #[m]
C_dash=Pt-(0.5*Do+0.5*Do)

#Shell side crossflow area
B=0.15              #[m]
id=0.45     #[m]
ass=id*C_dash*B/Pt       #[sq m]
#As there are two shell passes,area per pass is :
as_dash=ass/2            #[sq m]

#Equivalent diameter of shell 
De=4*(Pt**2-(math.pi/4)*Do**2)/(math.pi*Do)       #[m]

#Mass velocity on shell side
Gs=mdot/as_dash        #[kg/m**2.h]
Gs=Gs/3600              #[kg/m**2.s]
mu=7.0*10**-4              #Pa.s
Cp=Cp*1000              #J/kg.K
Nre=De*Gs/mu    #Reynold number
Npr=Cp*mu/k     #Prandtls number
Nnu=0.36*Nre**0.55*Npr**(1.0/3.0) #Nusselts number
hi=1050.0             #[W/sq m .K]
ho=Nnu*k/De         #[W/sq m.K]
Uo=1.0/(1.0/ho+(1.0/hi*(Do/Di)))          #[W/sq m K]
Uc=Uo
Rd=(Uc-Ud)/(Uc*Ud)                  #m**2.K/W

#Result
print"Fouling factor=Sclae resistance=%.2e" %round(Rd,6),"m^2 K/W"
Fouling factor=Sclae resistance=9.65e-04 m^2 K/W

Example no:5.9,Page no:5.42

In [6]:
#Length of tube required
import math
#Variable declaration
k=0.628         #W/(m.K)
rho=980.0     #[kg/m**3]
mu=6*10**-4      #kg/(m.s)
Cpw=4.187        #kJ/(kg.K)
Cp=Cpw*10**3      #J/(kg.K)
Di=25.0           #[mm]
Di=Di/1000      #[m]

#Calculation
mw_dot=1200.0*10**-3*rho        #Mass flow rate of water [kg/h]
mw_dot=mw_dot/3600.0            #[kg/s]
Ai=(math.pi*Di**2)/4.0              #Inside area of tube in sq m
G=mw_dot/Ai                 #kg/m**2.s
Nre=Di*G/mu                 #Reynolds number
Npr=Cp*mu/k                 #Pranddtl number
#Inside heat transfer coefficient
Nnu=0.023*Nre**0.8*Npr**0.4       #Nusselt number
hi=Nnu*k/Di             #[W/sq m.K]
ho=6000.0     #[W#sq m.K]
Do=0.028        #[m]
Dw=(Do-Di)/math.log(Do/Di)       #[m]
x=(Do-Di)/2                  #[m]
k2=348.9            #thermal conductivity of metal in [W/m.K]
Uo=1.0/((1.0/ho)+(1.0/hi)*(Do/Di)+(x/k2)*(Do/Dw))  #[W/sq m.K]
t1=303.0          #[K]
t2=343.0          #[K]
Q=mw_dot*Cpw*(t2-t1)        #[kJ/h]
Q=Q*1000.0              #[W]
Ts=393.0                      #[K]
dT1=Ts-t1                   #[K]
dT2=Ts-t2                   #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #[K]
Ao=Q/(Uo*dTlm)          #[sq m]
L=Ao/(math.pi*Do)           #Length

#Result
print"Length of tube required is",round(L,2),"m" 
Length of tube required is 4.4 m

Example no:5.10,Page no:5.44

In [87]:
#Suitability of Exchanger
import math

#Variable declaration
m_dot=7250.0      #[kg/h] of nitrobenzene 
Cp=2.387             #[kJ/kg.K]
mu=7*10**-4           #[kg/m.s]
k=0.151              #[W/m.K]
vis=1.0 
Ft=0.9              #LMTD correction factor
T1=400.0              #[K]
T2=317.0              #[K]
t1=333.0              #[K]
t2=300.0              #[K]

#Calculation
dT1=T1-t1          #[K]
dT2=T2-t2          #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)       #[K]
#For nitrobenzene
Q=m_dot*Cp*(T1-T2)          #[kJ/h]
Q=Q*1000.0/3600                    #[W]
n=170.0           #No. of tubes
L=5.0     #[m]
Do=0.019            #[m]
Di=0.015            #[m]
Ao=n*math.pi*Do*L       #[sq m]
Uo=Q/(Ao*Ft*dTlm)   #[W/sq m.K]
Ud=Uo           #[W/sq m.K]
B=0.15              #Baffle spacing [m]
Pt=0.025            #Tube pitch in [m]
C_dash=Pt-Do        # ance in [m]
id=0.45             #[m]

#Shell side cross flow area
ass=id*C_dash*B/Pt           #[sq m]

#Equivalent diameter of shell
De=4*(Pt**2-(math.pi/4)*(Do**2))/(math.pi*Do)        #[m]

#Mass velocity on shell side
Gs=m_dot/ass             #[kg/(m.h)]
Gs=Gs/3600.0              #[kg/m**2.s]
mu=7.0*10**-4          #[kg/m.s]
Cp=Cp*1000.0      #[J/kg.K]
Nre=De*Gs/mu        #Reynolds number
Npr=Cp*mu/k         #Prandtl number

#From empirical eqn:
mu_w=mu         #
Nnu=0.36*Nre**0.55*Npr**(1.0/3.0)
ho=Nnu*k/De         #[W/sq m.K]
hi=1050.0             #Given [W/sq m.K]
Uo=1.0/(1.0/ho+(1.0/hi)*(Do/Di))      #[W/sq m.K]
Uc=Uo               #W/sq m.K

#Suitability of heat exchanger
Rd_given=9*10**-4          #[W/sq m.K]
Rd=(Uc-Ud)/(Uc*Ud)          #[W/sq m.K]

#Result
print"Rd calculated(%.2e"%Rd,"W/m^2.K) is maximum allowable scale resistance"
print"As Rd calculated(%.2e"%Rd,"W/m^2K) is more than Rd given %.e("%Rd_given," W/m^2,K),the given heat exchanger is suitable"
Rd calculated(1.01e-03 W/m^2.K) is maximum allowable scale resistance
As Rd calculated(1.01e-03 W/m^2K) is more than Rd given 9e-04(  W/m^2,K),the given heat exchanger is suitable

Example no:5.11,Page no:5.47

In [90]:
#Number of tubes required
import math

#Variable declaration
mw_dot=1720.0          #water in [kg/h]
t1=293.0               #[K]
t2=318.0               #[K]
Cpw=4.28             #[kJ/kg.K]

#Calculation
Q=mw_dot*Cpw*(t2-t1)    #[kJ/h]
Q=Q*1000.0/3600           #W
lamda=2230.0          #[kJ/kg]
dT1=90.0               #[K]
dT2=65.0               #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #[K]

#Calculation of inside heat transfer coefficient
Di=0.0225             #[m]
u=1.2            #[m/s]\
rho=995.7            #[kg/m**3]
v=0.659*10**-6           #[m/s]
mu=v*rho        #[kg/m.s]
Nre=Di*u*rho/mu     #reynolds number
Cp=Cpw*1000         #[J/kg.K]
k=2.54       #[kJ/h.m.K]
k=k*1000.0/3600           #[W/m.K]
Npr=Cp*mu/k             #Prandtl number
Nnu=0.023*Nre**0.8*Npr**0.4       #Nusselt number
hi=k*Nnu/Di             #[W/sq m.K]
ho=19200.0            #[kJ/h.m**2.K]
ho=ho*1000.0/3600     #[W/m**2.K]
Do=0.025        #[m]
Dw=(Do-Di)/math.log(Do/Di)       #[m]
x=(Do-Di)/2     #[m]
kt=460.0           #For tube wall material [kJ/h.m.K]
kt=kt*1000.0/3600         #[W/m.K]
Uo=1.0/(1.0/ho+(1.0/hi)*(Do/Di)+(x/kt)*(Do/Dw))        #[W/sq m.K]
#Q=Uo*Ao*dTlm
Ao=Q/(Uo*dTlm)          #[sq  m]
L=4.0             #Tube length in [m]
n=Ao/(math.pi*Do*L)         #[Number of tubes]


#Result
print"Number of tubes required=",round(n)
Number of tubes required= 1.0

Example no:5.12,Page no:5.49

In [92]:
#Shell and tube heat exchanger
import math

#Variable declaration
t1=290.0          #Inlet temperature of cooling water [K]
ho=2250.0         #Heat transfer coefficient based on inside area in [W/sq m.K]
lamda=400.0      #[kJ/kg] LAtent heat of benzene 
mb_dot=14.4     #[t/h] Condensation rate of benzene vapour
Cpw=4.187       #Specific heat


#Calculation

#With no Scale
Q=mb_dot*1000.0*lamda     #Heat duty of condenser in [kJ/h]
Q=(Q/3600.0)*1000.0     #[W]
#Shell and tube type of heat exchanger is used as a single pass surface condenser
Di=0.022        #I.D of tube[m]
L=2.5           #Length of each tube in [m]
n=120.0           #Number of tubes
A=math.pi*Di*L      #Area of heat transfer per metre length in [m**2/m]
A=n*A           #Total area of heat transfer in [m**2]
Ai=(math.pi/4.0)*Di**2 #Cross-sectional area of each tube in [m**2]
Ai=n*Ai         #Total area of flow in [m**2]
u=0.75          #Velocty of water [ms**-1]
V=u*Ai          #Volumetric flow of water 
rho=1000.0        #[Density of water in [kg/m**3]]
mw_dot=V*rho    #Mass flow rate of water in  [kg/s]

#Heat balance
#Q=mw_dot*Cpw*(t2-t1)
t2=Q/(mw_dot*Cpw*1000)+t1        #[K]
T=350.0       #Condensing benzene temperature in [K]
dT1=T-t1    #[K]
dT2=T-t2    #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #LMTD
U=Q/(A*dTlm)                    #[W/m**2.K]
U=round(U)
#Neglecting resistance,we have:
hi=1/(1/U-1/ho)         #[W/m**2.K]
#hi is proportional to u**0.8
C=hi/(u**0.8)        #Constant

#With Scale
Rd=2.5*10**-4        #[m**2 K./W]
#1/U=1/hi+1/ho+Rd
#U=hi/(1+3.38*u**0.8)
#mw_dot=rho*u*Ai     #[kg/s]
#Let t2 be the outlet temperature of water 
#Q=mw_dot*Cpw*(t2-t1)
#t2=Q/(mw_dot*Cpw)+t1  
dT1=60.0
#dT2=T-(t1+8.373/u)
#dTlm=8.373/(u*math.log(60*u/(60*u-8.373)))
#Q=U*A*dTlm
#1.89=((u**-0.2)/(1+3.38*u**0.8))*(1/math.log((60*u)/60*u-8.373)
#If we assume values of u greater than 0.75 m/s
#For u=3.8     #[ms**-1]
u=3.8           #]ms**-1]

#Result
print"Water velocity must be 3.88 m/s"
Water velocity must be 3.88 m/s

Example no:5.13,Page no:5.52

In [93]:
#Length of pipe in Exchanger
import math

#Variable declaration
mh_dot=1.25         #[kg/s]
Cpw=4.187*10**3      #Heat capacity of water in [J/kg.K]
lamda=315.0          #[kJ/kg]
Q=mh_dot*lamda     #Rate of heat transfer from vapour     [kJ/s]
Q=Q*10**3            #[W]
Ts=345.0              #Temperature of condensing vapour[K]
t1=290.0              #Inlet temperature of water [K]
t2=310.0              #Outlet temperature of water[K]

#Calculation
dT1=Ts-t1           #[K]
dT2=Ts-t2           #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)         #[K]
#Heat removed from vapour = Heat gained
mw_dot=Q/(Cpw*(t2-t1))      #[kg/s]
hi=2.5                      #[kW/sq m.K]
hi=hi*1000                  #[W/sq m.K]
Do=0.025                    #[m]
Di=0.020                    #[m]
hio=hi*(Di/Do)              #Inside heat transfer cosfficient referred to outside dia in [W/sq m.K]
ho=0.8                      #Outside heat tranbsfer coefficient in [kW/sq m.K]
ho=ho*1000.0                  #[W/sq m.K]
Uo=1.0/(1.0/ho+1.0/hio)           #[W/sq m.K]
#Ud is 80% of Uc
Ud=(80.0/100)*Uo             #[W/sq m.K]
Ao=Q/(Ud*dTlm)              #[sq m]
L=1.0                         #[m]
A=math.pi*Do*L                  #Outside area of pipe per m length of pipe
len=Ao/A                    #Total length of piping required.
rho=1000.0                    #[kg/m**3]
V=mw_dot/rho                #[m**3/s]
v=0.6                       #[m/s]
a=V/v                       #Cross-sectional area for flow pass [sq m]
a1=(math.pi*Di**2.0)/4             #[sq m]
#for single pass on tube side fluid(water)
n=round(a/a1)                      #No. of tubes per pass
l=len/n                     #Length of each tube in [m]
#For two passes on water side:
tn=2*n                      #Total no of tubes
l2=len/tn                   #Length of each tube in [m]
#For four passes on water side/tube side
tn2=4*n                     #Total no. of tubes
l3=len/tn2                  #Length of each tube in [m]


#Result
print"No. of tubes=",tn2,"\nLength of tube=",round(l3,2),"m"

  
No. of tubes= 100.0 
Length of tube= 2.48 m

Example no:5.14,Page no:5.54

In [99]:
#Dirt factor

import math

#Variable declaration

#Properties of crude oil:
Cpc=1.986                  #[kJ/(kg.K)]
mu1=2.9*10**-3              #[N.s/sq m]
k1=0.136                   #[W/m.K]
rho1=824                   #[kg/m**3]
#Properties of bottom product:
Cp2=2.202                 #[kJ/kg.K]
rho2=867.0                  #[kg/m**3]
mu2=5.2*10**-3             #[N.s/sq m]
k2=0.119                  #[W/sq m.K]
mc_dot=135000.0                #Basis: cruid oil flow rate in [kg/h]
m_dot=106000.0                 #Bottom product flow rate inn [kg/h]
t1=295.0                    #[K]
t2=330.0                    #[K]
T1=420.0                    #[K]
T2=380.0                    #[K]
dT1=T1-t2                #[K]
dT2=T2-t1                #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)         #[K]
Q=mc_dot*Cpc*(t2-t1)                #kJ/h
Q=Q*1000.0/3600                       #[W]
#Shell side calculations:
Pt=25.0                                 #[mm]
Pt=Pt/1000                           #[m]
B=0.23                                #[m]
Do=0.019                               #[m]Outside diameter for square pitch 
c_dash=Pt-Do                        # ance in [m]
id=0.6                                 #[m]
ass=id*c_dash*B/Pt                     # Cross flow area of shell [sq m]
#since there is a Calculaiton mistake ,we take:
ass=0.0353 
Gs=m_dot/ass                           #Shell side mass velocity in [kg/sq m.h]
Gs=Gs/3600                             #[kg/sq m.s]
De=4*(Pt**2-(math.pi/4)*Do**2)/(math.pi*Do)     #[m]
Nre=De*Gs/mu2                         #Reynolds number
Npr=Cp2*1000*mu2/k2                        #Prandtl number
muw=mu2                             #Since mu/muw=1
Nnu=0.36*(Nre**0.55)*Npr**(1.0/3.0)*(mu2/muw)**(0.14)      #Nusselt number
ho=Nnu*k2/De                        #[W/sq m.K]
#Tube side heat transfer coefficient:
n=324.0                    #No. of tubes
n_p=324.0/2                #No.of tubes per pass
t=2.1                    #Thickness in [mm]
t=t/1000                 #[m]
Di=Do-2*t                 #I.d of tube in [m]
A=(math.pi/4)*(Di**2)        #Cross-sectional area of one tube in [sq m]
A_p=n_p*A               #Total area for flow per pass in [sq m]
G=mc_dot/A_p            #[kg/sq m h]
G=G/3600.0                #[kg/sq m.s]
Nre=Di*G/mu1            #Reynolods number
Npr=42.35                #Prandtl number
Nnu=0.023*(Nre**0.8)*(Npr**0.4)       #Nusselt number
hi=Nnu*k1/Di                         #[W/sq m.K]
hio=hi*Di/Do                        #[W/sq m.K]
Uo=1.0/(1.0/ho+1.0/hio)                   #[W/sq m.K]
Uc=Uo
L=4.88                               #Length of tube in [m]
Ao=n*math.pi*Do*L                       #[sq m]
Ud=Q/(Ao*dTlm)                      #[W/sq m.K]
Rd=(Uc-Ud)/(Uc*Ud)                  #[m**2.K/W]

#Result
print"NOTE:The calculation of line no.36 to calculate 'ass' is wrongly done in Book by printing 0.0353,,..which is wrong" 
print"\nRd=%.2e"%Rd,"K/W,\nwhich is less than the provided,so this if installed will not give required temperatures without frequent cleaning"
NOTE:The calculation of line no.36 to calculate 'ass' is wrongly done in Book by printing 0.0353,,..which is wrong

Rd=7.34e-04 K/W,
which is less than the provided,so this if installed will not give required temperatures without frequent cleaning

Example no:5.15,Page no:5.57

In [105]:
#Heat transfer area
import math

#Variable declaration
#CASE I:
Cp=4*10**3            #[J/kg.K]
t1=295               #[K]
t2=375               #[K]
sp=1.1               #Specific gravity of liquid 
v1=1.75*10**-4         #Flow of liquid in [m**3/s]
rho=sp*1000         #[kg/m**3]
m_dot=v1*rho         #[kg/s]
Q=m_dot*Cp*(t2-t1)  #[W]
T=395                #[K]
dT1=T-t1            #[K]
dT2=T-t2            #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
U1A=Q/dTlm          #[W/K]
#CASE-II
v2=3.25*10**-4                   #Flow in [m**3/s]
T2=370                          #[K]
m_dot=v2*rho          #[kg/s]


#Calculation
Q=m_dot*Cp*(T2-t1)                #[W]
dT1=T-t1                          #[K]
dT2=T-T2                          #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)       #[K]
U2A=Q/dTlm                        #[W/K]
#since u is propn to v
#hi =C*v**0.8

U2_by_U1=U2A/U1A                

ho=3400                         #Heat transfer coeff for condensing steam in [W/sq m.K]
C=poly([0])
#Let C=1 and v=v1
#C=1 
v=v1                            #=1.75*10**-4 m**3/s
hi=C*v**0.8
U1=1.0/(1.0/ho+1.0/hi)                 #
#When v=v2
v=v2 
hi=C*v**0.8
U2=1.0/(1.0/ho+1.0/hi)               #
#Since U2=1.6U1
#On solving we get:
C=142497
v=v1
hi=C*v**0.8
U1=1.0/(1.0/ho+1.0/hi)                 #
A=U1A/U1                #Heat transfer area in [sq m]

#Result
print"Overall heat transfer coefficient is",round(U1,1),"W/m^2.K and\n\nHeat transfer area is",round(A,2),"m^2"
Overall heat transfer coefficient is 135.1 W/m^2.K and

Heat transfer area is 9.17 m^2

Example no:5.16,Page no:5.59

In [106]:
#Oil Cooler
import math

#Variable declaration
mo_dot=6*10**-2              #[kg/s]
Cpo=2*10**3                       #Specific heat of oil in [J/kg.K]
Cpw=4.18*10**3               #Specific heat of water in [J/kg.K]
T1=420                      #[K]
T2=320                      #[K]
T=290                       #[K] Water entering temperature

#Calculation
Q=mo_dot*Cpo*(T1-T2)        #[J/s]=[W]
#Heat given out =Heat gained
t2=Q/(mo_dot*Cpw)+T         #[K]
dT1=T1-t2                   #[K]
dT2=T2-T                    #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
hi=1.6*1000             #[W/sq m.K]
ho=3.6*1000           #[W/sq m.K]
U=1.0/(1.0/ho+1.0/hi) #[W/sq m.K]
A=Q/(U*dTlm)        #[sq m]
D=0.025             #[m]
L=A/(math.pi*D)     #[m]

#Result
print"Length of tube required =",round(L,2),"m"
Length of tube required = 2.66 m

Example no:5.17,Page no:5.60

In [30]:
#Countercurrent flow heat exchanger
import math

#Variable declaration
mb_dot=1.25         #Benzene in [kg/s]
Cpb=1.9*10**3             #For benzene in [J/kg.K]
Cpw=4.187*10**3           #in [J/kg.K]
T1=350              #[K]
T2=300              #[K]
Q=mb_dot*Cpb*(T1-T2)    #[W]
t1=290                  #[K]
t2=320                  #[K]

#Calculation
dT1=T1-t2               #[K]
dT2=T2-t1               #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
mw_dot=Q/(Cpw*(t2-t1))        #Minimum flow rate of water in [kg/s]
hi=850                      #[W/sq m.K]
ho=1700                     #[W/sq m.K]
Do=0.025                    #[m]
Di=0.022                    #[m]
x=(Do-Di) /2                    #Thickness in [m]
hio=hi*(Di/Do)              #[W/sq m.K]
Dw=(Do-Di)/math.log(Do/Di)       #[m]
k=45.0                        #[W/m.K]
Uo=1.0/((1.0/ho)+(1.0/hio)+(x/k)*(Do/Dw)) #[W/sq m.K]
Ao=Q/(Uo*dTlm)                  #[sq m]
L=1.0                             #Length in [m]
area=math.pi*Do*L                   # Outside surface area of tube per i m length 
Tl=Ao/area                      #Total length of tubing required in [m]

#Result
print"Total length of tubing required=",round(Tl),"m"
Total length of tubing required= 163.0 m

Example no:5.18,Page no:5.61

In [114]:
#Vertical Exchanger
import  math

#Variable declaration
m_dot=4500.0          #Benzene condensation rate in [kg/h]
lamda=394.0          #Latent heat of condensation of benzene in [kJ/kg]
Q=m_dot*lamda      #[kJ/h]
Q=Q*1000.0/3600       #[W]
Cpw=4.18            #[kJ/kg.K]
t1=295.0              #[K]
t2=300.0              #[K]


#Calculation
#For water :
mw_dot=Q/(Cpw*1000*(t2-t1))      #[kg/s]
rho=1000.0                    #[kg/m**3
V=mw_dot/rho          #Volumetric flow rate in [m**3/s]
u=1.05                #[m/s]
A=V/u                 #Cross-sectional area  required in [sq m]
#For tube:
x=1.6               #thickness in [mm]
x=x/1000            #[m]
Do=0.025            #[m]
Di=Do-2*x           #[m]
A1=(math.pi*Di**2)/4      #Of one tube [sq m]
n=A/A1               #No. of tubes reuired   
n=round(n)
L=2.5               #Length of tube in [m]
Ao=n*math.pi*Do*L       #Surface area for heat transfer in [sq  m]
Ts=353.0              #Condensing temp of benzene in [K]
T1=295.0              #Inlet temperature in [K]
T2=300.0              #Outlet temperature in [K]
dT1=Ts-T1           #[K]
dT2=Ts-T2           #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #[K]
Uo=Q/(Ao*dTlm)          #[W/sq mK]
Ud=Uo                   #[W/sq m.K]
#OVERALL HEAT TRANSFER COEFFCIENT:
#Inside side:
T=(T2+T1)/2             #[K]
hi=1063*((1+0.00293*T)*u**0.8)/(Di**0.2)        #[W/sq m.K]
hio=hi*(Di/Do)                                  #[W/sq m.K]
Dw=(Do-Di)/math.log(Do/Di)                           #[m]
k=45.0                #For tube in [W/(m.)]
#Outside of tube:
mdot_dash=1.25/n                #[kg/s]
M=mdot_dash/(math.pi*Do)            #[kg/(m.s)]
k=0.15                          #[W/(m.K)]
rho=880.0                         #[kg/m**3]
mu=0.35*10**-3                   #[N.s/sq m]
g=9.81                          #[m/s**2] Acceleration due to gravity
hm=(1.47*((4*mdot_dash)/mu)**(-1.0/3.0))/(mu**2/(k**3*rho**2*g))**(1.0/3.0)  #[W/sq m.K]
ho=hm                           #[W/sq m.K]
k=45                #[W/m]
Uo=1.0/(1.0/ho+1.0/hio+(x*Do)/(k*Dw))
#Uo=1/(1/ho+1/hio+(x*Do/(k*Dw)))     #Overall heat transfer coefficient in [W/sq m.K]
Uc=Uo                               #[W/sq m.K]
Rd=(Uc-Ud)/(Uc*Ud)                  #Maximum allowable sclae resistance in [K/W]

#Result
print"Uc(",round(Uc),"W/m^2.K) is in excess of Ud(",round(Ud),"W/m^2.K),therefore we allow for reasonable scale resistance,\nRd=%.1e"%Rd,"K/W\n" 
print"No.of tubes =",n
Uc( 994.0 W/m^2.K) is in excess of Ud( 754.0 W/m^2.K),therefore we allow for reasonable scale resistance,
Rd=3.2e-04 K/W

No.of tubes = 60.0

Example no:5.19,Page no:5.64

In [115]:
#Countercurrent Heat Exchanger
import math

#Variable declaration
mw_dot=5             #Water flow rate in [kg/s]
Cpw=4.18             #Heat capacity of water [kJ/kg.K]
t1=303               #[K]
t2=343               #[K]

#Calculation
Q=mw_dot*Cpw*(t2-t1)    #[kJ/s]
Q=Q*1000                 #[W]
T1=413                   #[K]
T2=373                   #[K]
dT1=T1-t2               #[K]
dT2=T2-t1               #[K]
dTlm=dT1                 #/[K]
hi=1000          #[W/sq m.K]
ho=2500          #[W/sq m.K]
Rd=1.0/(0.714*1000)      #Fouling factor[m**2.K/KW]
U=1.0/(1.0/hi+1.0/ho+Rd)      #[W/sq m.K]
A=Q/(U*dTlm)            #[sq m]

#Result
print"Heat transfer area is",round(A,2),"m^2"
Heat transfer area is 33.45 m^2

Example no5.20:,Page no:5.65

In [117]:
#Number of tube side pass
import math

#Variable declaration
Cpo=1.9          #Heat capacity for oil[kJ/kg.K]
Cps=1.86       #Heat capacity for steam [kJ/kg.K]
ms_dot=5.2      #Mass flow rate in [kg/s]
T1=403.0          #[K]
T2=383.0          #[K]

#Calculation
Q=ms_dot*Cps*(T1-T2)        #[kJ/s]
Q=Q*1000.0                    #[W]
t1=288.0                       #[K]
t2=358.0                       #[K]
dT2=T1-t2                   #[K]
dT1=T2-t1                   #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #LMTD in [K]
U=275.0                            #Overall heat transfer coeffcient in [W#sq m.K]
Ft=0.97                         #LMTD correction factor
A=Q/(U*Ft*dTlm)                 #[sq m]

#Result
print"Heat exchanger surface area is",round(A,2),"m^2"
Heat exchanger surface area is 10.84 m^2

Example no:5.21,Page no:5.66

In [125]:
#Number of tubes passes
import math

#Variable declaration
mc_dot=3.783         #Cold water flow rate[kg/s]
mh_dot=1.892        #Hot water flow rate [kg/s]
Cpc=4.18            #Sp heat of cold water [kJ/(kg.K)]
T1=367.0              #[K]
t2=328.0              #[K]
t1=311.0              #[K]
Cph=4.18            #Specific heat of hot water [kJ/(kg.K)]
rho=1000.0             #Density [kg/m**3]
D=0.019              #Diameter of tube in [m]
U=1450.0               #Overal heat transfer coefficient in [W/sq m.K]   

#Calculation
T2=T1-mc_dot*Cpc*(t2-t1)/(mh_dot*Cph)   #[K]
Q=mc_dot*Cpc*(t2-t1)        #[kJ/s]
Q=Q*1000.0                    #[W]
#For counterflow heat exchanger
dT1=T1-t2                   #[K]
dT2=17.0                      #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
lmtd=dTlm                   #LMTD 
Ft=0.88                     #LMTD correction factor
A=Q/(U*dTlm)                #[sq m]
u=0.366                     #Velocity through tubes[ms**-1]
Ai=mc_dot/(rho*u)           #Total flow Area in [sq m]
n=Ai/((math.pi/4)*(D**2))        #No. of tubes 
L=1.0                         #Per m length[m]
sa=math.pi*D*L                  #S.S per tube per 1 m length
L=A/(n*math.pi*D)               #Length of tubes in [m]

#Result
print"The length is more than allowable 2.44 m length,so we must use more than one tube"
#For 2passes on the tube side
A=Q/(U*Ft*lmtd)     #[sq m]
L=A/(2*n*math.pi*D)     #Length in [m]
print"This length is within 2.44 m requirement,so the design choice is:\n"
print"--Type of heat exchanger : \t1-2 Shell and tube heat exchanger"
print"--No of tubes per pass=\t\t",round(n)
print"--Length of tube per pass=\t",round(L,2),"m"
The length is more than allowable 2.44 m length,so we must use more than one tube
This length is within 2.44 m requirement,so the design choice is:

--Type of heat exchanger : 	1-2 Shell and tube heat exchanger
--No of tubes per pass=		36.0
--Length of tube per pass=	1.83 m

Example no:5.22,Page no:5.67

In [143]:
#Outlet temperature for hot and cold fluids
import math

#Variable declaration
mh_dot=16.67        #Mass flow rate of hot fluid in [kg/s]
mc_dot=20.0          #Mass flow rate of cold fluid in [kg/s]
Cph=3.6             #Sp heat of hot fluid in [kJ/kg.K]
Cph=Cph*1000         #Sp heat of hot fluid in [J/kg.K]
Cpc=4.2             #Sp heat of cold fluid in [kJ/(kg.K)]
Cpc=Cpc*1000         #Sp heat of cold fluid in [J/(kg.K)]
U=400.0               #Overall heat transfer coefficient in [W/sq m.K]
A=100.0               #Surface area in [sq m]

#Calculation
mCp_h=mh_dot*Cph     #[J/s] or [W/K]
mCp_c=mc_dot*Cpc     #[J/s] or [W/K]
mCp_small=mCp_h     #[W/K]
C=mCp_small/mCp_c   #Capacity ratio           
ntu=U*A/mCp_small   #NTU
T1=973.0              #Hot fluid inlet temperature in [K]
t1=373.0              #Cold fluid inlet temperature in [K]

#Case 1:Countercurrent flow arrangement
E=(1.0-math.exp(-(1.0-C)*ntu))/(1.0-C*math.exp(-(1.0-C)*ntu)) #Effectiveness
E=round(E,2)
#W=T1-T2/(T1-t1)  therefore:
T2=T1-E*(T1-t1)     #[K]
print"For countercurrent flow arrangement:"
print"Exit temperature of hot fluid is",T2,"K(",T2-273,"degree C)"
t2=mCp_h*(T1-T2)/(mCp_c)+t1     #[From energy balance eqn in ][K]
print"Exit temperature of cold fluid is",round(t2)," K(",round(t2-273) ,"degree C)\n"

#Case 2:Parallel flow arrangement
E1=(1-math.exp(-(1.0+C)*ntu))/(1.0+C)
E1=round(E1,3)
T2=T1-E1*(T1-t1)     #[K]
t2=mCp_h*(T1-T2)/(mCp_c)+t1     #[From energy balance eqn in ][K]
print"For Parallel flow arrangement:"
print"Exit temperature of Hot water=",T2,"K(",T2-273,"degree C)"
print"Exit temperature of cold water=",round(t2,1),"K(",round(t2-273,1),"degree C)"
For countercurrent flow arrangement:
Exit temperature of hot fluid is 721.0 K( 448.0 degree C)
Exit temperature of cold fluid is 553.0  K( 280.0 degree C)

For Parallel flow arrangement:
Exit temperature of Hot water= 734.8 K( 461.8 degree C)
Exit temperature of cold water= 543.2 K( 270.2 degree C)

Example no:5.23,Page no:5.69

In [2]:
#Counter flow concentric heat exchanger
import math
from scipy.optimize import fsolve

#Variable declaration
Cpo=2131.0        #Sp heat of oil in [J/kg.K]
Cpw=4187.0        #Sp heat of water in [J/kg.K]
mo_dot=0.10     #Oil flow rate in [kg/s]
mw_dot=0.20      #Water flow rate in [kg/s]
U=380.0           #Overall heat transfer coeff in [W/sq m.K]
T1=373.0          #Initial temp of oil [K]
T2=333.0          #Final temperature of oil [K]
t1=303.0          #Water enter temperature in [K]


#Calculation
t2=t1+mo_dot*Cpo*(T1-T2)/(mw_dot*Cpw)   #[K]   

#1.LMTD method
dT1=T1-t2           #[K]
dT2=T2-t1           #[K]
dTlm=(dT1-dT2)/math.log(dT1/dT2)     #[K]
lmtd=dTlm            #[K]
Q=mo_dot*Cpo*(T1-T2)        #[J/s]
A=Q/(U*dTlm)                #[sq m]
Do=0.025                    #Inner tubve diameter [m]
L=A/(math.pi*Do)                #Length in [m]

#2.NTU method
mCp_c=mw_dot*Cpw               #[W/K]
mCp_h=mo_dot*Cpo               #[W/K]
print"In textbook value of mCp_h is wrongly calculated as 231.1  so we will take this only for calculation\n"
mCp_h=231.1                 #[W/K]
#mCp_h is smaller
C=mCp_h/mCp_c
E=(T1-T2)/(T1-t1)               #Effeciency
#For countercurrent flow
def f(ntu):
    x=E-(1.0-math.exp(-(1.0-C)*ntu))/(1.0-C*math.exp(-(1.0-C)*ntu))
    return(x)
ntu=fsolve(f,1)
A=ntu*mCp_h/U       #[sq m]
A=round(A[0],2)
L1=A/(math.pi*Do)        #Length in [m]'


#Result
print"From LMTD approach:\nlength=",round(L,2),"m\n" 
print"From NTU method:\nlength=",round(L1,2),"m" 
In textbook value of mCp_h is wrongly calculated as 231.1  so we will take this only for calculation

From LMTD approach:
length= 6.61 m

From NTU method:
length= 7.26 m

Example no:5.24,Page no:5.70

In [3]:
#Number of tubes required
import math
from scipy.optimize import fsolve

#Variable declaration
ho=200.0      #[W/sq m.K]
hi=1500.0     #[W/sq m.K]
Cpw=4.2      #Sp heat of Water in [kJ/(kg.K)]
Cpo=2.1      #Sp heat of Oil in [kJ/(kg.K)]
E=0.8       #Effectiveness
k=46.0        #[W/m.K]
m_dot=0.167     #[kg/s]


#Calculation

mCp_oil=2*m_dot*Cpo*1000.0      #For oil [W/K]
#mCp_oil is wrongly calculated as 710.4
mCp_water=m_dot*Cpw*1000.0      #For water [W/K]
#mCp_oil is wrongly calculated as 710.4
#NOTE:The above two values are wrongly calculated in book as 710.4
#so we take here:
mCp_small=710.4     #[W/K]
#Since both mCp_water and mCp_oil are equal ,therefore:
C=1.0 
def f(ntu):
    x=E-(ntu/(1+ntu))
    return(x)
ntu=fsolve(f,1)
id=20.0       #Internal diameter in [mm]
od=25.0       #External diameter in [mm]
hio=hi*id/od        #[W/sq m.K]
Dw=(od-id)/math.log(od/id)   #[mm]
Dw=Dw/1000.0              #[m]
x=(od-id)/2.0             #[mm]
x=x/1000.0            #[m]
Do=0.025            #External dia in [m]
L=2.5               #Length of tube in [m]
Uo=1.0/(1.0/ho+1.0/hio+(x/k)*(Dw/Do))     #[W/sq m.K]
A=ntu*mCp_small/Uo   #Heat transfer area in [sq m]
n=A/(math.pi*Do*L)      #No of tubes

#Result
print"No. of tubes required =",round(n+1)
No. of tubes required = 86.0

Example no:5.25,Page no:5.72

In [154]:
#Parallel and Countercurrent flow
import math

#Variable declaration
#(i)Parallel flow
T1=633.0      #[K]
t2=303.0      #[K]
T2=573.0      #[K]
t1=400.0      #[K]

#Calculation
dT1=T1-t2   #[K]
dT2=T2-t1   #[K]
mh_dot=1.2  #[kg/s]
U=500.0       #Overall heat transfer coefficient in [W/sqm.K]
Cp=2083.0         #Sp.heat of oil J/kg.K
dTlm=(dT1-dT2)/math.log(dT1/dT2) #[K]
Q=mh_dot*Cp*(T1-T2)         #[W]
A=Q/(U*dTlm)                #[sq m]

#(ii)Counter current flow
dT1=T1-t1            #[K]
dT2=T2-t2           #[K]
dTlm=(dT2-dT1)/math.log(dT2/dT1)     #[K]
A1=Q/(U*dTlm)        #[sq m]

#Result
print"For parallel flow,Area =",round(A,3),"m^2\nFor countercurrent flow,Area=",round(A1,3),"m\n"
print"For the same terminal temperatures of the fluid ,\nthe surface area for the counterflow arrangement is less than the required for the parallel flow"
For parallel flow,Area = 1.234 m^2
For countercurrent flow,Area= 1.195 m

For the same terminal temperatures of the fluid ,
the surface area for the counterflow arrangement is less than the required for the parallel flow