Skip to content

Commit

Permalink
Merged Ioannis changes while considering Juan's improvements past Ioa…
Browse files Browse the repository at this point in the history
…nnis' version
  • Loading branch information
Mathias157 committed Jun 26, 2024
1 parent 4c1efe4 commit 74712f0
Show file tree
Hide file tree
Showing 23 changed files with 2,326 additions and 2,206 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@
*.gsp
base/data/.gitignore
base/data/README.md
*.lst
*.log
*.lxi
*.pf
%batfileMERGEWITHBASE%
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,23 @@ The DTU Balmorel team has decided on the following procedure for merging new cha
2. Create a new branch from master, which will be used as a temporary branch to do all the changes
3. Make the desired changes in a new scenario:

a. Add a new scenario called 'changes', which result in the following folder structure:
a. Add a new scenario called 'changes', which the following files and folder structure (copy Balmorel.gms and cplex.op4 from base/model if nothing is to be changed in these files):

Balmorel
├── base
├── changes
│ ├── data
│ └── model
├── cplex.op4
└── Balmorel.gms
├── cplex.op4
└── Balmorel.gms
├── simex
├── README.md
├── .gitignore
└── .gitattributes

b. Keep the base scenario identical to the current master and apply all changes to the 'changes' scenario

4. Run the [test script](base/auxils/master_merge_tests/merge_tests.ipynb) and make sure that the model stays feasible and that you verify the changes
5. Make a pull request and report the changes made with the KPI outputs from the tests in 4. in ... (todo: check where it makes sense to put these descriptions, as simple as possible)
4. Run the [test script](base/auxils/master_merge_tests/merge_tests.ipynb), make sure that the model stays feasible and that the results make sense
5. Consider critically if the tests performed in 4. is enough to verify and validate the changes made
6. Make a pull request with the changes and report them in general terms, including the KPI outputs from the tests in 4. in ... (todo: check where it makes sense to put these descriptions, as simple as possible)

15 changes: 0 additions & 15 deletions base/addons/_hooks/acronyms.inc

This file was deleted.

11 changes: 11 additions & 0 deletions base/addons/hydrogen/bb4/hydrogen_balbase4.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
QHYDROGEN_STOMAXUNLD
QHYDROGEN_STOVOL
QHYDROGEN_GCH4KT_UP
$ifi %COMBTECH%==yes QHYDROGENGKE_UP_ADD
QBIOMETHANE_EQ
QBIOMETHANE_STOVOLTS
QGKBIOMETHANE_UP
QGKBIOGASUPGRADING_UP
QGKBIOGASMETHANATION_UP



QXH2K_UP
$ifi %H2TransInvest%==yes QXH2KNACCUMNET
$ifi %H2TransInvest%==yes QXH2KNACCUMNET_NGTOH2
Expand All @@ -26,3 +28,12 @@ $ifi %H2TransInvest%==yes QXH2KMAX_NGTOH2
$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
QSYNTHETIC_EQ_PRODUCTION
QSYNTHETIC_EQ_SHIFT
QSYNTHETIC_EQ_SHIFT_UP
QSYNTHETIC_EQ_SHIFT_DOWN
QSYNTHETIC_EQ_SHIFT_BALANCE_MOVE
QSYNTHETIC_EQ_SHIFT_BALANCE_OVERALL

579 changes: 322 additions & 257 deletions base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions base/addons/hydrogen/bb4/hydrogen_ipardecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ 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
PARAMETERS
*IHYDROGEN_DH2SYNFUEL_REGION_Y_TOT(YYY,RRR)
IHYDROGEN_DH2SYNFUEL_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);

*Deduct the synthetic fuels, from overall demand
HYDROGEN_DH2(Y,IR) = HYDROGEN_DH2(Y,IR) - HYDROGEN_DH2_SYN(Y,IR);

*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
1 change: 0 additions & 1 deletion base/addons/hydrogen/bb4/hydrogen_isetdecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Set IHYDROGEN_GCH4TOH2(G) 'Steam reforming technologies producing hydrog
Set IHYDROGEN_GH2FUEL(G) 'Power plants using hydrogen as fuel (excluding H2 storage and biomethane technologies)';
SET IHYDROGEN_GH2TOE(G) 'Technology producing only electricity consuming hydrogen'
SET IHYDROGEN_GH2TOEH(G) 'Technology producing electricity and consuming hydrogen'
Set IHYDROGEN_GH2UP(G) 'Fuels needing boost of hydrogen (not used)'
Set IHYDROGEN_GH2TOBIOMETH(G) 'Hydrogen + DAC to synthetic natural gas technologies'
SET IHYDROGEN_GBIOGASMETHANATION(G) 'Technologies consuming biogas, electricity, and H2 to produce biomethane'
SET IHYDROGEN_GBIOGASUPGRADING(G) 'Technologies consuming biogas and electricity to remove CO2 and produce biomethane'
Expand Down
5 changes: 4 additions & 1 deletion base/addons/hydrogen/bb4/hydrogen_pardeclare.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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_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'
DAC_DE(GGG) 'Power demand needed to produce biomethane through DAC (Mwe/MWth biomethane)'
Expand Down Expand Up @@ -55,4 +58,4 @@ PARAMETER XH2KACCUMNET(YYY,IRRRE,IRRRI) "Resulting H2 transmission capacity dev
PARAMETER XH2_T(Y,IRRRE,IRRRI,S,T) "H2 export from region IRRRE to IRRRI to be transferred to future runs (MW) to be transferred to future runs";

