From 4631e9056ac228bc2952a31a46be1a716f81d4c3 Mon Sep 17 00:00:00 2001 From: Mathias157 Date: Mon, 7 Oct 2024 18:17:12 +0200 Subject: [PATCH] Added biomass availability --- src/Modules/format_balmorel_data.py | 33 ++++++++++++++++++++++++++--- src/assumptions.yaml | 8 ++++++- src/preprocessing | 10 ++++++--- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/src/Modules/format_balmorel_data.py b/src/Modules/format_balmorel_data.py index f8fe94e..ef290ab 100644 --- a/src/Modules/format_balmorel_data.py +++ b/src/Modules/format_balmorel_data.py @@ -129,9 +129,17 @@ def grids(ctx): @main.command() +@click.option('--woodpot', type=float, required=True, help="Domestic potential of woody biomass") +@click.option('--strawpot', type=float, required=True, help="Domestic potential of agricultural biomass") +@click.option('--biogaspot', type=float, required=True, help="Domestic potential of biogas") +@click.option('--woodimport', type=bool, required=True, help="Allow import of woodpellets to large cities?") @click.pass_context -def biomass_availability(ctx): - """Get biomass availability from Bramstoft, Rasmus, Amalia Pizarro-Alonso, Ida Græsted Jensen, Hans Ravn, and Marie Münster. “Modelling of Renewable Gas and Renewable Liquid Fuels in Future Integrated Energy Systems.” Applied Energy 268 (June 15, 2020): 114869. https://doi.org/10.1016/j.apenergy.2020.114869.""" +def biomass_availability(ctx, woodpot: float, strawpot: float, biogaspot: float, woodimport: bool): + """Get biomass distribution key from Bramstoft et al 2020, assume total availability. + + Distribution potentials: + Bramstoft, Rasmus, Amalia Pizarro-Alonso, Ida Græsted Jensen, Hans Ravn, and Marie Münster. “Modelling of Renewable Gas and Renewable Liquid Fuels in Future Integrated Energy Systems.” Applied Energy 268 (June 15, 2020): 114869. https://doi.org/10.1016/j.apenergy.2020.114869. + """ # File from Bramstoft et al 2020 df = pd.read_excel('Data/BalmorelData/DKBiomassAvailability.xlsx').drop(columns='Flow') @@ -162,7 +170,26 @@ def biomass_availability(ctx): # Make .inc-file f = IncFile(name='GMAXF', path='Output', prefix="TABLE GMAXF(YYY, CCCRRRAAA, FFF) 'Maximum fuel use (GJ) per year'\n", - suffix='\n;', body=df) + suffix='\n;\n', + body=df) + + ## Set national levels + f.suffix += "\n".join([ + "GMAXF('2050', 'DENMARK', 'BIOGAS') = %0.2f;"%(biogaspot*1e6), + "GMAXF('2050', 'DENMARK', 'WOODCHIPS') = EPS;", + "GMAXF('2050', 'DENMARK', 'WOODWASTE') = EPS;", + "GMAXF('2050', 'DENMARK', 'STRAW') = %0.2f;"%(df.query('CRA != "DENMARK" and F == "STRAW"')['Value'].sum()), + "GMAXF('2050', 'DENMARK', 'WOOD') = %0.2f;"%(df.query('CRA != "DENMARK" and F == "WOOD"')['Value'].sum()), + "* Use existing potentials as distribution key for input potentials for straw and wood, defined below", + "GMAXF('2050', CCCRRRAAA, 'STRAW') = GMAXF('2050', CCCRRRAAA, 'STRAW') / GMAXF('2050', 'DENMARK', 'STRAW') * %0.2f;"%(strawpot*1e6), # From PJ to GJ + "GMAXF('2050', CCCRRRAAA, 'WOOD') = GMAXF('2050', CCCRRRAAA, 'WOOD') / GMAXF('2050', 'DENMARK', 'WOOD') * %0.2f;"%(woodpot*1e6), # From PJ to GJ + ]) + + if not(woodimport): + f.suffix += "\n* Disallow import of woodpellets\nGMAXF('2050', 'DENMARK', 'WOODPELLETS') = EPS;" + else: + f.suffix += "\n* Allow import of woodpellets\nGMAXF('2050', 'DENMARK', 'WOODPELLETS') = %0.2f;"%(df.query('CRA != "DENMARK" and F == "WOODPELLETS"')['Value'].sum()) + f.body_prepare(index=['Y', 'CRA'], columns='F', values='Value') ## Zeros have to be EPS diff --git a/src/assumptions.yaml b/src/assumptions.yaml index 597aac1..0a6fad1 100644 --- a/src/assumptions.yaml +++ b/src/assumptions.yaml @@ -27,4 +27,10 @@ fuel_assumptions: timeseries: weather_year: 2012 - total_offshore_wind_potential: 40000 # MW \ No newline at end of file + +resources: + total_offshore_wind_potential: 40000 # MW + woodpot: 7.3 # PJ, potential of woody biomass for energy, ENS_Med_ForestBaU scenario from Ruiz, Pablo (2019): ENSPRESO - BIOMASS. European Commission, Joint Research Centre (JRC) [Dataset] PID: http://data.europa.eu/89h/74ed5a04-7d74-4807-9eab-b94774309d9f + strawpot: 22 # PJ, potential of agro waste for energy, ENS_Med_ForestBaU scenario from Ruiz, Pablo (2019): ENSPRESO - BIOMASS. European Commission, Joint Research Centre (JRC) [Dataset] PID: http://data.europa.eu/89h/74ed5a04-7d74-4807-9eab-b94774309d9f + biogaspot: 43.3 # PJ, potential of biogas for energy, ENS_Med_ForestBaU scenario from Ruiz, Pablo (2019): ENSPRESO - BIOMASS. European Commission, Joint Research Centre (JRC) [Dataset] PID: http://data.europa.eu/89h/74ed5a04-7d74-4807-9eab-b94774309d9f + woodimport: False # Allow import of woody biomass to major cities? \ No newline at end of file diff --git a/src/preprocessing b/src/preprocessing index 8f2dd64..54ef235 100644 --- a/src/preprocessing +++ b/src/preprocessing @@ -260,7 +260,7 @@ rule offshore_wind: ] params: weather_year=config['timeseries']['weather_year'], - total_offshore_wind_potential=config['timeseries']['total_offshore_wind_potential'], + total_offshore_wind_potential=config['resources']['total_offshore_wind_potential'], nordsoeen_connection=config['grid_assumptions']['electricity']['nordsoeen_connection'] output: f'{out_path}OFFSHORE_WND_VAR_T.inc' @@ -289,12 +289,16 @@ rule biomass_availability: params: model_path=config["balmorel_input"]["model_path"], scenario=config["balmorel_input"]["scenario"], - load_again=config["balmorel_input"]["load_again"] + load_again=config["balmorel_input"]["load_again"], + woodpot=config['resources']['woodpot'], + strawpot=config['resources']['strawpot'], + biogaspot=config['resources']['biogaspot'], + woodimport=config['resources']['woodimport'] output: [ f"{out_path}GMAXF.inc" ] shell: """ - python {input[0]} --model-path={params.model_path} --scenario={params.scenario} --load-again={params.load_again} biomass-availability + python {input[0]} --model-path={params.model_path} --scenario={params.scenario} --load-again={params.load_again} biomass-availability --woodpot={params.woodpot} --strawpot={params.strawpot} --biogaspot={params.biogaspot} --woodimport={params.woodimport} """ \ No newline at end of file