Chapter 10 : Liquid Flow in Open Channels

Example 10.1 Pageno : 353

In [6]:
from sympy import *

# variables
yo = Symbol("yo")
A = 20*yo
P = 20 + 2*yo
Rh= 20*yo/(20+2*yo)
n = 0.017        # ft

# calculations
ans = solve((1.49/n)*A*Rh**(2./3)*(0.0001)**(1./2) - 400) #*yo*Rh**(2./3)

# result
print "Yo = %.2f ft"%ans[0]
Yo = 8.32 ft

Example 10.2 pageno : 356

In [8]:
# calculations
Rh = 20*8.34/(20+2*8.34)

# result
print "Rh = %.2f ft"%Rh
Rh = 4.55 ft

Example 10.3 pageno : 362

In [17]:
from sympy import *

# variables
yo = Symbol("yo")
n = 0.017      #ft 1/6
A = 2*yo**2
Rh = yo/2

# Calculations
ans = solve((1.49/n)*A*Rh**(2./3) * (0.0001)**(1./2) - 400,yo)
Yo = ans[0]
B = 2*Yo

#result
print "Yo**(8/3) = %.f "%(Yo**(8./3))
print "Yo  = %.2f ft "%(Yo)
print "B = %.2f ft "%(B)

# note : answer are slightly differenet because of solve method of sympy
Yo**(8/3) = 362 
Yo  = 9.11 ft 
B = 18.22 ft 

Example 10.4 Page no : 367

In [2]:
import math
from sympy import Symbol, solve

# variables
q = 500./40        # cfs/ft
ye = ((12.5)**2 / 32.2)**(1./3)
n = 0.017
So = Symbol("So")

# calculations
Sc = 32.2 * n**2 / (2.2 * ye**(1./3))
ans = solve((1.49/n)*160*(3.33)**(2./3)*So**(1./2) - 500)
So = ans[0]

# result
print "Sc = %.4f"%Sc
print "So = %f"%So
print "So is a mild slope since it is less than Se"
Sc = 0.0035
So = 0.000256
So is a mild slope since it is less than Se

Example 10.5 page no : 369

In [4]:
from sympy import solve,Symbol
import math

# variables
y = Symbol("y")
A = 10*y + 2*y**2
n = 0.017
b = 10 + 4*y
P = 10 + 2*math.sqrt(5)*y

# calculations
ans = solve(A**3/b *32.2/1000**2 - 1)
yo = ans[1]
Ae = 97.3         # sqft
be = 29.65        # ft
Rhe = Ae/32       # ft
Sc = 32.2*n**2/2.2 * (Ae/(be*Rhe**(4./3)))

# result
print "Yo = %.2f ft"%yo
print "Sc = %.5f"%Sc
Yo = 4.91 ft
Sc = 0.00315

Example 10.6 page no : 373

In [37]:
from sympy import Symbol,solve

# variables
Q = round((1.49/0.015)*50*(50./20)**(2./3)*(0.001)**(1./2))        # cfs
E = 5.52           # ft

# calculations and results
Ye = ((Q/10)**2/32.2)**(1./3)
Emin = 3 * Ye/2

print "Ye = %.2f ft"%Ye
print "Minimum height of hump : Emin = %.2f ft"%Emin

Ye = 2 * 5.52/3
b = Symbol("b")
ans = solve( ( (289/b)**2 / 32.2  )**(1./3) - Ye)
b = ans[1]

print "Ye = %.2f ft"%Ye
print "Maximum width of contraction : b = %.1f ft"%b
Ye = 2.96 ft
Minimum height of hump : Emin = 4.44 ft
Ye = 3.68 ft
Maximum width of contraction : b = 7.2 ft