Python高克勒-曼宁-斯特里克勒公式计算一维流量

📜曼宁公式-用例

📜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 的函数。

Python 复制代码
def reversed_mannings_fun(tar, args):
   
    Q, b, m_l, m_r, n_m, S_0 = args
    area = ((((tar * m_l) + (tar * m_r) + b) + b) / 2) * tar
    perimeter = b + (tar * (m_l * m_l + 1) ** 0.5) + (tar * (m_r * m_r + 1) ** 0.5)
    ratio = area / perimeter
    return (Q * n_m / S_0 ** 0.5) - (area * ratio ** (2.0 / 3.0))


def solve(fun, x0, precision, args):
  
    last_x = x0
    next_x = last_x + 10 * precision  

    while abs(last_x - next_x) > precision:

        next_y = fun(next_x, args)
        last_x = next_x
        next_x = last_x - next_y / derivative(fun, last_x, precision, args)  # update estimate using N-R
    return next_x

def 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)

🔗参阅:亚图跨际

相关推荐
一眼万里*e几秒前
fish-speech语音大模型本地部署
python·flask·大模型
结衣结衣.22 分钟前
python中的函数介绍
java·c语言·开发语言·前端·笔记·python·学习
茫茫人海一粒沙25 分钟前
Python 代码编写规范
开发语言·python
林浩23326 分钟前
Python——异常处理机制
python
belldeep28 分钟前
普林斯顿微积分读本(修订版) 中文版目录
微积分·数学分析
数据分析螺丝钉1 小时前
力扣第240题“搜索二维矩阵 II”
经验分享·python·算法·leetcode·面试
海涛高软1 小时前
osg 矩阵相关
线性代数·矩阵
小蜗笔记2 小时前
在Python中实现多目标优化问题(7)模拟退火算法的调用
开发语言·python·模拟退火算法
TANGLONG2222 小时前
【C语言】数据在内存中的存储(万字解析)
java·c语言·c++·python·考研·面试·蓝桥杯
summ1ts2 小时前
组合数求法汇总
c++·数学·算法·离散数学·组合数学