Skip to content

Commit de52711

Browse files
committed
Fix calculation of solar rooftop potentials for "m" clusters
I.e. when the generators are clustered to the "simplified" network resolution, but the grid is clustered further, e.g. by using the clusters = 37m "m" option.
1 parent 6b96486 commit de52711

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Snakefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ rule build_clustered_population_layouts:
6262
script: "scripts/build_clustered_population_layouts.py"
6363

6464

65+
rule build_simplified_population_layouts:
66+
input:
67+
pop_layout_total="resources/pop_layout_total.nc",
68+
pop_layout_urban="resources/pop_layout_urban.nc",
69+
pop_layout_rural="resources/pop_layout_rural.nc",
70+
regions_onshore=pypsaeur('resources/regions_onshore_{network}_s{simpl}.geojson')
71+
output:
72+
clustered_pop_layout="resources/pop_layout_{network}_s{simpl}.csv"
73+
resources: mem_mb=10000
74+
script: "scripts/build_clustered_population_layouts.py"
75+
76+
6577
rule build_heat_demands:
6678
input:
6779
pop_layout_total="resources/pop_layout_total.nc",
@@ -235,6 +247,7 @@ rule prepare_sector_network:
235247
profile_offwind_dc=pypsaeur("resources/profile_offwind-dc.nc"),
236248
clustermaps=pypsaeur('resources/clustermaps_{network}_s{simpl}_{clusters}.h5'),
237249
clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv",
250+
simplified_pop_layout="resources/pop_layout_{network}_s{simpl}.csv",
238251
industrial_demand="resources/industrial_demand_{network}_s{simpl}_{clusters}.csv",
239252
heat_demand_urban="resources/heat_demand_urban_{network}_s{simpl}_{clusters}.nc",
240253
heat_demand_rural="resources/heat_demand_rural_{network}_s{simpl}_{clusters}.nc",

scripts/prepare_sector_network.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,14 @@ def insert_electricity_distribution_grid(network):
689689
solar = network.generators.index[network.generators.carrier == "solar"]
690690
network.generators.loc[solar, "capital_cost"] = costs.at['solar-utility',
691691
'fixed']
692-
# add max solar rooftop potential assuming 1kW/person
693-
potential = pop_layout.total.rename(index = lambda x: x + " solar")
692+
if snakemake.wildcards.clusters[-1:] == "m":
693+
pop_solar = simplified_pop_layout.total.rename(index = lambda x: x + " solar")
694+
else:
695+
pop_solar = pop_layout.total.rename(index = lambda x: x + " solar")
696+
697+
# add max solar rooftop potential assuming 0.1 kW/m2 and 10 m2/person,
698+
#i.e. 1 kW/person (population data is in thousands of people) so we get MW
699+
potential = 0.1*10*pop_solar
694700

695701
network.madd("Generator",
696702
solar,
@@ -1778,6 +1784,8 @@ def remove_h2_network(n):
17781784
pop_layout["ct_total"] = pop_layout["ct"].map(ct_total.get)
17791785
pop_layout["fraction"] = pop_layout["total"]/pop_layout["ct_total"]
17801786

1787+
simplified_pop_layout = pd.read_csv(snakemake.input.simplified_pop_layout,index_col=0)
1788+
17811789
costs = prepare_costs(snakemake.input.costs,
17821790
snakemake.config['costs']['USD2013_to_EUR2013'],
17831791
snakemake.config['costs']['discountrate'],

0 commit comments

Comments
 (0)