from numpy import pi
from __future__ import division
# given data
h_fg=2256*10**3 # in J/kg
rho=970 # in kg/m**3
rho_v=0.596 # in kg/m**3
k=0.66 # in W/mK
miu=3.7*10**-4 # in kg/m-s
T_sat=100 # in degree C
T_s=40 # in degree C
L=1.5 # in m
d=0.09 # in m
g=9.81#
# heat transfer coefficient
#h_bar = 1.13*[ rho*g*(rho-rho_v)*h_fg*k**3/(miu*L*(T_sat-T_s))]**(1/4) # in W/m**2k
h_bar= 1.13*(rho*g*(rho-rho_v)*h_fg*k**3/(miu*L*(T_sat-T_s)))**(1/4)#
# heat transfer rate
q=h_bar*pi*d*L*(T_sat-T_s) # in watt
print "Heat transfer rate = %0.3f kW" %(q*10**-3)
#rate of condensation
m=q/h_fg # in kg/s
print "Rate of condenstion = %0.4f kg/s" %m
from numpy import pi
from __future__ import division
# given data
h_fg=2310*10**3 # in J/kg
rho=980 # in kg/m**3
k=0.67 # in W/mK
Cp=4.18#
delta=.41*10**-6 # in m**2/s
miu=rho*delta#
T_sat=70 # in degree C
T_s=55 # in degree C
L=1 # in m
d=0.03 # in m
g=9.81#
N=5#
# (a) for Horizontal tube
h_bar = 0.725*(rho**2*g*h_fg*k**3/(N*miu*d*(T_sat-T_s)))**(1/4) # in W/m**2k
# heat transfer rate
q=h_bar*pi*d*L*N**2*(T_sat-T_s) # in watt
print "Heat transfer rate for horizontal tube = %0.3f kW" %(q*10**-3)
#rate of condensation
m=q/h_fg # in kg/s
print "Rate of condenstion = %0.3f kg/s" %m
# (b) For Vertical tube
h_bar = 1.13*(rho**2*g*h_fg*k**3/(miu*L*(T_sat-T_s)))**(1/4) # in W/m**2k
# heat transfer rate
q=h_bar*pi*d*L*N**2*(T_sat-T_s) # in watt
print "Heat transfer rate for vertical tube = %0.3f kW" %(q*10**-3)
#rate of condensation
m=q/h_fg # in kg/s
print "Rate of condenstion = %0.3f kg/s" %m
from numpy import pi
# given data
h_fg=2392*10**3 # in J/kg
rho=993 # in kg/m**3
k=0.63 # in W/mK
miu=728*10**-6 # in kJ/m-s
N=10#
T_sat=45.7 # in degree C
T_s=25 # in degree C
d=4*10**-3 # in m
g=9.81#
h_bar = 0.725*(rho**2*g*h_fg*k**3/(N*miu*d*(T_sat-T_s)))**(1/4) # in W/m**2k
m=300/(60*60)#
# Formula m=q/h_fg
q=m*h_fg#
print "Heat transfer rate = %0.3f kW" %(q*10**-3)
# Formula q=h_bar*pi*d*L*N**2*(T_sat-T_s)
L=q/(h_bar*pi*d*N**2*(T_sat-T_s))#
print "Length of tube = %0.3f m" %L
# Note: Answer in the book is wrong
from math import sin
from numpy import pi
# given data
h_fg=2400*10**3 # in J/kg
rho=993 # in kg/m**3
rho_v=0.0563 # in kg/m**3
t_mf=(40+30)/2 # in degree C
k=0.625 # in W/mK
miu=728*10**-6 # in kJ/m-s
x=0.25#
T_sat=40 # in degree C
T_s=30 # in degree C
g=9.81#
# (a) Thickness of condensate film
delta=(4*k*(T_sat-T_s)*miu*x/(rho*(rho-rho_v)*g*h_fg))**(1/4) # in meter
print "Thickness of condensate film = %0.5f mm" %(delta*10**3)
#(b) Local value of heat transfer coefficient
hx=k/delta # in W/m**2
L=0.5 # in m
hm=4/3*(L/x)**(1/4)*hx#
print "Average heat transfer coefficient = %0.1f W/m**2" %hm
# The heat transfer rate
A=0.5*0.5 # in m**2
q=hm*A*(T_sat-T_s) # in watt
print "The heat transfer rate = %0.2f kW" %(q*10**-3)
# (c)
theta=45 # in degree
h_vertical=hm#
h_inclined=h_vertical*(sin(theta*pi/180))**(1/4)#
print "Average heat transfer coefficient when plate is inclined at 45 degree = %0.1f W/m**2K" %h_inclined
#given correlataion
#h_A=5.56*(det_T)**3
#h_P=h_A*(rho/rho_a)**0.4
del_T=25 # in degree C
h_A=5.56*(del_T)**3 # in W/m**2K
print "The heat transfer coefficient = %0.3f kW/m**2K" %(h_A*10**-3)
# and at 20 bar
rho=20#
rho_a=1#
h_P=h_A*(rho/rho_a)**0.4 # in W/m**2
print "Value of h_P = %0.1f kW/m**2" %(h_P*10**-3)