Code Monkey home page Code Monkey logo

muskingum-cunge's Introduction

Muskingum-Cunge Routing in Python

drawing

Overview

muskingumcunge is a Python implementation of the Musking-Cunge model, a channel routing method that allows for the estimation of a hydrograph's lag and attenuation as it propogates downstream through a river network. In this implementation, the Muskingum-Cunge method uses cross-sectional geometry and a Manning's flow assumption to derive parameters of the Muskingum method (K and X) at each timestep.

The example below shows how to use muskingumcunge to route a simple hydrograph through a trapezoidal channel.

import numpy as np
import matplotlib.pyplot as plt
from muskingumcunge.reach import TrapezoidalReach
from muskingumcunge.timeseriestools import parabolic_hydrograph_generator

# Generate hydrograph
start = 0  # hours
stop = 24  # hours
dt = 0.1  # hours
timestamps = np.arange(start, stop, dt)
peak = 1000
duration = 10
inflows = parabolic_hydrograph_generator(timestamps, peak, duration)

# Build reach
reach = TrapezoidalReach(100, 100, 0.1, 0.001, 2000)

# Route flows
outflows = reach.route_hydrograph(inflows, 0.1)

# Plot results
fig, ax = plt.subplots()
ax.plot(timestamps, inflows, label='inflow')
ax.plot(timestamps, outflows, label='outflow')
ax.set_xlabel('Time(hrs)')
ax.set_ylabel('Flowrate(cms)')
plt.legend()
plt.tight_layout()
plt.show()

Current functonality of this package includes

  • Calculation of channel geometry (top width, area, wetted perimeter, and hydraulic radius) as a function of stage
  • Derivation of stage-discharge rating curve and Muskingum Parameters
  • Simple synthetic unit hydrograph generation
  • Muskingum-Cunge routing
  • Basinwide Muskingum-Cunge routing

Hopefully more reatures to come!!

Citation

DOI

Scott Lawson - UVM. (2024). sclaw/muskingum-cunge: Alpha Release (alpha). Zenodo. https://doi.org/10.5281/zenodo.13128294

Installation

muskingumcunge can be installed using pip:

$ python3 -m pip install muskingumcunge

Issue tracker

Any bugs, suggestions, or questions may be logged using the issues tab

https://github.com/sclaw/muskingum-cunge/issues

muskingum-cunge's People

Contributors

sclaw avatar

Stargazers

jing xin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.