From c6ed36df625a382cf4451ddf0ef57448d5f8dd75 Mon Sep 17 00:00:00 2001 From: lisazeyen Date: Fri, 23 Feb 2024 15:23:55 +0100 Subject: [PATCH 1/2] adjust AC bus to low voltage --- scripts/add_existing_baseyear.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index 750ab22ff..d6f1802c4 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -416,6 +416,11 @@ def add_heating_capacities_installed_before_baseyear( name_type = "central" if name == "urban central" else "decentral" nodes = pd.Index(n.buses.location[n.buses.index.str.contains(f"{name} heat")]) + + if (name_type != "central") and options["electricity_distribution_grid"]: + nodes_elec = nodes + " low voltage" + else: + nodes_elec = nodes heat_pump_type = "air" if "urban" in name else "ground" @@ -440,7 +445,7 @@ def add_heating_capacities_installed_before_baseyear( "Link", nodes, suffix=f" {name} {heat_pump_type} heat pump-{grouping_year}", - bus0=nodes, + bus0=nodes_elec, bus1=nodes + " " + name + " heat", carrier=f"{name} {heat_pump_type} heat pump", efficiency=efficiency, @@ -458,7 +463,7 @@ def add_heating_capacities_installed_before_baseyear( "Link", nodes, suffix=f" {name} resistive heater-{grouping_year}", - bus0=nodes, + bus0=nodes_elec, bus1=nodes + " " + name + " heat", carrier=name + " resistive heater", efficiency=costs.at[f"{name_type} resistive heater", "efficiency"], @@ -540,7 +545,7 @@ def add_heating_capacities_installed_before_baseyear( ], ) - +#%% if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake @@ -552,7 +557,7 @@ def add_heating_capacities_installed_before_baseyear( clusters="37", ll="v1.0", opts="", - sector_opts="1p7-4380H-T-H-B-I-A-dist1", + sector_opts="8760-T-H-B-I-A-dist1", planning_horizons=2020, ) From 60653de9f628e911a50c06400614d72e4c527045 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:27:17 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/add_existing_baseyear.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index d6f1802c4..44c9b20ef 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -416,7 +416,7 @@ def add_heating_capacities_installed_before_baseyear( name_type = "central" if name == "urban central" else "decentral" nodes = pd.Index(n.buses.location[n.buses.index.str.contains(f"{name} heat")]) - + if (name_type != "central") and options["electricity_distribution_grid"]: nodes_elec = nodes + " low voltage" else: @@ -545,7 +545,8 @@ def add_heating_capacities_installed_before_baseyear( ], ) -#%% + +# %% if __name__ == "__main__": if "snakemake" not in globals(): from _helpers import mock_snakemake