{ "cells": [ { "cell_type": "markdown", "id": "ff0d7694", "metadata": {}, "source": [ "(tunnel)=\n", "# tunnel\n", "A pressurized tunnel object that can couple reservoirs and hydropower plants. The flow in the tunnel is calculated based on the pressure and mass balance in the tunnel network\n", "\n", "| | |\n", "|---|---|\n", "|Input connections|{ref}`reservoir`, {ref}`plant`, {ref}`discharge_group`, {ref}`tunnel`, {ref}`interlock_constraint`|\n", "|Output connections|{ref}`tunnel`, {ref}`plant`, {ref}`reservoir`, {ref}`river`, {ref}`interlock_constraint`, {ref}`discharge_group`|\n", "|License|SHOP_OPEN|\n", "|Release version|13.5.1.a|\n", "\n", "```{contents}\n", ":local:\n", ":depth: 1\n", "```\n", "\n", "## Introduction\n", "The tunnel module can be used to model both single tunnels between reservoirs and complex tunnel systems leading in and out of hydropower plants. The main assumption is that flow in a tunnel can be determined by the pressure difference between inlet and outlet, and the head loss due to friction inside the tunnel. Tunnels are also allowed to have gates inside them to control the water flow.\n", "\n", "## Physical properties\n", "\n", "It is possible to input several physical properties of each tunnel. The [start_height](tunnel:start_height) and [end_height](tunnel:end_height) are used to determine whether the tunnel openings are submerged or not. This influences whether the reservoir level is high enough to allow water flowing through the tunnel, and the counterpressure at the far end for water flowing through the tunnel. [Diameter](tunnel:diameter) and [length](tunnel:length) are currently not in use for the optimization, but reserved for more detailed simulation of pressure wave propagation in the tunnel system. The [loss_factor](tunnel:loss_factor) is multiplied with the square of the flow in the tunnel to obtain the pressure loss in the direction of the flow.\n", "\n", "[time_delay](tunnel:time_delay) is currently put on the tunnel object for backwards compatibility, but no pressurized tunnel should have any meaningful time delay. Time delay should be placed on a [](river) object for improved consistency and flexibility when defining delays.\n", "\n", "## Optimization properties\n", "\n", "### For a single tunnel\n", "\n", "The [gate_opening_curve](tunnel:gate_opening_curve) XY-table is the basis for optimization of gates inside tunnels. If a tunnel does not have a gate inside it, this data is not needed. Note that this is not related to the old [](gate) object in SHOP, which should not be used in favour of tunnels and rivers. The X-values represent an arbitrary position given by increasing numbers. The Y-values represent the corresponding opening factor for each position. In the simplest case, a binary gate can be described by the X-values [0,1] and Y-values [0,1]. This means that position \"0\" has an opening factor of 0. SHOP interprets an opening factor of 0 as a fully closed gate. The position \"1\" is defined with an opening factor of 1, which represents a fully open gate. The tunnel's loss_factor is divided by the gate position, which corresponds to infinite loss for closed gate. Thus, the loss_factor used to describe the tunnel should correspond to the situation of a fully open gate.\n", "\n", "To prevent too frequent adjustment of the gate, the [gate_adjustment_cost](tunnel:gate_adjustment_cost) can be used. The cost is multiplied with the change in gate opening between each time step and the product is added to the objective function. To align the optimization with the current state of the gate, use the [initial_opening](tunnel:initial_opening) attribute. \n", "\n", "If the gate is not restricted to only the listed positions, but can be set to any position between the first and last listed position, set the [continuous_gate](tunnel:continuous_gate) parameter to 1. If the gate opening does not need to be optimized, it can be fixed to a schedule using the [gate_opening_schedule](tunnel:gate_opening_schedule) attribute. Please note that the values in the schedule refers to the position of the gate (X-values of the gate_opening_curve).\n", "\n", "It is possible to define limits for min and max flow in tunnels by the attributes [min_flow](tunnel:min_flow) and [max_flow](tunnel:max_flow). The attributes [min_flow_penalty_cost](tunnel:min_flow_penalty_cost) and [max_flow_penalty_cost](tunnel:max_flow_penalty_cost) can be set to add the possibility of breaking the min_flow and max_flow constraints by taking a penalty, otherwise the constraints are hard limits.\n", "\n", "### Involving multiple tunnels\n", "\n", "Some rules for operating the tunnel system depend on the state of several tunnels simultaneously. A common situation is that not all reservoirs above a plant can have open tunnels at the same time. To represent these constraints, the involved objects must be connected to an [](interlock_constraint). The simplest case contains two reservoirs, of which only one can be connected to the plant at any given time. After adding a interlock_constraint and connecting the tunnels from each reservoir to that constraint, set the [min_open](interlock_constraint:min_open) and the [max_open](interlock_constraint:max_open) both equal to 1.\n", "\n", "## Results\n", "\n", "SHOP optimizes the gate opening in all tunnels, and this [gate_opening](tunnel:gate_opening) factor between 0 and 1 is reported. The optimized [flow](tunnel:flow) in every tunnel is also saved. The [end_pressure](tunnel:end_pressure) and [physical_flow](tunnel:physical_flow) for all tunnels is also post-calculated by simulating the non-linear tunnel network equations based on optimized reservoir level and plant discharge results. A difference between flow and physical_flow means that the linearized optimization problem predicts a different flow than the non-linear post-simulation.\n", "\n", "## Examples\n", " - [](simple-tunnel)\n", " - [](junction-example)\n", " - [](advanced-tunnel)\n", " - [](creek-intake-example)\n", " \n", "\n", "## References\n", " - Handling state dependent nonlinear tunnel flows in short-term hydropower scheduling {cite}`Belsnes2004`\n", " - Modelling Minimum Pressure Height in Short-term Hydropower Production Planning {cite}`Dorn2016`\n", " - Modelling tunnel network flow and minimum pressure height in short-term hydropower scheduling {cite}`Aaslid2019a`\n", " \n", "\n", "## Attributes" ] }, { "cell_type": "code", "execution_count": 1, "id": "b43bba9c", "metadata": { "tags": [ "remove-input", "full-width" ] }, "outputs": [ { "data": { "text/html": [ "