import math
# Variables :
staticPHead = 5.; #meter
stagnationPHead = 6.; #meter
# Calculations
h = stagnationPHead-staticPHead; #meter
g = 9.81; #consmath.tant
Cv = 0.98; #Coeff of pilot tube
V = Cv*math.sqrt(2*g*h); #m/s
# Results
print "Velocity of flow in m/sec : %.2f"%V
import math
# Variables :
Cv = 0.975; #Coeff of pilot tube
h = 100./1000; #meter
g = 9.81; #consmath.tant
Sm = 13.6; #Sp. gravity
S = 0.86; #gravity of turpinre
# Calculations
V = Cv*math.sqrt(2*g*h*(Sm/S-1)); #m/s
# Results
print "Velocity in m/sec : %.3f"%V
import math
# Variables :
l = 2.; #meter
d0 = 0; #meter
d1 = 0.3; #meter
d2 = 1.0; #meter
d3 = 1.2; #meter
d4 = 1.6; #meter
d5 = 2.0; #meter
d6 = 1.4; #meter
d7 = 1.0; #meter
d8 = 0.4; #meter
d9 = 0.3; #meter
d10 = 0.2; #meter
V0 = 0; #meter
V1 = 0.5; #meter
V2 = 0.7; #meter
V3 = 0.8; #meter
V4 = 1.0; #meter
V5 = 1.2; #meter
V6 = 0.9; #meter
V7 = 0.8; #meter
V8 = 0.6; #meter
V9 = 0.5; #meter
V10 = 0.3; #meter
# Calculations
Q = l/3*(d0*V0+4*d1*V1+2*d2*V2+4*d3*V3+2*d4*V4+4*d5*V5+2*d6*V6+4*d7*V7+2*d8*V8+4*d9*V9+2*d10*V10+d0*V0); #cum/sec
# Results
print "Rate of discharge in cum/sec : ",Q
import math
# Variables :
Cd = 0.62; #consmath.tant
H = 0.12; #meter
L = 0.3; #meter
g = 9.81; #consmath.tant
# Calculations
Q = 2./3*Cd*math.sqrt(2*g)*L*H**(3./2); #m**3/s
# Results
print "Discharge in m**3/sec : %.4f"%Q
import math
# Variables :
Cd = 0.66; #consmath.tant
H = 0.15; #meter
L = 0.40; #meter
# Calculations
g = 9.81; #consmath.tant
Q = 2./3*Cd*math.sqrt(2*g)*L*H**(3./2); #m**3/s
# Results
print "Discharge in m**3/sec : %.5f"%Q
print "Discharge in litres/sec : %.2f"%(Q*10**3)
import math
# Variables :
Cd = 0.62; #consmath.tant
H = 200./1000; #meter
theta = 90.; #degree
g = 9.81; #consmath.tant
# Calculations
Q = 8./15*Cd*math.sqrt(2*g)*math.tan(math.radians(theta/2))*H**(5./2); #m**3/s
Q = Q*1000*60; #litres/minute
# Results
print "Discharge in litres/minute : %.f"%Q
import math
# Variables :
Cd = 0.62; #consmath.tant
Q = 250; #litres/sec
Q = Q*10**-3; #m**3/s
theta = 90; #degree
g = 9.81; #consmath.tant
d = 1.3; #meter
# Calculations
H = (Q/8*15/Cd/math.sqrt(2*g)/math.tan(math.radians(theta/2)))**(2./5); #m
h = d-H; #meter
# Results
print "Position above the bed in meter : %.3f"%h
import math
from scipy.integrate import quad
# Variables :
Cd = 0.65; #consmath.tant
A = 220; #m**2
g = 9.81; #consmath.tant
l = 30./100; #meter
H1 = 16.8/100; #meter
H2 = 6.8/100; #meter
# Calculations
def f1(h):
return h**(-3./2)
T = A/(2./3*Cd*l*math.sqrt(2*g))* quad(f1,H2,H1)[0]
# Results
print "Time taken is ",(math.floor(T/60))," minute ",round((T/60-math.floor(T/60))*60)," sec."
# note : answer might be vary because of quad function.
import math
# Variables :
H = 0.40; #meter
L = 5; #meter
print ("(i) End contractions are Suppressed : ");
# Calculations and Results
Q = 1.84*L*H**(3./2); #m**3/s
print "Discharge in m**3/sec : %.4f"%Q
print "Discharge in litres/sec : %.1f"%(Q*1000)
print ("(ii) End contractions are Considered : ");
n = 2;
Q = 1.84*(L-0.1*n*H)*H**(3./2); #m**3/s
print "Discharge in m**3/sec : %.5f"%Q
print "Discharge in litres/sec : %.2f"%(Q*1000)
import math
# Variables :
Cd = 0.62; #Coeff of discharge
H = 250./1000; #meter
L = 400./1000; #meter
# Calculations
g = 9.81; #gravity acceleration
Q = 2./3*Cd*math.sqrt(2*g)*L*H**(3./2); #m**3/s or cumec
# Results
print "Discharge in cumec : %.4f"%Q
import math
# Variables :
g = 9.81; #consmath.tant
Cd = 0.6; #Coefficient of discharge
B = 1.3; #meter
H1 = 6-(1.8+1.5); #meter
H2 = 6-1.5; #meter
# Calculations
Q = 2./3*Cd*B*math.sqrt(2*g)*(H2**(3./2)-H1**(3./2)); #m**3/sec
# Results
print "Discharge through the orifice in m**3/sec : %.1f"%Q
# note : answer is in m**3/sec.
import math
# Variables :
Cd = 0.60; #Coeff of discharge
L = 36.; #meter
H = 1.1; #meter
A = 50.; #m**2
g = 9.81; #gravity acceleration
# Calculations and Results
Qmax = 1.705*Cd*L*H**(3./2); #m**3/s
print "Maximum Discharge in m**3/sec : %.3f"%Qmax
Va = Qmax/A; #m/s(velocity of approach)
Q = 1.705*Cd*L*((H+Va**2/2/g)**(3./2)-(Va**2/2/g)**(3./2)); #m**3/s
print "New discharge considering velocity of approach in m**3/sec : %.2f"%Q
import math
# Variables :
w = 1.5; #m
d = 0.75; #m
Cd = 0.64; #Coeff of discharge
QT = 45.; #cumec
h = 8.; #meter
A = w*d; #m**2
g = 9.81; #gravity acceleration
# Calculations
Q = Cd*A*math.sqrt(2*g*h); #m**3/sec
n = QT/Q; #no. of spillways
# Results
print "No. of spillways : ",round(n)
import math
# Variables :
B = 1; #meter
b = 0.4; #meter
H = 0.57; #meter
h = 0.5; #meter
A = B*H; #m**2
g = 9.81; #gravity consmath.tant
a = b*h; #m**2
# Calculations
Q = A*a/math.sqrt(A**2-a**2)*math.sqrt(2*g*(H-h)); #m**3/sec
# Results
print "Discharge in m**3/sec : %.2f"%Q