reservoir.hpp file
Defines the Reservoir structure representing a water reservoir.
This file defines the gtopt::Reservoir structure, which models a water reservoir within a hydro-thermal power system. A reservoir stores water that drives turbines, subject to volume limits, spill constraints, and evaporation losses.
Unit conventions
- Volume fields (
emin,emax,eini,efin,capacity): hm³ (cubic hectometre = 10⁶ m³). Legacy comments may say "dam³" but the actual unit is hm³, as demonstrated byflow_conversion_rate = 0.0036:3600 m³ / 10⁶ = 0.0036. - Flow fields (
spillway_capacity,fmin,fmax): m³/s - The default
flow_conversion_rate = 0.0036converts m³/s × h → hm³:volume = 0.0036 × flow_m3s × duration_h
Scaling
LP variable scaling for reservoir energy/volume variables is controlled via PlanningOptions::variable_scales. No per-element energy_scale field is exposed — use the variable_scales option array instead:
"variable_scales": [ {"class_name": "Reservoir", "variable": "energy", "uid": 1, "scale": 1000} ]
JSON Example
{ "uid": 1, "name": "res1", "junction": "j1", "emin": 100, "emax": 5000, "eini": 2500 }
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/Reservoir/
Namespaces
- namespace gtopt
Classes
- struct gtopt::Reservoir
- Water reservoir in a hydro cascade system.