diff --git a/Snakefile b/Snakefile index f586a2a7..92ff9e76 100644 --- a/Snakefile +++ b/Snakefile @@ -159,7 +159,8 @@ rule build_industrial_demand_per_country: rule build_industrial_demand: input: - clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv" + clustered_pop_layout="resources/pop_layout_{network}_s{simpl}_{clusters}.csv", + industrial_demand_per_country="resources/industrial_demand_per_country.csv" output: industrial_demand="resources/industrial_demand_{network}_s{simpl}_{clusters}.csv" threads: 1 diff --git a/config.yaml b/config.yaml index ca93a08c..148a09d8 100644 --- a/config.yaml +++ b/config.yaml @@ -7,10 +7,10 @@ run: '190712-test_district' scenario: sectors: [E] # ,E+EV,E+BEV,E+BEV+V2G] # [ E+EV, E+BEV, E+BEV+V2G ] simpl: [''] - lv: [1.0,1.25,2.0]#, 1.125, 1.25, 1.5, 2.0]# or opt + lv: [1.0]#, 1.125, 1.25, 1.5, 2.0]# or opt clusters: [128] #[90, 128, 181] #[45, 64, 90, 128, 181, 256] #, 362] # (2**np.r_[5.5:9:.5]).astype(int) minimum is 37 opts: [''] #for pypsa-eur - sector_opts: [Co2L0-3H-T-H-B-I,Co2L0-3H-T-H-B-I-nodistrict]#,Co2L0p1-3H-T-H-B-I,Co2L0p25-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#[Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#,Co2L0-3H-T-H-B-I-onwind0p25-solar3]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] + sector_opts: [Co2L0-3H-T-H-B-I]#,Co2L0p1-3H-T-H-B-I,Co2L0p25-3H-T-H-B-I,Co2L0p5-3H-T-H-B-I]#[Co2L0-3H-T-H-B-I-onwind0-solar3,Co2L0-3H-T-H-B-I-onwind0p125-solar3,Co2L0-3H-T-H-B-I-onwind0p25-solar3,Co2L0-3H-T-H-B-I-onwind0p50-solar3,Co2L0-3H-T-H-B-I-solar3]#,Co2L0-3H-T-H-B-I-onwind0p25-solar3]#,Co2L0p05-3H-T-H-B-I,Co2L0p10-3H-T-H-B-I,Co2L0p20-3H-T-H-B-I,Co2L0p30-3H-T-H-B-I,Co2L0p50-3H-T-H-B-I]#[Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0-3H-T-H,Co2L0p20-3H-T-H] #Co2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p20-3H-T-HCo2L-3H-T-H,Co2L0p10-3H-T-H,Co2L0p30-3H-T-H,Co2L0p50-3H-T-H] #Co2L-3H,Co2L-3H-T,, LC-FL, LC-T, Ep-T, Co2L-T] # Co2L will give default (5%); Co2L0p25 will give 25% CO2 emissions; Co2Lm0p05 will give 5% negative emissions diff --git a/scripts/build_industrial_demand.py b/scripts/build_industrial_demand.py index ca4aa934..fce7b6ad 100644 --- a/scripts/build_industrial_demand.py +++ b/scripts/build_industrial_demand.py @@ -4,15 +4,18 @@ import pandas as pd idx = pd.IndexSlice def build_industrial_demand(): + pop_layout = pd.read_csv(snakemake.input.clustered_pop_layout,index_col=0) + pop_layout["ct"] = pop_layout.index.str[:2] + ct_total = pop_layout.total.groupby(pop_layout["ct"]).sum() + pop_layout["ct_total"] = pop_layout["ct"].map(ct_total.get) + pop_layout["fraction"] = pop_layout["total"]/pop_layout["ct_total"] - population = pd.read_csv(snakemake.input.clustered_pop_layout, - index_col=0) + industrial_demand_per_country = pd.read_csv(snakemake.input.industrial_demand_per_country,index_col=0) - totals = pd.Series(data=[1100.,1814.,586.,400.,580.,186.], - index=["industry new electricity","industry process heat", - "naphtha feedstock","shipping H2","aviation kerosene","process emissions"]) + industrial_demand = industrial_demand_per_country.loc[pop_layout.ct].fillna(0.) + industrial_demand.index = pop_layout.index + industrial_demand = industrial_demand.multiply(pop_layout.fraction,axis=0) - industrial_demand = pd.DataFrame({i : population["total"]*totals[i]*1e6/population["total"].sum() for i in totals.index }) industrial_demand.to_csv(snakemake.output.industrial_demand) @@ -27,6 +30,7 @@ if __name__ == "__main__": snakemake = Dict() snakemake.input = Dict() snakemake.input['clustered_pop_layout'] = "resources/pop_layout_elec_s_128.csv" + snakemake.input['industrial_demand_per_country']="resources/industrial_demand_per_country.csv" snakemake.output = Dict() snakemake.output['industrial_demand'] = "resources/industrial_demand_elec_s_128.csv" with open('config.yaml') as f: