📜曼寧公式-用例
📜Python流體數據統計模型和淺水滲流平流模型模擬 | 📜Python蒸發散物理問題(微積分-線性代數-拉普拉斯和傅立葉變換)
??Python計算一維流量
高克勒-曼寧-斯特里克勒公式公式基于一維(橫截面平均)流動特性的假設,將明渠水流的水深和流速聯系起來。斯特里克勒公式是對納維-斯托克斯方程和連續性方程進行大幅簡化的結果。 盡管一維方法在很大程度上已被至少二維數值模型所取代,但一維斯特里克勒公式公式仍經常用作邊界條件的第一近似值。
斯特里克勒公式的基本形式為:
u = k s t ? S 1 / 2 ? R h 2 / 3 u=k_{s t} \cdot S^{1 / 2} \cdot R_h^{2 / 3} u=kst??S1/2?Rh2/3?
其中,
- u u u 是 ( m / s m / s m/s ) 中的橫截面平均流速
- k s t k_{s t} kst? 是斯特里克勒系數 ( m 1 / 3 / s m ^{1 / 3} / s m1/3/s ),對應于曼寧 n m n_m nm?? 的倒數。
- k s t ≈ 20 ( n m ≈ 0.05 ) k_{s t} \approx 20\left(n_m \approx 0.05\right) kst?≈20(nm?≈0.05) 對于粗糙、復雜和接近自然的河流
- k s t ≈ 90 ( n m ≈ 0.011 ) k_{s t} \approx 90\left(n_m \approx 0.011\right) kst?≈90(nm?≈0.011) 用于光滑、混凝土內襯的渠道
- k s t ≈ 26 / D 90 1 / 6 k_{s t} \approx 26 / D_{90}^{1 / 6} kst?≈26/D901/6? (基于顆粒尺寸 D 90 D_{90} D90? 進行近似,其中 90 % 90 \% 90% 的表面沉積物顆粒較小)
- S S S 是假設的能量斜率 ( m / m ) ( m / m ) (m/m)?,可以假設其對應于穩定、均勻流動條件下的河道斜率。
- R h R_h Rh? 是水力半徑(米)
水力半徑 R h R_h Rh?是潤濕面積 A A A與潤濕周長 P P P的比率。 A A A 和 P P P 都可以作為水深 h h h 和河道底部寬度 b b b 的函數進行計算。許多河道橫截面可以近似為梯形,其中水面寬度 B = b + 2 ? h ? m B=b+2 \cdot h \cdot m B=b+2?h?m(其中 m m m是下圖所示的岸坡)。
因此, A A A 和 P P P 由以下公式得出:
A = h ? 0.5 ? ( b + B ) = h ? ( b + h ? m ) P = b + 2 h ? ( m 2 + 1 ) 1 / 2 \begin{gathered} A=h \cdot 0.5 \cdot(b+B)=h \cdot(b+h \cdot m) \\ P=b+2 h \cdot\left(m^2+1\right)^{1 / 2} \end{gathered} A=h?0.5?(b+B)=h?(b+h?m)P=b+2h?(m2+1)1/2?
最后,排水 Q ( m 3 / s ) Q\left( m ^3 / s \right) Q(m3/s)?可計算為:
Q = u ? A = k s t ? S 1 / 2 ? R h 2 / 3 ? A Q=u \cdot A=k_{s t} \cdot S^{1 / 2} \cdot R_h^{2 / 3} \cdot A Q=u?A=kst??S1/2?Rh2/3??A
編寫一個腳本,將流量打印為河道底寬 b b b、岸坡 m m m、水深 h h h、坡度 S S S 和斯特里克勒系數 k s t k_{s t} kst? 的函數。
def reversed_mannings_fun(tar, args):Q, b, m_l, m_r, n_m, S_0 = argsarea = ((((tar * m_l) + (tar * m_r) + b) + b) / 2) * tarperimeter = b + (tar * (m_l * m_l + 1) ** 0.5) + (tar * (m_r * m_r + 1) ** 0.5)ratio = area / perimeterreturn (Q * n_m / S_0 ** 0.5) - (area * ratio ** (2.0 / 3.0))def solve(fun, x0, precision, args):last_x = x0next_x = last_x + 10 * precision while abs(last_x - next_x) > precision:next_y = fun(next_x, args)last_x = next_xnext_x = last_x - next_y / derivative(fun, last_x, precision, args) # update estimate using N-Rreturn next_xdef derivative(fun, x, delta_x, args):return (fun(x + delta_x, args) - fun(x - delta_x, args)) / (2.0 * delta_x)if __name__ == '__main__':Q = 15.5 b = 5.1 m_left = 2.5 m_right = 2.5 n_m = 1/20 S_0 = 0.005 init_value = .01 args0 = [Q, b, m_left, m_right, n_m, S_0]x_found = solve(reversed_mannings_fun, init_value, init_value / 10.0, args0)print("Iterated water depth = %.3f" % x_found)