WaterStrategy
English
English
  • WaterStrategy Documentation
  • Support
  • Getting Started
    • Creating an Account
    • Logging In
    • Tour of WaterStrategy
    • Creating a new Project and Network
    • Sharing Projects and Networks
    • Exporting and Importing Models
    • Dealing with Model Errors
    • Uploading External Data
  • Modeling Basics
    • Water Resource System Modeling?
    • What is Pywr?
    • Pywr Concepts
    • Node Types
      • Water Input
        • Input Node
        • Catchment Node
        • Proportional Input Node
      • Water Transport
        • Link Node
        • River Node
        • Delay Node
        • RiverSplit Node
        • RiverSplitWithGauge Node
        • RiverGauge Node
        • BreakLink Node
        • PiecewiseLink Node
        • MultiSplitLink Node
      • Water Storage
        • Storage Node
        • Reservoir Node
        • VirtualStorage Node
        • RollingVirtualStorage Node
        • AnnualVirtualStorage Node
        • SeasonalVirtualStorage Node
        • AggregatedStorage Node
      • Water Output
        • Output Node
        • Loss Link Node
      • Hydropower
        • Turbine Node
      • Others
        • AggregatedNode
    • Allocation Penalties
    • Scenarios
      • WaterStrategy Scenarios
      • Pywr-Scenarios
        • Parameter and pywr-scenario Integration
    • Parameters
      • Base Parameter Class
        • Parameter
        • IndexParameter
      • Simple Parameters
        • Constant
        • Constant Scenario Parameter
        • Constant Scenario Index Parameter
      • Combining multiple parameters
        • Aggregated Parameter
        • Aggregated Index Parameter
        • Division Parameter
        • Negative Parameter
        • MaxParameter
        • Negative MaxParameter
        • MinParameter
        • Negative MinParameter
        • Offset Parameter
      • Time Series and Profiles
        • Daily Profile
        • Weekly Profile
        • Monthly Profile
        • Uniform Drawdown Profile
        • Scenario Daily Profile
        • Scenario Weekly Profile
        • Scenario Monthly Profile
        • Array Indexed Scenario Monthly Factors
        • RBF Profile
      • DataFrame Parameter
      • HDF5 Parameter
      • Array Based Parameters
        • Array Indexed Parameter
        • Array Indexed Scenario Parameter
        • Indexed Array Parameter
      • Threshold Parameters
        • Abstract Threshold
        • Storage Threshold
        • Node Threshold
        • Parameter Threshold
        • Recorder Threshold
        • Current Year Threshold
        • Current Ordinal Day Threshold
      • Interpolation Parameters
        • Interpolated Parameter
        • Interpolated Quadrature
        • Interpolated Flow
        • Interpolated Volume
      • Control Curve Parameters
        • Base Control Curve
        • Control Curve Interpolated Parameter
        • Control Curve Piecewise Interpolated Parameter
        • Control Curve Index Parameter
      • Hydropower Parameters
      • Others
        • Annual Harmonic Series Parameter
        • Deficit Parameter
        • Scenario Wrapper Parameter
        • Piecewise Integral Parameter
        • Flow Parameter
        • Flow Delay Parameter
        • Discount Factor Parameter
    • Recorders
      • Base Recorder
        • Recorder
        • Node Recorder
        • Storage Recorder
        • Parameter Recorder
        • Index Parameter Recorder
        • Aggregator
      • Numpy Array Recorders
        • Numpy Array Node Recorder
        • Numpy Array Storage Recorder
        • Numpy Array Level Recorder
        • Numpy Array Area Recorder
        • Numpy Array Parameter Recorder
        • Numpy Array Index Parameter Recorder
        • Numpy Array Daily Profile Parameter Recorder
      • Flow Duration Curve Recorders
        • Flow Duration Curve Recorder
        • Storage Duration Curve Recorder
        • Flow Duration Curve Deviation Recorder
        • Seasonal Flow Duration Curve Recorder
      • Deficit Recorders
        • Numpy Array Node Deficit Recorder
        • Numpy Array Node Supplied Ratio Recorder
        • Numpy Array Node Curtailment Ratio Recorder
        • Total Deficit Node Recorder
        • Deficit Frequency Node Recorder
      • Statistical Recorders
        • Aggregated Recorder
        • Mean Flow Node Recorder
        • Total Flow Node Recorder
        • Annual Total Flow Recorder
        • Mean Parameter Recorder
        • Total Parameter Recorder
        • Rolling Mean Flow Node Recorder
        • Minimum Volume Storage Recorder
        • Minimum Threshold Volume Storage Recorder
        • Timestep Count Index Parameter Recorder
        • Annual Count Index Threshold Recorder
        • Rolling Window Parameter Recorder
      • Index Recorders
        • Annual Count Index Parameter Recorder
      • File Recorders
        • CSV Recorder
        • Tables Recorder
      • Hydro-power Recorders
        • Hydropower Recorder
        • Total Hydro Energy Recorder
  • Applied Modeling
    • Reservoir and Storage Nodes
  • Tutorials
    • Creating and running a simple model
      • Creating and Running a Model
        • Setting up a Project and Network
        • Adding Nodes and Links (Edges)
        • Add Data to the Nodes
        • Setting the Time Horizon
        • Running the Model and Visualizing its Outputs
        • Creating a New Scenario
        • Exercise
      • Making Changes to a Model
        • Adding a Reservoir
        • Adding Basic Operating Rules
    • Modelling basin reservoir systems
      • Creating a New Project and Network
      • Adding a Dam (Reservoir)
      • Adding a Demand
      • Adding a Water Treatment Works with Losses
      • Adding a Source Representing Groundwater
      • Additional Exercises
      • Adding reservoir bathymetry, evaporation, and rainfall
        • Background on Evaporation and Precipitation on Reservoirs
        • Adding reservoir bathymetry (Area)
        • Adding reservoir bathymetry (Level)
        • Adding monthly evaporation and rainfall
      • Using allocation penalties and control rules to balance sources
      • Control Curves and Demand Savings
        • Adding reservoir control curves and demand savings (reductions)
    • Using Allocation Penalties to Allocate Water
      • Exercise 1a Two nodes
      • Exercise 1b Two demands
      • Exercise 1c Minimum Flow Properties
      • Exercise 2a Simple system with reservoir draw downs
      • Exercise 2b Simple system with overflow
    • Pywr-scenarios reading external DataFrame and adding Custom Rules
      • Uploading Files
      • Reading CSV DataFrame
      • Running pywr-scenarios
      • Reading h5 DataFrame for pywr-scenarios
      • Create Custom Rule - TranscientDecisionParameter
