from __future__ import division
from math import pi,sqrt
print "Example 12.1 page no 124\n\n"
T_i=660#temperature of flue at inlet in furnsce
D_1=6#inside diameter of pipe,ft
v_1=25#velocity at inlet
print "\n temperature at inlet T_i=%0.2f k\n diameter at inlet D_1=%0.2f ft\n velocity at inlet v_1=%0.2f ft/s"%(T_i,D_1,v_1)#
A_1=pi/4*D_1**2#
q_1=A_1*v_1#volumatric flow rate at inlet
print"\n area at ilet A_1=%0.2f st**2\n volumatric flow rate at inlet q_1=%0.2f ft**3/s"%(A_1,q_1)#
#applying charle's law for volumatic flow out of the scrubber
#given
T_2=2360#the temperature up to which furnace heats the gas
v_2=40#velocity of flow at outlet
print "\n temperature T_2=%0.2f k\n velocity of flow at outlet v_2=%0.2f ft/s"%(T_2,v_2)#
q_2=q_1*(T_2/T_i)#volumatric flow rate at outlet
A_2=q_2/v_2# cross sectional area at outlet duct
print "\n volumatric flow rate at outlet q_2=%0.2f ft**3/s\n cross sectional area at outlet A_2=%0.2f ft**2 "%(q_2,A_2)#
D_2=sqrt(4*A_2/pi)#diameter at outlet
print "\n diameter at outlet D_2=%0.2f ft "%(D_2)#
from __future__ import division
print "Example 12.2 page no 125\n\n"
#to calculate reynolds number
L=2.54#diameter of tube in cm
rho=1.50#density of liquid in gm/cm**3
v=20#velocity of flow in cm/s
meu=0.78e-2#viscosity of liquid in g/cm*s
print "\n diameter of tube L=%0.2f cm\n density rho=%0.2f gm/cm**3\n velocity v=%0.2f cm/s\n viscosity meu=%0.2f g/cm*s"%(L,rho,v,meu)#
R_e=L*rho*v/meu#reynolds number
print "\n Reynolds no. R_e=%0.2f "%(R_e)#
from __future__ import division
print "\n Example 12.3 page no 126\n\n"
#to determine the teynolds no of a gas stream
v=3.8#velocity through the duct
D=0.45#duct diameter
rho=1.2#density of gas
meu=1.73e-5#viscosity of gas
print "\n velocity v = %0.2f m/s\n diameter D=%0.2f m\n density rho=%0.2f kg/m**3\n viscosity meu=%0.2e kg/m*s"%(v,D,rho,meu)#
R_e=D*v*rho/meu#reynolds no
print "\n reynoldsno R_e = %0.2f "%(R_e)#
from __future__ import division
from math import pi
print " Example 12.5 page no 128\n\n"
SG=0.96#sp.gravity of a liquid
R=0.03#radius of long circular tube through which liquid flow
#flow rate is related with the diameter of circular tube
q=2*pi*(3*R**2-(200/3)*R**3)#
print "\n volumatric flow rate q = %0.3f m**3/s"%(q)#
rho_w=1000#density of water
rho_l=SG*rho_w#density of liquid
m_dot=rho_l*q#mass flow rate
print "\n mass flow rate m_dot=%0.2f kg/s"%(m_dot)#
s=pi*R**2#surface area
v_av=q/s#average velocity
print "\n average velocity v_av=%0.2f m/s"%(v_av)#
from __future__ import division
print "Example 12.6 page no 129\n\n"
#refer to example 12.6
V=20#volume of liquid passes through the section,m**3
q=0.00565#volumatric flow rate
t=V/q#time to pass liquid pass through volume V
print "\n time t=%0.2f s"%(t)#
from __future__ import division
from math import pi
print "Example 12.7 page no. 130\n\n"
#a gas is flowing through a circular duct
D=1.2#diameter of duct,ft
T=760#temperature,k
P=1#pressure
T_s=520#standard temperature
P_s=1#standard pressure
q_s=1000# standard volumatric flow rate,in scfm(given)
q=q_s*(T/T_s)*(P/P_s)#actual volumatric flow rate
print "\n actual volumatric flow rate q=%0.2f acfm "%(q)#
s=pi*D**2/4#cross sectional area
s_m=s*0.0929#area in m**2
v=(q/s)/60#velocity
print "\n average velocity v=%0.2f ft/s"%(v)#
MW=33#mlecular weight of gas
R=0.7302#gas constant
rho=(P*MW)/(R*T)#density from ideal gas law
print "\n density rho=%0.2f lb/ft**3"%(rho)#
m_dot=rho*v*s_m#mass flow rate
print "\n mass flow rate m_dot=%0.2f lb/s"%(m_dot)##printing mistake in book
D_m=0.366#diamter in m
v_m=6.55#velocity in m/s
rho_m=rho*(0.4536/.3048**3)#density in kg/m**3
rho_m=0.952#round off value
print "\nv_m=%0.2f"%(v_m)#
meu=2.2e-5#viscosity of gas in
R_e=D_m*v_m*rho_m/meu#reynolds no
print "\n reynolds no R_e=%0.2f "%(R_e)##calculation error in book