#variable initialisation
B=2.5 #width in m
y=1.2 #depth in m
s_o=0.0036 #Bed slope
ga=998
g=9.81 #gravity
#solution
A=B*y #area
P=B+2*y #Wetted Perimeter
R=A/P #Hydraulic radius
tou=ga*g*R*s_o #average shear stress
print "tou=",round(tou,2),"Pa"
from __future__ import division
import math
#variable initialization
w=10 #width in m
h=1.5 # horizantal slope
v=1 #vertical slope
d=3 #depth in m
n=0.015 #mannings n
Q=100
#solution
A=(w+(h*d))*d #Area
P=round((w+(2*d)*math.sqrt((h**2)+v)),3) #wetted perimeter
R=A/P #hydraulic radius
#By mannings formula
So=((Q*n)/(A*(math.pow(R,2/3))))**2
print "So=",'%0.3E' % So
import math
#variable initialisation
w=5 #width in m
d=2.3 #depthin m
f=0.02 #friction factor
g=9.81 #gravity
#solution
A=w*d #area
P=w+(2*d) #Wetted perimeter
R=round(A/P ,3) #Hydraulic radius
C=round(math.sqrt((8*g)/f),1) #value of chezy's C
print "C=",C
n=(math.pow(R,1/6))
print "n=",round(n/C,4)
import math
#variable iniatialization
B=3 #width in m
h=1 #horizantal slope
m=1 #vertical slope
So=0.0036 #bottom slope of channel
y=1.25 #depth in m
Q=15 #discharge in m^3/s
#solution
A=(B+(h*y))*y #area
V=round(Q/A,3) #velocity
P=round(B+(2*y*(math.sqrt((m**2)+1))),4) #wetted perimeter
R=round(A/P,4)
C=V/(math.sqrt(R*So)) #By chezy formula
print "C=",round(C,1)
import math
#variable initialization
Q=1.10 #Discharge in m^3/s
n=0.018 #Manning's n
S0=0.0004 #slope
#Calculation
#A=math.pi/8*(D**2)
#Perimeter=D*math.pi/2
#By Manning's formula,discharge
#Q=(1/n)*AR(2/3)S(1/2)
D=(Q*n*8*(4**(2/3)))/(math.pi*(S0**(1/2)))
print "D=",round(D**(3/8),3),"m"
import math
#variable initialization
m=1.0 #side slopes
Q=50 #discharge
V=2.0 #Velocity in m/s
n=0.02 #Manning's n
#Calculation
A=Q/V#Area
y=(A/9)**(1/2)
print "y=",round(y,3),"m"
B=8*y
print "B=",round(B,2),"m"
P=B+(2*y*math.sqrt(m**2+1)) #Wetted Perimeter
R=A/P
S0=V*n/((R**(2/3))) #By Manning's formula,
print "S0=",round(S0**2,6),
#variable initialization
m=2.0 #side slopes
Q=15.0 #discharge
n=0.014 #Manning's n
S0=1/5000
#Calculation
#R=ye/2
#Dicarge by Manning's formula,
#Q=(1/n)*AR(2/3)S(1/2)
Be=0.4721
A=Be+m
ye=(Q/((1/n)*(A)*(0.5**(2/3))*(S0**(0.5))))**(3/8)
print "Ye=",round(ye,3),"m"
Be=ye*Be #Bottom width
print "Be=",round(Be,3),"m"
import math
#variable initialization
Q=10 #Discharge ihn m^3/s
V=1.25 #Velocity in m/s
m=1.0 #Manning's n
#Calculation
A=Q/V #Calculating area
#(a)For the most efficient rectangular channel,
Yem=(A/2)**(1/2)
print "(a)Yem=",round(Yem,2),"m"
Bem=A/Yem #Bottom width
print "Bem=",round(Bem,2),"m"
Pem=Bem+(2*Yem)#Perimeter
print "Pem=",round(Pem,1),"m"
#(b)For the most efficient triangular section,
Yem=math.sqrt(A)
print "(b)Yem=",round(Yem,3),"m"
Pem=2*math.sqrt(2)*Yem #Perimeter
print "Pem=",round(Pem,1),"m"
#(c)For the most efficient trpezoidal section,
Yem=(A/math.sqrt(3))**(1/2)
print "(c)Yem=",round(Yem,3),"m"
Bem=2/math.sqrt(3)*Yem #Bottom width
print "Bem=",round(Bem,3),"m"
Pem=2*math.sqrt(3)*Yem #Perimeter
print "Pem=",round(Pem,3),"m"
#(d)The most efficient circular section is a semicircle.
Yem=(A/(math.pi/2))**(1/2)
print "(d)Yem=",round(Yem,3),"m"
Pem=math.pi*Yem #Perimeter
print "Pem=",round(Pem,4),"m"
print "The most efficient circular section has the least perimeter and maximum perimeter is 8.00m"
import math
#variable initialization
B=2 #width in m
Q=6 #Discharge in m
g=9.81 #gravity
#Calculation
#At critical depth,Q**2/g=A**3/Tc
q=Q/B #Discharge intensity
yc=(q**2/g)**(1/3)
print "Yc=",round(yc,3),"m"
Vc=Q/(B*yc)
Ec=yc+((Vc**2)/(2*g)) #Specific energy at critical depth
print "Ec=",round(Ec,3),"m"
#variable initialization
B=3 #width in m
Q=6 #Discharge in m
g=9.81 #gravity
m=1.5 #side slop in m
#Calculation
#(a)Rectangular channel
q=Q/B #Discharge intensity
yc1=(q**2/g)**(1/3)
print "Yc=",round(yc1,3),"m"
#(b)In a triangular channel of side slope m horizpntal:1 vertical
Yc=((2*Q**2)/(g*m**2))**(1/5)
print "Yc=",round(Yc,3),"m"
#(c)Trapezoidal channel of side slope m horizontal:1 vertical
yc=((q**2)/(g))*2
#By trial and error method,
a=0.237
print "By trial and error method,Yc=",round(Yc+a,3),"m"
#variable initialization
g=9.81 #gravity
Yc=1.2 #critical depth
B=3 #Width in m
m=2 #side slop in m
#Calculation
#(a)Rectangular channel
q=(g*Yc**3)**(1/2)
Q=B*q
print "Q=",round(Q,3),"m^3/s"
#(B)Triangular channel
Q=((g*(m**2)*Yc**5)/2)**(1/2)
print "Q=",round(Q,3),"m^3/s"
#(c)Trapezoidal section
m=1.5
B=2.5 #Bottom width
Q=(((B+(m*Yc))**3)*(Yc**3))/(B+(2*m*Yc))
Q=Q*g
print "Q=",round(Q**(1/2),3),"m^3/s"
#variable initialization
Yc=0.90 #Critical depth
m=2 #side slope in m
B=3.5 #Bottom width in m
#Calculation
#At Critical depth,Q**2/g=A**3/Tc
Ec=Yc+((B+m*Yc)*Yc)/(2*(B+2*m*Yc)) #Minimum speific energy
print "Ec=",round(Ec,3),"m"
#variable initialization
n=0.014 #Manning's n
w=Tc=3 #Width in m
Yc=1.2 #Critical depth
g=9.81 #Gravity constant
#Calculation
Ac=w*Yc #Area
Q=(g*(Ac**3/Tc))**(1/2) #Discharge
#If this discharge is to flow at a normal depth of 1.2m,By Manning's formula
P=w+2*Yc #Perimeter
R=Ac/P
S0=((Q*n)/(Ac*R**(2/3)))**2
print "S0="'%4.2E' % S0
import math
#variable initialization
W=3.5 #Width in m
d=2 #depth in m
S0=0.0036 #slope
g=9.81 #gravity constant
n=0.015 #Manning's n
#Calculation
A1=W*d #Area
P1=2*d+W #Perimeter
R1=A1/P1
Q=(1/n)*A1*R1**(2/3)*S0**(1/2) #Discharge
V1=Q/A1
F1=V1/(math.sqrt(2*g)) #Hence flow is subcritical.
#Case 1:LAt the maximum height of the hump del_Zm
q=Q/W
Yc=(q**2/g)**(1/3)
#By the energy equation,assuming ni loss between sections 1 and 2,
E1=d+((V1**2)/(2*g))
del_Zm=E1-Yc-(Yc/2)
print "del_Zm=",round(del_Zm,3),"m"
#Case 2:The discharge remains at 26.74.
d=2.4
V2=Q/(W*d)
Vc=2.718
del_Zm=d+(V2**2/(2*g))-Vc
print "del_Zm=",round(del_Zm,3),"m"
import math
#variable initialization
Q=10.0 #Discharge in m^3/s
V1=1.25 #Velocity in m/s
w=5.2 #width in m
B2=3.0 #bed width in m
g=9.81 #Gravity constant
#Calculation
A1=Q/V1
Y1=A1/w
q1=Y1*V1
E1=Y1+(V1**2/(2*g)) #Specific energy
F1=V1/(math.sqrt(g*Y1)) #Froude number
q2=Q/B2 #Downstream section
Yc2=(q2**2/g)**(1/3)
del_Z=E1-(1.5*Yc2)
print "Required height of the hump is,del_Z=",round(del_Z,4),"m"
import math
#variable initialization
y1=0.20 #initial depth
y2=1.20 #sequent depth
g=9.81 #Gravity
#Calculation
#y2/y1=(1/2)(-1)+math.sqrt(1+8F1**2)
F1=(y2/y1)*(2)+1+8
F1=(F1)**(1/2)
V1=F1*math.sqrt(0.2*g)
q=V1*y1 #Discharge per unit width
print "q=",round(q,3),"m^3/s/m"
EL=((y2-y1)**3)/(4*y1*y2) #Energy loss
print "EL=",round(EL,3),"m"
import math
#variable initialization
F1=10.0 #Froude number before jump
EL=3.20 #energy loss
g=9.81 #Gravity
#Calculation
#Let's take Y2/Y1 as Y
Y=(1/2)*(-1+math.sqrt(1+8*F1**2))
#Sequent depth ratio
#EL/y1=(Y-1)**3/(4*Y)
y1=round(EL/((Y-1)**3/(4*Y)),4)
print "(i)Y1=",y1,"m"
y2=Y*y1 #Depthh after jump
print "Y2=",round(y2,3),"m"
V1=F1*(math.sqrt(g*y1))
q=V1*y1 #Discharge intensity
print "(ii)q=",round(q,4),"m^3/s/m"
F2=q/(y2*math.sqrt(g*y2)) #Froude number after the jump
print "(iii)F2=",round(F2,4)
import math
#variable initialization
V2=0.80 #Velocity
y2=1.75 #depth after jump
ga=9790 #density
g=9.81 #gravity
#Calculation
F2=V2/(math.sqrt(g*y2)) #Froude number after the jump
#Let's take Y2/Y1 as Y
Y=(1/2)*(-1+math.sqrt(1+8*F2**2))
y1=Y*y2
print "Y1=",round(y1,3),"m"
#Sequent depth ratio
EL=((y2-y1)**3)/(4*y1*y2) #Energy loss
print "EL=",round(EL,3),"m"
Q=V2*y2
P=ga*Q*EL #Power dissipated
print "P=",round(P/1000,2),"kW/metre width"
import math
#variable initialization
F2=0.12 #Froude number after the jump
EL=9.0 #Energy loss
g=9.81 #Gravity
#Calculation
#Let's take Y2/Y1 as Y
Y=round((1/2)*(-1+math.sqrt(1+8*F2**2)),4) #ratio of depth
y2=EL/(((1-Y)**3)/(4*Y))
V2=F2*(math.sqrt(g*y2))
q=V2*y2 #Discharge intensity
print "q=",round(q,4),"m^3/s/m"
import math
#variable initialization
F1=4.5 #By assumption of Froude number
g=9.81 #Gravity
q=2.0 #discharge per unit width
#Calculation
y1=(q**2/(g*F1**2))**(1/3)
Y=round((1/2)*(-1+math.sqrt(1+8*F1**2)),2) #ratio of depth
EL=round(y1*((Y-1)**3/(4*Y)),3)
print "EL=",EL,"m.But actual EL=1.75.Hence assumed F1 is not correct"
#F1 should be higher than 4.5
F1=5.10
y1=round((q**2/(g*F1**2))**(1/3),3)
Y=round((1/2)*(-1+math.sqrt(1+8*F1**2)),2) #ratio of depth
EL=round(y1*((Y-1)**3/(4*Y)),3)
print"Hence the assumption F1=5.10 is all right."
print "y1=",y1,"m"
y2=y1*Y
print "y2=",round(y2,3),"m"
import math
#variable initialization
y1=0.5 #depth of flow before jump
y2=3.0 #depth of flow after jump
g=9.81 #gravity in m/s^2
ga=9790 #specific weight
#solution
#sequent depths related to critical depth as,
yc=((y1)*(y2)*(y1+y2))/2 #Critical depth
print "(i)yc=",round(math.pow(yc,1/3),3),"m"
#(q**2)/g=yc**3
q=round(math.sqrt(yc*g),3)
E_L=round(((y2-y1)**3)/(4*y1*y2),3) #Head loss
P=ga*q*E_L #Power lost per metre width
print "(ii)P=",round(P/1000,1),"kW"
import math
#variable initialization
F1=10 #Froude number before jump
y1=0.4 #depth of flow in m
g=9.81 #gravity
#Calculation
y2=(1/2)*(-1+math.sqrt(1+8*F1**2))*y1
EL=(y2-y1)**3/(4*y1*y2) #Energy loss
E1=y1*(1+F1**2/2) #Initial specific energy
E2=E1-EL #Specific energy at the heel
print "E2=",round(E2,2),"m"