hydro

This module contains functions related to hydropower technologies.

  1. Water balance of reservoirs.

Similar to the storage technologies, changes in reservoir storage (\({\rm{storage}}_{s,h,m,y}^{\rm{reservoir}}\)) in two successive periods should be balanced by total inflow (\({\rm{inflow}}_{s,h,m,y}^{\rm{total}}\)) and total outflow (\({\rm{outflow}}_{s,h,m,y}^{\rm{total}}\)):

\[{\rm{storage}}_{s,h,m,y}^{\rm{reservoir}}- {\rm{storage}}_{s,h-1,m,y}^{\rm{reservoir}}= \Delta h\times3600\times\left({\rm{inflow}}_{s,h,m,y}^{\rm{total}} -{\rm{outflow}}_{s,h,m,y}^{\rm{total}}\right)\quad\forall s,h,m,y\]

Here \({\rm{inflow}}_{s,h,m,y}^{\rm{total}}\) consists of two parts: the total outflow received from all immediate upstream reservoirs (\(\sum_{{\rm{su}}\in{\mathcal{IU}}_s}{{\rm{outflow}}_ {{\rm{su}},h-\tau_{{\rm{su}},s},m,y}^{\rm{total}}}\)) and the net inflow (also called incremental inflow) of the drainage area controlled by this hydropower reservoir (\({{\rm{INFLOW}}}_{s,h,m,y}^{\rm{net}}\)), which can be expressed as follows:

\[{\rm{inflow}}_{s,h,m,y}^{\rm{total}} ={{\rm{INFLOW}}}_{s,h,m,y}^{\rm{net}}+\sum_{{\rm{su}}\in {\mathcal{IU}}_s}{{\rm{outflow}}_{{\rm{su}},h- \tau_{{\rm{su}},s},m,y}^{\rm{total}}}\quad\forall s,h,m,y\]

Note that PREP-SHOT assumes a constant water travel (or propagation) time (\({\tau}_{{\rm{su}},s}\)). The total outflow of each reservoir consists of three parts: upstream water withdrawal (i.e., water used for non-hydro purposes such as agriculture irrigation and urban water supply) (\({\rm{outflow}}_{s,h,m,y}^{\rm{withdraw}}\)), generation flow (i.e., water flow through the turbines of the hydropower plant) (\({\rm{outflow}}_{s,h,m,y}^{\rm{gen}}\)) and spillage flow (i.e., water spilled over the spillways) (\({\rm{outflow}}_{s,h,m,y}^{\rm{spillage}}\)):

\[{\rm{outflow}}_{s,h,m,y}^{\rm{total}} ={\rm{outflow}}_{s,h,m,y}^{\rm{withdraw}} +{\rm{outflow}}_{s,h,m,y}^{\rm{gen}} +{\rm{outflow}}_{s,h,m,y}^{\rm{spillage}}\quad\forall s,h,m,y\]
  1. Reservoir outflow

The generation flow and spillage flow of the reservoir are limited by the maximum outflow capacity of turbines (\({\rm{OUTFLOW}}_s^{\rm{gen}}\)) and spillway (\({\rm{OUTFLOW}}_s^{\rm{spillage}}\)), respectively. The sum of these two parts also needs to meet the minimum outflow required (\({{\rm{OUTFLOW}}}_s\)) for other purposes (e.g., ecological flow, shipping flow). These constraints are summarized as:

\[ \begin{align}\begin{aligned}{\rm{outflow}}_{s,h,m,y}^{\rm{gen}}\le{\rm{OUTFLOW}}_s^{\rm{gen}} \quad\forall s,h,m,y\\{\rm{outflow}}_{s,h,m,y}^{\rm{spillage}}\le {\rm{OUTFLOW}}_s^{\rm{spillage}}\quad\forall s,h,m,y\\{{\rm{OUTFLOW}}}_s\le {\rm{outflow}}_{s,h,m,y}^{\rm{gen}} +{\rm{outflow}}_{s,h,m,y}^{\rm{spillage}}\quad\forall s,h,m,y\end{aligned}\end{align} \]
  1. Reservoir storage

