diff --git a/base/addons/_hooks/qheq.inc b/base/addons/_hooks/qheq.inc index db92eada..afbe9a68 100644 --- a/base/addons/_hooks/qheq.inc +++ b/base/addons/_hooks/qheq.inc @@ -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"; diff --git a/base/addons/combtech/bb4/combtech_eqndecdef.inc b/base/addons/combtech/bb4/combtech_eqndecdef.inc index 47e99110..01988635 100644 --- a/base/addons/combtech/bb4/combtech_eqndecdef.inc +++ b/base/addons/combtech/bb4/combtech_eqndecdef.inc @@ -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)); @@ -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)) ; @@ -131,7 +132,7 @@ 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) ; @@ -139,7 +140,7 @@ QECOMBGSHAREK1(IY411,IA,IGCOMB1,S,T)$(IGKE(IGCOMB1) AND GDATA(IGCOMB1,'GDCOMBGSH *"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) @@ -149,7 +150,7 @@ 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) ; @@ -157,7 +158,7 @@ QHCOMBGSHAREK1(IY411,IA,IGCOMB1,S,T)$(IGKH(IGCOMB1)AND GDATA(IGCOMB1,'GDCOMBGSHA *"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) @@ -166,7 +167,7 @@ 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) ; @@ -174,8 +175,17 @@ QCOMBFSHAREK1(IY411,IA,IGCOMB1,S,T)$(IAGK_HASORPOT(IY411,IA,IGCOMB1) AND GDATA(I *"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) + +; \ No newline at end of file diff --git a/base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc b/base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc index 2d350cff..cbc62086 100644 --- a/base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc +++ b/base/addons/hydrogen/bb4/hydrogen_eqndecdef.inc @@ -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' @@ -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 @@ -97,8 +101,7 @@ 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) ; @@ -106,8 +109,7 @@ QHYDROGEN_STOMAXCON(IY411,IA,IHYDROGEN_GH2STO,S,T)$(IAGK_HASORPOT(IY411,IA,IHYDR * 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) ; @@ -115,8 +117,7 @@ QHYDROGEN_STOMAXLOAD(IY411,IA,IHYDROGEN_GH2STO,IS3,T)$(IAGK_HASORPOT(IY411,IA,IH * 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) diff --git a/base/addons/hydrogen/bb4/hydrogen_qeeq.inc b/base/addons/hydrogen/bb4/hydrogen_qeeq.inc index 9af8393b..1254b75b 100644 --- a/base/addons/hydrogen/bb4/hydrogen_qeeq.inc +++ b/base/addons/hydrogen/bb4/hydrogen_qeeq.inc @@ -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)) diff --git a/base/addons/hydrogen/bb4/hydrogen_qheq.inc b/base/addons/hydrogen/bb4/hydrogen_qheq.inc index 77899ffe..09acaa10 100644 --- a/base/addons/hydrogen/bb4/hydrogen_qheq.inc +++ b/base/addons/hydrogen/bb4/hydrogen_qheq.inc @@ -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))