forked from NREL/ReEDS-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
b_inputs.gms
6103 lines (5019 loc) · 239 KB
/
b_inputs.gms
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
$title 'ReEDS 2.0'
* Note - all dollar values are in 2004$ unless otherwise indicated
* It is our intention that there are no hard-coded values in B_inputs.gms
* but you will note that we still have some work to do to make that happen...
*Setting the default directory separator
$setglobal ds \
$eolcom \\
*Change the default slash if in UNIX
$ifthen.unix %system.filesys% == UNIX
$setglobal ds /
$endif.unix
*need to convert the 'unit' numhintage to some large value
$ifthen.unithintage %numhintage%=="unit"
$eval numhintage 300
$endif.unithintage
*need to convert the 'group' numhintage to some large value
$ifthen.unithintage %numhintage%=="group"
$eval numhintage 300
$endif.unithintage
* there are numeraire hintages on either sides of the outer breaks
* when using calcmethod = 1, here adding two for safety
* NB this will not increase model size given conditions
* dictating valcap and valgen for initial classes
$eval numhintage %numhintage% + 2
*$ontext
* --- print timing profile ---
option profile = 3
option profiletol = 0
* --- supress .lst file printing ---
* equations listed per block
option limrow = %debug% ;
* variables listed per block
option limcol = %debug% ;
* solver's solution output printed
option solprint = off ;
* solver's system output printed
option sysout = off ;
*$offtext
set dummy "set used for initalization of numerical sets" / 0*10000 / ;
alias(dummy,adummy) ;
*======================
* -- Local Switches --
*======================
* Following are scalars used to turn on or off various components of the model.
* For binary swithces, [0] is off and [1] is on.
* These switches are generated from the cases file in runbatch.py.
$include inputs_case%ds%gswitches.txt
* Extra switches that are defined based on other switches
scalar Sw_Prod "Scalar value for whether Sw_H2 or Sw_DAC are enabled" ;
Sw_Prod$[Sw_H2 or Sw_DAC or Sw_DAC_Gas] = 1 ;
set timetype "Type of time method used in the model"
/ seq, win, int / ;
parameter Sw_Timetype(timetype) "Switch that specifies the type of time method used in the model" ;
Sw_Timetype("%timetype%") = 1 ;
*============================
* --- Scalar Declarations ---
*============================
*year-related switches that define retirement and upgrade start dates
scalar retireyear "first year to allow capacity to start retiring" /%GSw_Retireyear%/
upgradeyear "first year to allow capacity to upgrade" /%GSw_Upgradeyear%/
climateyear "first year to apply climate impacts" /%GSw_ClimateStartYear%/ ;
*** Scalars: copied from inputs/scalars.csv to inputs_case/scalars.txt in runbatch.py
$include inputs_case%ds%scalars.txt
*==========================
* --- Set Declarations ---
*==========================
* Written by copy_files.py
$include b_sets.gms
sets
*The following two sets:
*ban - will remove the technology from being considered, anywhere
*bannew - will remove the ability to invest in that technology
ban(i) "ban from existing, prescribed, and new generation -- usually indicative of missing data or operational constraints"
/
h2-cc
ice
upv_10
wind-ofs_15
mhkwave
caes
* csp-ns is "CSP, no storage". There is ~1.3 GW existing capacity but we group it with UPV and
* don't allow new builds of csp-ns.
csp-ns
other
unknown
geothermal
hydro
csp3_1*csp3_12
csp4_1*csp4_12
pumped-hydro-flex
hydED_pumped-hydro-flex
CoalOldUns_CoalOldScr
CoalOldUns_CofireOld
CoalOldScr_CofireOld
$ifthene.hydup not %GSw_HydroCapEnerUpgradeType% == 1
hydUD
hydUND
$endif.hydup
$ifthene.hydup2 %GSw_HydroAddPumpDispUpgSwitch% == 0
hydEND_hydED
hydED_pumped-hydro
$endif.hydup2
/,
bannew(i) "banned from creating new capacity, usually due to lacking data or represention"
/
can-imports
hydro
distpv
geothermal
Ocean
cofireold
caes
CoalOldScr
CoalOldUns
csp-ns
*you cannot build existing hydro...
HydEND
HydED
/,
*Technologies with certain combinations of power technology, cooling technology, and
*water source are also banned from new capacity below after defining
*linking sets between i, ctt, and wst.
*Data is insufficient to characterize new pond cooling systems, regulations effectively
*prohibit new once-through cooling
bannew_ctt(ctt) "banned ctt from creating new non-numeraire techs, usually due to lacking data or representation"
/
o
p
/,
bannew_wst(wst) "banned wst from creating new non-numeraire techs, usually due to lacking data or representation"
/
fsl
ss
/ ;
alias(i,ii,iii) ;
set i_water_cooling(i) "derived technologies from original technologies with cooling technologies other than just none",
*Hereafter numeraire techs in cooling-water context mean original technologies,
*like gas-CC, and non-numeraire techs mean techs that are derived from numeraire techs
*with cooling technology type and water source data appended to them, like gas-CC_r_fsa
*-- it is gas-CC with recirculating cooling and fresh surface appropriated water source.
i_water_nocooling(i) "technologies that use water, but are not differentiated by cooling tech and water source"
/
Hydro
Gas-CT
geothermal
distpv
/,
i_water(i) "set of all technologies that use water for any purpose",
i_ii_ctt_wst(i,ii,ctt,wst) "linking set between non-numeraire techs, numeraire techs, cooling technology types, and water source types",
*linking sets extracted from i_ii_ctt_wst(i,ii,ctt,wst) that allow one-one mapping among dimensions
i_ctt(i,ctt) "linking set between non-numeraire techs and cooling technology types",
i_wst(i,wst) "linking set between non-numeraire techs and water source types",
wst_i_ii(i,ii) "linking set between non-numeraire techs and numeraire techs",
ctt_i_ii(i,ii) "linking set between non-numeraire techs and numeraire techs";
*input parameters for non-numeraire techs and linking set only if Sw_WaterMain is ON and start with a blank slate
i_water_cooling(i) = no ;
i_ii_ctt_wst(i,ii,ctt,wst) = no ;
$ifthen.coolingwatersets %GSw_WaterMain% == 1
set i_water_cooling_temp(i)
/
$offlisting
$include inputs_case%ds%i_coolingtech_watersource.csv
$onlisting
/,
i_ii_ctt_wst_temp(i,ii,ctt,wst)
/
$offlisting
$ondelim
$include inputs_case%ds%i_coolingtech_watersource_link.csv
$include inputs_case%ds%i_coolingtech_watersource_upgrades_link.csv
$offdelim
$onlisting
/ ;
i_water_cooling(i)$i_water_cooling_temp(i) = yes ;
i_ii_ctt_wst(i,ii,ctt,wst)$i_ii_ctt_wst_temp(i,ii,ctt,wst) = yes ;
$endif.coolingwatersets
i_water(i)$[i_water_cooling(i) or i_water_nocooling(i)] = yes ;
*linking sets between non-numeraire techs, numeraire techs, cooling tech, and water source
i_ctt(i,ctt)$[sum{(ii,wst)$i_ii_ctt_wst(i,ii,ctt,wst), 1 }] = YES ;
i_wst(i,wst)$[sum{(ii,ctt)$i_ii_ctt_wst(i,ii,ctt,wst), 1 }] = YES ;
*wst_i_ii(i,ii) and ctt_i_ii(i,ii) are identical linking set between non-numeraire and numeraire techs,
*kept both for clarity of use in cooling technology and water source related formulations
wst_i_ii(i,ii)$[sum{(wst,ctt)$i_ii_ctt_wst(i,ii,ctt,wst), 1 }] = YES ;
ctt_i_ii(i,ii)$[sum{(wst,ctt)$i_ii_ctt_wst(i,ii,ctt,wst), 1 }] = YES ;
set i_numeraire(i) "numeraire techs that need cooling" ;
*i_numeraire(i) will be removed from valcap set as these technologies are ultimately
*expanded to non-numeraire techs. valcap will have non-numeraire techs if Sw_WaterMain=1
*or will have numeraire techs otherwise.
i_numeraire(ii)$sum{(wst,ctt,i)$i_ii_ctt_wst(i,ii,ctt,wst), 1 } = yes ;
table ctt_hr_mult(i,ctt) "heatrate multipliers to differentiate cooling technology types"
$offlisting
$ondelim
$include inputs_case%ds%heat_rate_mult.csv
$offdelim
$onlisting
;
table ctt_cc_mult(i,ctt) "capital cost multipliers to differentiate cooling technology types"
$offlisting
$ondelim
$include inputs_case%ds%cost_cap_mult.csv
$offdelim
$onlisting
;
table ctt_cost_vom_mult(i,ctt) "VOM cost multipliers to differentiate cooling technology types"
$offlisting
$ondelim
$include inputs_case%ds%cost_vom_mult.csv
$offdelim
$onlisting
;
set
i_geotech(i,geotech) "crosswalk between an individual geothermal technology and its category"
/
(egs_allkm_1*egs_allkm_10).egs_allkm,
(geohydro_allkm_1*geohydro_allkm_10).geohydro_allkm,
(egs_nearfield_1*egs_nearfield_10).egs_nearfield
/,
*technology-specific subsets
battery(i) "battery storage technologies",
beccs(i) "Bio with CCS",
bio(i) "technologies that use only biofuel",
boiler(i) "technologies that use steam boilers"
canada(i) "Canadian imports",
ccs(i) "CCS technologies",
ccsflex_byp(i) "Flexible CCS technologies with bypass",
ccsflex_dac(i) "Flexible CCS technologies with direct air capture",
ccsflex_sto(i) "Flexible CCS technologies with storage",
ccsflex(i) "Flexible CCS technologies",
cf_tech(i) "technologies that have a specified capacity factor"
coal_ccs(i) "technologies that use coal and have CCS",
coal(i) "technologies that use coal",
cofire(i) "cofire technologies",
consume(i) "technologies that consume electricity and add to load",
conv(i) "conventional generation technologies",
csp_storage(i) "csp generation technologies with thermal storage",
csp(i) "csp generation technologies",
csp1(i) "csp-tes generation technologies 1",
csp2(i) "csp-tes generation technologies 2",
csp3(i) "csp-tes generation technologies 3",
csp4(i) "csp-tes generation technologies 4",
dac(i) "direct air capture technologies",
distpv(i) "distpv (i.e., rooftop PV) generation technologies",
dr(i) "demand response technologies",
dr1(i) "demand response storage technologies",
dr2(i) "demand response shed technologies",
demand_flex(i) "demand flexibility technologies (includes DR and EVMC)",
dupv(i) "dupv generation technologies",
evmc(i) "ev flexibility technologies",
evmc_storage(i) "ev flexibility as direct load control",
evmc_shape(i) "ev flexibility as adoptable change to load from response to pricing",
fossil(i) "fossil technologies"
gas_cc_ccs(i) "techs that are gas combined cycle and have CCS",
gas_cc(i) "techs that are gas combined cycle",
gas_ct(i) "techs that are gas combustion turbine",
gas(i) "techs that use gas (but not o-g-s)",
geo_base(i) "geothermal technologies typically considered in model runs",
geo_hydro(i) "geothermal hydrothermal technologies",
geo_egs(i) "geothermal enhanced geothermal systems technologies",
geo_extra(i) "geothermal technologies not typically considered in model runs",
geo(i) "geothermal technologies",
h2_ct(i) "h2-ct and h2-cc technologies",
h2(i) "hydrogen-producing technologies",
hyd_add_pump(i) "hydro techs with an added pump",
hydro_d(i) "dispatchable hydro technologies",
hydro_nd(i) "non-dispatchable hydro technologies",
hydro(i) "hydro technologies",
lfill(i) "land-fill gas technologies",
nondispatch(i) "technologies that are not dispatchable"
nuclear(i) "nuclear technologies",
ofswind(i) "offshore wind technologies",
ogs(i) "oil-gas-steam technologies",
onswind(i) "onshore wind technologies",
psh(i) "pumped hydro storage technologies",
pv(i) "all PV generation technologies",
pvb(i) "hybrid pv+battery technologies",
pvb1(i) "pvb generation technologies 1",
pvb2(i) "pvb generation technologies 2",
pvb3(i) "pvb generation technologies 3",
re(i) "renewable energy technologies",
refurbtech(i) "technologies that can be refurbished",
rsc_i(i) "technologies based on Resource supply curves",
smr(i) "steam methane reforming technologies",
storage_hybrid(i) "hybrid VRE-storage technologies",
storage_standalone(i) "stand alone storage technologies",
storage(i) "storage technologies",
thermal_storage(i) "thermal storage technologies",
upgrade(i) "technologies that are upgrades from other technologies",
upv(i) "upv generation technologies",
vre_distributed(i) "distributed PV technologies",
vre_no_csp(i) "variable renewable energy technologies that are not csp",
vre_utility(i) "utility scale wind and PV technologies",
vre(i) "variable renewable energy technologies",
wind(i) "wind generation technologies",
allt "all potential years" /1900*2500/,
t(allt) "full set of years" /2010*%endyear%/,
* Each generation technology is broken out by class:
* 1. initial capacity: init-1, init-2, ..., init-n
* 2. prescribed capacity: prescribed
* 3. new capacity: new
* This allows us to distinguish between existing, prescribed, and model-chosen builds
* The number of classes is set by numhintage for initial capacity and numclass for new capacity
v "technology class"
/
init-1*init-%numhintage%,
new1*new%numclass%
/,
initv(v) "inital technologies" /init-1*init-%numhintage%/,
newv(v) "new tech set" /new1*new%numclass%/,
* DAC == direct air capture
* H2 == hydrogen
* Note: no longer tracking H2 by color. This means ReEDS internalizes
* emissions for any H2 produced for non-power sector demands
p "products produced" /DAC, H2/
;
*================================
* --- Spatial / Temporal Sets ---
*================================
* written by copy_files.py
set r "regions"
/
$offlisting
$include inputs_case%ds%val_r.csv
$onlisting
/ ;
* written by copy_files.py
$onempty
set cs(*) "carbon storage sites"
/
$offlisting
$include inputs_case%ds%val_cs.csv
$onlisting
/ ;
$offempty
* created in and mapped to hierarchy in ldc_prep.py
set ccreg "capacity credit regions"
/
$offlisting
$include inputs_case%ds%ccreg.csv
$onlisting
/ ;
Sets
eall "emission categories used in reporting" /CO2, SO2, NOX, HG, CH4, CO2e/
e(eall) "emission categories used in model" /CO2, SO2, NOX, HG, CH4/
nercr "NERC regions"
* https://www.nerc.com/pa/RAPA/ra/Reliability%20Assessments%20DL/NERC_LTRA_2021.pdf
/
* written by copy_files.py
$include inputs_case%ds%val_nercr.csv
/
transreg "Transmission Planning Regions from FERC order 1000"
* (https://www.ferc.gov/sites/default/files/industries/electric/indus-act/trans-plan/trans-plan-map.pdf)
/
* written by copy_files.py
$include inputs_case%ds%val_transreg.csv
/,
transgrp "sub-FERC-1000 regions"
/
* written by copy_files.py
$include inputs_case%ds%val_transgrp.csv
/,
cendiv "census divisions"
/
* written by copy_files.py
$include inputs_case%ds%val_cendiv.csv
/,
interconnect "interconnection regions"
/
* written by copy_files.py
$include inputs_case%ds%val_interconnect.csv
/,
country "country regions"
/
* written by copy_files.py
$include inputs_case%ds%val_country.csv
/,
st "US, Mexico, and/or Canadian States/Provinces"
/
* written by copy_files.py
$include inputs_case%ds%val_st.csv
/,
* biomass supply curves defined by USDA region
usda_region "Biomass supply curve regions"
/
* written by copy_files.py
$include inputs_case%ds%val_usda_region.csv
/,
* Aggregated regions
aggreg "Aggregated regions"
/
$include inputs_case%ds%val_aggreg.csv
/
tg_i(tg,i) "technologies that belong in tech group tg"
;
hyd_add_pump('hydED_pumped-hydro') = yes ;
hyd_add_pump('hydED_pumped-hydro-flex') = yes ;
* Sets involved with resource supply curve definitions
set rscbin "Resource supply curves bins" /bin1*bin%numbins%/,
sc_cat "supply curve categories (capacity and cost)"
/cap "capacity available",
cost "total supply curve cost",
cost_trans "transmission component of supply curve cost",
cost_cap "generation capacity (e.g. economies of scale) component of supply curve cost"/
rscfeas(i,r,rscbin) "feasibility set for technologies that have resource supply curves" ;
alias(r,rr,n,nn) ;
alias(v,vv) ;
alias(t,tt,ttt) ;
alias(st,ast) ;
alias(allt,alltt) ;
alias(cendiv,cendiv2) ;
alias(rscbin,arscbin) ;
alias(nercr,nercrr) ;
alias(transgrp,transgrpp) ;
parameter yeart(t) "numeric value for year",
year(allt) "numeric year value for allt" ;
yeart(t) = t.val ;
year(allt) = allt.val ;
set att(allt,t) "mapping set between allt and t" ;
att(allt,t)$[year(allt) = yeart(t)] = yes ;
*the end year is defined dynamically
*if %end_year% < annual data, we are gonna get into trouble...
*if you aint first you're last
set tfirst(t) "first year",
tlast(t) "last year" ;
*aint first you're last
tfirst(t)$[ord(t) = 1] = yes ;
tlast(t)$[ord(t) = smax(tt,ord(tt))] = yes ;
parameter deflator(allt) "Deflator values (for inflation) calculated from http://www.usinflationcalculator.com/inflation/consumer-price-index-and-annual-percent-changes-from-1913-to-2008/ using the Avg-Avg values"
/
$offlisting
$ondelim
$include inputs_case%ds%deflator.csv
$offdelim
$onlisting
/ ;
*various parameters needed for Present Value Factor (PVF) calculations before solving
*specifically these are used in the aggregating of the PVF of
*onm and capital when years are skipped
alias(t,yy,yyy) ;
set yearafter "set to loop over for the final year calculation" /1*19/ ;
Set upgrade_to(i,ii) "mapping set that allows for i to be upgraded to ii"
upgrade_from(i,ii) "mapping set that allows for i to be upgraded from ii"
upgrade_link(i,ii,iii) "indicates that tech i is upgradeable from ii with a delta base of iii"
/
$offlisting
$ondelim
$include inputs_case%ds%upgrade_link.csv
$ifthen.ctech %GSw_WaterMain% == 1
$include inputs_case%ds%upgradelink_water.csv
$endif.ctech
$offdelim
$onlisting
/ ;
upgrade(i)$[sum{(ii,iii), upgrade_link(i,ii,iii) }] = yes ;
upgrade_to(i,ii)$[sum{iii, upgrade_link(i,iii,ii) }] = yes ;
upgrade_from(i,ii)$[sum{iii, upgrade_link(i,ii,iii) }] = yes ;
set unitspec_upgrades(i) "upgraded technologies that get unit-specific characteristics"
/Gas-CC_Gas-CC-CCS_Mod, Coal-new_Coal-CCS_mod, Coal-IGCC_coal-CCS_mod,
CoalOldScr_coal-CCS_mod, CoalOldUns_coal-CCS_mod/ ;
* --- Read technology subset lookup table ---
Table i_subsets(i,i_subtech) "technology subset lookup table"
$offlisting
$ondelim
$include inputs_case%ds%tech-subset-table.csv
$offdelim
$onlisting
;
*assign subtechs to each upgrade tech
*based on what they will be upgraded to
i_subsets(i,i_subtech)$[upgrade(i)$Sw_Upgrades] =
sum{ii$upgrade_to(i,ii), i_subsets(ii,i_subtech) } ;
*approach in cooling water formulation is populating parameters of numeraire tech (e.g. gas-CC)
*for non-numeraire techs (e.g. gas-CC_r_fsa; r = recirculating cooling, fsa=fresh surface appropriated water source)
*e.g. populate i_subsets for non-numeraire techs from numeraire tech using a linking set ctt_i_ii(i,ii)
i_subsets(i,i_subtech)$[i_water_cooling(i)$Sw_WaterMain] =
sum{ii$ctt_i_ii(i,ii), i_subsets(ii,i_subtech) } ;
** define tech bans so that they are not defined in the technology subsets below **
* switch based gen tech bans (see cases file for details)
if(Sw_BECCS = 0,
ban('beccs_mod') = yes ;
ban('beccs_max') = yes ;
) ;
if(Sw_Biopower = 0,
ban('biopower') = yes ;
) ;
if(Sw_Canada <> 1,
ban('can-imports') = yes ;
) ;
if(Sw_CCS = 0,
ban(i)$i_subsets(i,'ccs') = yes ;
) ;
if(Sw_CCSFLEX_BYP = 0,
ban('Gas-CC-CCS-F1') = yes ;
ban('coal-CCS-F1') = yes ;
) ;
if(Sw_CCSFLEX_STO = 0,
ban('Gas-CC-CCS-F2') = yes ;
ban('coal-CCS-F2') = yes ;
) ;
if(Sw_CCSFLEX_DAC = 0,
ban('Gas-CC-CCS-F3') = yes ;
ban('coal-CCS-F3') = yes ;
) ;
if(Sw_CSP = 0,
ban(i)$i_subsets(i,'csp') = yes ;
) ;
if(Sw_CSP = 1,
ban(i)$i_subsets(i,'csp2') = yes ;
) ;
if(Sw_CoalIGCC = 0,
ban('Coal-IGCC') = yes ;
) ;
if(Sw_CoalNew = 0,
ban('coal-new') = yes ;
) ;
if(Sw_CofireNew = 0,
ban('CofireNew') = yes ;
) ;
if(Sw_DAC = 0,
ban(i)$i_subsets(i,'dac') = yes ;
) ;
if(Sw_DAC_Gas = 0,
ban("dac_gas") = yes ;
);
if(Sw_DR = 0,
ban(i)$i_subsets(i,'dr') = yes ;
) ;
if(Sw_DUPV = 0,
ban(i)$i_subsets(i,'dupv') = yes ;
) ;
if(Sw_EVMC = 0,
ban(i)$i_subsets(i,'evmc') = yes ;
) ;
if(Sw_Geothermal = 0,
ban(i)$i_subsets(i,'geo') = yes ;
) ;
if(Sw_Geothermal = 1,
ban(i)$i_subsets(i,'geo_extra') = yes ;
) ;
if(Sw_H2 = 0,
ban(i)$i_subsets(i,'h2') = yes ;
) ;
if(Sw_H2_SMR = 0,
ban(i)$i_subsets(i,'smr') = yes ;
) ;
if(Sw_H2CT = 0,
ban(i)$i_subsets(i,'h2_ct') = yes ;
) ;
if(Sw_H2CTupgrade = 0,
ban(i)$[i_subsets(i,'h2_ct')$upgrade(i)] = yes ;
) ;
if(Sw_LfillGas = 0,
ban('lfill-gas') = yes ;
) ;
if(Sw_MaxCaptureCCSTechs = 0,
ban('beccs_max') = yes ;
ban('coal-CCS_max') = yes ;
ban('Gas-CC-CCS_max') = yes ;
) ;
if(Sw_Nuclear = 0,
bannew(i)$i_subsets(i,'nuclear') = yes ;
) ;
if(Sw_NuclearSMR = 0,
ban("Nuclear-SMR") = yes ;
) ;
if(Sw_OfsWind = 0,
ban(i)$i_subsets(i,'ofswind') = yes ;
) ;
if(Sw_OnsWind6to10 = 0,
bannew('wind-ons_6') = yes ;
bannew('wind-ons_7') = yes ;
bannew('wind-ons_8') = yes ;
bannew('wind-ons_9') = yes ;
bannew('wind-ons_10') = yes ;
) ;
* always allow PSH to use fresh surface water (fsa, fsu)
* do not allow new PSH to use saline surface water
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'ss') }] = YES ;
$ifthen.pshwat %GSw_PSHwatertypes% == 0
* do not allow saline ground water or wastewater effluent
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'sg') }] = YES ;
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'ww') }] = YES ;
$elseif.pshwat %GSw_PSHwatertypes% == 1
* option to also prohibit fresh groundwater
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'sg') }] = YES ;
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'ww') }] = YES ;
bannew(i)$[sum{wst_i_ii(i,ii)$i_subsets(i,'psh'), i_wst(i,'fg') }] = YES ;
$elseif.pshwat %GSw_PSHwatertypes% == 2
* option 2 allows fresh/saline ground water and wastewater
$else.pshwat
$endif.pshwat
*** Restrict valcap for hybrid storage techs based on Sw_HybridPlant switch
* 0: Ban all storage, including CSP
if(Sw_HybridPlant = 0,
ban(i)$i_subsets(i,'storage_hybrid') = yes ;
) ;
* 1: Allow CSP, ban all other storage
if(Sw_HybridPlant = 1,
ban(i)$[i_subsets(i,'storage_hybrid')$(not sameas(i,'csp_storage'))] = yes ;
ban(i)$i_subsets(i,'csp_storage') = no ;
) ;
* 2: Allow hybrid plants, excluding CSP
if(Sw_HybridPlant = 2,
ban(i)$[i_subsets(i,'storage_hybrid')$(not sameas(i,'csp_storage'))] = no ;
ban(i)$i_subsets(i,'csp_storage') = yes ;
) ;
* 3: Allow CSP and all other hybrid plants (note csp_storage bans are controlled by Sw_CSP)
if(Sw_HybridPlant = 3,
ban(i)$[i_subsets(i,'storage_hybrid')$(not sameas(i,'csp_storage'))] = no ;
) ;
*ban techs in hybrid PV+battery if the switch calls for it
if(Sw_PVB=0,
ban(i)$i_subsets(i,'pvb') = yes ;
bannew(i)$i_subsets(i,'pvb') = yes ;
) ;
* Ban PVB_Types that aren't included in the model
$ifthen.pvb123 %GSw_PVB_Types% == '1_2'
ban(i)$i_subsets(i,'pvb3') = yes ;
$endif.pvb123
$ifthen.pvb12 %GSw_PVB_Types% == '1'
ban(i)$i_subsets(i,'pvb2') = yes ;
ban(i)$i_subsets(i,'pvb3') = yes ;
$endif.pvb12
*** Restrict valcap for storage techs based on Sw_Storage switch
* 0: Ban all storage
if(Sw_Storage = 0,
ban(i)$i_subsets(i,'storage_standalone') = yes ;
Sw_BatteryMandate = 0 ;
) ;
* 3: Ban 2-, 6-, and 10-hour batteries (keep 4- and 8-hour batteries and PSH)
if(Sw_Storage = 3,
ban(i)$[i_subsets(i,'storage_standalone')
$(sameas(i,'battery_2') or sameas(i,'battery_6') or sameas(i,'battery_10'))] = yes ;
) ;
* 4: Ban everything except 4-hour batteries
if(Sw_Storage = 4,
ban(i)$[i_subsets(i,'storage_standalone')$(not sameas(i,'battery_4'))] = yes ;
) ;
* option to ban upgrades
ban(i)$[upgrade(i)$(not Sw_Upgrades)] = yes ;
bannew(i)$[upgrade(i)$(not Sw_Upgrades)] = yes ;
if(Sw_WaterMain = 1,
*By default, ban new builds with bannew_ctt cooling techs for all i,
bannew(i)$[sum{ctt$bannew_ctt(ctt), i_ctt(i,ctt) }] = YES ;
* ban new builds of Nuclear and coal-CCS with dry cooling techs as cooling requirements
* of nuclear and coal-CCS make dry cooling impractical
bannew(i)$[sum{ctt_i_ii(i,'Nuclear'), i_ctt(i,'d') }] = YES ;
bannew(i)$[sum{ctt_i_ii(i,'coal-CCS_mod'), i_ctt(i,'d') }] = YES ;
bannew(i)$[sum{ctt_i_ii(i,'coal-CCS_max'), i_ctt(i,'d') }] = YES ;
bannew(i)$[sum{ctt_i_ii(i,'Nuclear-SMR'), i_ctt(i,'d') }] = YES ;
*ban and bannew all non-numeraire techs that are derived from ban numeraire techs
ban(i)$sum{ii$ban(ii), ctt_i_ii(i,ii) } = YES ;
bannew(i)$sum{ii$bannew(ii), ctt_i_ii(i,ii) } = YES ;
* ban new builds of water sources included in bannew_wst for all i
bannew(i)$[sum{wst$bannew_wst(wst), i_wst(i,wst) }] = YES ;
* end parentheses for Sw_WaterMain = 1
) ;
* Turn off canadian imports as an option when running NARIS
$ifthen.naris %GSw_Region% == "naris"
ban(i)$i_subsets(i,'canada') = yes ;
$endif.naris
* Ban DUPV, CSP, and Geothermal resources that do not remain after aggregation
set resourceclass "renewable resource classes" /0*20/ ;
parameter resourceclassnum(resourceclass) "numeric value for resource class" ;
resourceclassnum(resourceclass) = resourceclass.val ;
set tech_resourceclass(i,resourceclass) "map from CSP/DUPV techs to resource classes"
/
$offlisting
$ondelim
$include inputs_case%ds%tech_resourceclass.csv
$offdelim
$onlisting
/ ;
* There are 12 CSP resource classes by default. If Sw_NumCSPclasses < 12, we ban the
* CSP techs with resource class > Sw_NumCSPclasses
if(Sw_NumCSPclasses < 12,
ban(i)$[i_subsets(i,'csp')
$sum{resourceclass$tech_resourceclass(i,resourceclass),
resourceclassnum(resourceclass)>Sw_NumCSPclasses }] = yes ;
) ;
* There are 7 DUPV resource classes by default. If Sw_NumDUPVclasses < 7, we ban the
* DUPV techs with resource class > Sw_NumDUPVclasses
if(Sw_NumDUPVclasses < 7,
ban(i)$[i_subsets(i,'dupv')
$sum{resourceclass$tech_resourceclass(i,resourceclass),
resourceclassnum(resourceclass)>Sw_NumDUPVclasses }] = yes ;
) ;
*Ban Geothermal resources that do not remain after aggregation
if(Sw_NumGeoclasses < 10,
ban(i)$[i_subsets(i,'geo')
$sum{resourceclass$tech_resourceclass(i,resourceclass),
resourceclassnum(resourceclass)>Sw_NumGeoclasses }] = yes ;
) ;
*Ingest list of new nuclear restricted BAs ('p' regions), ba list is consistent with NCSL restrictions.
*https://www.ncsl.org/research/environment-and-natural-resources/states-restrictions-on-new-nuclear-power-facility.aspx
$onempty
set nuclear_ba_ban(r) "List of BAs where new nuclear builds are restricted"
/
$offlisting
$include inputs_case%ds%nuclear_ba_ban_list.csv
$onlisting
/ ;
$offempty
* techs banned by state (note that this only applies to valinv later)
$onempty
table tech_banned(i,st) "Banned technologies by state"
$offlisting
$ondelim
$include inputs_case%ds%techs_banned.csv
$offdelim
$onlisting
;
$offempty
* --- define technology subsets ---
battery(i)$(not ban(i)) = yes$i_subsets(i,'battery') ;
beccs(i)$(not ban(i)) = yes$i_subsets(i,'beccs') ;
bio(i)$(not ban(i)) = yes$i_subsets(i,'bio') ;
boiler(i)$(not ban(i)) = yes$i_subsets(i,'boiler') ;
canada(i)$(not ban(i)) = yes$i_subsets(i,'canada') ;
ccs(i)$(not ban(i)) = yes$i_subsets(i,'ccs') ;
ccsflex_byp(i)$(not ban(i)) = yes$i_subsets(i,'ccsflex_byp') ;
ccsflex_dac(i)$(not ban(i)) = yes$i_subsets(i,'ccsflex_dac') ;
ccsflex_sto(i)$(not ban(i)) = yes$i_subsets(i,'ccsflex_sto') ;
ccsflex(i)$(not ban(i)) = yes$i_subsets(i,'ccsflex') ;
cf_tech(i)$(not ban(i)) = yes$i_subsets(i,'cf_tech') ;
coal_ccs(i)$(not ban(i)) = yes$i_subsets(i,'coal_ccs') ;
coal(i)$(not ban(i)) = yes$i_subsets(i,'coal') ;
cofire(i)$(not ban(i)) = yes$i_subsets(i,'cofire') ;
consume(i)$(not ban(i)) = yes$i_subsets(i,'consume') ;
conv(i)$(not ban(i)) = yes$i_subsets(i,'conv') ;
csp_storage(i)$(not ban(i)) = yes$i_subsets(i,'csp_storage') ;
csp(i)$(not ban(i)) = yes$i_subsets(i,'csp') ;
csp1(i)$(not ban(i)) = yes$i_subsets(i,'csp1') ;
csp2(i)$(not ban(i)) = yes$i_subsets(i,'csp2') ;
csp3(i)$(not ban(i)) = yes$i_subsets(i,'csp3') ;
csp4(i)$(not ban(i)) = yes$i_subsets(i,'csp4') ;
dac(i)$(not ban(i)) = yes$i_subsets(i,'dac') ;
distpv(i)$(not ban(i)) = yes$i_subsets(i,'distpv') ;
dr(i)$(not ban(i)) = yes$i_subsets(i,'dr') ;
dr1(i)$(not ban(i)) = yes$i_subsets(i,'dr1') ;
dr2(i)$(not ban(i)) = yes$i_subsets(i,'dr2') ;
demand_flex(i)$(not ban(i)) = yes$i_subsets(i,'demand_flex') ;
dupv(i)$(not ban(i)) = yes$i_subsets(i,'dupv') ;
evmc(i)$(not ban(i)) = yes$i_subsets(i,'evmc') ;
evmc_storage(i)$(not ban(i)) = yes$i_subsets(i,'evmc_storage') ;
evmc_shape(i)$(not ban(i)) = yes$i_subsets(i,'evmc_shape') ;
fossil(i)$(not ban(i)) = yes$i_subsets(i,'fossil') ;
gas_cc_ccs(i)$(not ban(i)) = yes$i_subsets(i,'gas_cc_ccs') ;
gas_cc(i)$(not ban(i)) = yes$i_subsets(i,'gas_cc') ;
gas_ct(i)$(not ban(i)) = yes$i_subsets(i,'gas_ct') ;
gas(i)$(not ban(i)) = yes$i_subsets(i,'gas') ;
geo_base(i)$(not ban(i)) = yes$i_subsets(i,'geo_base') ;
geo_hydro(i)$(not ban(i)) = yes$i_subsets(i,'geo_hydro') ;
geo_egs(i)$(not ban(i)) = yes$i_subsets(i,'geo_egs') ;
geo_extra(i)$(not ban(i)) = yes$i_subsets(i,'geo_extra') ;
geo(i)$(not ban(i)) = yes$i_subsets(i,'geo') ;
h2_ct(i)$(not ban(i)) = yes$i_subsets(i,'h2_ct') ;
h2(i)$(not ban(i)) = yes$i_subsets(i,'h2') ;
hydro_d(i)$(not ban(i)) = yes$i_subsets(i,'hydro_d') ;
hydro_nd(i)$(not ban(i)) = yes$i_subsets(i,'hydro_nd') ;
hydro(i)$(not ban(i)) = yes$i_subsets(i,'hydro') ;
lfill(i)$(not ban(i)) = yes$i_subsets(i,'lfill') ;
nondispatch(i)$(not ban(i)) = yes$i_subsets(i,'nondispatch') ;
nuclear(i)$(not ban(i)) = yes$i_subsets(i,'nuclear') ;
ofswind(i)$(not ban(i)) = yes$i_subsets(i,'ofswind') ;
ogs(i)$(not ban(i)) = yes$i_subsets(i,'ogs') ;
onswind(i)$(not ban(i)) = yes$i_subsets(i,'onswind') ;
psh(i)$(not ban(i)) = yes$i_subsets(i,'psh') ;
pv(i)$(not ban(i)) = yes$i_subsets(i,'pv') ;
pvb(i)$(not ban(i)) = yes$i_subsets(i,'pvb') ;
pvb1(i)$(not ban(i)) = yes$i_subsets(i,'pvb1') ;
pvb2(i)$(not ban(i)) = yes$i_subsets(i,'pvb2') ;
pvb3(i)$(not ban(i)) = yes$i_subsets(i,'pvb3') ;
re(i)$(not ban(i)) = yes$i_subsets(i,'re') ;
refurbtech(i)$(not ban(i)) = yes$i_subsets(i,'refurbtech') ;
rsc_i(i)$(not ban(i)) = yes$i_subsets(i,'rsc') ;
smr(i)$(not ban(i)) = yes$i_subsets(i,'smr') ;
storage_hybrid(i)$(not ban(i)) = yes$i_subsets(i,'storage_hybrid') ;
storage_standalone(i)$(not ban(i)) = yes$i_subsets(i,'storage_standalone') ;
storage(i)$(not ban(i)) = yes$i_subsets(i,'storage') ;
thermal_storage(i)$(not ban(i)) = yes$i_subsets(i,'thermal_storage') ;
upv(i)$(not ban(i)) = yes$i_subsets(i,'upv') ;
vre_distributed(i)$(not ban(i)) = yes$i_subsets(i,'vre_distributed') ;
vre_no_csp(i)$(not ban(i)) = yes$i_subsets(i,'vre_no_csp') ;
vre_utility(i)$(not ban(i)) = yes$i_subsets(i,'vre_utility') ;
vre(i)$(not ban(i)) = yes$i_subsets(i,'vre') ;
wind(i)$(not ban(i)) = yes$i_subsets(i,'wind') ;
* Create mapping of technology groups to technologies
tg_i('wind-ons',i)$onswind(i) = yes ;
tg_i('wind-ofs',i)$ofswind(i) = yes ;
tg_i('pv',i)$[(pv(i) or pvb(i))$(not distpv(i))] = yes ;
tg_i('csp',i)$csp(i) = yes ;
tg_i('ccs',i)$ccs(i) = yes ;
tg_i('gas-uncontrolled',i)$[gas(i)$(not ccs(i))] = yes ;
tg_i('nuclear',i)$nuclear(i) = yes ;
tg_i('storage',i)$storage_standalone(i) = yes ;
tg_i('h2',i)$h2_ct(i) = yes ;
*Hybrid pv+battery (PVB) configurations are defined by:
* (1) inverter loading ratio (DC/AC) and
* (2) battery capacity ratio (Battery/PV Array)
*Each configuration has ten resource classes
*The PV portion refers to "UPV", but not "DUPV"
*The battery portion refers to "battery_X", where X is the duration
set pvb_config "set of hybrid pv+battery configurations" / pvb1, pvb2, pvb3 / ;
set pvb_agg(pvb_config,i) "crosswalk between hybrid pv+battery configurations and technology options"
/
pvb1.(pvb1_1, pvb1_2, pvb1_3, pvb1_4, pvb1_5, pvb1_6, pvb1_7, pvb1_8, pvb1_9, pvb1_10)
pvb2.(pvb2_1, pvb2_2, pvb2_3, pvb2_4, pvb2_5, pvb2_6, pvb2_7, pvb2_8, pvb2_9, pvb2_10)
pvb3.(pvb3_1, pvb3_2, pvb3_3, pvb3_4, pvb3_5, pvb3_6, pvb3_7, pvb3_8, pvb3_9, pvb3_10)
/ ;
*add non-numeraire CSPs in index i of already defined set tg_i(tg,i)
tg_i("csp",i)$[(csp1(i) or csp2(i) or csp3(i) or csp4(i))$Sw_WaterMain] = yes ;
*Offhsore wind turbine types
set ofstype "offshore types used in offshore requirement constraint (eq_RPS_OFSWind)" / ofs_fix, ofs_float, ofs_all / ;
set ofstype_i(ofstype,i) "crosswalk between ofstype and i"
/
ofs_all.(wind-ofs_1*wind-ofs_15)
ofs_fix.(wind-ofs_1*wind-ofs_7)
ofs_float.(wind-ofs_8*wind-ofs_15)
/ ;
$onempty
table water_with_cons_rate(i,ctt,w,r) "--gal/MWh-- technology specific-cooling tech based water withdrawal and consumption data"
$offlisting
$ondelim
$include inputs_case%ds%water_with_cons_rate.csv
$offdelim
$onlisting
;
$offempty
$onempty
* Water requirement if all filling takes place in 1 year and minimum reservoir level is 15% of max volume
table water_req_psh(r,rscbin) "--Mgal/MW/yr-- required water for PSH during construction to fill reservoir"
$offlisting
$ondelim
$include inputs_case%ds%water_req_psh_10h_1_51.csv
$offdelim
$onlisting
;
$offempty
* Recalculate PSH water requirements based on user input filling time
scalar psh_fillyrs "number of years assumed to fill PSH reservoirs" /%GSw_PSHfillyears%/ ;
water_req_psh(r,rscbin) = round(water_req_psh(r,rscbin) / psh_fillyrs, 6) ;
*populate the water withdrawal and consumption data to non-numeraire technologies
*based on numeraire techs and cooling technologies types to avoid repetitive
*entry of data in the input data file and provide flexibility
*in populating data if new combinations come along the way
water_with_cons_rate(i,ctt,w,r)$i_water_cooling(i) =
sum{(ii,wst)$i_ii_ctt_wst(i,ii,ctt,wst), water_with_cons_rate(ii,ctt,w,r) } ;
*CSP techs have same water withdrawal and consumption rates; populating all CSP data with the data of csp1_1
water_with_cons_rate(i,ctt,w,r)$[i_water_cooling(i)$(csp1(i) or csp2(i) or csp3(i) or csp4(i))] =
sum{(ii,wst)$i_ii_ctt_wst(i,ii,ctt,wst), water_with_cons_rate("csp1_1",ctt,w,r) } ;
water_with_cons_rate(ii,ctt,w,r)$[sum{(wst,i)$i_ii_ctt_wst(i,ii,ctt,wst), 1 }] = no ;
parameter water_rate(i,w,r) "--gal/MWh-- water withdrawal/consumption w rate in region r by technology i" ;
* adding geothermal categories for water accounting
i_water(i)$geo(i) = yes ;
water_with_cons_rate(i,ctt,w,r)$geo(i) = water_with_cons_rate("geothermal",ctt,w,r) ;
* Till this point, i already has non-numeraire techs (e.g., gas-CC_o_fsa, gas-CC_r_fsa,
*and gas-CC_r_fg) instead of numeraire technology (e.g., gas-CC)
* The line below just removes ctt dimension, by summing over ctt.