Python : Calculation of normal depth of open channel with rectangular cross section by 'scipy.optimize.brentq'
Calculation program of normal depth of open channel with rectangular cross sectionby Brent's method is introduced in this post. Basic equations for normal depth calculation of open channel with rectangular cross section are shown below.
(known) discharge | |
(known) width of rectangular open channe | |
(known) Manning's roughness coefficient | |
(known) gradient of channel invert | |
(unknown) normal depth |
Following equation is solved for .
The critical depth calculation of is extra.
# normal depth and critical depth of rectangular cross section import numpy as np from scipy import optimize def cal_hc(q,b): # critical depth g=9.8 hc=(q**2/g/b**2)**(1/3) return hc def func(h,q,b,n,i): f=q-b*h/n*(b*h/(b+2*h))**(2/3)*i**(1/2) return f def main(): q=42.0 # discharge b=4.0 # channel width n=0.014 # Manning's roughness coefficient i=0.001 # invert gradient h1=0.0 h2=10.0 hh=optimize.brentq(func,h1,h2,args=(q,b,n,i)) print('hn=',hh) # normal depth hc=cal_hc(q,b) print('hc=',hc) # critical depth #============== # Execution #============== if __name__ == '__main__': main()
Calculation results are shown below.
hn= 3.866645305835682 hc= 2.2407023732785825
That's all. Thank you.