Skip to content

Commit

Permalink
Fix bug in emissions
Browse files Browse the repository at this point in the history
  • Loading branch information
katarkow committed Jul 29, 2024
1 parent f9e6272 commit 8ea6f91
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
21 changes: 11 additions & 10 deletions core/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -740,18 +740,19 @@ q_emiMac(t,regi,emiMac) ..
***--------------------------------------------------
q_emiCdrAll(t,regi)..
vm_emiCdrAll(t,regi)
=e= !! BECC + DACC
(sum(emiBECCS2te(enty,enty2,te,enty3),vm_emiTeDetail(t,regi,enty,enty2,te,enty3))
+ sum(teCCS2rlf(te,rlf), vm_co2capture_cdr(t,regi,"cco2","ico2","ccsinje",rlf)))
!! scaled by the fraction that gets stored geologically
* (sum(teCCS2rlf(te,rlf),
vm_co2CCS(t,regi,"cco2","ico2",te,rlf)) /
(sum(teCCS2rlf(te,rlf),
vm_co2capture(t,regi,"cco2","ico2","ccsinje",rlf))+sm_eps))
=e=
( !! BECC + DACC
sum(emiBECCS2te(enty,enty2,te,enty3),vm_emiTeDetail(t,regi,enty,enty2,te,enty3))
- vm_emiCdrTeDetail(t, regi, "dac") !! this is a negative value
)
* ( !! scaled by the fraction that gets stored geologically
sum(teCCS2rlf(te, rlf), vm_co2CCS(t, regi, "cco2", "ico2", te, rlf))
/ (sum(teCCS2rlf(te, rlf), vm_co2capture(t, regi, "cco2", "ico2", "ccsinje", rlf)) + sm_eps)
)
!! net negative emissions from co2luc
- p_macBaseMagpieNegCo2(t,regi)
!! negative emissions from the cdr module that are not stored geologically
- (vm_emiCdr(t,regi,"co2") + sum(teCCS2rlf(te,rlf), vm_co2capture_cdr(t,regi,"cco2","ico2","ccsinje",rlf)))
!! negative emissions from the cdr module that are not stored geologically
- (vm_emiCdr(t,regi,"co2") - vm_emiCdrTeDetail(t, regi, "dac"))
;


