This repository contains a Pywr extended node that adds functionality to manage irrigation demands based on soil water balance. The software is designed to estimate the water demands according to the soil's water content and crop type. This tool has been developed as part of a research project. The Pywr with irrigation extended node allows to use all the nodes from original source, including Hydropowers, ground water and hydroeconomic.
- Irrigation Water Demand: A extended node that estimate water demands based on soil water balance method.
- Integrated with Pywr: Leverages the Pywr framework for water resource modeling and optimization.
- Supports Multiple Scenarios: The package includes usage examples demonstrating different scenarios of irrigation water demand in the Upper Batalha river (Brazil).
This package uses Miniforge/Conda for dependency management. To install the package and its dependencies, follow the steps below:
-
Clone the repository:
git clone https://github.com/LabSid-USP/pywr-extension-irrigation.git cd pywr-irrigation-node
-
Install Miniforge if you don't already have it. You can follow the instructions here;
-
Create a Conda environment and install the required dependencies:
conda create --name pywr_irrigation -c conda-forge python=3.12 pywr conda activate pywr_irrigation
The Pywr irrigation extended node can be used in water resource optimization to manage irrigation demand based on soil water balance. Below are some examples located in the examples/
directory to help you get started.
There are four example scenarios included:
- Example based on economic aspects with irrigation extented node: examples\hydroecon_with_irrigation_node\run_allocation_hydroecon_with_irr.py;
- Example based on economic aspects without irrigation extended node: examples\hydroecon_without_irrigation_node\run_allocation_hydroecon_without_irr.py;
- Example Prority based with irrigation extended node: examples\with_irrigation_node\run_allocation_with_irr.py;
- Example Priority based without irrigation extended node: examples\without_irrigation_node\run_allocation_without_irr.py.
You can run these examples as follows:
cd examples
python ./with_irrigation_node/run_allocation_with_irr.py
Replace ./with_irrigation_node/run_allocation_with_irr.py
with any of the other examples (./hydroecon_without_irrigation_node/run_allocation_hydroecon_without_irr.py
, ./with_irrigation_node/run_allocation_with_irr.py
, or ./without_irrigation_node/run_allocation_without_irr.py
) to explore different scenarios.
You can find the results in ./results folder. All discharges in Pywr are in volume/day (m³/day)
We welcome contributions from the community. If you find a bug or have a feature request, please open an issue or submit a pull request.
This project is licensed under the GPL-3.0 License. See the LICENSE file for details.
If you use this software in your research, please cite the corresponding article (once published) or refer to the preprint available here.
For any inquiries, feel free to reach out to the development team via the repository's issue tracker.