From 2295da85813e129959479a7a457bc9ef7a2460d4 Mon Sep 17 00:00:00 2001
From: Alois Dirnaichner <alodi@directbox.com>
Date: Wed, 25 Mar 2020 15:21:58 +0100
Subject: [PATCH] Replace conversion factor for the energy content of methane.

---
 core/declarations.gms                          | 2 +-
 core/equations.gms                             | 2 +-
 core/presolve.gms                              | 8 +++-----
 modules/37_industry/fixed_shares/postsolve.gms | 2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/core/declarations.gms b/core/declarations.gms
index e7858c8..29febcb 100644
--- a/core/declarations.gms
+++ b/core/declarations.gms
@@ -432,7 +432,7 @@ s_macChange                                           "maximum yearly increase o
 s_tgn_2_pgc                                           "conversion factor 100-yr GWP from TgN to PgCeq"
 s_tgch4_2_pgc                                         "conversion factor 100-yr GWP from TgCH4 to PgCeq"
 
-s_ch4landfill_mac                                     "Factor to calculate gas from landfills to be used as SE carrier"  /0.001638/
+sm_MtCH4_2_TWa                                        "Energy content of methane. MtCH4 --> TWa: 1 MtCH4 = 1.23 * 10^6 toe * 42 GJ/toe * 10^-9 EJ/GJ * 1 TWa/31.536 EJ = 0.001638 TWa (BP statistical review)"  /0.001638/
 
 sm_D2015_2_D2005                                      "Convert $2015 to $2005 by dividing by 1.2: 1/1.2 = 0.8333"      /0.8333/
 sm_DptCO2_2_TDpGtC                                    "Conversion multiplier to go from $/tCO2 to T$/GtC: 44/12/1000"     /0.00366667/ 
diff --git a/core/equations.gms b/core/equations.gms
index d7b2fa6..987f1e5 100644
--- a/core/equations.gms
+++ b/core/equations.gms
@@ -120,7 +120,7 @@ q_balSe(t,regi,enty2)$( entySE(enty2) AND (NOT (sameas(enty2,"seel"))) )..
          )
 ***   add (reused gas from waste landfills) to segas to not account for CO2 
 ***   emissions - it comes from biomass
-  + ( s_ch4landfill_mac
+  + ( sm_MtCH4_2_TWa
     * ( vm_macBase(t,regi,"ch4wstl")
       - vm_emiMacSector(t,regi,"ch4wstl")
       )
diff --git a/core/presolve.gms b/core/presolve.gms
index 4629f60..d55cb4a 100644
--- a/core/presolve.gms
+++ b/core/presolve.gms
@@ -269,9 +269,8 @@ pm_macStep(ttot,regi,enty)$(MacSector(enty))
   = min(801, ceil(p_priceCO2forMAC(ttot,regi,enty) / sm_dmac) + 1);
 
 *** If the gas price increase since 2005 is higher than the CO2 price, it will drive CH4 emission abatement.
-*** Conversion: pm_priceCO2 [$/tCeq]; T$/TWa = 1e6 M$/TWa * 0.001638 TWa/MtCH4 * 1 MtCH4/s_gwpCH4 MtCO2eq * (44/12) MtCO2eq/MtCeq
-*** conversion factor MtCH4 --> TWa: 1 MtCH4 = 1.23 * 10^6 toe * 42 GJ/toe * 10^-9 EJ/GJ * 1 TWa/31.536 EJ = 0.001638 TWa (BP statistical review)
-p_priceGas(ttot,regi)=q_balPe.m(ttot,regi,"pegas")/(qm_budget.m(ttot,regi)+sm_eps) * 1000000 * 0.001638 * (1/s_gwpCH4) * 44/12;
+*** Conversion: pm_priceCO2 [$/tCeq]; T$/TWa = 1e6 M$/TWa * sm_MtCH4_2_TWa * 1 MtCH4/s_gwpCH4 MtCO2eq * (44/12) MtCO2eq/MtCeq
+p_priceGas(ttot,regi)=q_balPe.m(ttot,regi,"pegas")/(qm_budget.m(ttot,regi)+sm_eps) * 1000000 * sm_MtCH4_2_TWa * (1/s_gwpCH4) * 44/12;
 
 pm_macStep(ttot,regi,"ch4gas")
   = min(801, ceil(max(pm_priceCO2(ttot,regi) * (25/s_gwpCH4), max(0,(p_priceGas(ttot,regi)-p_priceGas("2005",regi))) ) / sm_dmac) + 1);
@@ -403,9 +402,8 @@ pm_macCost(ttot,regi,emiMacSector(enty))
 
 *JeS* add 50% of abated CH4 from coal MACs to PEprod. CH4 from oil production is usually flared and not re-used. CH4 from gas production is mostly avoided losses from leakages.
 *** These losses are not accounted for, so neither are the avoided losses.
-*** conversion factor MtCH4 --> TWa: 1 MtCH4 = 1.23 * 10^6 toe * 42 GJ/toe * 10^-9 EJ/GJ * 1 TWa/31.536 EJ = 0.001638 (BP statistical review)
 p_macPE(ttot,regi,enty) = 0.0;
-p_macPE(ttot,regi,"pegas")$(ttot.val gt 2005) = 0.001638 * 0.5 * (vm_macBase.l(ttot,regi,"ch4coal")-vm_emiMacSector.l(ttot,regi,"ch4coal"));
+p_macPE(ttot,regi,"pegas")$(ttot.val gt 2005) = sm_MtCH4_2_TWa * 0.5 * (vm_macBase.l(ttot,regi,"ch4coal")-vm_emiMacSector.l(ttot,regi,"ch4coal"));
 
 
 ***------------ adjust adjustment costs for advanced vehicles according to CO2 price in the previous time step ----------------------
diff --git a/modules/37_industry/fixed_shares/postsolve.gms b/modules/37_industry/fixed_shares/postsolve.gms
index 314d19e..2d7a5f2 100644
--- a/modules/37_industry/fixed_shares/postsolve.gms
+++ b/modules/37_industry/fixed_shares/postsolve.gms
@@ -30,7 +30,7 @@ loop (enty$( sameas(enty,"co2") OR sameas(enty,"cco2") ),
               vm_prodSE.l(ttot,regi,entyPE2,entySE,te2)
             )
             !! SE CH4 from waste bypass
-          + ( 0.001638
+          + ( sm_MtCH4_2_TWa
             * ( vm_macBase.l(ttot,regi,"ch4wstl")
               - vm_emiMacSector.l(ttot,regi,"ch4wstl")
               )
-- 
GitLab