Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Modelling stable creek intakes

Open in vLab iLab Assistant

Creek intakes are modelled as tiny reservoirs connected to a tunnel network in SHOP, typically connected directly on the main tunnel of a large plant. Since the reservoir volumes of creek intakes are so small compared to the flow in the tunnel network, it can be challenging to model a stable system when creek intakes are present. This example will describe general rules and best practice for modelling creek intakes in SHOP. Note that this example does not use the old creek_intake object in combination with a junction, as this way of modelling is deprecated.

The system that will be used to illustrate the creek intake modelling in SHOP is based on the code in the function build_model() found in the creek_model.py script:

The resulting topology is shown below:

Loading...

A single large reservoir called Reservoir sits at the far end of a long tunnel stretch down to the plant. Three small creek intake reservoirs, Creek1 to 3, are connected to the main tunnel of the plant. All reservoirs have river objects connected to them that acts as spillways with up_level_flow_curve defining the flow out of the reservoirs.

Modelling the reservoir of a creek intake

The reservoirs representing creek intakes should be modelled using the following principles:

Storage capacity

The reservoir of a creek intake represents the volume of the tunnel segment in addition to any small dam at the top of the creek intake. In this model, the max_vol it is set to 0.001 Mm3 for all three creek intakes.

Upper and lower regulation levels

The hrl of the creek intake reservoirs should be the top of the dam or tunnel entrance of the creek intake. Above this level, water will spill out of the creek. The lrl should be set to the lrl of the large reservoir in the network. If the lrl of the creek intake reservoirs are set lower than the lrl of the main reservoir, problems can arise if the large reservoir is empty.

Volume to level conversion

One of the most important factors of modelling a creek intake reservoir is the vol_level curve. Since the reservoir capacity is so small, the level of a creek intake reservoir can change very rapidly over a time step in the optimization model. It is therefore important to model the vol_level curve with the same gradient in all segments. The simple way to do this is to set 0 Mm3 for lrl, max_vol for hrl, and then choose some additional height above hrl and calculate the volume that will ensure a constant gradient. Choosing the level of hrl+Δ\textup{hrl} + \Delta for the final point on the vol_level curve should result in a volume of V=(1+Δhrl−lrl)⋅VmaxV = (1+\frac{\Delta}{\textup{hrl}-\textup{lrl}})\cdot V_{\textup{max}}. This means that the reservoir level can potentially go far above the actual intake of the creek, but this will not happen if the spillway of the creek intake is modelled correctly.

Flow_descr

Before SHOP 16.4.0, the flow_descr attribute on the reservoir object would be used in the tunnel network simulations when a reservoir in the network had a level above hrl. SHOP now only uses the vol_level curve in these calculations, but for older SHOP versions it is important to define a flow_descr on the creek intake reservoirs even though a river is used to model the spillage.

The values for max_vol, hrl, lrl, and the vol_level curve of each reservoir in the model is printed below:

Reservoir
max_vol: 50.0
lrl: 80.0
hrl: 100.0
vol_level:
0.0      80.0
5.0      85.0
12.0     90.0
20.0     95.0
50.0    100.0
60.0    102.0
Name: 0.0, dtype: float64

Creek1
max_vol: 0.001
lrl: 80.0
hrl: 110.0
vol_level:
0.000     80.0
0.001    110.0
0.002    140.0
Name: 0.0, dtype: float64

Creek2
max_vol: 0.001
lrl: 80.0
hrl: 105.0
vol_level:
0.000     80.0
0.001    105.0
0.002    130.0
Name: 0.0, dtype: float64

Creek3
max_vol: 0.001
lrl: 80.0
hrl: 101.0
vol_level:
0.000     80.0
0.001    101.0
0.002    121.0
Name: 0.0, dtype: float64

Modelling the tunnels connecting the creek intakes

The creek intake reservoirs are connected to the main tunnel with short tunnel objects with low loss coefficients. Note that setting the loss coefficients to zero may lead to instabilities when solving the tunnel network equations, so the loss factors should always be larger than zero. In this case, the tunnels connecting the creeks have a loss coefficient of 1e-6, while the main tunnel segments have much higher losses. 1e-6 is about 0.1% of the sum of all loss factors in the tunnel network:

Loss in Rsv_N1: 0.00015, 14.96 % of sum loss factor

Loss in N1_N2: 2.5e-05, 2.49 % of sum loss factor

Loss in N2_N3: 2.5e-05, 2.49 % of sum loss factor

Loss in N3_plant: 0.0008, 79.76 % of sum loss factor

