Fuel struct
#include <gtopt/fuel.hpp>
Time-schedulable fuel price, heat content, and emission factors.
Referenced by Generator.fuel. Every field is stage-schedulable (scalar / per-stage vector / file).
Public static variables
- static LPClassName class_name
Public variables
- OptActive active
- Activation status.
- OptTRealFieldSched combustion_emission_factor
- OptName description
- Array<FuelEmissionFactor> emission_factors
- OptTRealFieldSched heat_content
- OptTRealFieldSched max_offtake
- OptTRealFieldSched max_offtake_cost
- OptBool max_offtake_per_block
- OptTRealFieldSched min_offtake
- OptTRealFieldSched min_offtake_cost
- OptBool min_offtake_per_block
- Name name
- Human-readable name.
- OptTBRealFieldSched price
- OptName subtype
- OptName type
- Uid uid
- Unique identifier.
- OptTRealFieldSched upstream_emission_factor
Variable documentation
static LPClassName gtopt:: Fuel:: class_name
Canonical class-name constant used in LP row labels and config fields like VariableScale::class_name. Single source of truth — FuelLP exposes no separate ClassName member; callers reach the constant via Fuel::class_name directly (or FuelLP::Element::class_name in generic contexts).
OptTRealFieldSched gtopt:: Fuel:: combustion_emission_factor
Legacy single-pollutant combustion CO₂ factor [tCO₂/<fuel_unit>]. Auto-folded by System::fold_legacy_fuel_emission_factors() into emission_factors[] (matching emission "co2") at parse time and cleared. Prefer the new emission_factors[] for new configs — it supports multi-pollutant.
OptName gtopt:: Fuel:: description
Optional free-text description (e.g. conversion provenance)
Array<FuelEmissionFactor> gtopt:: Fuel:: emission_factors
Multi-pollutant per-fuel emission factors. One row per Emission kind, with optional combustion + upstream factors. Combined with scalar Generator.heat_rate (× heat_content) by System::expand_fuel_emission_sources into synthesized EmissionSource rows — one per covering EmissionZone — which then feed that zone's cap row / allowance pool / price adder. Generators with heat_rate_segments are skipped with a warning.
OptTRealFieldSched gtopt:: Fuel:: heat_content
Heat content [GJ/<fuel_unit>], stage-schedulable. Optional — when set, enables physical/energy fuel-consumption reporting in the output parquets. When unset, only physical-unit consumption is emitted. Mirrors PLEXOS Fuel.Heat Content and SDDP Poder Calorífico. Recommended: set explicitly for any fuel whose price/EF are NOT already in GJ-basis so downstream reporting can convert correctly.
OptTRealFieldSched gtopt:: Fuel:: max_offtake
Maximum fuel consumption per stage [<fuel_unit>/stage], stage-schedulable. When set, FuelLP creates a per-(scenario, stage) constraint row enforcing
Σ_{g : Generator(g).fuel = this_fuel} (heat_rate_g(s, b) · generation_g(s, t, b) · duration_b) ≤ max_offtake(s)
summed across every active generator referencing this Fuel and every block in the stage. Mirrors PLEXOS's FueMaxOffWeek_<fuel> / FueMaxOffDay_<fuel> Constraint pattern, where the natural stage period (week / day) bounds the total fuel offtake from a single contract band.
Stage = the natural fuel-contract period (week in CEN PCP daily, month in long-term cases). Unit-flexibility contract applies: <fuel_unit> must match price, heat_rate, etc. for this fuel.
OptTRealFieldSched gtopt:: Fuel:: max_offtake_cost
Per-unit penalty for exceeding max_offtake [$/<fuel_unit>], stage-schedulable. When set and > 0 the cap becomes SOFT: a non-negative slack column with this cost is added to the cap row so the LP can over-consume at a per-unit price rather than going infeasible. When unset, the cap is HARD. Mirrors the Reservoir.efin_cost / EmissionZone.cap_cost convention.
OptBool gtopt:: Fuel:: max_offtake_per_block
When true, enforce the offtake cap per block instead of summed over the stage. The per-stage cap max_offtake is pro-rated by each block's share of stage duration:
block_cap_b = max_offtake(s) · duration_b / Σ_b duration_b
and FuelLP creates one row per (scenario, stage, block):
Σ_g (heat_rate_g(s, b) · gen_g(s, t, b) · duration_b) ≤ block_cap_b
Mirrors PLEXOS's per-period FueMaxOffWeek_<fuel> semantics: the weekly cap is enforced as a per-hour rate distributed uniformly across the week's hours, forcing the LP to spread offtake rather than front-loading it. This is TIGHTER than the default per-stage sum — the per-stage sum would let the LP pile cheap-fuel dispatch into a few hours, the per-block view would not.
When false / unset (default), the legacy per-stage sum behaviour applies: a single row per (scenario, stage) with the full max_offtake(s) on the right-hand side. Soft-cap slack (max_offtake_cost) is supported in both modes — for per-block the slack is shared across the per-block rows via a single stage-scoped column.
OptTRealFieldSched gtopt:: Fuel:: min_offtake
Minimum fuel consumption per stage [<fuel_unit>/stage], stage-schedulable. When set, FuelLP creates a per-(scenario, stage) lower-bound row enforcing
Σ_{g : Generator(g).fuel = this_fuel} (heat_rate_g(s, b) · generation_g(s, t, b) · duration_b) ≥ min_offtake(s)
summed across every active generator referencing this Fuel and every block in the stage. Mirrors PLEXOS's Fuel.Min Offtake {Hour, Day, Week, Month, Year} family (property IDs 595-600), used to model take-or-pay (ToP) contracts where the buyer commits to a minimum purchase quantity per period and pays a penalty for shortfall. Mirrors PSR SDDP's per-period TOP minima (without the SDDP make-up bank — that is a future state-column extension).
Canonical reference: Dong, W. and Kang, B. "Analysis of a multiple year gas sales agreement with make-up, carry-forward and indexation", Energy Economics 79 (2019), 76-96 (DOI 10.1016/j.eneco.2018.04.001).
Stage = the natural fuel-contract period. Unit-flexibility contract applies: <fuel_unit> must match price, heat_rate, etc. for this fuel. When both min_offtake and max_offtake are set on the same fuel, FuelLP emits two separate rows that share the per-block offtake DV (Y_f[b]) — same pattern as Commitment.{min,max}_starts.
OptTRealFieldSched gtopt:: Fuel:: min_offtake_cost
Per-unit penalty for SHORTFALL below min_offtake [$/<fuel_unit>], stage-schedulable. When set and > 0 the floor becomes SOFT: a non-negative slack column with this cost is added to the floor row so the LP can under-consume at a per-unit price rather than going infeasible. When unset, the floor is HARD (gtopt-native convention).
PLEXOS asymmetry note: PLEXOS's Fuel.Min Offtake Penalty (property 602) defaults to 1000 $/fuel-unit (NOT unset/hard like Max Offtake Penalty). gtopt keeps the symmetric "unset = hard" convention for both directions; the converter plexos2gtopt is responsible for injecting min_offtake_cost = 1000 when a PLEXOS bundle ships a Min Offtake without an explicit penalty, so PLEXOS-faithful behaviour is preserved at the conversion boundary rather than baked into the LP model.
OptBool gtopt:: Fuel:: min_offtake_per_block
When true, enforce the floor per block instead of summed over the stage. The per-stage floor min_offtake is pro-rated by each block's share of stage duration:
block_floor_b = min_offtake(s) · duration_b / Σ_b duration_b
and FuelLP creates one lower-bound row per (scenario, stage, block):
Σ_g (heat_rate_g(s, b) · gen_g(s, t, b) · duration_b) ≥ block_floor_b
When false / unset (default), the per-stage sum applies (one row per scenario × stage). Soft-floor slack (min_offtake_cost) is supported in both modes.
min_offtake_per_block is independent of max_offtake_per_block: e.g., a fuel may have a per-block min (hourly take-or-pay floor) alongside a per-stage sum max (weekly delivery cap).
OptTBRealFieldSched gtopt:: Fuel:: price
Fuel price [$/<fuel_unit>], per-(stage, block) schedulable. The fuel-unit is the user's choice (tonne, MMBtu, Nm³, GJ, …) and must match heat_rate, combustion_emission_factor, upstream_emission_factor, and heat_content for this fuel.
Accepts the same value forms as Generator.pmax: a scalar constant, a [stage] 1-D array, a [stage][block] 2-D matrix, or a filename string referencing a Parquet/CSV schedule under input_directory/Fuel/. Scalar / per-stage values broadcast to every block (back-compat with the legacy per-stage price). This lets a single-stage PLEXOS conversion carry the per-period Fuel_Price profile across the horizon instead of collapsing it to one value.
OptName gtopt:: Fuel:: subtype
Optional fine-grained sub-classification of type — e.g. type="gas" paired with subtype="lng", type="carbon" with subtype="sub_bituminous". Carries the converter-side Fuel.subtype hint emitted by plexos2gtopt.parsers._fuel_subtype_from_name and consumed by the IPCC-emission-defaults overlay in scripts/gtopt_shared/data/emissions/cen_chile.json (CEN-Chile sub-bituminous coal, LNG upstream chain). Metadata only — not consumed by the LP build; round-trips through the JSON for downstream reporting and auditing.
OptTRealFieldSched gtopt:: Fuel:: upstream_emission_factor
Legacy single-pollutant upstream CO₂ factor — same fold path as combustion_emission_factor.