source/emission_source_lp.cpp file

Substitute-out wiring for EmissionSource — every per-MWh emission contribution is stamped directly onto the generator dispatch column.

For each (scenario, stage, block), the per-source contribution to its zone is the scalar

α_{s,b} = weight_z,p · (1 − capture_s,p) · (rate_s + upstream_s) · dur_b [tCO₂-eq per MW of dispatch]

which is wired in three places, each only when active:

  • cap row (if EmissionZone.cap set): cap_row[gen_col] += α_{s,b}
  • carbon tax (if EmissionZone.price set OR objective_mode = "emissions"): gen_col.cost += block_ecost(price · α_rate) (where α_rate = α / dur is the dur-free $/MWh form; block_ecost adds the per-block duration · probability · discount factors.)
  • allowance-pool drawdown (if EmissionZone.allowance_pool set): pool.energy_row_{b}[gen_col] += α_{s,b}
  • CCS opex (always, when Generator.emission_captures[] carries a row for this pollutant with non-zero cost): gen_col.cost += block_ecost(capture · effective_rate · capture_cost)

Mirrors the existing CCS pattern (see the lp.col_at(gcol).cost += ... adder below). When the zone is pure reporting (no cap, no price, no pool, not emissions-objective), nothing is wired into the LP and only the per-block factor cache is populated — the cache feeds the per-source output streams in add_to_output.

Namespaces

namespace gtopt