#Water at 1 atm is boiled on a brass surface. Using the rohsenow correlation
#determine the heat transfer coefficient for nucleate boiling if the wall
#superheat is 11C?
import math
#initialisation of variables
P= 1 #atm
dt= 11 #C
Csf= 0.006
r= 1./3.
s= 1.
cl= 4.218 #J/gm K
hfg= 2257 #J/gm
Pr= 1.75
ul= 283.1/1000. #gm/m s
s= 57.78/1000. #N/m
pl= 958*1000. #gm/m^3
pv= 598. #gm/m^3
gc= 1000. #gm m/N s^2
g= 9.8 #m/s^2
#CALCULATIONS
p= pl-pv #change in density
q= ((math.pow(((cl*dt)/(hfg*Csf*Pr)),(1/r))*(ul*hfg))/math.pow((gc*s/(g*p)),(0.5))) #Heat transfer rate
h= q/dt #Heat transfer coefficient
#RESULTS
print '%s %.2e' % ('Heat transfer coefficient for nucleate boiling (W/m^2 C) = ',h)
raw_input('press enter key to exit')
#A tube, 1/2 in OD and 5 ft long, is used to condense steam at 6 psia; the
#average temperature of the tube is maintained at 130 F. Determine the
#condensation heat transfer coefficient if the tube is mounted
#(a) vertically and (b) horizontally
import math
#initialisation of variables
k= 0.384 #Btu/hr ft F
Tsat= 170.03 #F
hfg= 996.2 #Btu/lbm
T= 130 #F
l= 5. #ft
P= 6. #psia
g= 4.17*math.pow(10,8) #ft/h^2
d= 0.042 #ft
p= 61.2 #lbm/ft^3
u= 1.05 #lbm/ft h
#CALCULATIONS
dt= Tsat-T #Change in temp.
Tf= (Tsat+T)/2. #Average temp.
hc= 0.943*math.pow(((k*k*k*p*p*g*hfg)/(l*u*dt)),(1./4.))
hc1= 0.725*math.pow(((k*k*k*p*p*g*hfg)/(d*u*dt)),(1./4.))
#RESULTS
print '%s %.2f' % ('Condensation heat tranfer coefficient if the tube is vertical (Btu/h ft^2 F) = ',hc)
print '%s %.2f' % (' \n Condensation heat tranfer coefficient if the tube is horizontally (Btu/h ft^2 F) = ',hc1)
raw_input('press enter key to exit')