Skip to content

Commit

Permalink
Updates from Søren are included in this commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ida Græsted Jensen committed Jun 3, 2019
1 parent 617edd9 commit f703f0f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion base/addons/_hooks/qheq.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $label beginbb4

$ifi not %bb4%==yes $goto endoffile

* $ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/fucked up!! **** Hans : make better! fucked up !! TODO
$ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/hydrogen_qheq.inc";

$ifi %vqdebug%==yes $setglobal equation qheq
$ifi %vqdebug%==yes $include "../../base/addons/vqdebug/bb4/vqdebug_equations.inc";
Expand Down
28 changes: 19 additions & 9 deletions base/addons/combtech/bb4/combtech_eqndecdef.inc
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ EQUATIONS
QHCOMBGSHAREK12(Y,AAA,G,G,S,T) "Secondary combtech technology Heat Production is limited by GDCOMBGSHAREK1"
QCOMBFSHAREK1(Y,AAA,G,S,T) "Primary combtech technology fuel consumption is limited by GDCOMBGSHAREK1"
QCOMBFSHAREK12(Y,AAA,G,G,S,T) "Secondary combtech technology fuel consumption is limited by GDCOMBGSHAREK1"
QGKE_UP_ADD(Y,AAA,G,S,T) "Capacity adjustment constraint on electricity generation from biogas upgraded plants (MW)"
;

* Existing and new capacity: ----------------------------------------------------------

