Skip to content

Commit

Permalink
Merge pull request #204 from NREL/update-v2025.0.0
Browse files Browse the repository at this point in the history
Update to v2025.0.0
  • Loading branch information
kennedy-mindermann authored Jan 23, 2025
2 parents e9ae6fe + 700c294 commit f748ff4
Show file tree
Hide file tree
Showing 101 changed files with 25,505 additions and 27,832 deletions.
39 changes: 29 additions & 10 deletions ReEDS_Augur/prep_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import gdxpds
### Local imports
import ReEDS_Augur.functions as functions
from input_processing.ldc_prep import read_file


#%%### Procedure
Expand Down Expand Up @@ -60,7 +61,13 @@ def main(t, casedir):
hmap_7yr = pd.read_csv(os.path.join(inputs_case, 'hmap_7yr.csv'))
hmap_7yr['szn'] = h_dt_szn['season'].copy()

load = pd.read_hdf(os.path.join(inputs_case, 'load.h5'))
h_dt_szn = h_dt_szn.set_index(['year', 'hour'])
# Add explicit timestamp index
h_dt_szn['timestamp'] = pd.to_datetime(
h_dt_szn.index.map(hmap_7yr.set_index(['year', 'hour'])['*timestamp']))
h_dt_szn = h_dt_szn.reset_index().set_index('timestamp')

load = read_file(os.path.join(inputs_case, 'load.h5'), parse_timestamps=True)

resources = pd.read_csv(os.path.join(inputs_case, 'resources.csv'))

Expand Down Expand Up @@ -183,21 +190,24 @@ def intify(v):
h5out['vre_cf_marg'] = vre_cf_marg


h_dt_szn_load_years = h_dt_szn.loc[h_dt_szn.index.isin(load.index.get_level_values('datetime'))]
#%%### H2 and DAC load
### First just make it all inflexible (necessary for PRAS)
load_h2dac_all_hourly = (
gdxreeds['prod_filt']
.groupby(['r','allh']).Value.sum().unstack('r')
## Broadcast to hours in timeslice
.reindex(h_dt_szn.h).fillna(0).reset_index(drop=True)
.groupby(['r', 'allh']).Value.sum().reset_index()
.merge(h_dt_szn_load_years[['h']].reset_index(), left_on='allh', right_on='h')
.pivot(index='timestamp', columns='r', values='Value')
.fillna(0)
)


#%%### Total load and net load
### Get Candian exports and add to this solve year's load
can_exports = (
gdxreeds['can_exports_h_filt'].pivot(index='allh',columns='r',values='Value')
.reindex(h_dt_szn.h).reset_index(drop=True)
gdxreeds['can_exports_h_filt']
.merge(h_dt_szn_load_years[['h']].reset_index(), left_on='allh', right_on='h')
.pivot(index='timestamp', columns='r', values='Value')
)
load_year = load.loc[t].add(can_exports, fill_value=0)

Expand All @@ -207,14 +217,23 @@ def intify(v):
pras_load = load_year.add(load_h2dac_all_hourly, fill_value=0)
else:
pras_load = load_year.copy()
pras_load.index = h_dt_szn.set_index(['season','year','h','hour']).index
pras_load = (
pras_load.merge(
h_dt_szn[['season', 'year', 'h', 'hour']], left_index=True, right_index=True
)
.set_index(['season', 'year', 'h', 'hour'])
)
h5out['pras_load'] = pras_load
## Include the hourly H2/DAC load for debugging
h5out['pras_h2dac_load'] = load_h2dac_all_hourly
h5out['pras_h2dac_load'] = load_h2dac_all_hourly.reset_index(drop=True)

### Store load with the appropriate index for capacity_credit.py
h5out['load'] = load_year.set_index(
h_dt_szn.set_index(['ccseason','year','h','hour']).index)
h5out['load'] = (
load_year.merge(
h_dt_szn[['ccseason', 'year', 'h', 'hour']], left_index=True, right_index=True
)
.set_index(['ccseason', 'year', 'h', 'hour'])
)


