Flow struct
#include <gtopt/flow.hpp>
Exogenous water flow at a hydraulic junction.
Positive direction (direction = +1) models natural river inflow; negative direction (direction = -1) models mandatory minimum discharge releases or evaporation losses.
Public static variables
- static LPClassName class_name
Public functions
- auto is_input() const -> bool noexcept
Public variables
- OptActive active
- Activation status (default: active).
- OptName description
- OptInt direction
- Flow direction: +1 = inflow, −1 = outflow [dimensionless].
- OptSTBRealFieldSched discharge
- OptTBRealFieldSched fcost
- OptInflowModel inflow_model
- OptSingleId junction
- Name name
- Human-readable name.
- OptName type
- Optional element type/category tag.
- Uid uid
- Unique identifier.
Function documentation
bool gtopt:: Flow:: is_input() const noexcept
| Returns | true if flow is directed into the junction (inflow) |
|---|
Variable documentation
static LPClassName gtopt:: Flow:: class_name
Canonical class-name constant used in LP row labels and config fields like VariableScale::class_name. Single source of truth — FlowLP exposes no separate ClassName member; callers reach the constant via Flow::class_name directly (or FlowLP::Element::class_name in generic contexts).
OptName gtopt:: Flow:: description
Optional free-text description (e.g. conversion provenance)
OptSTBRealFieldSched gtopt:: Flow:: discharge
Water discharge schedule [m³/s]. Optional: when unset AND fcost is set, the LP column upper bound defaults to +inf (DblMax) — useful for non-physical inflow slacks that don't need an explicit cap. When unset AND fcost is also unset, the Flow contributes no column for that block (no bound information available).
OptTBRealFieldSched gtopt:: Flow:: fcost
Optional per-(stage, block) flow cost [$/(m³/s)/h]. When set, the LP-side Flow column relaxes from the default hard equality lowb = uppb = discharge to a soft band lowb = 0, uppb = discharge (or +inf if discharge is unset) and the column receives a positive objective coefficient fcost × cost_factor(scenario, stage, block) so the LP pays fcost · flow · duration per block. Models PLEXOS-style "Non-physical Inflow Penalty" — a costed slack column that the solver only activates when the junction balance cannot otherwise close. When unset the legacy hard-forced semantics are preserved (no cost, flow = discharge exactly).
OptInflowModel gtopt:: Flow:: inflow_model
Opt-in AR(1) inflow model (see InflowModel). Absent = the historical fixed-schedule behaviour, byte-identical LP.
OptSingleId gtopt:: Flow:: junction
ID of the connected junction (optional for flow-turbine mode)