Powered by GitBook
On this page
  • 1. Difference between storage and reservoir nodes
  • 2. Build the example reservoir system model
  • 2.1 Click the network created in last section and open it
  • 2.2 Find a river on the map
  • 2.3 Add the following nodes to the network
  • 2.4 Set up the time step and and time horizon
  • 2.5 Rename the nodes to names that make sense with their contexts
  • 2.6 Inputing data into the Catchment node
  • 2.7 Inputing data into the Example reservoir node
  • 2.8 Inputting data on the the Spill and Release Link nodes.
  • 2.9 Run the model
  • 2.10 See the calculated results

Was this helpful?

Export as PDF
  1. Tutorials
  2. Modelling basin reservoir systems

Adding a Dam (Reservoir)

PreviousCreating a New Project and NetworkNextAdding a Demand

Last updated 7 months ago

Was this helpful?

1. Difference between storage and reservoir nodes

Please note that there are two nodes in WaterStrategy and Pywr that represent reservoirs. The first is a node and the second is a node.

Both nodes store water. The reservoir node works just like a storage node, however it has built-in parameters allowing evaporation and precipitation to be directly represented on the node. To represent evaporation and precipitation with a storage node, a catchment node connected to the storage node is used to represent precipitation and output node drawing water from the storage node is is used to represent evaporation.

This tutorial will use reservoir nodes to build the reservoir system model.

2. Build the example reservoir system model

2.1 Click the network created in last section and open it

