diff --git a/Snakefile b/Snakefile index 6f3c118f..b01d7edd 100644 --- a/Snakefile +++ b/Snakefile @@ -62,6 +62,18 @@ rule build_clustered_population_layouts: script: "scripts/build_clustered_population_layouts.py" +rule build_simplified_population_layouts: + input: + pop_layout_total="resources/pop_layout_total.nc", + pop_layout_urban="resources/pop_layout_urban.nc", + pop_layout_rural="resources/pop_layout_rural.nc", + regions_onshore=pypsaeur('resources/regions_onshore_{network}_s{simpl}.geojson') + output: + clustered_pop_layout="resources/pop_layout_{network}_s{simpl}.csv" + resources: mem_mb=10000 + script: "scripts/build_clustered_population_layouts.py" + + rule build_heat_demands: input: pop_layout_total="resources/pop_layout_total.nc", @@ -235,6 +247,7 @@ rule prepare_sector_network: profile_offwind_dc=pypsaeur("resources/profile_offwind-dc.nc"), clustermaps=pypsaeur('resources/clustermaps_{network}_s{simpl}_{clusters}.h5'), clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv", + simplified_pop_layout="resources/pop_layout_{network}_s{simpl}.csv", industrial_demand="resources/industrial_demand_{network}_s{simpl}_{clusters}.csv", heat_demand_urban="resources/heat_demand_urban_{network}_s{simpl}_{clusters}.nc", heat_demand_rural="resources/heat_demand_rural_{network}_s{simpl}_{clusters}.nc", diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index d993c341..b596b50c 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -689,8 +689,14 @@ def insert_electricity_distribution_grid(network): solar = network.generators.index[network.generators.carrier == "solar"] network.generators.loc[solar, "capital_cost"] = costs.at['solar-utility', 'fixed'] - # add max solar rooftop potential assuming 1kW/person - potential = pop_layout.total.rename(index = lambda x: x + " solar") + if snakemake.wildcards.clusters[-1:] == "m": + pop_solar = simplified_pop_layout.total.rename(index = lambda x: x + " solar") + else: + pop_solar = pop_layout.total.rename(index = lambda x: x + " solar") + + # add max solar rooftop potential assuming 0.1 kW/m2 and 10 m2/person, + #i.e. 1 kW/person (population data is in thousands of people) so we get MW + potential = 0.1*10*pop_solar network.madd("Generator", solar, @@ -1778,6 +1784,8 @@ if __name__ == "__main__": pop_layout["ct_total"] = pop_layout["ct"].map(ct_total.get) pop_layout["fraction"] = pop_layout["total"]/pop_layout["ct_total"] + simplified_pop_layout = pd.read_csv(snakemake.input.simplified_pop_layout,index_col=0) + costs = prepare_costs(snakemake.input.costs, snakemake.config['costs']['USD2013_to_EUR2013'], snakemake.config['costs']['discountrate'],