import math
#Given
h = 1.2; #head of water
Cd = 2.2; #coefficient of discharge
rho = 1; #density of water
gamma_w = 9.81; #unit weigth of water
q = Cd*h**1.5;
#applying bernaulli's equation at u/s water surface at section A and B
#solving it by error and trial method we get
v1 = 13.7;v2 = 14.7;
d1 = 0.212;d2 = 0.197;
F1 = gamma_w*d1**2*math.cos(math.radians(60))/2;
F2 = gamma_w*d2**2/2;
W = gamma_w*60*2*math.pi*3*((d1+d2)/2)/360;
Fx = rho*q*(v2-v1*math.cos(math.radians(60)))-F1/2+F2;
Fy = rho*q*(v1*math.sin(math.radians(60)))+F1*math.sin(math.radians(60))+W;
F = (Fx**2+Fy**2)**0.5;
F = round(F*100)/100;
# Results
print "Resultant force = %.2f kN/m."%(F);
import math
#Given
C = 2.4; #coefficient of discharge
H = 2; #head
L = 100; #length of spillway
wc = 8; #heigth of weir crest above bottom
g = 9.81; #acceleration due to gravity
# Calculations
h = H+wc;
Q1 = C*L*H**(1.5); #neglecting approach velocity and end contractions
va = Q1/(h*L);
ha = va**2/(2*g);
Ha = ha+H;
Q = C*L*Ha**1.5;
Q = round(Q*10)/10;
# Results
print "discharge over oggy weir = %.2f cumecs."%(Q);
import math
#capacity of siphon
#head required in oggy spillway
#length of oggy weir required
#Given
t = 6; #tail water elevation
h = 1; #heigth of siphon spillway
w = 4; #width of siphon spillway
hw = 1.5; #head water elevation
C = 0.6; #coefficient of discharge
Co = 2.25; #coefficient of discharge of oggy spillway
lo = 4; #length of oggy spillway
hc = 1.5; #head on weir crest
g = 9.81; #acceleration due to gravity
# Calculations and Results
#part (a)
Q = C*h*w*(2*g*(t+hw))**0.5;
Q = round(Q*10)/10;
print "capacity of siphon = %.2f cumecs."%(Q);
#part (b)
h1 = (Q/(Co*lo))**(2./3);
h1 = round(h1*100)/100;
print "head required in oggy spillway = %.2f m"%(h1);
#part (c)
L = Q/(Co*(hc)**1.5);
L = round(L*100)/100;
print "length of oggy weir required = %.2f m."%(L);
import math
#Given
rl = 435; #full reservior level
cl = 429.6; #level of centre of siphon
hfl = 435.85; #high flood level
hfd = 600; #high flood discharge
w = 4; #width of throat
h = 2; #heigth of throat
C = 0.65; #coefficient of discharge
g = 9.81; #acceleration due to gravity
# Calculations
H = hfl-cl;
Q = C*w*h*(2*g*H)**0.5;
n = hfd/Q;
n = round(n*100)/100;
# Results
print " number of siphons units required = %.2f.hence provide 11 siphons units."%(n);
import math
from numpy import arange,zeros
#design oggy spillway for concrete gravity dam
#Given
rbl = 250; #avarage river bed level
rlc = 350; #R.L of spillway crest
s = 0.75; #slope on downstream side
Q = 6500; #discharge
L = 5*9; #length of spillway
Cd = 2.2; #coefficient of discharge
t = 2; #thickness of each pier
#step 1. computation of design head
H = (Q/(Cd*L))**(2./3);
P = rlc-rbl;
#P/H = 6.15,which is<1.33;it is a high overflow spillway
#H+P/H = 7.15>1.7; hence discharge coefficient is not affected by downstream apron interface
Kp = 0.01;
Ka = 0.1;
N = 4;
He = 17.5; #assumed
Le = L-2*(N*Kp+Ka)*He;
He1 = (Q/(Cd*Le))**(2./3);
He1 = round(He1*100)/100;
#He1 is almost equal to He
print "crest profile will be designed for Hd = %.2f m."%(He1);
#step 2. determination of d/s profile
#equating the slope of d/s side and derivative of profile equation suggested by WES
x = 27.03;
y = 0.04372*x**1.85;
print "downstream profile:";
x = arange(1,27)
y = zeros(26)
for i in range(26):
y[i] = 0.04372*x[i]**1.85;
y[i] = round(y[i]*1000)/1000;
print "x y";
for i in range(26):
print "%i %.2f"%(x[i],y[i]);
print "27.03 19.48";
#step 3. determination of u/s profile
# math.cosidering equation for vertical u/s face and Hd = 17.58
print "upstream profile:";
x = [-0.5, -0.1, -1.5, -2.0, -3.0, -4.0, -4.75];
y = zeros(7)
for i in range(7):
if i==6:
y[i] = 0.0633*(x[i]+4.75)**1.85+2.2151-1.2643*(x[i]+4.75)**0.625;
y[i] = round(y[i]*1000)/1000;
continue
y[i] = 0.0633*(x[i]+4.7466)**1.85+2.2151-1.2643*(x[i]+4.7466)**0.625;
y[i] = round(y[i]*1000)/1000;
print "x y";
for i in range(7):
print "%.2f %.2f"%(x[i],y[i]);
#step 4.design of d/s bucket
R = P/4;
print "radius of bucket = %i m."%(R);
print "bucket will subtend angle of 60 degree at the centre.";
import math
#design length and depth of stilling bamath.sin
#Given
q = 1; #discharge of spillway
Cd = 0.7; #coefficient of discharge
h1 = 10; #heigth of crest above downstream silting bamath.sin
g = 9.81; #acceleration due to gravity
Cv = 0.9; #coefficient of velocity
# Calculations
h = (3*q/(2*Cd*(2*g)**0.5))**(2./3);
H = h1+h/2;
vt = (2*g*H)**0.5;
v1 = Cv*vt;
y1 = q/v1;
F1 = v1/(g*y1)**0.5;
#F>1, flow is super-critical
y2 = 1;
v2 = q/y2;
F2 = v2/(g*y2)**0.5; #<1
y2 = (y1/2)*((1+8*F1**2)**0.5-1);
de = y2-1;
le = 5*(y2-y1);
de = round(de*1000)/1000;
le = round(le*10)/10;
# Results
print "stilling bamath.sin should be depressed by %.2f m."%(de);
print "length of stilling bamath.sin = %.2f m."%(le);
import math
#Given
q = 7.83; #discharge through spillway
w = 12.5; #width of fall
d = 2.; #depth of water in downstream
g = 9.8;
y1 = 0.5;
v1 = q/y1;
F1 = v1/(g*y1)**0.5;
#F>1,flow is super-critical
# Calculations
v2 = q/d;
F2 = v2/(g*d)**0.5;
y2 = (y1/2)*((1+8*F1**2)**0.5-1);
de = y2-d;
le = 5*(y2-y1);
de = round(de*100)/100;
le = round(le*10)/10;
# Results
print "stilling bamath.sin should be depressed by %.2f m."%(de);
print "length of stilling bamath.sin = %.2f m."%(le);
import math
#Given
Ag = 5*2.5; #area of gate
miu = 0.25; #coefficient of friction
w = 0.5; #weigth of gate
h = 2; #head of water over crest
g = 9.81; #acceleration due to gravity
gamma_w = 1000; #unit weigth of water
# Calculations
m = w*g*1000;
F = gamma_w*Ag*h*h*g/10;
ff = miu*F;
tf = (m+ff)/1000;
# Results
print "force to be exerted to lift the gate = %.2f kN."%(tf);
import math
#Given
q = 19; #dischrge through spillway
E = 1; #energy loss
#from energy loss equation;E = (y2-y1)**3/4y2y1; and solving it we get
#x = 0.5*(-1+(1+294.39*(x-1)**9/64*x**3))
#by trial and error method x = 2.806
x = 2.806;
y1 = 4*x/(x-1)**3;
y2 = x*y1;
y1 = round(y1*1000)/1000;
y2 = round(y2*1000)/1000;
print "depth of flow at both end of jumps = %.2f m and %.2f m. respectively."%(y1,y2);