From c60f4f7ef0589c20fc174c2d912bec4ca744b9e7 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Mon, 12 Aug 2024 12:35:20 +0200 Subject: [PATCH 1/5] add c_tech_CO2capturerate flag to manually adjust the CO2 capture rate of technologies via the config --- core/datainput.gms | 24 ++++++++++++++++++++++++ core/declarations.gms | 5 +++++ main.gms | 8 ++++++++ 3 files changed, 37 insertions(+) diff --git a/core/datainput.gms b/core/datainput.gms index 469ed5597..040fffa11 100644 --- a/core/datainput.gms +++ b/core/datainput.gms @@ -559,6 +559,30 @@ pm_share_trans("2130",regi) = 0.865; pm_share_trans("2150",regi) = 0.872; +$ifthen.tech_CO2capturerate not "%c_tech_CO2capturerate%" == "off" +p_PECarriers_CarbonContent(peFos)=pm_cintraw(peFos); +*** From conversation: 25 GtC/ZJ is the assumed carbon content of PE biomass (makes default bioh2c capture rate 90%) +*** Convert to GtC/TWa +p_PECarriers_CarbonContent("pebiolc")=25 / s_zj_2_twa; +loop(pe2se(entyPe,entySe,te)$(p_tech_co2capturerate(te)), + if(p_tech_CO2capturerate(te) gt 0, + if(p_tech_CO2capturerate(te) ge 1, + abort "Error: Inconsistent switch usage. A CO2 capture rate is greater than 1. Check c_tech_CO2capturerate."; + ); +*** Alter CO2 capture rate in fm_dataemiglob +*** fm_dataemiglob is given in GtC/ZJ + fm_dataemiglob(entyPe,entySe,te,"cco2") = p_tech_CO2capturerate(te) * p_PECarriers_CarbonContent(entyPe) * s_zj_2_twa; + if(sameAs(entyPe,"pebiolc"), + fm_dataemiglob(entyPe,entySe,te,"co2") = -fm_dataemiglob(entyPe,entySe,te,"cco2") ; + else + fm_dataemiglob(entyPe,entySe,te,"co2") = p_PECarriers_CarbonContent(entyPe) - fm_dataemiglob(entyPe,entySe,te,"cco2") ; + ); + ); +); +display fm_dataemiglob; +$endif.tech_CO2capturerate + + *JH* CO2 capture rate of CCS technologies (new SSP5 assumptions) if (c_ccscapratescen eq 2, fm_dataemiglob("pecoal","seel","igccc","co2") = 0.2; diff --git a/core/declarations.gms b/core/declarations.gms index 1e98f91bd..f1ed0dd21 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -119,6 +119,11 @@ p_gdppcap2050_PPP(all_regi) "regional GDP PPP per capita in p_maxPPP2050 "maximum income GDP PPP among regions in 2050" p_maxSpvCost "maximum spv investment cost among regions" +$ifthen.tech_CO2capturerate not "%c_tech_CO2capturerate%" == "off" +p_tech_CO2capturerate(all_te) "Technology specific CO2 capture rate" / %c_tech_CO2capturerate% / +p_PECarriers_CarbonContent(all_enty) "Carbon content of PE carriers [GtC/TWa]" +$endif.tech_CO2capturerate + pm_EN_demand_from_initialcap2(all_regi,all_enty) "PE demand resulting from the initialcap routine. [EJ, Uranium: MT U3O8]" pm_budgetCO2eq(all_regi) "budget for regional energy-emissions in period 1" p_actualbudgetco2(tall) "actual level of cumulated emissions starting from 2020 [GtCO2]" diff --git a/main.gms b/main.gms index ec69744f2..368cebc0c 100755 --- a/main.gms +++ b/main.gms @@ -1398,6 +1398,14 @@ $setGlobal cm_VREminShare off !! def = off *** amount of Carbon Capture and Storage (including DACCS and BECCS) is limited to a maximum of 2GtCO2 per yr globally, and 250 Mt CO2 per yr in EU28. *** This switch only works for model native regions. If you want to apply it to a group region use cm_implicitQttyTarget instead. $setGlobal cm_CCSmaxBound off !! def = off +*** c_tech_CO2capturerate "changes CO2 capture rate of carbon capture technologies" +*** Example on how to use: +*** c_tech_CO2capturerate bioh2c 0.8, bioftcrec 0.4 +*** This sets the CO2 capture rate of the bioh2c technology to 80% and the capture of bioftcrec (Bio-based Fischer-Tropsch with carbon capture) +*** to 40%. The capture rate here is measured as carbon captured relative to the total carbon content of the input fuel (including carbon that is converted into the output fuel). +*** Note: The change in capture rate via this switch follows directly after reading in the generisdata_emi.prn file. Hence, the subsequent corrections of the capture rate +*** related to CO2 pipeline leakage still come on top of this. +$setGlobal c_tech_CO2capturerate "bioh2c 0.8" !! def = off *** c_CES_calibration_new_structure <- 0 switch to 1 if you want to calibrate a CES structure different from input gdx $setglobal c_CES_calibration_new_structure 0 !! def = 0 !! regexp = 0|1 *** c_CES_calibration_write_prices <- 0 switch to 1 if you want to generate price file, you can use this as new p29_cesdata_price.cs4r price input file From b50e0b095109db09a760c1454d2d505a2620afe9 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Mon, 12 Aug 2024 12:37:42 +0200 Subject: [PATCH 2/5] stop overwriting emissions factors by reference GDX at the end of initialCap module to allow changing them in policy runs --- modules/05_initialCap/on/preloop.gms | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/05_initialCap/on/preloop.gms b/modules/05_initialCap/on/preloop.gms index 7a4852b23..2e97a5184 100644 --- a/modules/05_initialCap/on/preloop.gms +++ b/modules/05_initialCap/on/preloop.gms @@ -506,24 +506,14 @@ loop(regi, ); display pm_EN_demand_from_initialcap2, p05_emi2005_from_initialcap2; -*** To be moved to new emiAccounting module -* Discounting se2fe emissions from pe2se emission factors -loop(entySe$(sameas(entySe,"segafos") OR sameas(entySe,"seliqfos") OR sameas(entySe,"sesofos")), - pm_emifac(ttot,regi,entyPe,entySe,te,"co2")$pm_emifac(ttot,regi,entyPe,entySe,te,"co2") = - pm_emifac(ttot,regi,entyPe,entySe,te,"co2") - - pm_eta_conv(ttot,regi,te) - *( sum(se2fe(entySe,entyFe2,te2)$pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2"), pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2")*pm_eta_conv(ttot,regi,te2))/sum(se2fe(entySe,entyFe2,te2)$pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2"),1) ); ); -display pm_emifac; -); *** if cm_startyear > 2005, load outputs of InitialCap from input_ref.gdx if (cm_startyear gt 2005, Execute_Loadpoint 'input_ref' pm_eta_conv = pm_eta_conv; Execute_Loadpoint 'input_ref' o_INI_DirProdSeTe = o_INI_DirProdSeTe; - Execute_Loadpoint 'input_ref' pm_emifac = pm_emifac; Execute_Loadpoint 'input_ref' pm_EN_demand_from_initialcap2 = pm_EN_demand_from_initialcap2; Execute_Loadpoint 'input_ref' pm_pedem_res = pm_pedem_res; Execute_Loadpoint 'input_ref' pm_dataeta = pm_dataeta; @@ -557,4 +547,16 @@ $ifThen %cm_techcosts% == "GLO" $endIf ); +*** To be moved to new emiAccounting module +* Discounting se2fe emissions from pe2se emission factors +loop(entySe$(sameas(entySe,"segafos") OR sameas(entySe,"seliqfos") OR sameas(entySe,"sesofos")), + pm_emifac(ttot,regi,entyPe,entySe,te,"co2")$pm_emifac(ttot,regi,entyPe,entySe,te,"co2") = + pm_emifac(ttot,regi,entyPe,entySe,te,"co2") + - pm_eta_conv(ttot,regi,te) + *( sum(se2fe(entySe,entyFe2,te2)$pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2"), pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2")*pm_eta_conv(ttot,regi,te2))/sum(se2fe(entySe,entyFe2,te2)$pm_emifac(ttot,regi,entySe,entyFe2,te2,"co2"),1) ); +); + +display pm_emifac; +execute_unload 'after_emifacAdj_IniCap.gdx', pm_emifac, pm_eta_conv ; + *** EOF ./modules/05_initialCap/on/preloop.gms From 62a05763615a94ba5deb66657e7c6653c91cc23b Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Tue, 17 Sep 2024 15:40:04 +0200 Subject: [PATCH 3/5] fix codeCheck issues --- core/datainput.gms | 6 +++--- core/declarations.gms | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/datainput.gms b/core/datainput.gms index 040fffa11..5d267d62c 100644 --- a/core/datainput.gms +++ b/core/datainput.gms @@ -565,13 +565,13 @@ p_PECarriers_CarbonContent(peFos)=pm_cintraw(peFos); *** Convert to GtC/TWa p_PECarriers_CarbonContent("pebiolc")=25 / s_zj_2_twa; loop(pe2se(entyPe,entySe,te)$(p_tech_co2capturerate(te)), - if(p_tech_CO2capturerate(te) gt 0, - if(p_tech_CO2capturerate(te) ge 1, + if(p_tech_co2capturerate(te) gt 0, + if(p_tech_co2capturerate(te) ge 1, abort "Error: Inconsistent switch usage. A CO2 capture rate is greater than 1. Check c_tech_CO2capturerate."; ); *** Alter CO2 capture rate in fm_dataemiglob *** fm_dataemiglob is given in GtC/ZJ - fm_dataemiglob(entyPe,entySe,te,"cco2") = p_tech_CO2capturerate(te) * p_PECarriers_CarbonContent(entyPe) * s_zj_2_twa; + fm_dataemiglob(entyPe,entySe,te,"cco2") = p_tech_co2capturerate(te) * p_PECarriers_CarbonContent(entyPe) * s_zj_2_twa; if(sameAs(entyPe,"pebiolc"), fm_dataemiglob(entyPe,entySe,te,"co2") = -fm_dataemiglob(entyPe,entySe,te,"cco2") ; else diff --git a/core/declarations.gms b/core/declarations.gms index f1ed0dd21..f614b679d 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -120,7 +120,7 @@ p_maxPPP2050 "maximum income GDP PPP among regions in 2050" p_maxSpvCost "maximum spv investment cost among regions" $ifthen.tech_CO2capturerate not "%c_tech_CO2capturerate%" == "off" -p_tech_CO2capturerate(all_te) "Technology specific CO2 capture rate" / %c_tech_CO2capturerate% / +p_tech_co2capturerate(all_te) "Technology specific CO2 capture rate" / %c_tech_CO2capturerate% / p_PECarriers_CarbonContent(all_enty) "Carbon content of PE carriers [GtC/TWa]" $endif.tech_CO2capturerate From b187a8e2a29bbcb4f6a73f966c7d02b6b177f3ff Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Fri, 27 Sep 2024 08:44:13 +0200 Subject: [PATCH 4/5] switch c_tech_CO2capturerate off by default --- main.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.gms b/main.gms index 368cebc0c..6b91f3833 100755 --- a/main.gms +++ b/main.gms @@ -1405,7 +1405,7 @@ $setGlobal cm_CCSmaxBound off !! def = off *** to 40%. The capture rate here is measured as carbon captured relative to the total carbon content of the input fuel (including carbon that is converted into the output fuel). *** Note: The change in capture rate via this switch follows directly after reading in the generisdata_emi.prn file. Hence, the subsequent corrections of the capture rate *** related to CO2 pipeline leakage still come on top of this. -$setGlobal c_tech_CO2capturerate "bioh2c 0.8" !! def = off +$setGlobal c_tech_CO2capturerate off !! def = off *** c_CES_calibration_new_structure <- 0 switch to 1 if you want to calibrate a CES structure different from input gdx $setglobal c_CES_calibration_new_structure 0 !! def = 0 !! regexp = 0|1 *** c_CES_calibration_write_prices <- 0 switch to 1 if you want to generate price file, you can use this as new p29_cesdata_price.cs4r price input file From 030009fc87d7bec32c356709a87ceba5e4d78bb8 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Fri, 27 Sep 2024 08:46:18 +0200 Subject: [PATCH 5/5] clean up initialCap debugging --- modules/05_initialCap/on/preloop.gms | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/05_initialCap/on/preloop.gms b/modules/05_initialCap/on/preloop.gms index 2e97a5184..ff782479a 100644 --- a/modules/05_initialCap/on/preloop.gms +++ b/modules/05_initialCap/on/preloop.gms @@ -557,6 +557,5 @@ loop(entySe$(sameas(entySe,"segafos") OR sameas(entySe,"seliqfos") OR sameas(ent ); display pm_emifac; -execute_unload 'after_emifacAdj_IniCap.gdx', pm_emifac, pm_eta_conv ; *** EOF ./modules/05_initialCap/on/preloop.gms