Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this tutorial we will add a reservoir node and some operating rules to the model bulit in the prevoius tutorial.
Loading...
Loading...
This first tutorial shows you the basics of how to create a model. This involves creating a network topology, populating it with data, and then running it.
Data to complete the tutorial can be found here:
Please watch the video for additional detail.
Scenarios allow users to explore and evaluate different conditions or management strategies within the water system model.
1. To create a new scenario, click on the Clone a scenario icon. (To 'clone' is to 'make a copy of').
choose Baseline as the scenario to clone, add a name to your scenario, in this case 'With abstraction', and click Clone.
You will see the new scenario is automatically made active.
At the moment, the new scenario is an exact clone of the baseline scenario.
In this scenario, we will assign a demand to the demand node. Change the max_flow of the demand output node to 5.0 Mm3/day
Run the new scenario and then view the simulated_flow of the demand node.
Now, the amount of water supplied to the demand node is no longer 0. The demand node attempts to abstract 5.0 Mm3/day of water. However, when there is not enough water in the river the full 5.0 Mm3/day cannot be abstracted.
Lets view the simulated_flow of the river output node.
Lets compare the river outflow in both scenarios.
We can see that the less water reaches the river outlet in the With abstraction scenario and sometimes there is no water flowing into the river outlet.
Add the baseline scenario to the view by selecting it in the menu and then pressing the Play button.
Please use the data in the online Excel table below for this tutorial.
Please watch this video for more detail.
We want to include time series for the flow in the catchment node and scalar values for Demand.
Double click on demand and update the attributes in the Inputs section as shown below:
Max_flow = 0
Allocation penalty = 0
new window will appear, Click Options, select PYWR_DATAFRAME and click Save
The window will update to the Dataframe tab. Copy the data from the Excel file using the link above and paste it as shown in the image. Note that 2 columns must be used, column A for the date-time index and column B for the data values. Click Save. For more detail please watch the video.
Please watch the video page for more detail.
Click on the the network level data menu button.
The network level data window appears.
The timestepper.start, timestepper.end and timestepper.timestep settings need to be defined which are the start and end dates of the models time horizon and the time step at which the model will be run.
The time series in our data set is monthly however we will run the model at a 1 Day time step (1D). Time steps can be in any number of days, weekly (W) and monthly (M).
Please set the data as follows:
timestepper.end = 2021-12-01
timestepper.start = 2020-01-01
timestepper.timestep = D
Click the Edit button, select Descriptor for each of the time step attributes.
Input the following data above and click Save.
This time horizon can be shorter than our input data, but the start and end dates must be within the range of your data. The date format and syntax is strict.
You may need to click on the edit button to change the values.
Double click on catchment node, on the right panel inside Inputs section, on flow attribute click on the edit button .
Nodes and links (also called ‘Edges’) are fundamental components of the water system model. Nodes represent specific elements within the system, such as reservoirs, catchments, and demands, each with unique properties, which are referred to as attributes. For example, one attribute is the ‘max_flow’ which is the maximum flow through a node.
These attributes can be of different types (e.g. monthly profiles) and they dictate the behavior of the specific node.
Edges represent the connections or pathways through which water flows between nodes, representing rivers, pipelines, or channels. Together, nodes and edges form the structure of the network, defining how water moves through the system.
The video below can help you follow the steps below.
Click on the network you created in the first step, ‘My new network’
This opens the network. If you selected to display a map when creating the network, a map will be shown.
Zoom to a location on the map where you want to build a network. We will zoom to the Nile river in Sudan. Next click on the Build icon outlined in Red to view the nodes palette showing the available list of Nodes.
Drag and drop the nodes to be used. In this case we will use:
1 Catchment - which will represent water flowing into the system
1 Link - a connecting node
2 Output nodes - These nodes remove water from the system. One will be a demand node and the other will be a river outlet or "sink".
To connect the nodes, click on edge to enable link mode. Click on the start node (catchment) and then click on the end node (link). Nodes must be started from the upstream node and ended on the downstream node.
Please note: once you have created the connections, click again on edge again to disable link mode.
Please watch the video for more details.
Click the Run a Model icon , select Run Pywr and click Submit.
The model will be submitted to run on the cloud.
You will see the Run appear in the Runs menu.
A blue ribbon means the Run is running.
A yellow ribbon means the Run is queing
A green ribbon means the Run has finished successfully
A red ribbon means the Run has termined with an error.
Clicking on the ribbon opens a window with the Run log. If there is an error, a traceback will appear at the bottom and can be used to help identify why the Run had an error.
Once the model has sucessfully ran, you can click on the various nodes to examine their time series output. In this case, the main output attribute is the 'simulated flow'.
A time series table first appears:
Click on Plot to see a plot of the time series.
As the max_flow of the demand node was set to 0, there is no flow in this node.
On the next flow, we will create a new scenario and change the max_flow of the demand node.
What is the simulated flow on the downstream output node representing the river outlet?
Double click on the node of interest. “Simulated_flow” will be available under the Output Section, click on the edit button to see results. Click on the Demand node which is the node on the right.
Creating and running a simple model
This tutorial introduces first steps in WaterStrategy, including:
creating a project and a network,
adding different types of nodes including a catchment node and water demand represented by an output node,
adding data to the nodes
creating two different scenarios, and
visualizing and comparing modelled time-series outputs between the scenarios
Please follow the steps below. The video also details the steps in this tutorial.
Projects in WaterStrategy allow organizing and managing water system models effectively. Projects provide a structured environment for organizing models, scenarios, and data, making collaboration easier. They store input data, model configurations, and simulation results in one place. Projects also promote reusability by allowing components and input file data to be reused across multiple models, saving time and effort.
In the ‘My projects’ page, click on Create Project.
We will name this Project “My First Project”. You can add a description if you would like. Then Click Add.
"My First Project" has been created. Within this project, users can create different versions of a network and upload files such as input data, which will be shared to all the networks in the project.
A network in WaterStrategy allows to structure and define the components of the water system model. Networks represent the physical and conceptual layout of the system, with each network embodying a specific topology or connection of nodes, such as reservoirs, catchments, and demand nodes. By creating a network, users visually map out the connections between these components. This is called the model topology. This helps users understand how water flows through the system and how different elements interact.
Networks in WaterStrategy allow efficient collaboration. Once a network is created, it can be shared with team members, enabling users to work on the same network or give their colleagues their on copy of a network.
Additionally, creating a new network from an existing one is easy – users can simply clone an existing network and then apply modifications to it. This flexibility allows users to quickly iterate on their models, test various hypotheses, and evaluate different management strategies.
Click on “My First Project” to go into it
Click on Create Network.
Click on Manual
add a Name and optionally a Description to your Network.
Choose your Template, in this case Pywr child template v1 (March 2021) – flow units in Mm3/day.
“Use Map” should be selected to show map background layer in the network.
Click Submit.
“My New Network” is now created!.
This page shows how to add a basic operating rule. Please watch the video to implement the operating rule.
Using what you learned in the previous steps, please clone the "With abstraction" Scenario and in the new scenario paste in Scenario 2 inflow data from the Excel data provided. How does this scenario 2 inflow data change the abstraction output?
Please watch the video to add a reservoir node to the model built in the previous tutorial. To do this, please create a copy of the model as shown in the video and please work in the With abstraction scenario
Drag and drop a Storage node on the network. Then delete the link conecting the Catchment node to the Link node. Connect the Catchment node to the Storage node and then connect the Storage node to the Link node.
Initially set the the max_volume of the storage node to 0 Mm3 and the initial_volume_pc to 0 and run the model.
Then clone the With_abstraction scenario and make a new scenario called 'Reservoir with storage and abstraction'.
In the new scenario, set the max_volume of the storage node to 6 Mm3 and the initial_volume_pc to 0.33. The reservoir will then begin the simulation at 30% full. Alternatively the initial_volume can be set at 1.8 Mm3. Either initial_volume or initial_volume_pc needs to be set.
Run the model and view the simulated_volume of the reservoir.
The resrevoir empties every dry season and fills every wet season.
Compare the simulated_flow on the demand node for the 'Reservoir with storage and abstraction' and 'With abstraction' scenario.
The storage reduced the deficit in the demand node. However, we can see that even with the storage, there are times that the demand node does not receive its full demand of 0.7 Mm3.
We saw that under flow Scenario 1, the reservoir would empty every year. How low must the demand be for the reservoir to still have some storage volume even in the dry season?