Skip to content

Commit

Permalink
Made an option for flexible regional hydrogen demand
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Jun 28, 2024
1 parent a90f489 commit d1b5297
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 42 deletions.
3 changes: 2 additions & 1 deletion base/addons/hydrogen/bb4/hydrogen_balbase4.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ $ifi %H2TransInvest%==yes QVXH2KN_ES
$ifi %H2TransInvest%==yes QXH2LAMBDA_ES

* Flexible hydrogen demand in space by Ioannis
* If-statements here for flexible demand in space option
$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space
QSYNTHETIC_EQ_PRODUCTION
QSYNTHETIC_EQ_SHIFT
QSYNTHETIC_EQ_SHIFT_UP
QSYNTHETIC_EQ_SHIFT_DOWN
QSYNTHETIC_EQ_SHIFT_BALANCE_MOVE
QSYNTHETIC_EQ_SHIFT_BALANCE_OVERALL
$label no_flexible_h2_space

29 changes: 14 additions & 15 deletions base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ QHYDROGEN_EQ(IY411,IR,IS3,T)..
- SUM((IA,IHYDROGEN_GH2STO)$(RRRAAA(IR,IA) AND (IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2STO))),VHYDROGEN_STOLOADT(IY411,IA,IHYDROGEN_GH2STO,IS3,T))
=E=
IHYDROGEN_DH2_REGION_T_Y(IY411,IR,IS3,T)/(1-DISLOSS_H2(IR))+
*IK changes for synthetic fuel
VGE_T_SYNFUEL_ST(IY411,IR,IS3,T)/(1-DISLOSS_H2(IR)) +

$ifi %flexible_h2_space%==yes VGE_T_FLEXDH2(IY411,IR,IS3,T)/(1-DISLOSS_H2(IR)) +
SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(IY411,IA,IS3,T)/(1-DISLOSS_H2(IA)))
+ SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2FUEL)$(RRRAAA(IR,IA)),VGE_T(IY411,IA,IHYDROGEN_GH2FUEL,IS3,T)/GDATA(IHYDROGEN_GH2FUEL,'GDFE'))
+ SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T(IY411,IA,IHYDROGEN_GH2TOBIOMETH,IS3,T)/GDATA(IHYDROGEN_GH2TOBIOMETH,'GDFE'))
Expand All @@ -81,48 +81,47 @@ $ONTEXT
*give it a try give the same demand

*Initiate the total
IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY,RRR) = HYDROGEN_DH2(YYY,RRR);
IHYDROGEN_DH2FLEX_REGION_Y_TOT(YYY,RRR) = HYDROGEN_DH2(YYY,RRR);
*Initiate the first value
IHYDROGEN_DH2SYNFUEL_REGION_Y(YYY,RRR)$((ORD(YYY) EQ 1)) = IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY,RRR);
IHYDROGEN_DH2FLEX_REGION_Y(YYY,RRR)$((ORD(YYY) EQ 1)) = IHYDROGEN_DH2FLEX_REGION_Y_TOT(YYY,RRR);
*The difference
LOOP(YYY$(NOT(ORD(YYY) EQ 1)),
IHYDROGEN_DH2SYNFUEL_REGION_Y(YYY,RRR) = IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY,RRR) - IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY-1,RRR);
IHYDROGEN_DH2FLEX_REGION_Y(YYY,RRR) = IHYDROGEN_DH2FLEX_REGION_Y_TOT(YYY,RRR) - IHYDROGEN_DH2FLEX_REGION_Y_TOT(YYY-1,RRR);
);

$OFFTEXT

*Additional EQs for synthetic fuel demand shift

*Additional EQs for hydrogen demand shift
$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space
QSYNTHETIC_EQ_PRODUCTION(IY411,IR,IS3,T)..
VGE_T_SYNFUEL_ST(IY411,IR,IS3,T) =E= (VGE_T_SYNFUEL(IY411,IR)*HYDROGEN_DH2_VAR_T(IR,IS3,T)/IHYDROGEN_DH2_REGION_SUMST(IR))$(IHYDROGEN_DH2_REGION_SUMST(IR) GT 0)
VGE_T_FLEXDH2(IY411,IR,IS3,T) =E= (VGE_FLEXDH2(IY411,IR)*HYDROGEN_DH2_VAR_T(IR,IS3,T)/IHYDROGEN_DH2_REGION_SUMST(IR))$(IHYDROGEN_DH2_REGION_SUMST(IR) GT 0)

