flexops.costing.add_fuel_cost

flexops.costing.add_fuel_cost(*, block: Block, fuel_power, time_index: DatetimeIndex, dt_hours: float, tariff: DataFrame, fuel_type: str = 'gas', dr_config: DRConfig | None = None, prorate: bool = True, decomposition_type: str | None = None, consumption_estimate: dict[str, float] | None = None) → OperatingCostHandles

Build EECO’s convex-relaxed in-objective fuel cost on block.

Mirrors add_electricity_cost() for a fuel utility: same rules (EECO owns the math, no cost math here, DR is a no-op container in v0), same OperatingCostHandles shape (fuel-flavored). tariff is the same rate_data object; EECO selects the underlying utility’s rows.

Parameters:
  • block – The Pyomo block to build cost expressions on.

  • fuel_power – Time-indexed fuel-usage Var/Expression carrying no units — a bare volumetric-flow magnitude in m³/hr — indexed 0..N-1.

  • time_index – Naive pd.DatetimeIndex aligning to fuel_power.

  • dt_hours – Timestep length in hours; passed to EECO once.

  • tariff – An EECO rate_data DataFrame (must carry the utility’s rows).

  • fuel_type – The fuel’s EECO utility. "gas" (the default) is the only value EECO 0.4.2 supports; every registered fuel (natural gas, biogas, …) bills through it today.

  • dr_config – Optional DR container (v0: no constraints built).

  • prorate – Prorate monthly demand and fixed charges to the horizon length (see monthly_scale_factor()).

  • decomposition_type – See add_electricity_cost(); splits fuel usage into imports and exports so a tariff’s export charges apply.

  • consumption_estimate – See add_operating_cost(); only the entry for fuel_type’s EECO utility, if any, applies here.

Returns:

The OperatingCostHandles for the fuel utility.

Raises:
  • FlexConfigError – If fuel_type is not a supported EECO utility, or EECO produced a nonlinear demand term.

  • FlexDataError – If time_index is timezone-aware.