Source:
Michael R. Lindberg, PE
Civil Engineering Reference Manual for the PE Exam 11th Edition Professional Publications Inc., Belmont, CA 2008 ISBN-13: 978-1-59126-129-2
The program OPENFLOW calculates the following:
Area
Wetted Perimeter
Hydraulic Radius
Hydraulic Depth
Uniform Section Factor
of conductors of four shapes: rectangle, trapezoid, triangle, and circle.
PROGRAM OPENFLOW
781 bytes, 1/25/2019
Code:
10 DESTROY K,D,B,P,R,T,H,W
20 DEGREES
30 DISP "1. RECTANGLE" @ WAIT 1
40 DISP "2. TRAPEZOID" @ WAIT 1
50 DISP "3. TRIANGLE" @ WAIT 1
60 DISP "4. CIRCLE" @ WAIT 1
70 DISP "ELSE. REPEAT" @ WAIT .5
80 INPUT "CHOICE (1-4,E):"; K
90 IF K=1 THEN 1010
100 IF K=2 THEN 2010
110 IF K=3 THEN 3010
120 IF K=4 THEN 4010
130 GOTO 30
1010 INPUT "WIDTH,DEPTH:";W,D
1020 A=D*W @ P=2*D+W @ R=A/P
1030 H=A/W @ S=A*R^(2/3)
1040 GOTO 5010
2010 INPUT "DEPTH:";D
2012 INPUT "WIDTH-LONG:";W
2014 INPUT "WIDTH-SHORT:";B
2016 INPUT "ANGLE:";T
2020 A=D*(B+D/TAN(T)) @ P=B+2*(D/SIN(T)) @ R=A/P
2030 H=A/W @ S=A*R^(2/3)
2040 GOTO 5010
3010 INPUT "WIDTH:";W
3012 INPUT "DEPTH:";D
3014 INPUT "ANGLE:";T
3020 A=D^2/TAN(T) @ P=2*D/SIN(T) @ R=A/P
3030 H=A/W @ S=A*R^(2/3)
3040 GOTO 5010
4010 INPUT "RADIUS:";R
4012 INPUT "ANGLE:";T @ T=PI*T/180
4014 RADIANS
4020 A=1/8*(T-SIN(T))*D^2 @ P=T*D/2 @ R=A/P
4030 H=A/D @ S=A*SQR(D)
4040 GOTO 5010
5010 PRINT "AREA=";A @ PAUSE
5020 PRINT "WET PERIM.=";P @ PAUSE
5030 PRINT "HYD. RADIUS=";R @ PAUSE
5040 PRINT "HYD. DEPTH=";H @ PAUSE
5050 PRINT "SECTION FACTOR=";S
5060 END