Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix h2 peak in buildings #1654

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cfg$extramappings_historic <- ""
cfg$inputRevision <- "6.70"

#### Current CES parameter and GDX revision (commit hash) ####
cfg$CESandGDXversion <- "cdddb54b54a8586b4fef00eb60a3be6cfa23ca55"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for which scenarios did you run the calibration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the calibration for H12, EU21 and PBS and I'm planning to redo this once I've merged the trunk. Should I test the calibration with further scenarios?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully, we will have pbs as default soon and then I will anyway run new calibrations for all other scenarios. I think, for now SSP2EU is enough

cfg$CESandGDXversion <- "26b64ac550044570469168f1dd3bf236c6b2e12f"

#### Force the model to download new input data ####
cfg$force_download <- FALSE
Expand Down
1 change: 1 addition & 0 deletions config/gdx-files/files
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SDP_EI-GDP_gdp_SDP_EI-En_gdp_S
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP5-GDP_gdp_SSP5-En_gdp_SSP5-Kap_debt_limit-Reg_62eff8f7.gdx
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_2b1450bc.gdx
indu_subsectorspbs-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.gdx
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-H2zero-Reg_62eff8f7.gdx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you adding a new calibration file? The aim is that this will be the new default, right? This is only a temporal solution?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this will be deleted. I already took a note (somewhere) that I should remember to delete all this. Thanks for reminding me again.



