from __future__ import division
import math
#variable initialization
g=9.81 #Gravity constant
H=2 #height in m
hL=0.2 #headloss
Cc=0.63 #Coefficient of contraction
D=4 #Diameter in cm
#Calculation
D=D/100 #Converting into m
V=round(math.sqrt(2*g*H),3) #Ideal Velocity
Va=math.sqrt(2*g*(H-hL))
Cv=round(Va/V,3)
print "(i)Coefficient of velocity Cv=",Cv
Cd=round(Cc*Cv,3)
print "Coefficient of discharge Cd=",Cd
a=math.pi/4*(D**2) #Discharge through the orifice
Q=Cd*a*(V)
print "(ii)Q=",round(Q*1000,3),"L/s"
y=0.50 #Given value
x=Cv*(4*y*H)**(1/2)
print "(iii)x=",x,"m"
import math
#variable initialization
d=25 #diameter im mm
H=5.5 #head in m
Q=3 #rate in L/s
x=1.5 #horizontal distance
y=0.12 #vertical distance
g=9.81 #gravity in m/s^2
#solution
Cv=round(x/(math.sqrt(4*y*H)),3) #Coefficient of velocity
print "Cv=",Cv
Q=Q/1000
a=((math.pi)/4)*((d/1000)**2)
Cd=round(Q/(a*(math.sqrt(2*g*H))),3) #Coefficient of contadiction
print "Cd=",Cd
Cc=Cd/Cv #Coefficient of discharge
print "Cc=",round(Cc,3)
import math
#variable initialisation
D=10 #diameter in cm
V1=2.5 #Velocity in pipe in m/s
P1=50 #pressure in kPa
Cv=0.98 #coefficient of velocity
ga=9.79 #Relative density
g=9.81 #gravity in m/s^2
#solution
H=round((P1/ga)+((V1**2)/(2*g)),3) #Total head
Vj=round(Cv*(math.sqrt(2*g*H)),2) #Velocity of jet
print "Vj=",Vj,"m/s"
A1=(math.pi/4)*((D/100)**2) #Discharge
aj=(A1*V1)/Vj
Dj=math.sqrt(aj*4/(math.pi))
print "Dj=",round((Dj*100),2),"cm"
Hl=((1/(Cv**2))-1)*((Vj**2)/(2*g)) #Headloss
print "HL=",round(Hl,3),"m"
import math
#variable initialization
D=20 #Diameter in cm
del_H=0.5 #pressure head differential in m
mu=0.001 #Coefficient of viscosity in Pa.s
rho=998 #density in kg/m63
g=9.81 #Gravity constant
#Calculation
D=D/100 #Coverting into m
#Q=K0*A2*math.sqrt(2*g*del_H)
A2=(math.pi/4)*((D/2)**2)
Q=A2*math.sqrt(2*g*del_H)
#As K0 is not known use trial and error method,
K0=0.62
Q=K0*Q
print "Q=",round(Q,5),"m^3/s"
V=Q/(math.pi*D**2/4) #Velocity
v=mu/rho
Re=V*D/v #Reynold's number
#For this value of Re,K0 is same as assumed.Hence no iterations required.
print "Q=",round(Q*1000,2),"L/s"
import math
#variable initialisation
Q=20 #Discharge in L/s
g=9.81 #gravity in m/s^2
Kf=0.99 #flow coefficient of nozzle
D=3.0 #diameter in cm
ga=0.70*9.79 #relative density
#solution
A2=math.pi/4*(D/100)**2 #calculating area
Q=Q/10000 #converting into m^3/s
del_H=((Q/(Kf*A2))**2)/(2*g) #Head difference across nozzle
#For a Horizontal nozzle Z1-Z2=0
del_P=ga*del_H #calculating del_p
print "del_p=", round(del_P,3),"kPa"
import math
#variable initialisation
D2=10 #diameter in cm
D1=20 #diameter in cm
Sm=13.6 #relative density constant
Sp=0.9 #relative density
Cd=0.99 #coefficient of discharge
g=9.81 #gravity in m/s^2
y=9 #manometer reading in cm
#solution
#for a differential monometer
r=(D1/2)/100 #radius
A2=(math.pi/4)*((r)**2) #area
D=round(math.sqrt(1-(D2/D1)**4),3)
delh=(Sm/Sp)-1 #calculating delh
Q=round(((Cd*A2)/D)*(math.sqrt(2*g*(delh*(y/100)))),2) #calculating flow
print "Q=",Q*1000,"L/s"
#when Q=50L/s
Q=50/1000
s=(((Cd*A2)/D)*(math.sqrt(2*g*(delh))))
y=round((Q/s)**2,2) #manometer reading
print "y=",int(y*100),"cm"
import math
#variable initialisation
D1=20 #diameter in cm
Cd=0.985 #coefficient of discharge
Sm=0.6 #relative density of liquid
Sp=1.0 #relative density
y=15 #U-tube reading in cm
D2=10 #diameter in cm
g=9.81 #gravityi in m/s^2
#solution
#from the inverted differential manometer
delh=(y/100)*(1-(Sm/Sp))
#By the venturimeter equation,
A2=(math.pi/4)*(((D1/100)/2)**2) #area
s=math.sqrt((1-((D2/D1)**4)))
Q=((Cd*A2)/s)*(math.sqrt((2*g*delh)))
print "Q=",round(Q*1000,2),"L/s"
HLi=(1-(Cd**2))*delh #Head loss in the intel section
print "HLi=",(round(HLi,4)*1000),"mm of water"
import math
#variable initialization
Sp=0.85 #Relative density
y=4 #pitot static tube reading in cm
C=0.99 #coefficient of pitot tube
Sm=13.6 #relative density
g=9.81 #gravity
#solution
#For the differential monometer
del_h=(y/100)*((Sm/Sp)-1) #del_h
#For the pitot tube
Vo=C*(math.sqrt(2*g*del_h)) #Velocity
print "Velocity at M=",round(Vo,3),"m/s"
import math
#variable initialization
Ps=3.0 #Stagnation Pressure in kPa
Po=-3.0 #Static pressure in kPa
rho=1.20 #mass density in kg/m^3
C=0.98 #instrument coefficient
#solution
#In a pitot static tube,
#Velocity of flow
Vo=C*math.sqrt(((2*(Ps-Po))/rho)*1000)
print "Vo=",int(Vo),"m/s"
import math
#variable initialization
D=30 #diameter in cm
Ps=-10 #static pressure in cm
Psn=1.0 #stagnation pressure in N/cm^2
C=0.98 #coefficient of tube
ga=9790 #density
g=9.81 #gravity
#solution
Po=(Ps/100)*13.6 #Calculating Po/ga
Ps=Psn*(10**4)/ga #Calculating ps/ga
del_h=(Ps-Po)
Vm=C*math.sqrt(2*g*del_h) #Centreline velocity
V=0.85*Vm #Mean velocity
Q=(math.pi/4)*((D/100)**2)*V #Discharge
print "Q=",round(Q,3),"m^3/s"
import math
#variable initialization
L=0.40 #Width in m
Q=25 #discharge in L/s
H1=10 #head in cm
g=9.81 #gravity in m/s^2
#solution
#By the weir formula,
Cd=(Q/1000)/((2/3)*(math.sqrt(2*g))*L*(math.pow((H1/100),3/2)))
print "Cd=",round(Cd,3) #Coefficient of discharge
import math
#variable initialization
L=2.5 #length in m
Cd=0.62 #Coefficient of discharge
H1=0.7 #head in m
t=0.15 #thickness in m
g=9.81 #gravity in m/s^2
#solution
L=L-2*t #crest length
n=2+(2*2) #no of end contractions
Le=L-(0.1*n*H1) #effective crest length
#The discharge from Francis Formula by neglecting the velocity of approach,
Q=(2/3)*(Cd)*(math.sqrt(2*g))*(Le)*(math.pow(H1,3/2))
print "Q=",round(Q,2),"m^3/s"