OpenHydroFlow is a web-based application for modeling and visualizing water distribution networks using EPANET hydraulic concepts. The application provides a comprehensive solution for creating, analyzing, and visualizing water distribution systems with an intuitive user interface.
- Automated Data Collection: Gather water infrastructure data from open-source APIs
- GIS Integration: Work with real-world geospatial data from the Madison, WI water system
- Hydraulic Modeling: Run extended-period hydraulic simulations
- Interactive Visualization: Visualize network components and simulation results
- Time Series Analysis: Analyze pressure, flow, and velocity over time
- Scenario Management: Create and compare different modeling scenarios
- Python 3.12+
- Flask
- NetworkX (for network graph modeling)
- GeoPandas
- NumPy/Pandas
- EPANET command-line tool (optional, auto-downloaded)
- HTML5/CSS3
- JavaScript
- Bootstrap 5
- Leaflet.js
- Chart.js
OpenHydroFlow/
│
├── app.py # Flask application entry point
├── setup.sh # Setup script for Linux/Mac
├── setup.bat # Setup script for Windows
├── requirements.txt # Python dependencies
├── README.md # Project documentation
│
├── data/ # Data storage
│ ├── raw/ # Raw data files
│ ├── processed/ # Processed data files
│ └── output/ # Model outputs and visualizations
│
├── src/ # Source code
│ ├── __init__.py
│ ├── data_collection.py # Data collection from APIs
│ ├── data_processing.py # Data cleaning and preparation
│ ├── network_model.py # Network modeling
│ ├── simulation.py # Hydraulic simulation
│ ├── visualization.py # Results visualization
│ └── epanet_util.py # EPANET utility functions
│
├── static/ # Frontend static assets
│ ├── css/
│ │ └── style.css # Custom CSS styles
│ └── js/
│ ├── main.js # Main application logic
│ ├── api.js # API client
│ ├── map.js # Map management
│ └── charts.js # Chart management
│
├── templates/ # HTML templates
│ ├── index.html # Main application page
│ └── about.html # About page
│
└── epanet/ # EPANET command-line tool (auto-downloaded)
- Python 3.12 or higher
- pip (Python package manager)
- Git
-
Clone the repository:
git clone https://github.com/SouravDSGit/OpenHydroFlow cd OpenHydroFlow -
Run the setup script:
On Linux/Mac:
chmod +x setup.sh ./setup.shOn Windows:
setup.bat -
The script will:
- Create a virtual environment
- Install all dependencies
- Set up data directories
- Create a .env file for API keys
-
Clone the repository:
git clone https://github.com/SouravDSGit/OpenHydroFlow cd OpenHydroFlow -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Create necessary directories:
mkdir -p data/raw data/processed data/output -
Create a .env file with API keys:
cp .env.sample .env
-
Activate the virtual environment (if not already activated):
source venv/bin/activate # On Windows: venv\Scripts\activate -
Start the Flask development server:
python app.py -
Open a web browser and navigate to:
http://localhost:5000
OpenHydroFlow uses the following open data sources:
- City of Madison, WI Open Data Portal
- USGS National Water Information System
- EPA SDWIS (Safe Drinking Water Information System)
- USGS National Map API (for elevation data)
OpenHydroFlow provides two methods for hydraulic simulation:
-
EPANET Command-line Tool: The application automatically downloads and configures the EPANET command-line tool for accurate hydraulic simulations.
-
Built-in Simulator: A simplified hydraulic calculator is included as a fallback when the EPANET command-line tool is not available.
OpenHydroFlow follows a four-step workflow:
- Data Collection: Gather water infrastructure GIS data, elevation data, water quality data, and monitoring station data from various APIs.
- Data Processing: Clean and transform the collected data into a format suitable for hydraulic modeling.
- Network Modeling: Create a water distribution model with pipes, junctions, reservoirs, and tanks.
- Simulation: Run hydraulic simulations to calculate pressure, flow, velocity, and other parameters throughout the network over time.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- EPANET developers for the hydraulic modeling engine
- City of Madison, WI for providing open access to water infrastructure data
- USGS and EPA for their open data APIs