112 changes: 56 additions & 56 deletions config/scenario_config.csv

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions config/scenario_config_H2zero.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ v_shfe.lo(t,regi,entyFe,sector)$pm_shfe_lo(t,regi,entyFe,sector) = pm_shfe_lo(t,
v_shGasLiq_fe.up(t,regi,sector)$pm_shGasLiq_fe_up(t,regi,sector) = pm_shGasLiq_fe_up(t,regi,sector);
v_shGasLiq_fe.lo(t,regi,sector)$pm_shGasLiq_fe_lo(t,regi,sector) = pm_shGasLiq_fe_lo(t,regi,sector);

*** RH: Fix H2 in buildings to zero until given year (always zero by default)
*** RH: Fix H2 in buildings to zero until given year (until 2025 by default)
vm_demFeSector.up(t,regi,"seh2","feh2s","build",emiMkt)$(t.val le c_H2InBuildOnlyAfter) = 0;

***----------------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion core/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,7 @@ $endif.altFeEmiFac
***######################## R SECTION START (MODULES) ###############################
*** THIS CODE IS CREATED AUTOMATICALLY, DO NOT MODIFY THESE LINES DIRECTLY
*** ANY DIRECT MODIFICATION WILL BE LOST AFTER NEXT MODEL START
*** CHANGES CAN BE DONE USING THE RESPECTIVE LINES IN scripts/start/prepare.R

sets

Expand Down Expand Up @@ -960,7 +961,7 @@ sets
codePerformance
/

module2realisation(modules,*) "mapping of modules and active realisations" /
module2realisation(modules,*) "mapping of modules and active realisations" /
macro . %macro%
welfare . %welfare%
PE_FE_parameters . %PE_FE_parameters%
Expand Down
2 changes: 1 addition & 1 deletion main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ parameter
parameter
c_H2InBuildOnlyAfter "Switch to fix H2 in buildings to zero until given year"
;
c_H2InBuildOnlyAfter = 2150; !! def = 2150 (rule out H2 in buildings)
c_H2InBuildOnlyAfter = 2025; !! def = 2025
*' For all years until the given year, FE demand for H2 in buildings is set to zero
parameter
c_peakBudgYr "date of net-zero CO2 emissions for peak budget runs without overshoot"
Expand Down
8 changes: 4 additions & 4 deletions modules/29_CES_parameters/calibrate/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ $ifthen.build_H2_offset "%buildings%" == "simple"

*** RK: feh2b offset scaled from 1% in 2025 to 50% in 2050 of fegab quantity
loop ((t,regi),
pm_cesdata(t,regi,"feh2b","offset_quantity")
= - (0.05 + 0.45 * min(1, max(0, (t.val - 2025) / (2050 - 2025))))
pm_cesdata(t,regi,"feh2b","offset_quantity")
= - (0.05 + 0.45 * min(1, (t.val - 2025) * max(0, (t.val - 2025) / (2080 - 2025)**2)))
* pm_cesdata(t,regi,"fegab","quantity")
- pm_cesdata(t,regi,"feh2b","quantity");
pm_cesdata(t,regi,"feh2b","quantity")
= (0.05 + 0.45 * min(1, max(0, (t.val - 2025) / (2050 - 2025))))
pm_cesdata(t,regi,"feh2b","quantity")
= (0.05 + 0.45 * min(1, (t.val - 2025) * max(0, (t.val - 2025) / (2080 - 2025)**2)))
* pm_cesdata(t,regi,"fegab","quantity");
);
$endif.build_H2_offset
Expand Down
2 changes: 1 addition & 1 deletion modules/29_CES_parameters/load/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*** Load CES parameters based on current model configuration
*** ATTENTION the file name is replaced by the function start_run()
*##################### R SECTION START (CES INPUT) ##########################
$include "./modules/29_CES_parameters/load/input/indu_subsectorspbs-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.inc"
$include "./modules/29_CES_parameters/load/input/indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.inc"
*###################### R SECTION END (CES INPUT) ###########################

option pm_cesdata:8:3:1;
Expand Down
1 change: 1 addition & 0 deletions modules/29_CES_parameters/load/input/files
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SDP_EI-GDP_gdp_SDP_EI-En_gdp_S
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP5-GDP_gdp_SSP5-En_gdp_SSP5-Kap_debt_limit-Reg_62eff8f7.inc
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_2b1450bc.inc
indu_subsectorspbs-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.inc
indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-H2zero-Reg_62eff8f7.inc



11 changes: 2 additions & 9 deletions modules/36_buildings/simple/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@
v36_costExponent.up(t,regi) = 20;


*** FS: no H2 in buildings before 2050
vm_demFeSector_afterTax.up('2010',regi,'seh2','feh2s','build','ES') = 0;
vm_demFeSector_afterTax.up('2015',regi,'seh2','feh2s','build','ES') = 0;
vm_demFeSector_afterTax.up('2020',regi,'seh2','feh2s','build','ES') = 1e-5;
vm_demFeSector_afterTax.up('2025',regi,'seh2','feh2s','build','ES') = 1e-5;


*** Assure that h2 penetration is not high in calibration so the extra t&d cost can be considered by the model. In case contrary, H2 is competitive against gas in buildings and industry even during calibration.
*** Fix H2 Phase-In costs to zero for calibration runs
$ifthen.CES_calibration "%CES_parameters%" == "calibrate"
v36_H2share.up(t,regi) = cm_build_H2costDecayStart;
v36_costAddH2LowPen.fx(t,regi) = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is v36_costAddH2LowPen still needed or coud it be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still needed for non-calibration runs. And in the current implementation it needs to be set to zero for a calibration run to make sure that no Phase-In costs are included.

$endif.CES_calibration


Expand Down
2 changes: 2 additions & 0 deletions modules/36_buildings/simple/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ Variables
Positive Variables
v36_expSlack(ttot,all_regi) "slack variable to avoid overflow on too high logistic function exponent"
v36_H2share(ttot,all_regi) "H2 share in gases"
v36_avgH2share(ttot, all_regi) "Average of the H2 share from this and the previous time period"
v36_costAddH2LowPen(ttot,all_regi) "low penetration H2 mark up component"
v36_costAddTeInvH2(ttot,all_regi,all_te) "Additional H2 phase-in cost at low H2 penetration levels [trUSD]"
;

Equations
q36_demFeBuild(ttot,all_regi,all_enty,all_emiMkt) "buildings final energy demand"
q36_H2Share(ttot,all_regi) "H2 share in gases"
q36_avgH2share(ttot, all_regi) "Computation of average of the H2 share from this and the previous time period"
q36_auxCostAddTeInv(ttot,all_regi) "logistic function exponent calculation for additional cost at low H2 penetration"
q36_costAddH2LowPen(ttot,all_regi) "additional annual investment costs under low H2 penetration in buildings"
q36_costAddH2PhaseIn(ttot,all_regi) "additional industry H2 t&d cost at low H2 penetration in buildings"
Expand Down
24 changes: 19 additions & 5 deletions modules/36_buildings/simple/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,46 @@ q36_costAddH2PhaseIn(t,regi)..
+ (v36_expSlack(t,regi) * 1e-8)
;


*' barrier cost for low penetration
$ifthen.no_calibration NOT "%CES_parameters%" == "calibration" !! CES_parameters
q36_costAddH2LowPen(t,regi)..
v36_costAddH2LowPen(t,regi)
=e=
cm_build_H2costAddH2Inv * sm_TWa_2_kWh / sm_trillion_2_non
cm_build_H2costAddH2Inv
* sm_TWa_2_kWh / sm_trillion_2_non
/ (1 + 3**v36_costExponent(t,regi))
;
$endif.no_calibration


*' Logistic function exponent for additional cost for hydrogen at low penetration cost equation
q36_auxCostAddTeInv(t,regi)..
v36_costExponent(t,regi)
=e=
10 / (cm_build_H2costDecayEnd - cm_build_H2costDecayStart)
* (v36_H2share(t,regi) + 1e-7
* (v36_avgH2share(t,regi) + 1e-7
- (cm_build_H2costDecayEnd + cm_build_H2costDecayStart) / 2
)
- v36_expSlack(t,regi)
;


*' Hydrogen fe share in buildings gases use (natural gas + hydrogen)
*' Average of the H2 share from this and the previous time period
q36_avgH2share(ttot, regi)$(ttot.val ge cm_startyear)..
v36_avgH2share(ttot, regi)
=e=
(v36_H2share(ttot, regi)
+ v36_H2share(ttot-1, regi)$(ttot.val > cm_startyear)
+ v36_H2share(ttot, regi)$(ttot.val = cm_startyear))
/ 2
;


*' Hydrogen fe share in buildings energy use
q36_H2Share(t,regi)..
v36_H2share(t,regi)
* sum(se2fe(entySe,entyFe,te)$(SAMEAS(entyFe,"feh2s")
OR SAMEAS(entyFe,"fegas")),
* sum(se2fe(entySe,entyFe,te)$(entyFe36(entyFe)),
vm_demFeSector_afterTax(t,regi,entySe,entyFe,"build","ES"))
=e=
sum(se2fe(entySe,entyFe,te)$SAMEAS(entyFe,"feh2s"),
Expand Down