;

QSYNTHETIC_EQ_SHIFT(IY411,IR)..
VGE_T_SYNFUEL(IY411,IR) =G= VSYN_FUEL_SHIFT(IY411,IR)
VGE_FLEXDH2(IY411,IR) =G= VFLEXDH2_SHIFT(IY411,IR)

;

QSYNTHETIC_EQ_SHIFT_UP(IY411,IR)..
VSYN_FUEL_SHIFT(IY411,IR) =G= (1-THETA_FLEX_SYNFUEL)*IHYDROGEN_DH2SYNFUEL_REGION_Y(IY411,IR)
VFLEXDH2_SHIFT(IY411,IR) =G= (1-THETA_FLEX_DH2)*IHYDROGEN_DH2FLEX_REGION_Y(IY411,IR)

;

QSYNTHETIC_EQ_SHIFT_DOWN(IY411,IR)..
(1+THETA_FLEX_SYNFUEL)*IHYDROGEN_DH2SYNFUEL_REGION_Y(IY411,IR) =G= VSYN_FUEL_SHIFT(IY411,IR)
(1+THETA_FLEX_DH2)*IHYDROGEN_DH2FLEX_REGION_Y(IY411,IR) =G= VFLEXDH2_SHIFT(IY411,IR)

;

QSYNTHETIC_EQ_SHIFT_BALANCE_MOVE(IY411)..
sum(IR,VSYN_FUEL_SHIFT(IY411,IR)) =E= sum(IR,IHYDROGEN_DH2SYNFUEL_REGION_Y(IY411,IR))
sum(IR,VFLEXDH2_SHIFT(IY411,IR)) =E= sum(IR,IHYDROGEN_DH2FLEX_REGION_Y(IY411,IR))

;

QSYNTHETIC_EQ_SHIFT_BALANCE_OVERALL(IY411)..
sum(IR,VGE_T_SYNFUEL(IY411,IR)) =E= sum(IR,IHYDROGEN_DH2SYNFUEL_REGION_Y(IY411,IR))

sum(IR,VGE_FLEXDH2(IY411,IR)) =E= sum(IR,IHYDROGEN_DH2FLEX_REGION_Y(IY411,IR))
;
*Stops here
$label no_flexible_h2_space

* Hydrogen production equal demand on area level:
* Prod + OutputStorage - InputStorage = DemandTransport + DemandPower + DemandBioRefinery + other
Expand Down
23 changes: 8 additions & 15 deletions base/addons/hydrogen/bb4/hydrogen_ipardecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@ PARAMETERS
PARAMETER IHYDROGEN_DH2_REGION_T_Y(YYY,RRR,SSS,TTT) 'Variation of H2 demand in each region along the year';
PARAMETER IHYDROGEN_DH2_AREA_T_Y(YYY,AAA,SSS,TTT) 'Variation of H2 demand in each region along the year';

*IK addd
$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space
PARAMETERS
*IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY,RRR)
IHYDROGEN_DH2SYNFUEL_REGION_Y(YYY,RRR) 'demand for synthetic fuel to shift per year'
*IHYDROGEN_DH2FLEX_REGION_Y_TOT(YYY,RRR)
IHYDROGEN_DH2FLEX_REGION_Y(YYY,RRR) 'demand for synthetic fuel to shift per year'
;

* If this is zero, no hydrogen demand related to synthetic fuels can be relocated endogenously
* Make two options here, that:
* 1. Activates synthetic fuel data
* 2. Allocate the fraction of demand that can be allocated (THETA_FLEX_SYNFUEL)
Scalar
THETA_FLEX_SYNFUEL /0/
;

*Assing Demand for synthetic fuels
IHYDROGEN_DH2SYNFUEL_REGION_Y(Y,IR) = HYDROGEN_DH2_SYN(Y,IR);
*Assing demand for flexible fuels
IHYDROGEN_DH2FLEX_REGION_Y(Y,IR) = HYDROGEN_FLEXDH2(Y,IR);

