Skip to content

Commit

Permalink
Added biomass availability
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias157 committed Oct 7, 2024
1 parent ef2d20a commit 4631e90
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 deletions.
33 changes: 30 additions & 3 deletions src/Modules/format_balmorel_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/assumptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ fuel_assumptions:

timeseries:
weather_year: 2012
total_offshore_wind_potential: 40000 # MW

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?
10 changes: 7 additions & 3 deletions src/preprocessing
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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}
"""

0 comments on commit 4631e90

Please sign in to comment.