Source file: critical_flow.html
Determines the critical flow depth for a trapezoidal channel carrying a given discharge, then compares it against an actual (observed/design) flow depth to classify the flow regime (subcritical, critical, or supercritical) using the Froude number.
Critical flow condition (minimum specific energy for a given discharge):
Q² / g = A_c³ / T_c
Where at critical depth y_c:
- A_c — cross-sectional area at critical depth
- T_c — top width at critical depth
- g — gravitational acceleration (9.81 m/s²)
Froude Number (flow regime indicator):
Fr = V / √(g × D_h)
Where:
- V — actual mean velocity = Q / A
- D_h — hydraulic depth = A / T (area / top width)
For bed width b, side slope z, depth y:
- Area: A = (b + z·y) × y
- Top width: T = b + 2z·y
| Input | Symbol |
|---|---|
| Discharge | Q (m³/s) |
| Bed width | b (m) |
| Side slope | z (horizontal per 1 vertical) |
| Actual water depth | y (m) — the depth being evaluated against critical conditions |
y_c)Since the critical-depth equation cannot be solved algebraically in closed form for a trapezoidal section, it is solved numerically by a coarse iterative search:
Start yc = 0.1, step = 1.0
Repeat 100 times:
Compute Ac, Tc at current yc
target = Ac³ / Tc
lhs = Q² / g
If target < lhs: yc += step (increase depth)
Else: yc -= step; step /= 10 (overshoot → back off and refine)
This is a simple "hunt and refine" search (similar in spirit to bisection, but not true bisection) that converges y_c to the point where Ac³/Tc = Q²/g.
Vc = Q / Ac (using Ac evaluated at the converged yc)
Using the user-supplied actual depth y:
A_act = (b + z·y) × y
T_act = b + 2z·y
V_act = Q / A_act
Dh = A_act / T_act
Fr = V_act / √(g × Dh)
| Froude Number | Regime |
|---|---|
Fr < 0.99 |
Subcritical (tranquil / safe) |
0.99 ≤ Fr ≤ 1.01 |
Critical flow state |
Fr > 1.01 |
Supercritical (rapid / turbulent) |
(A small tolerance band around Fr = 1.0 is used to flag "critical" rather than requiring an exact match, since floating-point convergence rarely lands exactly on 1.0.)
y_cV_cVFry_c uses a fixed number of iterations (100) with a fixed initial step; for very large or very small discharges/geometries it may not fully converge to high precision, though the step-refinement (÷10 per overshoot) generally keeps error small after 100 iterations.