Expand Down
2 changes: 2 additions & 0 deletions modules/33_CDR/portfolio/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if(card(te_used33) eq 0,
*** Fix CCS from CDR if there're no technologies that require CCS
if(card(te_ccs33) eq 0,
vm_co2capture_cdr.fx(t,regi,enty,enty2,te,rlf)$ccs2te(enty,enty2,te) = 0;
v33_co2emi_non_atm.fx(t,regi,te_all33) = 0;
);

*** Fix negative emissions and FE demand to zero for all the technologies that are not used
Expand All @@ -27,6 +28,7 @@ v33_FEdemand.fx(t,regi,entyFe,entyFe2,te_all33)$(not te_used33(te_all33) and fe2
*** to reduce unnecessary freedom (and likelyhood of spontaneous solver infeasibilities)
vm_emiCdrTeDetail.fx(t,regi,te_used33)$(t.val lt 2025) = 0.0;
v33_FEdemand.fx(t,regi,entyFe,entyFe2,te_used33)$(fe2cdr(entyFe,entyFe2,te_used33) AND (t.val lt 2025)) = 0.0;
v33_co2emi_non_atm.fx(t,regi,te_used33)$(t.val lt 2025) = 0;
vm_emiCdr.fx(t,regi,"co2")$(t.val lt 2025) = 0;
vm_omcosts_cdr.fx(t,regi)$((t.val lt 2025)) = 0;
vm_cap.fx(t,regi,"weathering",rlf)$(t.val lt 2025) = 0;
Expand Down
8 changes: 5 additions & 3 deletions modules/33_CDR/portfolio/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*** | Contact: [email protected]
*** SOF ./modules/33_CDR/portfolio/declarations.gms
scalars
s33_capture_rate "CO2 capture rate for capturing emissions, e.g., from burning natural gas" / 0.9 /

s33_co2_rem_pot "specific carbon removal potential [Gt C per Gt ground rock]"
s33_co2_rem_rate "carbon removal rate [fraction of annual reduction of total carbon removal potential]"
s33_costs_fix "fixed costs for mining, grinding, spreading [T$/Gt stone]"
Expand All @@ -28,19 +30,19 @@ v33_EW_onfield(ttot,all_regi,rlf,rlf) "amount of ground rock spread on fields i
v33_EW_onfield_tot(ttot,all_regi,rlf,rlf) "total amount of ground rock on fields, for each climate zone and transportation distance [Gt]"
v33_FEdemand(ttot,all_regi,all_enty,all_enty,all_te) "FE demand of each technology [TWa]"
vm_co2capture_cdr(ttot,all_regi,all_enty,all_enty,all_te,rlf) "total emissions captured through technologies in the CDR module that enter the CCUS chain + captured emissions from associated FE demand [GtC / a]"
v33_co2capture_non_atm(ttot, all_regi) "part of the captured CO2 from CDR-related acitivites that does not come from the atmosphere [GtC / a]"
v33_co2emi_non_atm(ttot,all_regi,all_te) "captured CO2 from CDR-related acitivites that does not come from the atmosphere [GtC / a]"
;

negative variables
vm_emiCdrTeDetail(ttot,all_regi,all_te) "(negative) emissions from CDR technologies in the CDR module by technology. Includes all atmospheric CO2 that enter the CCUS chain (i.e. CO2 stored (CDR) AND used (not CDR)) [GtC / a]"
vm_emiCdrTeDetail(ttot,all_regi,all_te) "gross (negative) emissions from CDR technologies in the CDR module by technology. Includes all atmospheric CO2 that enter the CCUS chain (i.e. CO2 stored (CDR) AND used (not CDR)) [GtC / a]"
;

equations
q33_demFeCDR(ttot,all_regi,all_enty) "CDR demand balance for final energy"
q33_emiCDR(ttot,all_regi) "aggregates the (negative) emissions captured by the CDR technologies"
q33_H2bio_lim(ttot,all_regi) "limits H2 from bioenergy to FE - H2 demand from CDR, i.e. no H2 from bioenergy for DAC"
q33_capconst(ttot,all_regi,all_te) "calculates amount of carbon captured by DAC and OAE"
q33_co2capture_non_atm(ttot,all_regi) "calculates the share of captured CO2 that does not come from the atmosphere"
q33_co2emi_non_atm(ttot,all_regi,all_te) "calculates the share of captured CO2 that does not come from the atmosphere"
q33_ccsbal(ttot,all_regi,all_enty,all_enty,all_te) "calculates CCS emissions from CDR technologies"

q33_DAC_FEdemand(ttot,all_regi,all_enty) "calculates final energy demand from DAC"
Expand Down
34 changes: 21 additions & 13 deletions modules/33_CDR/portfolio/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@ q33_demFeCDR(t,regi,entyFe)$(entyFe2Sector(entyFe,"cdr"))..

***---------------------------------------------------------------------------
*' Sum of all CDR emissions other than BECCS and afforestation, which are calculated in the core.
*' The negative emissions are discounted by emissions that are released due to <100 percent capture
*' rate, as they are unavoidable (1-s33_capture_rate of the emissions that are possible to capture).
*' Note that this includes all atmospheric CO2 captured in this module that enters the CCUS chain.
***---------------------------------------------------------------------------
q33_emiCDR(t,regi)..
vm_emiCdr(t,regi,"co2")
=e=
sum(te_used33, vm_emiCdrTeDetail(t,regi,te_used33))
+ (1 - s33_capture_rate) * sum(te_ccs33, v33_co2emi_non_atm(t, regi, te_ccs33))
;

***---------------------------------------------------------------------------
*' Calculation of (negative) CO2 emissions from capacity.
*' Calculation of gross (negative) CO2 emissions from capacity.
*' Negative emissions from enhanced weathering also result from decaying rock
*' spread in previous timesteps, so emissions do not equal to the capacity
*' (i.e., how much rock is spread in a given timestep).
Expand All @@ -48,27 +51,31 @@ q33_capconst(t, regi, te_used33)$(not sameAs(te_used33, "weathering"))..
;

***---------------------------------------------------------------------------
*' The CO2 captured from the gas used for heat production
*' required for all CDR and from limestone decomposition ocean alkalinity enhancement,
*' assuming a certain capture rate s33_capture rate.
*' The CO2 captured from the gas used for heat production (DAC, OAE)
*' and from limestone decomposition (OAE only).
***---------------------------------------------------------------------------
q33_co2capture_non_atm(t, regi)..
v33_co2capture_non_atm(t, regi)
q33_co2emi_non_atm(t, regi, te_ccs33)..
v33_co2emi_non_atm(t, regi, te_ccs33)
=e=
fm_dataemiglob("pegas","seh2","gash2c","cco2") * sum(fe2cdr("fegas",entyFe2,te_used33), v33_FEdemand(t,regi,"fegas", entyFe2,te_used33))
- s33_OAE_chem_decomposition * sum(te_oae33, vm_emiCdrTeDetail(t, regi, te_oae33))
!! carbon captured from burning gas (DAC and OAE technologies)
fm_dataemiglob("pegas","seh2","gash2c","cco2") !! conversion from PE to emissions
* (1 / pm_eta_conv(t,regi,"gash2c")) !! conversion from PE to FE
* sum(fe2cdr("fegas", entyFe2, te_ccs33), v33_FEdemand(t, regi,"fegas", entyFe2, te_ccs33)) !! FE gas used
!! carbon captured from calcination (OAE technologies only)
- (s33_OAE_chem_decomposition * vm_emiCdrTeDetail(t, regi, te_ccs33))$te_oae33(te_ccs33)
;

***---------------------------------------------------------------------------
*' Preparation of captured emissions to enter the CCUS chain.
*' The first part of the equation describes emissions captured from the ambient air,
*' the second part is non-atmospheric CO2 (e.g., from energy usage).
*' The first part of the equation describes emissons captured from the ambient air,
*' the second part is non-atmospheric CO2 (e.g., from energy usage),
*' assuming a capture rate s33_capture_rate.
***---------------------------------------------------------------------------
q33_ccsbal(t, regi, ccs2te(ccsCo2(enty), enty2, te))..
sum(teCCS2rlf(te, rlf), vm_co2capture_cdr(t, regi, enty, enty2, te, rlf))
=e=
- vm_emiCdrTeDetail(t, regi, "dac")
+ v33_co2capture_non_atm(t, regi)
+ s33_capture_rate * sum(te_ccs33, v33_co2emi_non_atm(t, regi, te_ccs33))
;

***---------------------------------------------------------------------------
Expand All @@ -78,7 +85,8 @@ q33_ccsbal(t, regi, ccs2te(ccsCo2(enty), enty2, te))..
q33_H2bio_lim(t,regi)..
sum(pe2se("pebiolc","seh2",te), vm_prodSE(t,regi,"pebiolc","seh2",te))
=l=
vm_prodFe(t,regi,"seh2","feh2s","tdh2s") - sum(fe2cdr("feh2s",entyFe2,te_used33), v33_FEdemand(t,regi,"feh2s",entyFe2,te_used33))
vm_prodFe(t,regi,"seh2","feh2s","tdh2s")
- sum(fe2cdr("feh2s",entyFe2,te_used33), v33_FEdemand(t,regi,"feh2s",entyFe2,te_used33))
;

***---------------------------------------------------------------------------
Expand Down Expand Up @@ -188,7 +196,7 @@ q33_EW_LimEmi(t,regi)..
*' Calculation of FE demand for OAE, i.e., electricity for rock preprocessing,
*' and heat for calcination.
***---------------------------------------------------------------------------
q33_OAE_FEdemand(t,regi,entyFe2, te_oae33)$sum(entyFe, fe2cdr(entyFe,entyFe2,te_oae33))..
q33_OAE_FEdemand(t,regi,entyFe2,te_oae33)$sum(entyFe, fe2cdr(entyFe,entyFe2,te_oae33))..
sum(fe2cdr(entyFe, entyFe2, te_oae33), v33_FEdemand(t, regi, entyFe, entyFe2, te_oae33))
=e=
p33_fedem(te_oae33, entyFe2) * sm_EJ_2_TWa * (- vm_emiCdrTeDetail(t, regi, te_oae33))
Expand Down

0 comments on commit 8ea6f91

Please sign in to comment.