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)

🔗参阅:亚图跨际

相关推荐
兵慌码乱6 小时前
面向桌面端的资产管理系统分层架构设计与核心模块实现
python·系统架构·sqlite·pyqt5·数据库设计·桌面应用开发·mvc架构
hboot7 小时前
AI工程师第三课 - 机器学习基础
python·scikit-learn·kaggle
顾林海12 小时前
Agent入门阶段-编程基础-Python:流程控制
python·agent·ai编程
呱呱复呱呱14 小时前
Django CBV 源码解读:一个请求是怎么找到你的 get() 方法的
python·django
曲幽19 小时前
刚部署的 LibreTranslate 频频翻车?我掏出了 20 年前的 StarDict 词典,用 FastAPI 搭了个本地词典翻译 API
python·fastapi·web·translate·goldendict·libretranslate·stardict·pystardict
荣码19 小时前
用Streamlit给AI应用套个界面,10行代码出Web页面
java·python
兵慌码乱1 天前
基于Python+PyQt5+SQLite的药房管理系统实现:事务一致性与界面解耦全流程解析
python·sqlite·信号与槽·pyqt5·数据库设计·桌面应用开发·事务处理
金銀銅鐵1 天前
[Python] 体验用欧几里得算法计算最大公约数的过程
python·数学
FreakStudio1 天前
W55MH32L-EVB 上手测评:硬件 TCP/IP 加持的以太网单片机,MicroPython 零门槛开发
python·单片机·嵌入式·大学生·面向对象·并行计算·电子diy·电子计算机
用户0332126663671 天前
使用 Python 从零创建 Word 文档
python