From ae3059f676479de97f4357a8b53c2e90d24eec82 Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Thu, 16 May 2019 16:08:16 +0200 Subject: [PATCH] Add "central" option to remove electricity grid (HVAC, HVDC, B2B) --- config.yaml | 4 ++-- scripts/prepare_sector_network.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index b565f164..f3ac8153 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,7 @@ logging_level: INFO results_dir: 'results/' summary_dir: results -run: '190514-detailed_co2_sweep' +run: '190516-decentral' scenario: sectors: [E] # ,E+EV,E+BEV,E+BEV+V2G] # [ E+EV, E+BEV, E+BEV+V2G ] @@ -10,7 +10,7 @@ scenario: 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,Co2L0p1-3H-T-H-B-I,Co2L0p2-3H-T-H-B-I,Co2L0p3-3H-T-H-B-I,Co2L0p4-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] + sector_opts: [Co2L0-3H-T-H-B-I-decentral-solar100,Co2L0p1-3H-T-H-B-I-decentral-solar100,Co2L0p2-3H-T-H-B-I-decentral-solar100,Co2L0p3-3H-T-H-B-I-decentral-solar100,Co2L0p4-3H-T-H-B-I-decentral-solar100]#,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/prepare_sector_network.py b/scripts/prepare_sector_network.py index a5417270..c86f4530 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1274,6 +1274,10 @@ def restrict_technology_potential(n,tech,limit): #beware if limit is 0 and p_nom_max is np.inf, 0*np.inf is nan n.generators.loc[gens,"p_nom_max"] *=limit +def decentral(n): + n.lines.drop(n.lines.index,inplace=True) + n.links.drop(n.links.index[n.links.carrier.isin(["DC","B2B"])],inplace=True) + if __name__ == "__main__": # Detect running outside of snakemake and mock snakemake for testing @@ -1335,6 +1339,9 @@ if __name__ == "__main__": if "I" in opts and "H" in opts: add_waste_heat(n) + if "decentral" in opts: + decentral(n) + for o in opts: m = re.match(r'^\d+h$', o, re.IGNORECASE) if m is not None: