Exercise to implement demand reductions when reservoirs levels are low
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 Mosetse 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 '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).
The Control Curve will be defined in the Parameters tab. In the Parameters tab add a Pywr_Parameter.
Name the parameter 'Mosetse control curve' and press Enter.
Paste in the following JSON code snippet below. Please not how the "Mosetse reservoir"
is referenced in the "storage_node"
attribute.
At each time step the Control Curve Index Parameter will return an Index Value as shown below:
These Indices can be associted 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.
We wil associate the following Demand Factors to the different control curve failure levels:
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
Name the parameter 'Mosetse control curve demand factor' and press Enter.
Paste in the following JSON code snippet below. Please not how the "Mosetse control curve"
is referenced in the "index_parameter"
attribute.
The Params
attribute takes in eithe scalers or Pywr parameters and the index of the array corresponds to index in the Parameter referenced in the index_paramter which in this case is the Mosetse control curve.
Select to make this Parameter output.
Next we will define the Baseline Moseste demand. This is the demand that Moseste has before any reductions are implemented. At the moment, Mosetse Demand is defined as a scaler (0.01) on the Max_flow attribute of the Mosetse Demand output node:
We will replace this with a Parameter reference.
First we will define the baseline demand using a Constant Paramter.
Add a new Pywr_parameter.
And name it Mosetse baseline demand.
The baseline demand will remain 0.1 Mm3/day. Copy and paste the JSON code snippet into the JSON tab.
At each time step, the modelled demand will be the Baseline Demand multiplied by the Demand Factor:
Timestep demand = Baseline demand x Demand Factor
This can be accomplished by using an Aggregated Parameter.
Add a new Pywr_parameter.
Name the new parameter 'Mosetse timestep demand'
Copy and paste the JSON code snippet into the JSON tab.
Select to make this Paramter value be output in each time step.
The 'Mosetse timestep demand' defines the demand at each time step taking into account the state (i.e. real-time storage) in the Reservoir.
This Parameter needs to be referenced on the Max_flow attribute of the Demand node.
Click on the Demand node and write or paste in the name of the Parameter in the Max_flow attribute replacing the scaler value (0.1)
Please note, if the Parameter name does not save, change the type of the entry to "Descriptor".
Next run the model.
View the simulated _volume on the Reservoir
You can zoom into the drought, for example this is the drought that offcured in 2042-2044.
In the the Scenario with demand redcutions, the Reservoir did not go to as low of storage (9.4 vs 8.17 Mm3).
Click on the simulated_flow of the Demand node. The demand reductions can be seen.
You can view the control cure parameter output by clicking on the Network Data view.
Clicking on Simuated Mosetse control curve shows what index the Mosetse control curve control Curve Index Parameter is returning at each time step. This varies between 0-2.
Exercise
Increase the Baseline Demand Parameter. How high can baseline demand be before the reservoir fully empties?
Last updated