Adding reservoir control curves and demand savings (reductions)
Introduction
Control curves can be used to implement a demand reductions when reservoir levels go below certain thresholds. This represents the implementation of temporary demand management measures. In this exercise the demand will be incrementally reduced as the reservoir goes below certain storage thresholds. This exercise will demonstrate the Control Curve Index Parameter, the Indexd Array Parameter as well as the Aggregated Parameter as well as parameter nesting.
Clone the scenario and define a control curve
Clone the 'Balanced sources' scenario and name the new one 'Demand reductions'
First we will define a control curve which uses storage volume thresholds to progressively reduce demand to model demand restrictions being placed on a demand. The first curve is a Monthly Profile (60% in come months and 45% in others) allowing for seasonal changes while the two subsequent curves are Constants (40% and 10% of reservoir storage capacity).
Reservoir control curve
The Control Curve will be defined in the Parameters tab. In the Parameters tab add a Pywr_Parameter.
Add a Pywr_Parameter
Name the parameter 'storage control curve' and press Enter.
storage control curve
Paste in the following JSON code snippet below. Please note how the "Example reservoir" is referenced in the "storage_node"attribute.
These Indices can be associated to a Demand Factor which will be defined using an Indexed Array Parameter. The Demand factor will be used to reduce demand when each control curve threshold is passed.
Associate demand factor
We will associate the following Demand Factors to the different control curve failure levels:
Reservoir control curve
These will reduce demand to 90%, 80% and 50% of the Baseline demand corresponding to 10%, 20% and 50% demand reductions.
Create a new Pywr_Parameter
Create a new Pywr_Parameter
Name the parameter 'control curve demand factor' and press Enter.
Name the parameter
Paste in the following JSON code snippet below. Please note how the"storage control curve" is referenced in the "index_parameter"attribute.
Paste the code and save
The Paramsattribute takes in either scalars or Pywr parameters and the index of the array corresponds to index in the Parameter referenced in the index_parameter which in this case is the control curve.
Select to make this Parameter output.
Select recording timeseries and save
Define the baseline demand
Next we will define the baseline demand. This is the demand that the reservoir has before any reductions are implemented. In previous tutorial, the Example demand is defined as a scalar (0.1) on the Max_flow attribute of the Example demand output node:
Example demand
We will replace this with a Parameter reference.
First, we will define the baseline demand using a Constant Parameter.
Add a new Pywr_parameter.
Add a new Pywr_parameter
And name it Baseline demand and press Enter.
Name the new Pywr_parameter
The baseline demand will remain 0.1 Mm3/day. Copy and paste the JSON code snippet into the JSON tab.
Paste the code and save
At each time step, the modeled demand will be the Baseline Demand multiplied by the Demand Factor: