2024-01-19 17:42:49 +00:00
|
|
|
# SPDX-FileCopyrightText: : 2023-4 The PyPSA-Eur Authors
|
2023-03-08 16:29:01 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2023-03-08 16:46:14 +00:00
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule add_existing_baseyear:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-09-22 11:58:08 +00:00
|
|
|
baseyear=config_provider("scenario", "planning_horizons", 0),
|
|
|
|
sector=config_provider("sector"),
|
|
|
|
existing_capacities=config_provider("existing_capacities"),
|
|
|
|
costs=config_provider("costs"),
|
2024-07-29 16:29:27 +00:00
|
|
|
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
|
2024-09-11 13:06:32 +00:00
|
|
|
energy_totals_year=config_provider("energy", "energy_totals_year"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "prenetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
|
|
|
powerplants=resources("powerplants_s_{clusters}.csv"),
|
|
|
|
busmap_s=resources("busmap_base_s.csv"),
|
|
|
|
busmap=resources("busmap_base_s_{clusters}.csv"),
|
|
|
|
clustered_pop_layout=resources("pop_layout_base_s_{clusters}.csv"),
|
2024-02-16 10:17:00 +00:00
|
|
|
costs=lambda w: resources(
|
|
|
|
"costs_{}.csv".format(
|
2023-09-22 11:58:08 +00:00
|
|
|
config_provider("scenario", "planning_horizons", 0)(w)
|
2024-02-17 16:39:10 +00:00
|
|
|
)
|
2024-02-16 10:17:00 +00:00
|
|
|
),
|
2024-09-13 13:37:01 +00:00
|
|
|
cop_profiles=resources("cop_profiles_base_s_{clusters}.nc"),
|
2024-02-10 16:22:01 +00:00
|
|
|
existing_heating_distribution=resources(
|
2024-09-13 13:37:01 +00:00
|
|
|
"existing_heating_distribution_base_s_{clusters}_{planning_horizons}.csv"
|
2024-02-10 16:22:01 +00:00
|
|
|
),
|
2024-09-02 17:32:13 +00:00
|
|
|
heating_efficiencies=resources("heating_efficiencies.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "prenetworks-brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-03-08 16:29:01 +00:00
|
|
|
wildcard_constraints:
|
2024-02-17 22:36:46 +00:00
|
|
|
# TODO: The first planning_horizon needs to be aligned across scenarios
|
|
|
|
# snakemake does not support passing functions to wildcard_constraints
|
|
|
|
# reference: https://github.com/snakemake/snakemake/issues/2703
|
|
|
|
planning_horizons=config["scenario"]["planning_horizons"][0], #only applies to baseyear
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 1
|
|
|
|
resources:
|
|
|
|
mem_mb=2000,
|
2023-03-08 18:22:00 +00:00
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/add_existing_baseyear_base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/add_existing_baseyear/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:45:25 +00:00
|
|
|
"../scripts/add_existing_baseyear.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-03-08 16:44:25 +00:00
|
|
|
|
2024-02-12 15:56:00 +00:00
|
|
|
def input_profile_tech_brownfield(w):
|
|
|
|
return {
|
2024-09-13 13:37:01 +00:00
|
|
|
f"profile_{tech}": resources("profile_{clusters}_" + tech + ".nc")
|
2024-02-12 15:56:00 +00:00
|
|
|
for tech in config_provider("electricity", "renewable_carriers")(w)
|
|
|
|
if tech != "hydro"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule add_brownfield:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-09-22 11:58:08 +00:00
|
|
|
H2_retrofit=config_provider("sector", "H2_retrofit"),
|
|
|
|
H2_retrofit_capacity_per_CH4=config_provider(
|
|
|
|
"sector", "H2_retrofit_capacity_per_CH4"
|
|
|
|
),
|
2024-06-19 13:54:23 +00:00
|
|
|
threshold_capacity=config_provider("existing_capacities", "threshold_capacity"),
|
2024-02-17 16:16:28 +00:00
|
|
|
snapshots=config_provider("snapshots"),
|
2024-03-14 17:46:45 +00:00
|
|
|
drop_leap_day=config_provider("enable", "drop_leap_day"),
|
2024-02-10 16:22:01 +00:00
|
|
|
carriers=config_provider("electricity", "renewable_carriers"),
|
2024-08-05 09:27:52 +00:00
|
|
|
heat_pump_sources=config_provider("sector", "heat_pump_sources"),
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
2024-02-12 15:56:00 +00:00
|
|
|
unpack(input_profile_tech_brownfield),
|
2024-09-13 13:37:01 +00:00
|
|
|
simplify_busmap=resources("busmap_base_s.csv"),
|
|
|
|
cluster_busmap=resources("busmap_base_s_{clusters}.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "prenetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-03-08 16:29:01 +00:00
|
|
|
network_p=solved_previous_horizon, #solved network at previous time step
|
2024-02-16 10:17:00 +00:00
|
|
|
costs=resources("costs_{planning_horizons}.csv"),
|
2024-09-13 13:37:01 +00:00
|
|
|
cop_profiles=resources("cop_profiles_base_s_{clusters}.nc"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "prenetworks-brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2023-03-08 16:29:01 +00:00
|
|
|
threads: 4
|
|
|
|
resources:
|
|
|
|
mem_mb=10000,
|
2023-03-08 18:22:00 +00:00
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/add_brownfield_base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.log",
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/add_brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-08 16:45:25 +00:00
|
|
|
"../scripts/add_brownfield.py"
|
2023-03-08 16:29:01 +00:00
|
|
|
|
2023-03-08 16:44:25 +00:00
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
ruleorder: add_existing_baseyear > add_brownfield
|
|
|
|
|
2023-03-08 16:44:25 +00:00
|
|
|
|
2023-03-08 16:29:01 +00:00
|
|
|
rule solve_sector_network_myopic:
|
2023-05-15 08:33:17 +00:00
|
|
|
params:
|
2023-09-22 11:58:08 +00:00
|
|
|
solving=config_provider("solving"),
|
|
|
|
foresight=config_provider("foresight"),
|
|
|
|
planning_horizons=config_provider("scenario", "planning_horizons"),
|
|
|
|
co2_sequestration_potential=config_provider(
|
|
|
|
"sector", "co2_sequestration_potential", default=200
|
2023-06-02 10:52:49 +00:00
|
|
|
),
|
2024-01-04 08:00:31 +00:00
|
|
|
custom_extra_functionality=input_custom_extra_functionality,
|
2023-03-08 16:29:01 +00:00
|
|
|
input:
|
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "prenetworks-brownfield/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2024-02-16 10:17:00 +00:00
|
|
|
costs=resources("costs_{planning_horizons}.csv"),
|
2023-03-08 16:29:01 +00:00
|
|
|
output:
|
2024-03-13 07:57:57 +00:00
|
|
|
network=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "postnetworks/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
2024-03-13 07:57:57 +00:00
|
|
|
config=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "configs/config.base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.yaml",
|
2023-03-08 16:29:01 +00:00
|
|
|
shadow:
|
|
|
|
"shallow"
|
|
|
|
log:
|
2024-02-17 22:36:46 +00:00
|
|
|
solver=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_solver.log",
|
2024-03-08 10:26:00 +00:00
|
|
|
memory=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_memory.log",
|
2024-02-17 22:36:46 +00:00
|
|
|
python=RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "logs/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}_python.log",
|
2024-01-22 08:28:51 +00:00
|
|
|
threads: solver_threads
|
2023-03-08 16:29:01 +00:00
|
|
|
resources:
|
2024-03-09 13:47:01 +00:00
|
|
|
mem_mb=config_provider("solving", "mem_mb"),
|
|
|
|
runtime=config_provider("solving", "runtime", default="6h"),
|
2023-03-08 16:29:01 +00:00
|
|
|
benchmark:
|
2024-02-17 22:36:46 +00:00
|
|
|
(
|
|
|
|
RESULTS
|
2024-09-13 13:37:01 +00:00
|
|
|
+ "benchmarks/solve_sector_network/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}"
|
2024-02-10 17:09:23 +00:00
|
|
|
)
|
2023-03-08 16:46:14 +00:00
|
|
|
conda:
|
|
|
|
"../envs/environment.yaml"
|
2023-03-08 16:29:01 +00:00
|
|
|
script:
|
2023-03-09 21:51:56 +00:00
|
|
|
"../scripts/solve_network.py"
|