#Variable declaration
d_o=25e-3 #Diameter of orifice
d_p=75e-3 #Diameter of pipe
flow_o=300e-6 #Flow rate through pipe
Meu_watr=1e-3 #Viscosity of water
#Calculation
import math
import sympy
area_o=math.pi/4*d_o**2 #Area of orifice
vel_o=flow_o/area_o #Velocity of water through the orifice
Re_o=d_o*vel_o*1000/Meu_watr #Re at the orifice
Cd=0.61
G=flow_o*1e3 #mass flow rate water
ho=sympy.Symbol('ho')
p=sympy.solve(G**2-((Cd*area_o*1000)**2*2*9.81*ho))
#Result
print"Difference in level on a water manometer =",round(p[0]*1000),"mm of water"
#Variable declaration
rho_sul=1300.0 #Density of sulphuric acid
id=50e-3 #Internal diameter of pipe
d_o=10e-3 #Diameter of orifice
h=.1 #Differential pressure shown on a mercury manometer
Cd=0.61 #Coeffecient of discharge
rho_merc=13550.0 #Density of mercury
rho_watr=1000.0 #Density of water
#Calculation
area_o=math.pi/4*d_o**2 #area of orifice
h_sul=h*(rho_merc-rho_sul)/rho_sul
G_sul=Cd*area_o*rho_sul*(2*9.81*h_sul)**0.5
DP=rho_sul*9.81*h_sul
#Result
print"(a).The mass flow rate of acid =",round(G_sul,3),"kg/s"
print"(b).The drop in pressure =",round(DP/1000),"kN/m**2"
#Variable declaration
d=150e-3 #Diameter of pipe
d_t=50e-3 #Throat diameter
hv=121e-3 #Pressure drop over the converging section
G=2.91 #Mass Flow rate of water
#Calculation
import math
A1=math.pi*d**2/4.0
A2=math.pi*d_t**2/4.0
Cd=G*math.sqrt(A1**2-A2**2)/(1000*A1*A2*math.sqrt(2*9.8*hv))
#Result
print"Coefficient for the converging cone of the meter at given flowrate =",round(Cd,2),"(Approx)"
#Variable declaration
l=0.3 #length of tube
id_t=25e-3 #Top internal diameter of tube
id_b=20e-3 #Bottom internal diameter of tube
d_f=20e-3 #Diameter of float
v_f=6e-6 #Volume of float
Cd=0.7 #Coefficient of discharge
rho=1000 #Density of water
rho_f=4800 #Density of float
#Calculation
import math
area_t=math.pi/4.0*id_t**2 #Cross-sectional area at top of tube
area_b=math.pi/4.0*id_b**2 #Cross-sectional area at bottom of tube
A_f=math.pi/4.0*d_f**2 #Area of float
A1=math.pi/4.0*((id_t+id_b)/2)**2
A2=A1-A_f
G=Cd*A2*math.sqrt((2*9.81*v_f*(rho_f-rho)*rho)/(A_f*(1-(A2/A1)**2)))
#Result
print"The flow rate of water =",round(G,3),"kg/s"
#Variable declaration
L=0.5 # Length of the weir
D=100e-3 #Height of water over the weir
n=0
#Calculation
#Using Francis formula:
Q=1.84*(L-(0.1*n*D))*D**1.5
#Result
print"Volumetric flowrate of water =",round(Q,2),"m**3/s"
#Variable declaration
G=15.0 #Mass flow rate of organic liquid
L_ow=2.0 #Length of the weir
rho_l=650.0
#Calculation
Q=G/rho_l
Q=round(Q,3)
#Use is made of the Francis formula (equation 6.43),
h_ow=(2.0/3.0)*(Q/L_ow)**(2.0/3.0)
#Result
print"Height of liquid flowing over the weir =%d"%(h_ow*1000),"mm"