This repository contains code and resources associated with the paper Accelerating Steady State Analysis of Water Distribution Systems Using GPU-Enhanced Edge-Based Diffusion. The main objective is to demonstrate how an edge-based diffusion mechanism can be used to achieve simultaneous hydraulic simulations (coarse-grained parallelization) by leveraging CUDA.
- Diffusion Model
- Requirements
- Virtual Reservoir Connectors
- CLI option
- Pressure reconstruction
- Generated Data
- Optimization algorithm
-
Clone the repository:
git clone https://github.com/erytheis/edge-based-diffusion-for-wds.git cd edge-based-diffusion-for-wds
-
Set up a Python environment (conda or venv recommended):
conda create -n erytheis_env python=3.10 conda activate erytheis_env
-
Install required packages:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 pip install torch_geometric pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.4.0+cu121.html pip install -r requirements.txt
(Make sure to include
requirements.txt
or similar in the repo with PyTorch, NumPy, SciPy, and other dependencies.)
-
Running a Basic Simulation
Usemain.py
to run a simple, demonstrative edge-based diffusion simulation:This script will:python main.py --config config/your_experiment.yaml
- Parse the configuration file at input/config.yaml
- Apply the edge-based diffusion solver on a GPU (if available).
- Calculate
$R^2$ with values obtained from WNTR (if available)