diff --git a/src/devices_models/devices/common/objective_function/piecewise_linear.jl b/src/devices_models/devices/common/objective_function/piecewise_linear.jl index f39378f2c..ce3928201 100644 --- a/src/devices_models/devices/common/objective_function/piecewise_linear.jl +++ b/src/devices_models/devices/common/objective_function/piecewise_linear.jl @@ -537,7 +537,8 @@ function _add_variable_cost_to_objective!( end pwl_fuel_consumption_expressions = _add_pwl_term!(container, component, cost_function, T(), U()) - is_time_variant = PSY.has_time_series(component) + + is_time_variant = is_time_variant(cost_function) for t in get_time_steps(container) fuel_cost_value = _get_fuel_cost_value( container, diff --git a/src/utils/powersystems_utils.jl b/src/utils/powersystems_utils.jl index 5d7fedf43..b7fd19292 100644 --- a/src/utils/powersystems_utils.jl +++ b/src/utils/powersystems_utils.jl @@ -338,6 +338,10 @@ function _get_piecewise_incrementalcurve_per_system_unit( return PSY.PiecewiseStepData(x_coords_normalized, y_coords_normalized) end +function is_time_variant(cost_function::PSY.FuelCurve{PSY.PiecewisePointCurve}) + return isa(PSY.get_fuel_cost(cost_function), IS.TimeSeriesKey) +end + function get_deterministic_time_series_type(sys::PSY.System) time_series_types = IS.get_time_series_counts_by_type(sys.data) @show existing_types = Set(d["type"] for d in time_series_types)