Skip to content

Commit

Permalink
Update interface and multistage input for vre_stor (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo authored Mar 17, 2024
1 parent 692a935 commit 561d1b1
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
,Network_zones,CO_2_Cap_Zone_1,CO_2_Cap_Zone_2,CO_2_Cap_Zone_3,CO_2_Max_tons_MWh_1,CO_2_Max_tons_MWh_2,CO_2_Max_tons_MWh_3,CO_2_Max_Mtons_1,CO_2_Max_Mtons_2,CO_2_Max_Mtons_3
MA,z1,1,0,0,0.05,0,0,0.018,0,0
CT,z2,0,1,0,0,0.05,0,0,0.025,0
ME,z3,0,0,1,0,0,0.05,0,0,0.025
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
MinCapReqConstraint,ConstraintDescription,Min_MW
1,MA_PV,5000
2,CT_Wind,10000
3,All_Batteries,6000
4 changes: 2 additions & 2 deletions src/load_inputs/load_resources_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ function process_piecewisefuelusage!(setup::Dict, gen::Vector{<:AbstractResource
inputs["intercept_cols"] = intercept_cols
inputs["PWFU_data"] = PWFU_data
inputs["PWFU_Num_Segments"] = num_segments
inputs["THERM_COMMIT_PWFU"] = intersect(ids_with_unit_commitment(gen), resource_id.(gen[HAS_PWFU]))
inputs["THERM_COMMIT_PWFU"] = intersect(ids_with_unit_commitment(gen), HAS_PWFU)

@info "Piecewise fuel usage data successfully read!"
end
Expand Down Expand Up @@ -898,7 +898,7 @@ function add_resources_to_input_data!(inputs::Dict, setup::Dict, case_path::Abst
inputs["HYDRO_RES"] = hydro(gen)
# Set of hydro resources modeled with known reservoir energy capacity
if !isempty(inputs["HYDRO_RES"])
inputs["HYDRO_RES_KNOWN_CAP"] = intersect(inputs["HYDRO_RES"], ids_with(gen, hydro_energy_to_power_ratio))
inputs["HYDRO_RES_KNOWN_CAP"] = intersect(inputs["HYDRO_RES"], ids_with_positive(gen, hydro_energy_to_power_ratio))
end

## STORAGE
Expand Down
9 changes: 3 additions & 6 deletions src/model/resources/resources.jl
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,8 @@ for attr in (:max_cap_solar_mw,
:max_cap_charge_dc_mw,
:max_cap_charge_ac_mw,
:max_cap_discharge_dc_mw,
:max_cap_discharge_ac_mw)
@eval @interface $attr
end

for attr in (:min_cap_solar_mw,
:max_cap_discharge_ac_mw,
:min_cap_solar_mw,
:min_cap_wind_mw,
:min_cap_inverter_mw,
:min_cap_charge_dc_mw,
Expand All @@ -808,7 +805,7 @@ for attr in (:min_cap_solar_mw,
:min_cap_discharge_ac_mw,
:inverter_ratio_solar,
:inverter_ratio_wind,)
@eval @interface $attr
@eval @interface $attr default_minmax_cap
end

for attr in (:etainverter,
Expand Down
2 changes: 1 addition & 1 deletion src/model/utility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ end
function by_rid_res(rid::Integer, sym::Symbol, rs::Vector{<:AbstractResource})
r = rs[findfirst(resource_id.(rs) .== rid)]
# use getter function for attribute `sym` if exists in GenX, otherwise get the attribute directly
f = isdefined(GenX, sym) ? getfield(GenX, sym) : r -> getproperty(r, sym)
f = isdefined(GenX, sym) ? getfield(GenX, sym) : x -> getproperty(x, sym)
return f(r)
end

14 changes: 7 additions & 7 deletions src/multi_stage/configure_multi_stage_inputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ function configure_multi_stage_inputs(inputs_d::Dict, settings_d::Dict, NetworkE
gen_VRE_STOR.inv_cost_discharge_ac_per_mwyr = compute_overnight_capital_cost(settings_d, inv_cost_discharge_ac_per_mwyr.(gen_VRE_STOR), capital_recovery_period_discharge_ac.(gen_VRE_STOR), tech_wacc_discharge_ac.(gen_VRE_STOR))
gen_VRE_STOR.inv_cost_charge_ac_per_mwyr = compute_overnight_capital_cost(settings_d, inv_cost_charge_ac_per_mwyr.(gen_VRE_STOR), capital_recovery_period_charge_ac.(gen_VRE_STOR), tech_wacc_charge_ac.(gen_VRE_STOR))

gen_VRE_STOR.fixed_om_inverter_cost_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_solar_cost_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_wind_cost_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_cost_discharge_dc_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_cost_charge_dc_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_cost_discharge_ac_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_cost_charge_ac_per_mwyr .*= OPEXMULT
gen_VRE_STOR.fixed_om_inverter_cost_per_mwyr = fixed_om_inverter_cost_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_solar_cost_per_mwyr = fixed_om_solar_cost_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_wind_cost_per_mwyr = fixed_om_wind_cost_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_cost_discharge_dc_per_mwyr = fixed_om_cost_discharge_dc_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_cost_charge_dc_per_mwyr = fixed_om_cost_charge_dc_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_cost_discharge_ac_per_mwyr = fixed_om_cost_discharge_ac_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
gen_VRE_STOR.fixed_om_cost_charge_ac_per_mwyr = fixed_om_cost_charge_ac_per_mwyr.(gen_VRE_STOR) .* OPEXMULT
end
end

Expand Down

0 comments on commit 561d1b1

Please sign in to comment.