Code Monkey home page Code Monkey logo

chydraulics's Introduction

OPEN CHANNEL HYDRAULICS

Aim

This is a repository to solve multiple problems related to open channel hydraulics.

Uniform Flow

Assuming uniform flow in a circular, no circular (rectangular, triangular and trapezoidal) or irregular (e.g. river) channel, the Manning equation is used to calculate:

  1. Normal water depth

  2. Flow discharge

  3. Channel slope

  4. Manning roughness coefficient

Structure

chydraulics

This directory contains:

  • clib.py: This is a python library with functions to calculate multiple variables related to open channel flow.

  • ufclass.py: This is a python library with the UniformClass to solve problems related to uniform flow in regular (e.g. circular, trapezoidal, etc) channels. Here the class UniformFlow call functions from clib.py.

  • uficlass.py: This is a python library with the UniformClassI to solve problems related to uniform flow in irregular (e.g. rivers) channels. Here the class UniformFlowI call functions from clib.py.

test_uf y test_ufi

These directories contain the following:

  • main.py: This is the python script that call the class UniformFlow or UniformFlowI in /chydraulics/ufclass.py or /chydraulics/uficlass.py which solves the problem.

  • .json (regular channels): JSON is a friendly format to introduce information to scripts. Note that are multiple files with the extension .json, these files contain information for unform flow problems. All the .json contain the same structure and information, so that, the scripts are able to indentify which of the four problems need to be solve. The structure of .json files is:

    "ST": Section type. It can be egual to 1 (Circular cross section) or 2 (Non circular cross section). [mandatory]

    "US": Unit measure system. It can be egual to "IS" (International system) or "BG" (English system). [mandatory]

    "Q": Flow discharge. It is given in "IS" or "BG". It is not given for problem 2.

    "So": Channel slope. It is not given for problem 3.

    "n": Manning roughness coefficient. It is not given for problem 4.

    "b": Channel width. It is given in "IS" or "BG". It is "b":"" for circular channels.

    "theta1": Inclination angle of channel left side with respect to the horizontal. It is given in degrees. It is "theta1":"" for circular channels.

    "theta2": Inclination angle of channel right side with respect to the horizontal. It is given in degrees. It is "theta2":"" for circular channels.

    "y": Normal water depth. It is given in "IS" or "BG". It is not given for problem 1.

    "r": Radius of a circular channel. It is given in "IS" or "BG". It is "r":"" for non circular channels.

  • .json (iregular channels)

    "US": Unit measure system. It can be egual to "IS" (International system) or "BG" (English system). [mandatory]

    "Q": Flow discharge. It is given in "IS" or "BG". It is not given for problem 2.

    "So": Channel slope. It is not given for problem 3.

    "xs": List of x coordinates of the n points that shape the cross section.

    "ys": List of y coordinates of the n points that shape the cross section.

    "ns": List of Manning roughness coefficients for n-1 segments (between two point) in the cross section. It is not given for problem 4, empty list.

    "y": Normal water depth. It is given in "IS" or "BG". It is not given for problem 1.

How to execute it

  1. Clone the repo as

git clone [email protected]:lamhydro/chydraulics.git

  1. Go into chydraulics/test_uf directory:

cd chydraulics/test_uf

  1. Execute the code as (e.g.):

./main.py uniformFlow_w1020.json

chydraulics's People

Contributors

lamhydro 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.