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

  1. Clone the 'Balanced sources' scenario and name the new one 'Demand reductions'

  2. 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.

{
	"type": "controlcurveindexparameter",
	"storage_node": "Example reservoir",
	"control_curves": [
		{
			"type": "monthlyprofileparameter",
			"values": [
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.45,
				0.6,
				0.6
			]
		},
		{
			"type": "constant",
			"value": 0.4
		},
		{
			"type": "constant",
			"value": 0.1
		}
	],
	"__recorder__": {
		"timeseries": true
	}
}
Paste the code and save
Select recording timeseries and save

At each time step the Control Curve Index Parameter will return an Index Value as shown below:

Reservoir control curve

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

  1. 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.

  1. Create a new Pywr_Parameter

Create a new Pywr_Parameter
  1. Name the parameter 'control curve demand factor' and press Enter.

Name the parameter
  1. Paste in the following JSON code snippet below. Please note how the"storage control curve" is referenced in the "index_parameter"attribute.

{
	"type": "indexedarrayparameter",
	"index_parameter": "storage control curve",
	"params": [
		1,
		0.9,
		0.8,
		0.5
	],
}
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.

  1. 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.

  1. 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
  1. The baseline demand will remain 0.1 Mm3/day. Copy and paste the JSON code snippet into the JSON tab.

{
	"type": "constant",
	"value": 0.1
}
Paste the code and save

At each time step, the modeled demand will be the Baseline Demand multiplied by the Demand Factor:

Timestep demand = Baseline demand x Demand Factor

Calculate timestep demand

This can be accomplished by using an Aggregated Parameter.

  1. Add a new Pywr_parameter.

Add a new Pywr_parameter

Name the new parameter 'timestep demand'

Name the new parameter
  1. Copy and paste the JSON code snippet into the JSON tab.

{
	"type": "AggregatedParameter",
	"agg_func": "product",
	"parameters": [
		"baseline demand",
		"control curve demand factor"
	]
}
Paste the code and save

Select to make this Paramter value be output in each time step.

Select recording the timeserries
  1. The '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.

  1. Click on the Demand node and write or paste 'timestep demand' in the max_flow attribute replacing the scalar value (0.1).

Enter max_flow attribute name

Please note, if the Parameter name does not save, change the type of the entry to "Descriptor".

Click on edit the max_flow
Select DESCRIPTOR
Enter the name

Don't forget to save the changes.

Run the model and view the results

  1. Run the model.

Click on to run the model
  1. View the simulated _volume on the Reservoir

Simulated _volume on the Reservoir

You can zoom into the drought, for example this is the drought that occurred in 2042-2044.

Simulated _volume on the Reservoir in 2042-2044

In the the Scenario with demand reductions, the Reservoir did not go to as low of storage (9.4 vs 8.17 Mm3).

  1. Click on the simulated_flow of the Demand node. The demand reductions can be seen.

simulated_flow of the Demand node
  1. You can view the control cure parameter output by clicking on the Network Data view.

Click to view the control cure parameter output

Clicking on simulated_storage control curve shows what index the storage control curve is returning at each time step. This varies between 0-2.

Control cure parameter output

Exercise

  1. Increase the Baseline Demand Parameter. How high can baseline demand be before the reservoir fully empties?

Last updated

Was this helpful?