#%%### Collect some csv's for ReEDS2PRAS
Expand Down
137 changes: 84 additions & 53 deletions b_inputs.gms

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions c_supplymodel.gms
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,9 @@ eq_forceprescription(pcat,r,t)$[tmodel(t)$force_pcat(pcat,t)$Sw_ForcePrescriptio
+ EXTRA_PRESCRIP(pcat,r,t)$[yeart(t)>=firstyear_pcat(pcat)]

* or in regions where there is a offshore wind requirement
+ EXTRA_PRESCRIP(pcat,r,t)$[r_offshore(r,t)$sameas(pcat,'wind-ofs')]
+ EXTRA_PRESCRIP(pcat,r,t)$[r_offshore(r,t)$sameas(pcat,'wind-ofs')
$(yeart(t)>=firstyear_RPS)
$sum{st$r_st(r,st), offshore_cap_req(st,t) }]
;


Expand Down Expand Up @@ -886,7 +888,7 @@ eq_growthlimit_relative(i,st,t)$[sum{r$[r_st(r,st)], valinv_irt(i,r,t) }
$tmodel(t)
$stfeas(st)
$Sw_GrowthPenalties
$(yeart(t)<=Sw_GrowthConLastYear)
$(yeart(t)<=Sw_GrowthPenLastYear)
$(yeart(t)>=model_builds_start_yr)]..

*the annual growth limit
Expand All @@ -904,7 +906,7 @@ eq_growthbin_limit(gbin,st,tg,t)$[valinv_tg(st,tg,t)
$tmodel(t)
$stfeas(st)
$Sw_GrowthPenalties
$(yeart(t)<=Sw_GrowthConLastYear)
$(yeart(t)<=Sw_GrowthPenLastYear)
$(yeart(t)>=model_builds_start_yr)]..

*the growth bin limit
Expand All @@ -928,9 +930,9 @@ eq_growthlimit_absolute(tg,t)$[growth_limit_absolute(tg)$tmodel(t)

=g=

* must exceed the total investment - same RHS as previous equation
sum{(i,v,r,rscbin)$[valinv(i,v,r,t)$m_rscfeas(r,i,rscbin)$tg_i(tg,i)$rsc_i(i)],
INV_RSC(i,v,r,rscbin,t) }
* must exceed the total investment
sum{(i,v,r)$[valinv(i,v,r,t)$tg_i(tg,i)],
INV(i,v,r,t) }
;

* ---------------------------------------------------------------------------
Expand Down Expand Up @@ -2424,7 +2426,8 @@ eq_REC_launder(RPSCat,st,t)$[RecStates(RPSCat,st,t)$(not tfirst(t))$(yeart(t)>=f
* ---------------------------------------------------------------------------

eq_RPS_OFSWind(st,t)$[tmodel(t)$stfeas(st)$offshore_cap_req(st,t)$Sw_StateRPS
$sum{(i,v,r)$[r_st(r,st)$ofswind(i)], valcap(i,v,r,t) }]..
$sum{(i,v,r)$[r_st(r,st)$ofswind(i)], valcap(i,v,r,t) }
$(yeart(t)>=firstyear_RPS)]..

* existing capacity of wind
sum{(i,v,r)$[r_st(r,st)$ofswind(i)], m_capacity_exog(i,v,r,t) }
Expand Down
2 changes: 1 addition & 1 deletion c_supplyobjective.gms
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ eq_ObjFn_inv(t)$tmodel(t)..
* --- growth penalties ---
+ sum{(gbin,i,st)$[sum{r$[r_st(r,st)], valinv_irt(i,r,t) }$stfeas(st)],
cost_growth(i,st,t) * growth_penalty(gbin) * (yeart(t) - sum{tt$[tprev(t,tt)], yeart(tt) }) * GROWTH_BIN(gbin,i,st,t)
}$[(yeart(t)>=model_builds_start_yr)$Sw_GrowthPenalties$(yeart(t)<=Sw_GrowthConLastYear)]
}$[(yeart(t)>=model_builds_start_yr)$Sw_GrowthPenalties$(yeart(t)<=Sw_GrowthPenLastYear)]

* --- cost of upgrading---
+ sum{(i,v,r)$[upgrade(i)$valcap(i,v,r,t)$Sw_Upgrades],
Expand Down
18 changes: 10 additions & 8 deletions cases.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yearset_suffix,Set of years that are modeled,default; 1yr_2yr; 1yr_5yr; 2yr_1yr2
endyear,Last year to be modeled,N/A,2050,
windows_suffix,Set of windows that are modeled,default; step5; step10; 2100,default,
solver,Solver for GAMS to use,CPLEX; gurobi,CPLEX,
distpvscen,Setting for distpv scenario (see inputs\dGen_model_inputs),N/A,stscen2023_mid_case,
distpvscen,Setting for distpv scenario (see inputs\dgen_model_inputs),N/A,stscen2023_mid_case,
calc_csp_cc,Switch to turn on CSP capacity credit calculations,0; 1,0,
batteryscen,Battery cost and performance inputs (inputs\plant_characteristics\{batteryscen}.csv). The options for batteryscen start with 'battery_' and the switch should be set to the entire file name (ex: battery_ATB_2024_advanced),battery_ATB_(2023|2024)_(conservative|moderate|advanced),battery_ATB_2024_moderate,
beccsscen,BECCS cost and performance inputs (inputs\plant_characteristics\{beccsscen}.csv) The options for beccsscen start with 'beccs_' and the switch should be set to the entire file name (ex: beccs_reference),(beccs_BVRE_2021_(high|mid|low)|beccs_(reference|lowcost)),beccs_reference,
Expand Down Expand Up @@ -39,7 +39,7 @@ supplycurve,Wind and Solar Supply Curves,default; 0; naris; 2018,default,
upvscen,UPV cost and performance inputs (inputs/plant_characteristics/{upvscen}.csv). The options for upvscen start with 'upv_' and the switch should be set to the entire file name (ex: upv_ATB_2023_advanced).,upv_ATB_(2023|2024)_(conservative|moderate|advanced),upv_ATB_2024_moderate,
uraniumscen,Uranium price scenario,AEO_(2021|2022|2023)_reference,AEO_2023_reference,
GSw_Region,Specify column from inputs/userinput/region_spec.csv or from {column of hierarchy.csv}/{period-delimited entries to keep from that column},N/A,usa,
GSw_RegionResolution,Specify the spatial resolution of modeled regions,county; ba; state; aggreg,aggreg,
GSw_RegionResolution,Specify the spatial resolution of modeled regions,county; ba; aggreg,aggreg,
capcredit_hierarchy_level,Select level at which to aggregate net load for capacity-credit calculation,r; nercr; transreg; transgrp; cendiv; st; interconnect; country; usda_region,transreg,
construction_schedules_suffix,File suffix for construction schedules,default,default,
construction_times_suffix,File suffix for construction times by technology,default,default,
Expand All @@ -48,7 +48,7 @@ depreciation_schedules_suffix,File suffix for depreciation schedules,default,def
financials_sys_suffix,File suffix for the system-wide system discount rate,ATB(2023|2024),ATB2024,
financials_tech_suffix,File suffix for technology-specific financial assumptions (see inputs\financials_tech),ATB(2023|2023_CRP20|2024),ATB2024,
financials_trans_suffix,File suffix for transmission financial assumptions,default; 30ITC_0pen_2022_2031,default,
incentives_suffix,File suffix for incentive definition,ira; ira_hii; ira_lii; annual; biennial; ira_45q_extension,ira,
incentives_suffix,File suffix for incentive definition,ira; ira_hii; ira_lii; annual; biennial; ira_45q_45v_extension; none,ira,
inflation_suffix,File suffix for historical inflation schedule,default,default,
ivt_suffix,File suffix for ivt csv file,default; small; step,default,
reg_cap_cost_mult_suffix,File suffix for regional capital cost multipliers,default,default,
Expand Down Expand Up @@ -114,10 +114,11 @@ GSw_CO2_BEC,"Break even cost capacity factor assignment. Must be a suffix to ""b
GSw_CoalIGCC,Turn on/off COAL IGCC,0; 1,1,
GSw_CoalNew,Turn on/off coal new,0; 1,1,
GSw_CoalRetire,"Adjust lifetime coal retirements [0 = coal retirements straight from EIA unit database, 1 = decrease the lifteime of currrently operating coal plants using switch 'coalretireyrs', 2 = increase the lifetime of all currently operating coal units by 'coalretireyrs']",0; 1; 2,0,
GSw_CofireNew,Turn on/off cofire-new,0; 1,1,
GSw_CofireNew,Turn on/off cofire-new,0; 1,0,
GSw_CoolingTechMults,Turn on/off to enable cooling tech cost/performance multipliers,0; 1,1,
GSw_CSAPR,Turn on/off the CSAPR emissions regulation,0; 1,1,
GSw_CSP,Turn on/off CSP [0=no CSP; 1=1 CSP tech; 2=2 CSP techs],0; 1; 2,1,
GSw_CSPRemoveLow, Remove the lowest quality CSP resource [0=do not remove; 1=remove],0; 1,1,
GSw_CSP_Types,'_'-delimited CSP types to include (i.e. 1 or 1_2 or 1_2_3),1_2,1_2,
GSw_CurtMarket,Price paid (in 2004$/MWh) for curtailed VRE,N/A,0,
GSw_DAC,"Turn on or off the representation of direct air capture [0 = off, 1 = on with projection specified by dacscen]",0; 1,0,
Expand All @@ -140,8 +141,9 @@ GSw_GenMandateScen,Select trajectory for national generation standard (see input
GSw_Geothermal,"Geothermal can be turned off [0], left to the default representation [1], or have an extended representation [2]",0; 1; 2,1,
GSw_gopt,Select opt file to be used,N/A,1,
GSw_GrowthAbsCon,Turn on/off absolute growth constraint,0; 1,0,
GSw_GrowthConLastYear,The last year that the growth penalty or contstraint is applied (if it is turned on),N/A,2034,
GSw_GrowthConLastYear,The last year that the growth constraint (GSw_GrowthAbsCon) is applied (if it is turned on),int,2026,
GSw_GrowthPenalties,Turn on/off relative growth penalties,0; 1,0,
GSw_GrowthPenLastYear,The last year that the growth penalty (GSw_GrowthPenalties) is applied (if it is turned on),int,2034,
GSw_H2,Turn on/off the representation of hydrogen supply/demand balance at a national level without storage (1) or at a regional level with storage (2),0; 1; 2,2,
GSw_H2_CompressorLoad,Turn on/off the accounting of electric loads from compressors used to operate the hydrogen transport network, 0; 1,0,
GSw_H2_Demand_Case,H2 demand case as indicated by the column headers in inputs/consume/h2_exogenous_demand.csv,none; BAU; Aggressive; Decarb; Decarb_with_BAU; LTS,none,
Expand Down Expand Up @@ -244,7 +246,7 @@ GSw_PRM_StressSeedMinRElevel,Region hierarchy level at which to include minimum
GSw_PRM_StressStorageCutoff,"How to select ""shoulder"" stress periods giving storage time to recharge before/after high-unserved-energy periods. Two-part switch separated by _. The first argument is ""EUE"" or ""capacity"" or ""absolute"". If ""EUE"" the second argument specifies a PRAS storage headspace / EUE threshold [fraction]; if ""cap"" it specifies a headspace / storage capacity threshold [fraction]; if ""abs"" it specifies absolute number of periods before/after [integer]. Turned off if set to ""off"".",N/A,EUE_0.1,
GSw_PRM_StressThreshold,/-delimited list of annual NEUE level [ppm] above which to re-solve the latest model year with new stress periods; formulated as HierarchyLevel_NEUEppm_StressMetric_PeriodAggMethod where HierarchyLevel is a column in hierarchy.csv; NEUEppm is normalized expected unserved energy in parts per million; StressMetric is EUE or NEUE (only used in period selection); PeriodAggMethod is 'sum' or 'max' over the hours in each period (only used in period selection) (see README.md for detailed notes),N/A,transgrp_10_EUE_sum,
GSw_PRM_hierarchy_level,hierarchy level within which to calculate peak demand,r; nercr; transreg; transgrp; cendiv; st; interconnect; country; usda_region,nercr,
GSw_PRM_scenario,"column of inputs/reserves/prm_annual.csv from which to draw the PRM (""nerc"" means the annual values from the 2023 NERC LTRA; ""static"" means the 2024 values from the same source)",none; static; nerc; ramp2025_20by50,nerc,
GSw_PRM_scenario,"column of inputs/reserves/prm_annual.csv from which to draw the PRM (""nerc"" means the annual values from the 2023 NERC LTRA; ""static"" means the 2024 values from the same source)"; "fixed_12" means all values are the same across time and regions = 0.12,none; static; nerc; ramp2025_20by50; fixed_12,fixed_12,
GSw_PRMTRADE_level,hierarchy level within which to allow PRM trading,r; nercr; transreg; transgrp; cendiv; st; interconnect; country; usda_region,country,
GSw_PSHfillyears,switch to define the number of years it is assumed to take to fill PSH reservoirs [only relevant with water constraints active],N/A,3,
GSw_PSHwatertypes,switch to define what types of water is available for filling PSH reservoirs (0=fresh surface/ground water; 1=fresh surface water; 2=all types except saline surface water) [only relevant with water constraints active],0; 1; 2,0,
Expand All @@ -260,7 +262,7 @@ GSw_ReducedResource,Turn on/off switch to reduce the RE resource available,0; 1,
GSw_Refurb,Turn on/off refurbishments,0; 1,1,
GSw_RetailAdder,2004$/MWh adder to the cost of electricity consumed by hydrogen production and DAC facilities,float,0,
GSw_Retire,Endogenous retirement: 0 = no endogenous retirement; 1 = any existing plants can retire; 2 = only existing coal/gas can retire; 3 = new/existing nuclear/coal/gas can retire after minimum age; 4 = new/existing plants of any tech can retire; 5 = same as 3 but nuclear can only retire after 2030,0; 1; 2; 3; 4; 5,5,
GSw_RetireYear,Year to begin retirements,N/A,2025,
GSw_RetireYear,Year to begin endogenous retirements,N/A,2027,
GSw_RGGI,Turn on/off RGGI,0; 1,1,
GSw_SitingGeo,Specify the Geothermal siting scenario [reference],reference,reference,
GSw_SitingUPV,"Specify the UPV siting scenario [reference, open, limited]",reference; open; limited,reference,
Expand Down Expand Up @@ -334,4 +336,4 @@ hourly_cluster_plots,switch to control the creation of diagnostic plots for hour
dump_alldata,switch to automatically dump data from final solve year into .gdx file,0; 1,0,
delete_big_files,switch to delete big input files after completion to save storage space,0; 1,0,
debug,Write and keep intermediate files and equation elements to help with debugging. The value of the switch is passed to `option limrow` and `option limcol` and indicates the number of equation and variable entries to print,int,0,
plot_ba_level,0=do not plot or output BA-level year-by-month plots; 1=plot and output BA-level year-by-month plots.,0; 1,0,
plot_ba_level,0=do not plot or output BA-level year-by-month plots; 1=plot and output BA-level year-by-month plots.,0; 1,0,
Loading

0 comments on commit f748ff4

Please sign in to comment.