gtopt/turbine.hpp file

Defines the Turbine structure representing a hydroelectric turbine.

This module defines the Turbine structure which couples a hydraulic waterway to an electrical generator, converting water flow [m³/s] into electrical power [MW].

Conversion relationship

power [MW] = efficiency [p.u.] × production_factor [MW·s/m³] × flow [m³/s]

The effective conversion rate is efficiency × production_factor. If efficiency is not set, it defaults to 1.0.

Variable production factor (hydraulic head)

When main_reservoir is set, the turbine's conversion rate can vary with the reservoir volume (hydraulic head). The piecewise-linear production factor curve is provided by a matching ReservoirProductionFactor element. During SDDP forward iterations the conversion-rate LP coefficient is updated based on the current reservoir volume.

Connection modes

A turbine connects to the water system via one of:

  • waterway — traditional mode: reads water flow from a separate Waterway element's flow column in the junction balance LP.
  • flow — simplified mode: reads discharge directly from a Flow element's fixed schedule. No junctions or waterways needed. Useful for simple run-of-river (pasada) units.
  • junction_a (+ optional junction_b) — built-in waterway mode: the turbine owns its own per-block flow column (Turbine/flow, units m³/s) that debits junction_a, credits junction_b (when set), and converts to power — replacing the separate penstock Waterway. junction_b unset = terminal/drain (no synthetic ocean junction needed). Mode priority: flow > junctions > waterway.

When flow is set, waterway and junction_a/b are ignored. When junction_a is set (without flow), the turbine owns its own flow column and the (possibly-stale) waterway reference is ignored. The turbine's power constraint becomes: power = efficiency × production_factor × flow (equality, or ≤ when drain=true). Aperture updates automatically change the flow discharge in flow mode, so the turbine power bound varies correctly across scenarios.

JSON Example (waterway mode)

{
  "uid": 1,
  "name": "t1",
  "waterway": "w1_2",
  "generator": "g_hydro",
  "production_factor": 0.0025,
  "capacity": 100,
  "main_reservoir": "res1"
}

JSON Example (flow mode — pasada)

{
  "uid": 2,
  "name": "t_pasada",
  "flow": "f_river",
  "generator": "g_pasada",
  "production_factor": 1.0
}

JSON Example (built-in waterway, terminal drain)

{
  "uid": 3,
  "name": "t_terminal",
  "junction_a": "res_intake",
  "generator": "g_hydro_terminal",
  "production_factor": 2.0
}

junction_b is omitted, so the turbined flow drains directly out of the modelled system (no synthetic ocean / sink junction needed).

JSON Example (built-in waterway, cascade)

{
  "uid": 4,
  "name": "t_cascade",
  "junction_a": "res_upstream",
  "junction_b": "res_downstream",
  "generator": "g_hydro_cascade",
  "production_factor": 2.0
}

Fields that accept a number/array/string value can hold:

  • A scalar constant
  • A 1-D inline array indexed by [stage]
  • A filename string referencing a Parquet/CSV schedule in input_directory/Turbine/

Namespaces

namespace gtopt

Classes

struct gtopt::Turbine
Hydroelectric turbine converting water flow into electrical power.