From 03670c1ab3361fb29b1896653f20b65ae31a3cb3 Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Fri, 19 Jul 2019 12:10:22 +0200 Subject: [PATCH] Simplify industry load-link-bus to avoid numerical problems Gurobi had numerical problems solving the system. Trivial load-link-bus combinations to manage CO2 have been replaced with simple loads. --- config.yaml | 2 +- scripts/prepare_sector_network.py | 56 ++++++++++++++----------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/config.yaml b/config.yaml index cb6b8972..80e14f13 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,7 @@ logging_level: INFO results_dir: 'results/' summary_dir: results -run: '190718-new_industry' +run: '190719-new_industry' scenario: sectors: [E] # ,E+EV,E+BEV,E+BEV+V2G] # [ E+EV, E+BEV, E+BEV+V2G ] diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 07d0b011..e60f7fe4 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1160,49 +1160,45 @@ def add_industry(network): solid_biomass_by_country = industrial_demand["solid biomass"].groupby(pop_layout.ct).sum() countries = solid_biomass_by_country.index - network.madd("Bus", - countries + " solid biomass for industry", - carrier="solid biomass for industry") - network.madd("Load", countries, suffix=" solid biomass for industry", - bus=countries+ " solid biomass for industry", + bus=countries+ " solid biomass", carrier="solid biomass for industry", p_set=solid_biomass_by_country/8760.) - #with BECCS - network.madd("Link", - countries + " solid biomass for industry", - bus0=countries + " solid biomass", - bus1=countries + " solid biomass for industry", - bus2="co2 atmosphere", - bus3="co2 stored", - efficiency2=-costs.at['solid biomass','CO2 intensity']*options["ccs_fraction"], - efficiency3=costs.at['solid biomass','CO2 intensity']*options["ccs_fraction"], - carrier="solid biomass for industry", - p_nom_extendable=True) + #Net transfer of CO2 from atmosphere to stored + network.madd("Load", + ["solid biomass for industry co2 from atmosphere"], + bus="co2 atmosphere", + carrier="solid biomass for industry co2 from atmosphere", + p_set=solid_biomass_by_country.sum()*costs.at['solid biomass','CO2 intensity']*options["ccs_fraction"]/8760.) + + network.madd("Load", + ["solid biomass for industry co2 to stored"], + bus="co2 stored", + carrier="solid biomass for industry co2 to stored", + p_set=-solid_biomass_by_country.sum()*costs.at['solid biomass','CO2 intensity']*options["ccs_fraction"]/8760.) - network.madd("Bus", - ["gas for industry"], - carrier="gas for industry") network.madd("Load", ["gas for industry"], - bus="gas for industry", + bus="EU gas", carrier="gas for industry", p_set=industrial_demand.loc[nodes,"methane"].sum()/8760.) - network.madd("Link", - ["gas for industry"], - bus0="EU gas", - bus1="gas for industry", - bus2="co2 atmosphere", - bus3="co2 stored", - efficiency2=costs.at['gas','CO2 intensity']*(1-options["ccs_fraction"]), - efficiency3=costs.at['gas','CO2 intensity']*options["ccs_fraction"], - carrier="gas for industry", - p_nom_extendable=True) + network.madd("Load", + ["gas for industry co2 to atmosphere"], + bus="co2 atmosphere", + carrier="gas for industry co2 to atmosphere", + p_set=-industrial_demand.loc[nodes,"methane"].sum()*costs.at['gas','CO2 intensity']*(1-options["ccs_fraction"])/8760.) + + network.madd("Load", + ["gas for industry co2 to stored"], + bus="co2 stored", + carrier="gas for industry co2 to stored", + p_set=-industrial_demand.loc[nodes,"methane"].sum()*costs.at['gas','CO2 intensity']*options["ccs_fraction"]/8760.) + network.madd("Load", nodes,