T1=100.0
T2=75.0
t1=5.0
t2=50.0
import math
LMTD_counter=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)))
LMTD_parallel=((T1-t1)-(T2-t2))/(math.log((T1-t1)/(T2-t2)))
print"The LMTD for counter flow configuration is ",round(LMTD_counter,1),"C"
print"The LMTD for parallel flow configuration is ",round(LMTD_parallel,2),"C"
T1=250
T2=150
t1=100
t2=150
import math
LMTD_counter=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)));
LMTD_parrelel=0
print"The LMTD for counter flow configuration is",round(LMTD_counter,1),"C"
print"if parallel flow is to give equal outlet temperatures,then the area needed must be infinite which is not feasible economically."
print"The LMTD for parrelel flow configuration is",LMTD_parrelel,"C"
rou_1= 0.985*62.4 # density in lbm/ft**3
cp_1=0.9994 # specific heat BTU/(lbm-degree Rankine)
v_1= 0.514e-5 # viscosity in ft**2/s
kf_1 = 0.376 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_1 = 6.02e-3 # diffusivity in ft**2/hr
Pr_1 = 3.02 # Prandtl Number
m_1=5000 # mass flow rate in lbm/hr
T_1=195 # temperature in degree F
rou_2= 1.087*62.4 # density in lbm/ft**3
cp_2=0.612 # specific heat BTU/(lbm-degree Rankine)
v_2= 5.11e-5 # viscosity in ft**2/s
kf_2 = 0.150 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_2 = 3.61e-3 # diffusivity in ft**2/hr
Pr_2 = 51 # Prandtl Number
m_2=12000 # mass flow rate in lbm/hr
T_2=85 # temperature in degree F
ID_a=0.1674
ID_p=0.1076
OD_p=1.375/12
A_p=math.pi*ID_p**2/4
A_a=math.pi*((ID_a)**2-(OD_p)**2)/4
D_h=ID_a-OD_p
D_e=(ID_a**2-OD_p**2)/(OD_p)
Re_1=(m_1/3600.0)*(ID_p)/(v_1*rou_1*A_p)
Re_2=(m_2/3600.0)*(D_e)/(v_2*rou_2*A_a)
Nu_1=0.023*(Re_1)**(4/5.0)*(Pr_1)**0.3
Nu_2=0.023*(Re_2)**(4/5.0)*(Pr_2)**0.4
h_1i=Nu_1*kf_1/ID_p
h_1o=h_1i*ID_p/OD_p
h_2=Nu_2*kf_2/D_e
Uo=1/((1/h_1o)+(1/h_2))
R=(m_2*cp_2)/(m_1*cp_1)
L=20
A=math.pi*OD_p*L
T1=195
t1=85
T2=((T1*(R-1))-(R*t1*(1-exp((Uo*A*(R-1))/(m_2*cp_2)))))/(R*exp(Uo*A*(R-1)/(m_2*cp_2))-1)
t2=t1+(T1-T2)/R
print"The outlet temperature of Ethylene glycol is %.1f degree F",round(t2,1),"F"
rou_1= 1.088 # density in kg/m**3
cp_1= 1007 # specific heat in J/(kg*K)
v_1= 18.2e-6 # viscosity in m**2/s
Pr_1 =0.703 # Prandtl Number
kf_1= 0.02814 # thermal conductivity in W/(m.K)
a_1 = 0.26e-4 # diffusivity in m**2/s
m_1=100 # mass flow rate in kg/hr
t1_air=20+273
t2_air=80+273
rou_2= 1.0732 # density in kg/m**3
cp_2= 1013 # specific heat in J/(kg*K)
v_2= 21.67e-6 #viscosity in m**2/s
Pr_2 =0.702 # Prandtl Number
kf_2= 0.03352 # thermal conductivity in W/(m.K)
a_2 = 0.3084e-4 # diffusivity in m**2/s
m_2=90 # mass flow rate in kg/hr
T1_CO2=600
ID_a=.098
ID_p=.07384
OD_p=.07938
import math
A_p=math.pi*ID_p**(2)/4.0
A_a=math.pi*((ID_a)**2-(OD_p)**2)/4.0
q_air=(m_1/3600.0)*(cp_1)*(t2_air-t1_air)
T2_CO2=T1_CO2-(q_air/(m_2*cp_2/3600.0))
LMTD_counter=((T1_CO2-t2_air)-(T2_CO2-t1_air))/(log((T1_CO2-t2_air)/(T2_CO2-t1_air)))
D_h=ID_a-OD_p
D_e=(ID_a**2-OD_p**2)/(OD_p)
Re_1=(m_1/3600.0)*(ID_p)/(v_1*rou_1*A_p)
Re_2=(m_2/3600.0)*(D_e)/(v_2*rou_2*A_a)
Nu_1=0.023*(Re_1)**(0.8)*(Pr_1)**0.3
Nu_2=0.023*(Re_2)**(0.8)*(Pr_2)**0.4
h_1i=Nu_1*kf_1/ID_p
h_1o=h_1i*ID_p/OD_p
h_2=Nu_2*kf_2/D_e
Rd_air=0.0004
Rd_CO2=0.002
Uo=1/((1/h_1o)+(1/h_2))
Uo=1/((1/Uo)+Rd_air+Rd_CO2)
A=q_air/(Uo*LMTD_counter)
L=(A/(math.pi*OD_p)) # length of each exchanger
L_available=2 # available exchanger length
N=L_available/L # no. of exchangers
fp=0.0245 #friction factor for air fom figure 6.14 corresponding to Re
fa=0.033 #friction factor for cCO2fom figure 6.14 corresponding to Re
V_air=(m_1/3600.0)/(rou_1*A_p)
V_CO2=(m_2/3600.0)/(rou_2*A_a)
dP_p=(fp*L_available*rou_1*V_air**2)/(ID_p*2)
dP_a=((rou_2*V_CO2**2)/2.0)*((fa*L_available/D_h)+1)
print"(a)The number of exchangers is ",round(N,0)
print"(b)The overall exchanger coefficient is ",round(Uo,1)," W/(sq.m.K)"
print"(c)The pressure drop for tube side is ",round(dP_p,2),"Pa"
print"The pressure drop for shell side is ",round(dP_a,1),"Pa"
rou_1= 0.994*62.4 # density in lbm/ft**3
cp_1=0.998 # specific heat BTU/(lbm-degree Rankine)
v_1= 0.708e-5 # viscosity in ft**2/s
kf_1 = 0.363 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_1 = 5.86e-3 # diffusivity in ft**2/hr
Pr_1 = 4.34 # Prandtl Number
m_1=170000 # mass flow rate in lbm/hr
T1=110.0 # temperature in degree F
rou_2= 62.4 # density in lbm/ft**3
cp_2=0.9988 # specific heat BTU/(lbm-degree Rankine)
v_2= 1.083e-5 # viscosity in ft**2/s
kf_2 = 0.345 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_2 = 5.54e-3 # diffusivity in ft**2/hr
Pr_2 = 7.02 # Prandtl Number
m_2=150000 # mass flow rate in lbm/hr
t1=65 # temperature in degree F
OD=3/(4*12.0)
ID=0.652/12.0
OD_p=1.375/12.0
Nt=224.0 # from table 9.3
Np=2 # no. of tube passes
Ds=17.25/12.0
Nb=15.0 # no. of baffles
B=1
sT=15/(16*12.0)
C=sT-OD
import math
At=(Nt*math.pi*ID**2)/(4*Np)
As=(Ds*C*B)/sT
De=4*((sT/2.0)*(0.86*sT)-(math.pi*OD**2/8.0))/(math.pi*OD/2.0)
Re_s=(m_1/3600.0)*(De)/(v_1*rou_1*As)
Re_t=(m_2/3600.0)*(ID)/(v_2*rou_2*At)
Nu_t=0.023*(Re_t)**(0.8)*(Pr_2)**0.4
Nu_s=0.36*(Re_s)**(0.55)*(Pr_1)**(1/3.0)
h_ti=Nu_t*kf_2/ID
h_to=h_ti*ID/OD
h_s=Nu_s*kf_1/De
Uo=1/((1/h_to)+(1/h_s))
R=(m_2*cp_2)/(m_1*cp_1)
L=16
Ao=Nt*math.pi*OD*L
UoAo_mccp=(Uo*Ao)/(m_2*cp_2)
S=0.58 #value of S from fig. 9.13 Ten Broeck graph corresponding to the value of (UoAo)/(McCpc)
t2=S*(T1-t1)+t1
T2=T1-R*(t2-t1)
ft=0.029 #friction factor for raw water fom figure 6.14 corresponding to Reynolds Number calculated above
fs=0.281 #friction factor for distilled water fom figure 6.14 corresponding to Reynolds Number calculated above
V_t=(m_2/3600.0)/(rou_2*At)
V_s=(m_1/3600.0)/(rou_1*As)
gc=32.2
dP_t=(rou_2*V_t**2)*((ft*L*Np/ID)+4*Np)/(2*gc)
dP_s=((rou_1*V_s**2)*(fs*Ds*(Nb+1)))/(2*gc*De)
print"Outlet Temperatures of raw water is ",round(t2,1),"F"
print"Outlet Temperatures of distilled water is ",round(T2,1),"F"
print"\nThe pressure drop for tube side is",round(dP_t/147,1),"psi"
print"The pressure drop for shell side is",round(dP_s/147,1),"psi"
m_1=170000 # mass flow rate in lbm/hr
T1=110 # temperature in degree F
cp_1=0.998 # specific heat BTU/(lbm-degree Rankine)
m_2=150000 # mass flow rate in lbm/hr
t1=65 # temperature in degree F
cp_2=0.9988 # specific heat BTU/(lbm-degree Rankine)
Uo=350 # exchanger coefficient
Ao=703.7
mcp_raw=m_2*cp_2
mcp_distilled=m_1*cp_1
mcp_min_max=mcp_raw/mcp_distilled
UA_mcpmin=(Uo*Ao)/(mcp_raw)
effectiveness=0.58 #value of effectiveness from figure 9.15 corresponding to the above calculated values of capacitance ratio and (UoAo/mcp_min)
qmax=mcp_raw*(T1-t1)
q=effectiveness*qmax # actual heat transfer
t2=(q/mcp_raw)+t1
T2=T1-(q/mcp_distilled)
print"The Outlet temperature is Raw Water is",round(t2,1),"F"
print"The Outlet temperature is disilled Water is",round(T2,1),"F"
rou_1= 0.852*62.4 # density in lbm/ft**3
cp_1=0.509 # specific heat BTU/(lbm-degree Rankine)
v_1=0.404e-3 # viscosity in ft**2/s
kf_1=0.08 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_1=2.98e-3 # diffusivity in ft**2/hr
Pr_1=490.0 # Prandtl Number
m_1=39.8 # mass flow rate in lbm/min
T1=190.0
T2=158.0
rou_2= 0.0653 # density in lbm/ft**3
cp_2=0.241 # specific heat BTU/(lbm-degree Rankine)
v_2= 20.98e-5 # viscosity in ft**2/s
kf_2 = 0.01677 # thermal conductivity in BTU/(hr.ft.degree Rankine)
a_2 = 1.066 # diffusivity in ft**2/hr
Pr_2 = 0.706 # Prandtl Number
m_2=67.0 # mass flow rate in lbm/min
t1=126.0
t2=166.0
q_air=m_2*cp_2*60*(t2-t1)
q_oil=m_1*cp_1*60*(T1-T2)
import math
LMTD=((T1-t2)-(T2-t1))/(math.log((T1-t2)/(T2-t1)))
Area_air=(9.82*8)/144.0
Area_oil=(3.25*9.82)/144.0
S=(t2-t1)/(T1-t1)
R=(T1-T2)/(t2-t1)
F=0.87 #value of correction factor from figure 9.21a corresponding to above calculated values of S and R
UA=q_air/(F*LMTD)
mcp_air=m_2*cp_2*60
mcp_oil=m_1*cp_1*60
mcp_min_max=mcp_air/mcp_oil
NTU=(UA/mcp_air)
effectiveness=0.62 #effectiveness from fig 9.21b corresponding to the values of capacitance ratio
t2_c=(T1-t1)*effectiveness+t1
T2_c=T1-(mcp_air)*(t2_c-t1)/(mcp_oil)
print"The Overall Coefficient is ",round(UA,0)," BTU/(hr. degree R)"
print"Calculated outlet temprature are:"
print"Outlet temprature for air",round(t2_c,1),"F"
print"Outlet temprature for Engine Oil",round(T2_c,0),"F"