*Deduct the synthetic fuels, from overall demand
HYDROGEN_DH2(Y,IR) = HYDROGEN_DH2(Y,IR) - HYDROGEN_DH2_SYN(Y,IR);
*Deduct the flexible demand, from overall demand
HYDROGEN_DH2(Y,IR) = HYDROGEN_DH2(Y,IR) - HYDROGEN_FLEXDH2(Y,IR);
$label no_flexible_h2_space

*IK finish here

IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T) = (HYDROGEN_DH2(Y,IR)*HYDROGEN_DH2_VAR_T(IR,S,T)/IHYDROGEN_DH2_REGION_SUMST(IR))$(IHYDROGEN_DH2_REGION_SUMST(IR) GT 0);
IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T) = (HYDROGEN_DH2(Y,IA)*HYDROGEN_DH2_VAR_T(IA,S,T)/IHYDROGEN_DH2_AREA_SUMST(IA))$(IHYDROGEN_DH2_AREA_SUMST(IA) GT 0);
Expand Down
4 changes: 2 additions & 2 deletions base/addons/hydrogen/bb4/hydrogen_pardeclare.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PARAMETERS
HYDROGEN_DH2 (YYY,CCCRRRAAA) 'Yearly demand for hydrogen from the transport sector'
*IK add
HYDROGEN_DH2_SYN (YYY,CCCRRRAAA) 'Yearly demand for hydrogen but synthetic fuels'

HYDROGEN_FLEXDH2 (YYY,CCCRRRAAA) 'Yearly demand for hydrogen but synthetic fuels'

HYDROGEN_DH2_VAR_T (CCCRRRAAA,SSS,TTT) 'Variation profile of H2 demand per region'
HYDROGEN_STOVOL_START (Y,AAA,G,SSS) 'Start level of hydrogen storage'
Expand Down
8 changes: 4 additions & 4 deletions base/addons/hydrogen/bb4/hydrogen_pardefine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ $if EXIST '../data/HYDROGEN_DH2.inc' $INCLUDE '../data/HYDROGEN_DH2.
$if not EXIST '../data/HYDROGEN_DH2.inc' $INCLUDE '../../base/data/HYDROGEN_DH2.inc';
%semislash%;

*IK add
PARAMETER HYDROGEN_DH2_SYN(YYY,CCCRRRAAA) 'Yearly demand for hydrogen' %semislash%
$if EXIST '../data/HYDROGEN_DH2_SYN.inc' $INCLUDE '../data/HYDROGEN_DH2_SYN.inc';
$if not EXIST '../data/HYDROGEN_DH2_SYN.inc' $INCLUDE '../../base/data/HYDROGEN_DH2_SYN.inc';

PARAMETER HYDROGEN_FLEXDH2(YYY,CCCRRRAAA) 'Yearly demand for hydrogen' %semislash%
$if EXIST '../data/HYDROGEN_FLEXDH2.inc' $INCLUDE '../data/HYDROGEN_FLEXDH2.inc';
$if not EXIST '../data/HYDROGEN_FLEXDH2.inc' $INCLUDE '../../base/data/HYDROGEN_FLEXDH2.inc';
%semislash%;

PARAMETER HYDROGEN_DH2_VAR_T(CCCRRRAAA,SSS,TTT) 'Variation profile of H2 demand per region' %semislash%
Expand Down
9 changes: 5 additions & 4 deletions base/addons/hydrogen/bb4/hydrogen_vardeclare.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ POSITIVE VARIABLES

;

*Demand shift IK
$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space
Positive variable
VGE_T_SYNFUEL_ST(Y,RRR,S,T) 'Hourly hydrogen for synthetic fuel'
VGE_T_SYNFUEL(Y,RRR) 'Total hydrogen for synthetic fuel'
VSYN_FUEL_SHIFT(Y,RRR) 'how much to shift from one area to area'
VGE_T_FLEXDH2(Y,RRR,S,T) 'Hourly hydrogen for flexible hydrogen demand'
VGE_FLEXDH2(Y,RRR) 'Total hydrogen for flexible hydrogen demand'
VFLEXDH2_SHIFT(Y,RRR) 'how much to shift from one area to area'
;
$label no_flexible_h2_space

SOS2 VARIABLE VXH2LAMBDA(Y,IRRRE,IRRRI,XES) 'SOS2 Variable for modelling economy of scale';

