This tutorial describes how to add reservoir bathymetry (area and level), evaporation, and rainfall.
Evaporation losses and added storage via precipitation are major components of a reservoir's mass balance. Evaporation and precipitation rates are both generally measured in length/time. In metric units this is often mm/day.
To get volumetric daily flow rates which are required for Pywr, these rates are then multiplied by the Area of the reservoir. In the metric templates in WaterStrategy this Area is generally expressed in Km2.
For a template that uses flow in Mm3/day, a conversion of 0.001 is required to obtain Mm3/day.
Evaporation (mm/day) * Area (km) * 0.001 = Mm3/day
For a template that uses flow in Ml/day, no conversion is required to obtain Ml/day.
Evaporation (mm/day) * Area (km) * 1 = Ml/day
In this step, we will add the the Evaporation and Precipitation rates (mm/day). Internally the reservoir multiplies the real-time Reservoir area by the Evaportion.
The Evaporation can be defined by a parameter or a scalar. For example, a time series can be used that is correlated to the flow scenario time series. However in this case, we will use a Monthly profile parameter which assigns a different value to each month in the year.
Select the reservoir and edit the Evaporation attribute.
WaterStrategy has a Json editor for a Monthly profile parameter. To use it, In the options tab select PYWR_MONTHLY_PROFILE.
In the Monthly Profile tab, enter the evaporation rates in the table below:
Evaporation (mm/day)
2.70
4.02
1.45
1.98
0.98
0.10
0.04
0.03
0.04
0.48
1.14
2.45
Then, save it.
Follow the same steps for the Rainfall attribute using the table below the figure.
Precipitation (mm/day)
4.91
2.33
1.24
2.30
0.39
0.01
0.01
0.00
0.01
0.48
1.76
2.23
Finally set the Evaporation Penalty to -2000 and the Evaporation Unit Conversion on the reservoir node to 0.001.
The highly negative Evaporation Penalty of -2000 is higher priority than either the reservoir and any other nodes in the system. This ensures that evaporation outflow is met first before any management rules are implemented.
The Unit Conversion allows the model to correctly convert the evaporation in mm/day and reservoir area in Km2 to the correct flow units in the template which are Mm3/day
Run this scenario and compare the simulated volume against the 'Demand with GW' scenario.
Evaporation is shown to result in a decrease in reservoir levels during droughts. Precipitation additions do not compensate for the losses.
The water Level of a reservoir can be calculatedi n the same way as for a reservoir. A reservoir's water level is required to be able to calculate hydropower. While the Botswana National Model doesn't include hydropower, for completeness it is included in this tutorial.
Please note: Unlike the Area parameter that was defined on the Resevoir node. We will define the Level parameter in the Parameters tab of the Interface. This is to demonstrate the Parameters tab, the Level could be defined also on the node.
Below is an example area Level vs Volume rating table for:
0
1
7
8
10
16
15
18
25
20
When plotted it looks like this:
Click on the Parameters tab on the interface.
Click on the + to add a new parameter. Select PYWR_PARAMETER
In the text field that appears write 'Dam level'
Copy and Paste the Json below into the editor and click Save.
Click on Timeseries in the Outputs tab to enable the saving of the Level timeseries.
Click on Map to return to the map view
7. The Dam level parameter needs to be referenced on the Level attribute on the reservoir, to do this, click on the Reservoir an write the name of the parameter in the Level attribute (Dam level). Please note that the name is case sensitive.
Run the model.
You will see that because the Dam level parameter is not defined on the node, the simulated_level is not output on the reservoir node. Instead to view the output, click on the Network Attributes button.
Click on the simulated_Dam level. Note that the Reservoir node name is in the name of the output of the Parameter.
The Level time series can be seen below.
The Area that a Reservoir or Storage node covers depends on how full the reservoir is.
The Area Rating Curve determines gives the Area of a reservoir as a function of its Level or Storage. In WaterStrategy and Pywr, the time step storage of a reservoir is known at each time step. We can use this storage with an Area rating cure to calculate the reservoir area and therefore its evaporation at each time-step.
Below is an example Area rating table:
When plotted it looks like this:
The interpolated volume parameter uses an array (table) of Reservoir Volumes and corresponding values. In this case the associated values are the corresponding Reservoir Area for a given Volume. In between the given points in the table, the parameter interpolates.
Please note: Parameters can be defined directly on a node or they can be defined in the Parameters tab in the interface. Parameters that are defined in the Parameters tab in the interface can be used on multiple nodes and nested within different parameters.
This tutorial includes both types of definitions. The area will be defined on the node, while the level parameter (next step) will be defined in the Parameters tab.
Clone the 'Demand with treatment losses' scenario and call the new one 'Adding reservoir P and E'. The P stands for Precipitation and E stands for Evaporation.
Click on the Reservoir and edit the Area attribute.
The Interpolated Volume Parameter does not currently have a JSON editor in WaterStrategy. In order to define this parameter on this attribute, we need to use the generic PYWR_PARAMETER. This allows us to put in the JSON for any Pywr parameter.
Press OK
4. Copy and Paste the JSON code below into the text in the JSON tab
You can select to record the parameter value as a time series by selecting Timeseries in the Outputs tab. Then, save it.
Run the model and view the Simulated_Area output
This shows the Area of the reservoir over time.
Smaller areas correspond with lower reservoir storage volumes.
are functions that return a value in the model at each time-step. These values can be a constant, based on time (e.g. on the day or month), a calculation based on the time step reservoir storage and many other calculations. In this case, we are interested in a parameter that returns the Area of a reservoir or storage node as a function of its time-step storage. To do this we use an .
0
1
7
2
10
4
15
6
25
14