* Existing and new combtech, sum of fuel (MW) use any (S,T) limited by rated capacity (MW) on primal (0 for irrelevant, eps for 0) ({eps,(0;1]})
QCOMBFUP(IY411,IA,IGCOMB1,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBFUP'))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB1,'GDCOMBFUP')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB1,'GDCOMBFUP')
=G=
(VGF_T(IY411,IA,IGCOMB1,IS3,T) + SUM(IGCOMB2$GGCOMB(IGCOMB1,IGCOMB2), VGF_T(IY411,IA,IGCOMB2,IS3,T)));

* Bounds on individual units are assigned individually to .UP, however, the sum-of-bounds may exceed 1
QECOMBGUP(IY411,IA,IGCOMB1,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBGUP') AND IGKE(IGCOMB1))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * (GDATA(IGCOMB1,'GDCOMBGUP')$GDATA(IGCOMB1,'GDCOMBGUP')+1$(NOT GDATA(IGCOMB1,'GDCOMBGUP')))
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * (GDATA(IGCOMB1,'GDCOMBGUP')$GDATA(IGCOMB1,'GDCOMBGUP')+1$(NOT GDATA(IGCOMB1,'GDCOMBGUP')))
=G=
VGE_T(IY411,IA,IGCOMB1,IS3,T) + SUM(IGCOMB2$GGCOMB(IGCOMB1,IGCOMB2), VGE_T(IY411,IA,IGCOMB2,IS3,T));

Expand Down Expand Up @@ -84,7 +85,7 @@ QECOMBFSHAREUP(IY411,IA,IGKE,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGKE) AND (IGCOMB1(I

* Bounds on individual units are assigned individually to .UP, however, the sum-of-bounds may exceed 1
QHCOMBGUP(IY411,IA,IGCOMB1,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBGUP') AND IGKH(IGCOMB1))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1))*(1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * (GDATA(IGCOMB1,'GDCOMBGUP')$GDATA(IGCOMB1,'GDCOMBGUP')+1$(NOT GDATA(IGCOMB1,'GDCOMBGUP')))
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1))*(1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * (GDATA(IGCOMB1,'GDCOMBGUP')$GDATA(IGCOMB1,'GDCOMBGUP')+1$(NOT GDATA(IGCOMB1,'GDCOMBGUP')))
=G=
VGH_T(IY411,IA,IGCOMB1,IS3,T) + SUM(IGCOMB2$GGCOMB(IGCOMB1,IGCOMB2), VGH_T(IY411,IA,IGCOMB2,IS3,T))
;
Expand Down Expand Up @@ -131,15 +132,15 @@ QHCOMBFSHAREUP(IY411,IA,IGKH,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGKH) AND (IGCOMB1(I

*"Primary combtech technology Electricity Production is limited by GDCOMBGSHAREK1"
QECOMBGSHAREK1(IY411,IA,IGCOMB1,S,T)$(IGKE(IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBGSHAREK1'))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBGSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBGSHAREK1')
=G=
VGE_T(IY411,IA,IGCOMB1,S,T)
;

*"Secondary combtech technology Electricity Production is limited by GDCOMBGSHAREK1"
QECOMBGSHAREK12(IY411,IA,IGCOMB1,IGCOMB2,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB2) AND IGKE(IGCOMB2) AND GGCOMB(IGCOMB1,IGCOMB2) AND GDATA(IGCOMB2,'GDCOMBGSHAREK1'))..

(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBGSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBGSHAREK1')
=G=
VGE_T(IY411,IA,IGCOMB2,IS3,T)

Expand All @@ -149,15 +150,15 @@ QECOMBGSHAREK12(IY411,IA,IGCOMB1,IGCOMB2,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB2)

*"Primary combtech technology Heat Production is limited by GDCOMBGSHAREK1"
QHCOMBGSHAREK1(IY411,IA,IGCOMB1,S,T)$(IGKH(IGCOMB1)AND GDATA(IGCOMB1,'GDCOMBGSHAREK1'))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBGSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBGSHAREK1')
=G=
VGH_T(IY411,IA,IGCOMB1,S,T)
;

*"Secondary combtech technology Heat Production is limited by GDCOMBGSHAREK1"
QHCOMBGSHAREK12(IY411,IA,IGCOMB1,IGCOMB2,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB2) AND IGKH(IGCOMB2) AND GGCOMB(IGCOMB1,IGCOMB2) AND GDATA(IGCOMB2,'GDCOMBGSHAREK1'))..

(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBGSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBGSHAREK1')
=G=
VGH_T(IY411,IA,IGCOMB2,IS3,T)

Expand All @@ -166,16 +167,25 @@ QHCOMBGSHAREK12(IY411,IA,IGCOMB1,IGCOMB2,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB2)

*"Primary combtech technology fuel consumption is limited by GDCOMBGSHAREK1"
QCOMBFSHAREK1(IY411,IA,IGCOMB1,S,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBFSHAREK1'))..
(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBFSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1))* (1$(NOT IGKRATE(IA,IGCOMB1,S,T)) + IGKRATE(IA,IGCOMB1,S,T))*GDATA(IGCOMB1,'GDCOMBFSHAREK1')
=G=
VGF_T(IY411,IA,IGCOMB1,S,T)
;

*"Secondary combtech technology fuel Production is limited by GDCOMBGSHAREK1"
QCOMBFSHAREK12(IY411,IA,IGCOMB1,IGCOMB2,IS3,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB2) AND IGKH(IGCOMB2) AND GGCOMB(IGCOMB1,IGCOMB2) AND GDATA(IGCOMB2,'GDCOMBFSHAREK1'))..

(VGKNACCUMNET(IY411,IA,IGCOMB1) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBFSHAREK1')
(VGKNACCUMNET(IY411,IA,IGCOMB1)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IGCOMB1)) + GKFX(IY411,IA,IGCOMB1)) * (1$(NOT IGKRATE(IA,IGCOMB1,IS3,T)) + IGKRATE(IA,IGCOMB1,IS3,T)) * GDATA(IGCOMB2,'GDCOMBFSHAREK1')
=G=
VGF_T(IY411,IA,IGCOMB2,IS3,T)

;

*"Capacity adjustment constraint on electricity generation from biogas upgraded plants (MW)"
QGKE_UP_ADD(IY411,IA,IGCOMB1,IS3,T)..

VGE_T(IY411,IA,IGCOMB1,IS3,T)+ SUM(IGCOMB2$GGCOMB(IGCOMB1,IGCOMB2),(VGE_T(IY411,IA,IGCOMB2,IS3,T)*(1+HYDROGEN_H2TOF(IGCOMB2))))
=L=
GKFX(IY411,IA,IGCOMB1)+VGKNACCUMNET(IY411,IA,IGCOMB1)

;
17 changes: 9 additions & 8 deletions base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
Equations
QHYDROGEN_GGETOH2(Y,AAA,G,S,T) 'Hydrogen production - existing electrolysis plant'
QHYDROGEN_HGETOH2(Y,AAA,G,S,T) 'Heat generated - existing electrolysis plant'

*Ida additions
QHYDROGEN_GGEHTOH2(Y,AAA,G,S,T) 'Hydrogen production - existing SOEC plant'
QHYDROGEN_HGEHTOH2(Y,AAA,G,S,T) 'Heat used - existing SOEC plant'
QHYDROGEN_H2TOEH(Y,AAA,G,S,T) 'Heat production in fuel cells'

QHYDROGEN_GCH4KT(Y,AAA,G,S,T) 'Hydrogen production of steam reforming plants restricted by capacity'

Expand Down Expand Up @@ -38,6 +37,11 @@ QHYDROGEN_HGEHTOH2(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GEHTOH2),IS3,T)..

VGE_T(IY411,IA,IHYDROGEN_GEHTOH2,IS3,T) =E= VGH_T(IY411,IA,IHYDROGEN_GEHTOH2,IS3,T)*GDATA(IHYDROGEN_GEHTOH2,'GDCB');


QHYDROGEN_H2TOEH(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2TOE),IS3,T) ..

VGE_T(IY411,IA,IHYDROGEN_GH2TOE,IS3,T) =E= VGH_T(IY411,IA,IHYDROGEN_GH2TOE,IS3,T)*GDATA(IHYDROGEN_GH2TOE,'GDCB');

* Hydrogen gas storage, dynamic balance for weekly time horizon:
* Start and end filling degree in each week fixed to values obtained
* from yearly simulation
Expand Down Expand Up @@ -97,26 +101,23 @@ QHYDROGEN_STOVOL(IY411,IA,IHYDROGEN_GH2STO,S,T)$(IAGK_HASORPOT(IY411,IA,IHYDROGE
*Hydrogen storage is modelled as a inter-seasonal storage that can be used with a T resolutions
QHYDROGEN_STOMAXCON(IY411,IA,IHYDROGEN_GH2STO,S,T)$(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2STO))..
GKFX(IY411,IA,IHYDROGEN_GH2STO)
+ VGKN(IY411,IA,IHYDROGEN_GH2STO)$IAGKNY(IY411,IA,IHYDROGEN_GH2STO)
+ SUM(IY402$IY411PREVY(IY411,IY402), VGKNACCUMNET(IY402,IA,IHYDROGEN_GH2STO))
+ VGKNACCUMNET(IY411,IA,IHYDROGEN_GH2STO)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IHYDROGEN_GH2STO))
=G=
VHYDROGEN_STOVOL_T(IY411,IA,IHYDROGEN_GH2STO,S,T)
;

* Maximum loading, hydrogen gas storage:
QHYDROGEN_STOMAXLOAD(IY411,IA,IHYDROGEN_GH2STO,IS3,T)$(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2STO))..
( GKFX(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHLOAD')
+ (VGKN(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHLOAD'))$IAGKNY(IY411,IA,IHYDROGEN_GH2STO)
+ SUM(IY402$IY411PREVY(IY411,IY402), VGKNACCUMNET(IY402,IA,IHYDROGEN_GH2STO))/GDATA(IHYDROGEN_GH2STO,'GDSTOHLOAD')
+ VGKNACCUMNET(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHLOAD')$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IHYDROGEN_GH2STO))
) *IGKRATE(IA,IHYDROGEN_GH2STO,IS3,T)
=G= VHYDROGEN_STOLOADT(IY411,IA,IHYDROGEN_GH2STO,IS3,T)
;

* Maximum unloading, hydrogen gas storage:
QHYDROGEN_STOMAXUNLD(IY411,IA,IHYDROGEN_GH2STO,IS3,T)$(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2STO))..
( GKFX(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHUNLD')
+ (VGKN(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHUNLD'))$IAGKNY(IY411,IA,IHYDROGEN_GH2STO)
+ SUM(IY402$IY411PREVY(IY411,IY402), VGKNACCUMNET(IY402,IA,IHYDROGEN_GH2STO))/GDATA(IHYDROGEN_GH2STO,'GDSTOHUNLD')
+ VGKNACCUMNET(IY411,IA,IHYDROGEN_GH2STO)/GDATA(IHYDROGEN_GH2STO,'GDSTOHUNLD')$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IHYDROGEN_GH2STO))
) *IGKRATE(IA,IHYDROGEN_GH2STO,IS3,T)
=G=
VHYDROGEN_GH2_T(IY411,IA,IHYDROGEN_GH2STO,IS3,T)
Expand Down
4 changes: 4 additions & 0 deletions base/addons/hydrogen/bb4/hydrogen_qeeq.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GETOH2,IS3,T))
+SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T(IY411,IA,IHYDROGEN_GEHTOH2,IS3,T))


*adding electricity production with a factor "HYDROGEN_H2TOF".
-SUM(IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2UP)$(RRRAAA(IR,IA) AND (GDATA(IHYDROGEN_GH2UP,'GDTYPE') NE GHOB)), HYDROGEN_H2TOF(IHYDROGEN_GH2UP)*VGE_T(IY411,IA,IHYDROGEN_GH2UP,IS3,T))
1 change: 1 addition & 0 deletions base/addons/hydrogen/bb4/hydrogen_qheq.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-SUM(IHYDROGEN_GETOH2$IAGK_HASORPOT(IY411,IA,IHYDROGEN_GETOH2), VGH_T(IY411,IA,IHYDROGEN_GETOH2,IS3,T))
+SUM(IHYDROGEN_GEHTOH2$IAGK_HASORPOT(IY411,IA,IHYDROGEN_GEHTOH2), VGH_T(IY411,IA,IHYDROGEN_GEHTOH2,IS3,T))
-SUM(IHYDROGEN_GH2TOE$IAGK_HASORPOT(IY411,IA,IHYDROGEN_GH2TOE), VGH_T(IY411,IA,IHYDROGEN_GH2TOE,IS3,T))

0 comments on commit f703f0f

Please sign in to comment.