4 changes: 4 additions & 0 deletions base/model/balopt.opt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ $setglobal ES_H2TRANS
$Setglobal IMPORT_H2 YES
*!option yes

* Allows flexible demand of H2 in regions (set ratio of flexible demand in HYDROGEN_FLEXDH2 with the scalar THETA_FLEX_DH2)
$setglobal flexible_h2_space
*!option yes

*-----------------END: HYDROGEN ADDON---------------------------------------

* Use stepwise linear fuel prices
Expand Down
15 changes: 14 additions & 1 deletion base/output/OUTPUT_SUMMARY.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SET COMMODITY /ELECTRICITY,HEAT,HYDROGEN,BIOMETHANE/;
SET TECH_TYPE /CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,BOILERS,ELECT-TO-HEAT,INTERSEASONAL-HEAT-STORAGE,INTERSEASONAL-ELECT-STORAGE,INTRASEASONAL-HEAT-STORAGE,INTRASEASONAL-ELECT-STORAGE,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,SOLAR-HEATING,HYDRO-WAVE,HEAT-PUMP,EL-BOILER,FUELCELL,ELECTROLYZER,H2-STORAGE,BIOMETH-DAC,BIOGASUPGRADING,BIOGASMETHANATION,HUB-OFF,STEAMREFORMING/;
SET GTECH_TYPE(GGG,TECH_TYPE);
SET PRICE_CATEGORY /AVERAGE,AVERAGE_WEIGHTED_BY_CONSUMPTION,AVERAGE_WEIGHTED_BY_PRODUCTION/;
SET VARIABLE_CATEGORY /EXOGENOUS,ENDOGENOUS,DECOMMISSIONING,ENDOGENOUS_ELECT2HEAT,ENDO_INTRASTO,ENDO_INTERSTO,ENDO_EV,ENDO_HEATPUMP,ENDO_ELBOILER,ENDO_OTHERTRANS,DIST_LOSSES,TRANS_LOSSES,ENDO_CCS,ENDO_H2,ENDO_BIOMETHANE,ENDO_FUELCELL/;
SET VARIABLE_CATEGORY /EXOGENOUS,ENDOGENOUS,DECOMMISSIONING,ENDOGENOUS_ELECT2HEAT,ENDO_INTRASTO,ENDO_INTERSTO,ENDO_EV,ENDO_HEATPUMP,ENDO_ELBOILER,ENDO_OTHERTRANS,DIST_LOSSES,TRANS_LOSSES,ENDO_CCS,ENDO_H2,ENDO_BIOMETHANE,ENDO_FUELCELL,ENDO_REGIONAL/;
SET EL_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,DEMAND_P2H,DEMAND_EV,CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,ELECT-TO-HEAT,INTER-STO,INTRA-STO,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,HYDRO-WAVE,FUELCELL,DEMAND_OTHERTRANS,DEMAND_DISTLOSSES,DEMAND_CCS,DEMAND_P2G/;
SET H_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,BOILERS,CHP-BACK-PRESSURE,CHP-EXTRACTION,INTER-STO,INTRA-STO,SOLAR-HEATING,P2H,FUELCELL,DEMAND_P2G,DEMAND_DISTLOSSES/;
SET UNITS /GW,TWh,MWh,Money_per_MWh,Mmoney,kton,GWh/;
Expand Down Expand Up @@ -699,9 +699,16 @@ H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR))=
SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T))
;

$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space
H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')$(CCCRRR(C,IR))=
VGE_T_FLEXDH2.L(Y,IR,S,T)
;
$label no_flexible_h2_space

H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)=
IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR))+
SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)*DISLOSS_H2(IA)/(1-DISLOSS_H2(IA)))
$ifi %flexible_h2_space%==yes + VGE_T_FLEXDH2.L(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR))
;

** ENDOGENOUS DEMAND
Expand Down Expand Up @@ -767,6 +774,12 @@ H2_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)=
SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000
;

$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space2
H2_DEMAND_YCR(Y,C,IR,'ENDO_REGIONAL','TWh')$CCCRRR(C,IR)=
SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')*IHOURFRAC)/IOF1000000
;
$label no_flexible_h2_space2

* ----------- END OF H2 DEMAND --------------
$label NO_HYDROGEN_DEMAND30

Expand Down

0 comments on commit d1b5297

Please sign in to comment.