PARAMETER XH2INVCOST_ES(YYY,IRRRE,IRRRI,XES) 'Investment cost in H2 transmission lines at the beginning of each XES (money/XKN_ES )';
PARAMETER XH2KN_ES(IRRRE,IRRRI,XES) 'Installed capacity in H2 transmission lines at the beginning of each XES (MW)';
PARAMETER XH2KN_ES(IRRRE,IRRRI,XES) 'Installed capacity in H2 transmission lines at the beginning of each XES (MW)';
6 changes: 6 additions & 0 deletions base/addons/hydrogen/bb4/hydrogen_pardefine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ $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';
%semislash%;

PARAMETER HYDROGEN_DH2_VAR_T(CCCRRRAAA,SSS,TTT) 'Variation profile of H2 demand per region' %semislash%
$if EXIST '../data/HYDROGEN_DH2_VAR_T.inc' $INCLUDE '../data/HYDROGEN_DH2_VAR_T.inc';
$if not EXIST '../data/HYDROGEN_DH2_VAR_T.inc' $INCLUDE '../../base/data/HYDROGEN_DH2_VAR_T.inc';
Expand Down
2 changes: 1 addition & 1 deletion base/addons/hydrogen/bb4/hydrogen_qeeq.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GETOH2,IS3,T)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOH2)))
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GETOHH2,IS3,T)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2)))
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GETOHH2,IS3,T)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2)))
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GEHTOH2,IS3,T)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2)))

*Adding electricity consumption from BIOMETHANE-DAC generation
Expand Down
7 changes: 7 additions & 0 deletions base/addons/hydrogen/bb4/hydrogen_vardeclare.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@ POSITIVE VARIABLES

;

*Demand shift IK
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'
;

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

2 changes: 1 addition & 1 deletion base/addons/hydrogen/hydrogen_acronyms.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ACRONYM HYDROGEN_GH2STO, HYDROGEN_GETOH2, HYDROGEN_GEHTOH2, HYDROGEN_GCH4TOH2, HYDROGEN_GH2FUEL, HYDROGEN_GH2TOE;
ACRONYM HYDROGEN_GH2STO, HYDROGEN_GETOH2, HYDROGEN_GEHTOH2, HYDROGEN_GCH4TOH2, HYDROGEN_GH2FUEL, HYDROGEN_GH2TOE,HYDROGEN_GIMPORTH2;
2 changes: 0 additions & 2 deletions base/addons/hydrogen/hydrogen_eqndecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ QHYDROGEN_EQ(IR,IS3,T)..
IHYDROGEN_DH2_REGION_T_Y(IR,IS3,T)+ SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(IA,IS3,T))
+ SUM(IAGK_Y(IA,IHYDROGEN_GH2FUEL) $(RRRAAA(IR,IA)),VGE_T(IA,IHYDROGEN_GH2FUEL,IS3,T)/GDATA(IHYDROGEN_GH2FUEL,'GDFE'))
+ SUM(IAGKN(IA,IHYDROGEN_GH2FUEL) $(RRRAAA(IR,IA)),VGEN_T(IA,IHYDROGEN_GH2FUEL,IS3,T)/GDATA(IHYDROGEN_GH2FUEL,'GDFE'))
+ SUM(IAGK_Y(IA,IHYDROGEN_GH2UP) $(RRRAAA(IR,IA)),HYDROGEN_H2TOF(IHYDROGEN_GH2UP)*VGF_T(IA,IHYDROGEN_GH2UP,IS3,T))
+ SUM(IAGKN(IA,IHYDROGEN_GH2UP) $(RRRAAA(IR,IA)),HYDROGEN_H2TOF(IHYDROGEN_GH2UP)*VGFN_T(IA,IHYDROGEN_GH2UP,IS3,T))
* + SUM(HYDROGEN_DH2F_U,VHYDROGEN_DH2F_T(IR,IS3,T,HYDROGEN_DH2F_U) )
* - SUM(HYDROGEN_DH2F_D,VHYDROGEN_DH2F_T(IR,IS3,T,HYDROGEN_DH2F_D) )
- VHYDROGEN_QH2EQ(IR,IS3,T,'IMINUS') + VHYDROGEN_QH2EQ(IR,IS3,T,'IPLUS')
Expand Down
2 changes: 0 additions & 2 deletions base/addons/hydrogen/hydrogen_isetdecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Set IHYDROGEN_GCH4TOH2(G) 'Steam reforming technologies producing hydrog
Set IHYDROGEN_GH2FUEL(G) 'Power plants using hydrogen as fuel';
*IDA new additions
SET IHYDROGEN_GH2TOE(G) 'Solid oxide fuel cells'
Set IHYDROGEN_GH2UP(G) 'Fuels needing boost of hydrogen'
;

