Analysis of gradually varied open channel flow
This program is designed to be used in a part of the analysis of flow in either a rectangular or trapezoidal open channel.
- arguments passed into the program must be in imperial units
- the program outputs answers in imperial units
- distances are given and provided in units of feet
- flow rate must be given in units of cubic feet per second
- the acceleration of gravity is approximated to 32.17404855643044 feet per second squared
- trapezoidal channels must be symmetrical
- channel must slope downward
- channel: str type; describes the type of channel and may be either 'rectangular' or 'trapezoidal'
- Q: numeric type; flow rate given in units of cubic feet per second
- b: numeric type; length of the bottom width of the channel
- S0: numeric type; slope of the channel bottom given as a positive value
- z: numeric type; sideslope of trapezoidal channels
- n: numeric type; Manning's friction factor of the channel
- alpha: numeric type; a velocity correction factor
- steps: numeric type; the number of steps desired to determine the distance between two points along the channel
- Normal depth
- Critical depth
- Immediate distance between two points along the channel
- Step table: uses the step method to determine the distance between two points along the channel. The more steps that are provided, the greater the accuracy of the distance between the points.
- Water surface profile: a graphical display of the water surface profile, channel bottom, normal depth line, and critical depth line. The category of slope is provided (mild or steep), along with the type of profile (M1, M2, M3, S1, S2, or S3).
- Upstream point: the upstream point between two points along the channel is stated.
To use the program, clone/download this repository, navigate to the local directory, and create a virtual environment:
$ python3 -m venv venv
Activate the virtual environment:
For Linux/Mac OS:
$ source venv/bin/activate
For Windows:
> venv\Scripts\activate
Install the required libraries for this program:
$ pip install -r requirements.txt
Example problem
Many segments of the Los Angeles River were "hardened" in past years by covering the riverbed in concrete. Along one segment of the river, it is now a concrete trapezoidal channel with a bottom width of 160 ft, a longitudinal slope of 0.0034, and 2H:1V sideslopes (z = 2). Assume n = 0.014 and alpha = 1.05.
- The design discharge for this stretch of the channel is 83,700 cfs.
- The depth of water is 15 ft at Point A.
- The depth of water is 17 ft at Point B.
- Determine the normal depth.
- Determine the critical depth.
- Use the direct step method with a single step (delta y = 2 ft) to determine the distance from Point A to Point B.
- Use the direct step method with two steps (two steps of delta y = 1 ft) to determine the distance from Point A to Point B.
- What type of profile exists in the vicinity of Point A? Make a sketch fo the general shape of the water surface.
- Which point is upstream, A or B?
1. Instantiate a new object of 'OpenChannel'
>>> channel1 = OpenChannel('trapezoidal', 83700, 160, 0.0034, 2, 0.014, 1.05, 2)
2. Specify two depths along the channel
>>> yA = 15
>>> yB = 17
3. Call the function normal depth to determine the normal depth of the channel
>>> channel1.normal_depth()
4. Call the function critical depth to determine the critical depth of the channel
>>> channel1.critical_depth()
5. Call the function distance to determine the immediate distance between the two specified points
>>> channel1.distance(yA, yB)
6. Call the function step_table to view the use of the direct step method in determining the distance between the two specified points
>>> channel1.step_table(yA, yB)
7. Call the function profile to view the water surface profile and determine the slope category and type of profile of the flow
>>> channel1.profile()
8. Call the function upstream_point to determine which of the two specified points is upstream according to the profile
>>> channel1.upstream_point(yA, yB)