The initial (when \(h=h_{\rm{start}}\)) and terminal (when \(h=h_{\rm{end}}\)) storage (\({\rm{storage}}_{s,h=h_{\rm{start}},m,y}^{\rm{reservoir}}\) and \({\rm{storage}}_{s,h=h_{\rm{end}},m,y}^{\rm{reservoir}}\)) of hydropower reservoir in each month of each year should be assigned as:

\[ \begin{align}\begin{aligned}{\rm{storage}}_{s,h=h_{\rm{start}},m,y}^{\rm{reservoir}} ={{\rm{STORAGE}}}_{s,m,y}^{\rm{initreservoir}}\quad\forall s,m,y\\{\rm{storage}}_{s,h=h_{\rm{end}},m,y}^{\rm{reservoir}} ={{\rm{STORAGE}}}_{s,m,y}^{\rm{endreservoir}}\quad\forall s,m,y\end{aligned}\end{align} \]

The reservoir storage is bounded between the maximum (\({\overline{{\rm{STORAGE}}}}_s^{\rm{reservoir}}\)) and minimum storage (\({\underline{{\rm{STORAGE}}}}_s^{\rm{reservoir}}\)) depending on the functions (e.g., flood control, recreation, and water supply) of the reservoir:

\[{\underline{{\rm{STORAGE}}}}_s^{\rm{reservoir}}\le {\rm{storage}}_{s,h,m,y}^{\rm{reservoir}}\le {\overline{{\rm{STORAGE}}}}_s^{\rm{reservoir}}\quad\forall s,h,m,y\]
class prepshot._model.hydro.AddHydropowerConstraints(model)[source]

Bases: object

Class for hydropower constraints and calculations.

Parameters

model (object) --

__init__(model)[source]

Initialize the class. Here I define the variables needed and the constraints for the hydropower model.

Parameters

model (object) -- Model container which is a dict-like objective and includes parameters, variables and constraints.

Return type

None

end_storage_rule(s, m, y)[source]

Determine storage of reservoir in the terminal hour of each month.

Parameters
  • s (str) -- hydropower plant.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

genflow_up_bound_rule(s, h, m, y)[source]

Upper bound of generation flow.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

hydro_output_rule(h, m, y, z)[source]

Hydropower output of all hydropower plants across each zone.

Parameters
  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

  • z (str) -- Zone.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

inflow_rule(s, h, m, y)[source]

Define hydrolic connnect between cascade reservoirs, total inflow of downsteam reservoir = natural inflow + upstream outflow from upsteam reservoir(s).

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

Total inflow of reservoir.

Return type

poi.ExprBuilder

init_storage_rule(s, m, y)[source]

Determine storage of reservoir in the initial hour of each month.

Parameters
  • s (str) -- hydropower plant.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

outflow_low_bound_rule(s, h, m, y)[source]

Lower bound of total outflow.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

outflow_rule(s, h, m, y)[source]

Total outflow of reservoir is equal to the sum of generation and spillage.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

Total outflow of reservoir.

Return type

poi.ExprBuilder

outflow_up_bound_rule(s, h, m, y)[source]

Upper bound of total outflow.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

output_calc_rule(s, h, m, y)[source]

Hydropower production calculation. Head parameter is specified after building the model.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

output_low_bound_rule(s, h, m, y)[source]

Lower bound of hydropower output.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

output_up_bound_rule(s, h, m, y)[source]

Upper bound of hydropower output.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

storage_low_bound_rule(s, h, m, y)[source]

Lower bound of reservoir storage.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

storage_up_bound_rule(s, h, m, y)[source]

Upper bound of reservoir storage.

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex

water_balance_rule(s, h, m, y)[source]

Water balance of reservoir, i.e., storage[t] = storage[t-1] + net_storage[t].

Parameters
  • s (str) -- hydropower plant.

  • h (int) -- Hour.

  • m (int) -- Month.

  • y (int) -- Year.

Returns

The constraint of the model.

Return type

poi.ConstraintIndex