OSeMOSYS / osemosys_global

A global power system model generator for OSeMOSYS
https://osemosys-global.readthedocs.io/
GNU Affero General Public License v3.0
26 stars 15 forks source link

[BUG]: Adding `CCG` as a `no_invest` technology breaks workflow #158

Open trevorb1 opened 1 year ago

trevorb1 commented 1 year ago

Conda environment check

Current Behavior

If you add CCG as a no_invest technology, an extra PWRCCGxxxxx00 technology is written out to the the TotalAnnualMaxCapacityInvestment csv file. This leads to a double definition error thrown by glpk

Expected Behavior

Only one PWRCCGxxxxx00 is written out to the the TotalAnnualMaxCapacityInvestment csv file

Steps To Reproduce

  1. Add CCG to the no_invest technology list in the config file
  2. Run the workflow with snakemake -c

Operating System

Linux

Log output

GLPSOL--GLPK LP/MIP Solver 5.0
Parameter(s) specified in the command line:
 -m resources/osemosys_fast_preprocessed.txt -d results/India/PreProcessed_India.txt
 --wlp results/India/India.lp --check
Reading model section from resources/osemosys_fast_preprocessed.txt...
1130 lines were read
Reading data section from results/India/PreProcessed_India.txt...
results/India/PreProcessed_India.txt:31346: TotalAnnualMaxCapacityInvestment[GLOBAL,PWRCCGINDSO00,2020] already defined
Context: ...49 0 GLOBAL PWRBIOINDSO01 2050 0 GLOBAL PWRCCGINDSO00 2020 0
MathProg model processing error

Anything else?

I think the cause of this is the two CCG options in OG. PWRCCGxxxxx00 is assigned to all existing CCG plants as they have slightly worse efficiencies then new CCG plants. To prevent investment in them, all PWRCCGxxxxx00 techs are assigned a TotalAnnualMaxCapacityInvestment value of 0 by default, and the model can only invest in new high efficiecny CCG plants, PWRCCGxxxxx01.

When we add CCG to the no-invest technology list, both PWRCCGxxxxx00 and PWRCCGxxxxx01 are added to the TotalAnnualMaxCapacityInvestment data. However, since PWRCCGxxxxx00 is already there by default, it gets defined twice.