* Based on 'GDTYPE'
Expand All @@ -14,7 +13,6 @@ IHYDROGEN_GETOH2(G) = YES$(GDATA(G,'GDTYPE') EQ HYDROGEN_GETOH2);
IHYDROGEN_GCH4TOH2(G) = YES$(GDATA(G,'GDTYPE') EQ HYDROGEN_GCH4TOH2);

*IDA new additions
IHYDROGEN_GH2UP(G)= YES$(GDATA(G,'GDFUEL') EQ THERMGAS_H2 OR GDATA(G,'GDFUEL') EQ BIOGAS_H2);
IHYDROGEN_GH2TOE(G)= YES$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2TOE);
IHYDROGEN_GEHTOH2(G) = YES$(GDATA(G,'GDTYPE') EQ HYDROGEN_GEHTOH2);

Expand Down
2 changes: 0 additions & 2 deletions base/addons/hydrogen/hydrogen_pardeclare.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ PARAMETERS
HYDROGEN_DH2 (YYY,CCCRRRAAA) 'Yearly demand for hydrogen from the transport sector'
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'
*IDAS new additions
HYDROGEN_H2TOF (GGG) 'Factor for need of hydrogen for fuel production'
;
5 changes: 0 additions & 5 deletions base/addons/hydrogen/hydrogen_pardefine.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ PARAMETER HYDROGEN_STOVOL_START(Y,AAA,G,SSS) 'Start level of hydrogen storage
* Include start filling level of hydrogen storage obtained from yearly simulation
$ifi %bb3%==yes execute_load '../../simex/HYDROGEN_STOVOL_START.gdx', HYDROGEN_STOVOL_START;

PARAMETER HYDROGEN_H2TOF(GGG) 'Hydrogen to fuel factor' %semislash%
$if EXIST '../data/HYDROGEN_H2TOF.inc' $INCLUDE '../data/HYDROGEN_H2TOF.inc';
$if not EXIST '../data/HYDROGEN_H2TOF.inc' $INCLUDE '../../base/data/HYDROGEN_H2TOF.inc';
%semislash%

$onmulti
$if EXIST '../data/HYDROGEN_AGKN.inc' $INCLUDE '../data/HYDROGEN_AGKN.inc';
$if not EXIST '../data/HYDROGEN_AGKN.inc' $INCLUDE '../../base/data/HYDROGEN_AGKN.inc';
Expand Down
4 changes: 4 additions & 0 deletions base/auxils/annuity_calculation/annuity_calculation.gms
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,28 @@ SET CCCRRRAAA "All geographical entities (CCC + RRR + AAA)"
$if EXIST '../data/CCCRRRAAA.inc' $INCLUDE '../data/CCCRRRAAA.inc';
$if not EXIST '../data/CCCRRRAAA.inc' $INCLUDE '../../base/data/CCCRRRAAA.inc';


SET CCC(CCCRRRAAA) "All Countries"
$if EXIST '../data/CCC.inc' $INCLUDE '../data/CCC.inc';
$if not EXIST '../data/CCC.inc' $INCLUDE '../../base/data/CCC.inc';


SET C(CCC) "Countries in the simulation"
$if EXIST '../data/C.inc' $INCLUDE '../data/C.inc';
$if not EXIST '../data/C.inc' $INCLUDE '../../base/data/C.inc';

SET FFF "Fuels"
$if EXIST '../data/FFF.inc' $INCLUDE '../data/FFF.inc';
$if not EXIST '../data/FFF.inc' $INCLUDE '../../base/data/FFF.inc';

*INCLUDE FFF FROM OTHER ADDONS
$include "../../base/addons/hydrogen/bb4/hydrogen_fffadditions.inc";

SET FDATASET "Characteristics of fuels "
$if EXIST '../data/FDATASET.inc' $INCLUDE '../data/FDATASET.inc';
$if not EXIST '../data/FDATASET.inc' $INCLUDE '../../base/data/FDATASET.inc';


PARAMETER FDATA(FFF,FDATASET) "Fuel specific values"
$if EXIST '../data/FDATA.inc' $INCLUDE '../data/FDATA.inc';
$if not EXIST '../data/FDATA.inc' $INCLUDE '../../base/data/FDATA.inc';
Expand Down
Loading

0 comments on commit 74712f0

Please sign in to comment.