Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor changes for running single node network #160

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions workflow/scripts/additional_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,10 @@ def additional_functionality(n, snapshots, snakemake):

add_max_capacity_limits(n, investment_year, constraints["limits_capacity_max"])

h2_import_limits(n, investment_year, constraints["limits_volume_max"])
if int(snakemake.wildcards.clusters) != 1:
h2_import_limits(n, investment_year, constraints["limits_volume_max"])

electricity_import_limits(n, investment_year, constraints["limits_volume_max"])
electricity_import_limits(n, investment_year, constraints["limits_volume_max"])

if investment_year >= 2025:
h2_production_limits(
Expand Down
17 changes: 10 additions & 7 deletions workflow/scripts/cluster_wasserstoff_kernnetz.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,17 @@ def aggregate_parallel_pipes(df):

wasserstoff_kernnetz = build_clustered_gas_network(df, bus_regions)

wasserstoff_kernnetz[["bus0", "bus1"]] = (
wasserstoff_kernnetz[["bus0", "bus1"]].apply(sorted, axis=1).apply(pd.Series)
)
if not wasserstoff_kernnetz.empty:
wasserstoff_kernnetz[["bus0", "bus1"]] = (
wasserstoff_kernnetz[["bus0", "bus1"]]
.apply(sorted, axis=1)
.apply(pd.Series)
)

reindex_pipes(wasserstoff_kernnetz, prefix="H2 pipeline")
reindex_pipes(wasserstoff_kernnetz, prefix="H2 pipeline")

wasserstoff_kernnetz["p_min_pu"] = 0
wasserstoff_kernnetz["p_nom_diameter"] = 0
wasserstoff_kernnetz = aggregate_parallel_pipes(wasserstoff_kernnetz)
wasserstoff_kernnetz["p_min_pu"] = 0
wasserstoff_kernnetz["p_nom_diameter"] = 0
wasserstoff_kernnetz = aggregate_parallel_pipes(wasserstoff_kernnetz)

wasserstoff_kernnetz.to_csv(snakemake.output.clustered_h2_network)
9 changes: 6 additions & 3 deletions workflow/scripts/export_ariadne_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,8 @@ def get_primary_energy(n, region):
"Store",
("Link", "gas pipeline"),
("Link", "gas pipeline new"),
]
],
errors="ignore",
)
.groupby("carrier")
.sum()
Expand Down Expand Up @@ -1154,7 +1155,8 @@ def get_primary_energy(n, region):
# Assuming renewables are only generators and StorageUnits
"Link",
"Line",
]
],
errors="ignore",
)
.filter(like=region)
.groupby("carrier")
Expand Down Expand Up @@ -1232,6 +1234,7 @@ def get_secondary_energy(n, region, _industry_demand):
.multiply(MWh2PJ)
.drop(
["AC", "DC", "electricity distribution grid"],
errors="ignore",
)
)

Expand Down Expand Up @@ -1544,7 +1547,7 @@ def get_secondary_energy(n, region, _industry_demand):
.groupby(["carrier", "component"])
.sum()
.multiply(MWh2PJ)
.drop(["gas pipeline", "gas pipeline new", ("gas", "Store")])
.drop(["gas pipeline", "gas pipeline new", ("gas", "Store")], errors="ignore")
.groupby("carrier")
.sum()
)
Expand Down