2.2 Find a river on the map

This tutorial has a recommended location, but it doesn't matter if you cannot find the exact location, just find another location with a river.

2.3 Add the following nodes to the network

  • Place a reservoir node to the river.

The upper link node representing the reservoir release represents flow that leaves the reservoir as a result of any release rules or to meet downstream allocations. Release rules would generally be specified on this node. Reservoir release rules defined on this node are usually represented by a parameter defined on the nodes max_flow attribute.

The lower link node represents the spill from the reservoir. The spill is used if reservoir release rules are defined constraining how much water can be released via this node and additional water needs to be released than is allowed by the release rules (for example if the reservoir is over capacity). As the spill is generally used only when the reservoir is over capacity, this node generally has a highly positive allocation penalty.

###Notice: remember to connect the nodes by clicking first on the upstream node and then the downstream node.

You can view how to add edges in the video below.

The reservoir system should look like the figure below.

2.4 Set up the time step and and time horizon

2.5 Rename the nodes to names that make sense with their contexts

  • the Catchment node to 'Example catchment',

  • the Reservoir node to 'Example reservoir'

  • the Output node to 'Example outlet'.

  • the Link nodes to 'Release' and the other one 'Spill'.

The figure below shows where to click to rename the catchment node. The same process can be repeated for all the other nodes.

2.6 Inputing data into the Catchment node

Please go to the following link to find the time series data for this step.

  • Click on the Catchment node and follow the clicks (red arrows shown in the sequence of figures below.

  • In the Excel link you will have a time series. Please copy the first (or only time series if there is only one). Make sure to copy the dates as well.

  • Paste the time series into cell A1 in the Dataframe tab

  • You should have a time series as shown below. Click Save.

2.7 Inputing data into the Example reservoir node

  • Click on the Example reservoir node

  • Set the max_volume to 25 Mm3. This is the maximum capacity for the dam in this tutorial.

  • Set the initial_volume to 15 Mm3. This is the storage level that the simulation starts with on the first time step.

  • Set the allocation penalty to -200. Often reservoirs have a negative allocation penalty. Allocation penalties are often used to balance reservoir or other water source use in multi-reservoir and multi-source systems.

The attributes on the reservoir should look like those below:

2.8 Inputting data on the the Spill and Release Link nodes.

  • On the Spill link node set the 'Allocation penalty' to 1000

  • The Release link node should not have any data input.

2.9 Run the model

2.10 See the calculated results

  • View the 'simulated_volume' of the reservoir node to see the reservoir storage volume over time.

  • Click on the 'Plot' view.

The reservoir is seen to fill and remain full for most of the time horizon. This is the case becaues there is no demand on the reservoir nor are there any evaporation losses defined.

To see a video on how to run the model and view outputs click here.

###Notice: make sure you use the 'Reservoir' node: and not the 'Storage' node: .

Place a node upstream of the reservoir. The catchment node represents the river flowing into the reservoir.

Place an node downstream of the reservoir. The output node in this case represents the river outlet.

Place two nodes between the reservoir and output nodes (as shown below). In this case, these link nodes represent the (1) reservoir releases and (2) spill.

Connect the nodes with edges which are commonly referred to links.

https://docs.google.com/spreadsheets/d/1MR1Xxk77gFzcY3J3r6c6g38UB8pd1HMY/edit?usp=sharing&ouid=103362449956532179397&rtpof=true&sd=true
storage
reservoir
catchment
output
link
Guidance on how to add edges
Open the created network
Recommended location for this example
The river used in this example
Reservoir node
Adding a reservoir node
Adding a catchment node
Adding an output node
Adding link nodes
The example reservoir system
Set up the time step and and time horizon
Rename the catchment node
Click on the catchment node and then the edit button for the Flow attribute.
The type of parameter to be used for the flow parameter should be set to PYWR Dataframe which is a time-series.
Click 'OK' to accept the parameter type change.
Paste inflow data
Save inflow data
Reservoir data
Spill allocation penalty setting
Release link setting
Run the model
Run the model
Get calculated results
View the reservoir volume