From ec4e9aa548fce44109d851bf6f33070395d10787 Mon Sep 17 00:00:00 2001 From: JulianGeis Date: Wed, 17 Jan 2024 11:23:29 +0100 Subject: [PATCH] wasserstoff kernnetz --- scripts/prepare_sector_network.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index b57b832c..ba3f24c6 100755 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1324,6 +1324,18 @@ def add_storage_and_grids(n, costs): n, "H2 pipeline ", carriers=["DC", "gas pipeline"] ) + h2_pipes["p_nom"] = 0. + + if snakemake.input.get("custom_h2_pipelines"): + fn = snakemake.input.custom_h2_pipelines + wkn = pd.read_csv(fn, index_col=0) + + h2_pipes = pd.concat([h2_pipes, wkn]) + + # drop duplicates according to buses (order can be different) and keep pipe with highest p_nom + h2_pipes['buses_sorted'] = h2_pipes.apply(lambda row: tuple(sorted([row['bus0'], row['bus1']])), axis=1) + h2_pipes = h2_pipes.sort_values('p_nom').drop_duplicates(subset=['buses_sorted'], keep='last').drop(columns = 'buses_sorted') + # TODO Add efficiency losses n.madd( "Link", @@ -1332,6 +1344,7 @@ def add_storage_and_grids(n, costs): bus1=h2_pipes.bus1.values + " H2", p_min_pu=-1, p_nom_extendable=True, + p_nom_min=h2_pipes.p_nom.values, length=h2_pipes.length.values, capital_cost=costs.at["H2 (g) pipeline", "fixed"] * h2_pipes.length.values, carrier="H2 pipeline",