From d90aca17b79a7687863992a429bcb636f76a20ef Mon Sep 17 00:00:00 2001 From: Toni Seibold <153275395+toniseibold@users.noreply.github.com> Date: Wed, 7 Aug 2024 15:32:33 +0200 Subject: [PATCH] Fix hydrogen import boundary condition (#159) * include retrofitted and Kernnetz pipelines for hydrogen import boundary condition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * bugfixing mock_snakemake and fullfilling prerequisites for review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Changelog.md | 1 + config/config.yaml | 2 +- workflow/scripts/additional_functionality.py | 10 +++++++--- workflow/scripts/modify_prenetwork.py | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index de2462ba..54f672ec 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,5 @@ # Changelog +- fix the hydrogen import boundary condition - add primary oil bus and account for refinery emissions - added Changelog file diff --git a/config/config.yaml b/config/config.yaml index 7dda0847..0ecd1edb 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -5,7 +5,7 @@ # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run run: - prefix: 240806oilrefineries + prefix: 20240807fix_hydrogen_import_constraint name: # - CurrentPolicies diff --git a/workflow/scripts/additional_functionality.py b/workflow/scripts/additional_functionality.py index e6670697..2ff02cbf 100644 --- a/workflow/scripts/additional_functionality.py +++ b/workflow/scripts/additional_functionality.py @@ -129,14 +129,18 @@ def h2_import_limits(n, investment_year, limits_volume_max): limit = limits_volume_max["h2_import"][ct][investment_year] * 1e6 logger.info(f"limiting H2 imports in {ct} to {limit/1e6} TWh/a") - + pipeline_carrier = [ + "H2 pipeline", + "H2 pipeline (Kernnetz)", + "H2 pipeline retrofitted", + ] incoming = n.links.index[ - (n.links.carrier == "H2 pipeline") + (n.links.carrier.isin(pipeline_carrier)) & (n.links.bus0.str[:2] != ct) & (n.links.bus1.str[:2] == ct) ] outgoing = n.links.index[ - (n.links.carrier == "H2 pipeline") + (n.links.carrier.isin(pipeline_carrier)) & (n.links.bus0.str[:2] == ct) & (n.links.bus1.str[:2] != ct) ] diff --git a/workflow/scripts/modify_prenetwork.py b/workflow/scripts/modify_prenetwork.py index 07666bbe..971d981f 100644 --- a/workflow/scripts/modify_prenetwork.py +++ b/workflow/scripts/modify_prenetwork.py @@ -587,10 +587,10 @@ def aladin_mobility_demand(n): snakemake = mock_snakemake( "modify_prenetwork", simpl="", - clusters=44, + clusters=22, opts="", ll="vopt", - sector_opts="None", + sector_opts="none", planning_horizons="2020", run="KN2045_Bal_v4", )