Loss in Creek1_N1: 1e-06, 0.10 % of sum loss factor

Loss in Creek2_N2: 1e-06, 0.10 % of sum loss factor

Loss in Creek3_N3: 1e-06, 0.10 % of sum loss factor

Modelling the main tunnel

The main tunnel from the large reservoir to the plant is split into 4 tunnel segments to allow creek intakes to connect at different points in the system. 15% of the main tunnel loss happens in the first tunnel segment between the large reservoir and the first creek intake, then 2.5% loss is added between each creek before 80% of the loss happens after the last creek intake. The main tunnel is modelled as flat at the lrl of the large reservoir before it drops off down to the plant in the final tunnel segment. This is seen in the start_height and end_height of each tunnel:

Rsv_N1: starts at 80.0 masl, ends at 80.0 masl

N1_N2: starts at 80.0 masl, ends at 80.0 masl

N2_N3: starts at 80.0 masl, ends at 80.0 masl

N3_plant: starts at 80.0 masl, ends at 0.0 masl

Creek1_N1: starts at 80.0 masl, ends at 80.0 masl

Creek2_N2: starts at 80.0 masl, ends at 80.0 masl

Creek3_N3: starts at 80.0 masl, ends at 80.0 masl

Modelling the spillways

The overflow example gives a general overview of how to modell spillage in SHOP. For creek intakes, it is recommended to add a river object with a simple up_level_flow_curve to each creek reservoir. The upstream_elevation of the river should be the hrl of the reservoirs, and using a single segment in the up_level_flow_curve is usually sufficient. Setting a flow_cost on the spill rivers is also common practice, but not strictly necessary as long as the creek reservoirs has a water value consistent with the larger reservoir(s) in the tunnel system. In this model, no flow_cost is added to the rivers connected to the creek intake reservoirs, and the energy_value_input of all creeks are set to the same as the large reservoir.

General recommendations and considerations

Optimizing a dry system state

It is good practice to test the stability of the modelling in both wet and dry system conditions. First the a dry system state with all reservoirs at lrl and low inflow is optimized:

Dry objective value: -2418.8001375253316

As expected, the power plant produces very little since the system is dry. Enough water is saved to produce some power during the price peak towards the end of the optimization horizon.

All reservoir levels slowly increase in the beginning when the power plant is offline, and the inflow into the creeks flow into the larger reservoir. When the power plant draws water, the reservoir levels drop quickly in the closest creek intakes while it takes a little longer for the main upstream reservoir to be affected.

Loading...
Loading...
Loading...

The tunnel flow is shown in the figure below. As the reservoir volumes of the creek intakes are so small, most of the inflow goes directly into the larger reservoir. For these calm conditions, there are virtually no deviations between the optimized tunnel flow and the post-calculated physical_flow in the tunnels (note the scale on the y-axis).

Loading...
Loading...

There is no flow in any of the spillways, as expected. As for the tunnel flow, the deviation between the optimized flow and post-calculated physical_flow is zero for all rivers.

The history saving thread hit an unexpected error (OperationalError('database is locked')).History will not be written to the database.
Loading...
Loading...

Optimizing a wet system state

In the wet system state, all reservoirs start at hrl and the creek intakes receive 10 times the amount of inflow compared to the dry case.

Wet objective value: -521669.04006049456

The power plant has to operate in almost all hours to avoid spillage losses in the system, but is still able to ramp down when the prices are low.

The initial reservoir levels of all creek intakes are high above the large reservoir, but this initial difference is quickly eliminated due to the operation of the power plant and the relatively low losses in the system. The reservoir levels in the three creeks vary rapidly from hour to hour as inflow and power plant discharge changes.

Loading...
Loading...
Loading...

The flow in the tunnel system is much more dramatic in the wet system state, and the direction of flow into and out of the large reservoir changes multiple times during the optimization. This is due to the changes in the operation of the power plant and the large but random changes in inflow from hour to hour. There are some slight deviations between the flow and physical_flow in this run, which means that there is a small error in the linearization of the non-linear tunnel network equations. However, the deviations are very small compared to the flow in the tunnels.

Loading...
Loading...

SHOP is able to avoid spillage in the wet system state, but spillage from creek intakes are not uncommon. Specifying a mip_flag (or using the command set universal_river_mip /on) and adding a flow_cost on the creek spillways can be considered when there is a lot of spillage in the system. However, it is important to consider that adding high spillage penalties in a system where spillage is unavoidable can simply make the calculation time longer. This can happen when the objective function is increased a lot due to (spillage) penalties.

Loading...
Loading...