# Chapter 16: Non-Uniform Flow in Open Channels¶

## Example 16.2, Page 541¶

In [1]:
from __future__ import division
import math

#Initializing  the  variables
B  =  [1.4 ,0.9];
D  =  [0.6 ,0.32];
g  =  9.81;
h  =  0.03;
Z  =  0.25;

#Calculations
Q1  =  B[1]*D[1]*(2*g*h/(1-(B[1]*D[1]/B[0]*D[0])**2))**0.5
E  =  D[0]-Z;
Q2  =  1.705*B[1]*E**1.5;

print "Volume flow rate (m3/s) :",round(Q2,4)

Volume flow rate (m3/s) : 0.3177


## Example 16.3, Page 546¶

In [2]:
from __future__ import division
import math

#Initializing  the  variables
a  =0.5;
b  =  0.5;
Dn  =  1.2;
s  =  1/1000;
C  =  55;
g  =  9.81;

#Calculations
c = (1+a)/b;
QbyB = Dn*C*(Dn*s)**0.5;
q = QbyB;
Dc = (q**2/g)**(1/3);

header  =  "Mean Depth(Dm)    Numenator    Denominator\t L"
unit  =    "   (m) \t  \t \t  \t(m)"

m=[]
Dm=[]
N=[]
D=[]
Lm=[]
total=0
for c in range(7):
m.append(2.4-0.15*c);
Dm.append((m[c]+m[c]-0.15)/2);
N.append(1 - (Dc/Dm[c])**3) ;    # Numerator
D.append(1 - (Dn/Dm[c])**3);     # Denominator
Lm.append(150*(N[c]/D[c]));
total = total +Lm[c];

print unit
for c in range(7):
mm=str(Dm[c])+'\t       '+str(round(N[c],4))+'        '+str(round(D[c],4))+' \t'+str(round(Lm[c],2))
print mm

print "\ndistance upstream covered (approx in m):",round(total)

Mean Depth(Dm)    Numenator    Denominator	 L
(m) 	  	 	  	(m)
2.325	       0.9576        0.8625 	166.54
2.175	       0.9482        0.8321 	170.94
2.025	       0.9358        0.7919 	177.26
1.875	       0.9192        0.7379 	186.86
1.725	       0.8962        0.6634 	202.65
1.575	       0.8636        0.5577 	232.27
1.425	       0.8159        0.4028 	303.8

distance upstream covered (approx in m): 1440.0