diff --git a/config.default.yaml b/config.default.yaml index 4085e719..ffb9cd2e 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -263,7 +263,9 @@ sector: biomass_transport: false # biomass transport between nodes conventional_generation: # generator : carrier OCGT: gas - biomass_to_liquid: true + biomass_to_liquid: false + biosng: false + industry: @@ -510,6 +512,7 @@ plotting: solid biomass for industry co2 from atmosphere: '#736412' solid biomass for industry co2 to stored: '#47411c' biomass to liquid: '#32CD32' + BioSNG: '#123456' # power transmission lines: '#6c9459' transmission lines: '#6c9459' diff --git a/scripts/add_brownfield.py b/scripts/add_brownfield.py index 9d2d86ce..87cb8947 100644 --- a/scripts/add_brownfield.py +++ b/scripts/add_brownfield.py @@ -139,4 +139,5 @@ if __name__ == "__main__": add_brownfield(n, n_p, year) + n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0]) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index 11b8d49b..5fe71f10 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -495,4 +495,5 @@ if __name__ == "__main__": default_lifetime = snakemake.config['costs']['lifetime'] add_heating_capacities_installed_before_baseyear(n, baseyear, grouping_years, ashp_cop, gshp_cop, time_dep_hp_cop, costs, default_lifetime) + n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0]) diff --git a/scripts/plot_network.py b/scripts/plot_network.py index 4a1bc6d0..cbc7cdbd 100644 --- a/scripts/plot_network.py +++ b/scripts/plot_network.py @@ -307,7 +307,6 @@ def plot_h2_map(network): ) n.plot( - geomap=False, bus_sizes=0, link_colors='#72d3d6', link_widths=link_widths_retro, @@ -441,7 +440,6 @@ def plot_ch4_map(network): ) n.plot( - geomap=False, ax=ax, bus_sizes=0., link_colors='#e8d1d1', @@ -451,7 +449,6 @@ def plot_ch4_map(network): ) n.plot( - geomap=False, ax=ax, bus_sizes=0., link_colors=link_color_used, diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 19637b5f..1f10d36f 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1860,6 +1860,7 @@ def add_biomass(n, costs): lifetime=costs.at[key, 'lifetime'] ) + #Solid biomass to liquid fuel if options["biomass_to_liquid"]: n.madd("Link", @@ -1894,6 +1895,42 @@ def add_biomass(n, costs): capital_cost=costs.at['BtL', 'fixed'] + costs.at['biomass CHP capture', 'fixed'] * costs.at[ "BtL", "CO2 stored"], marginal_cost=costs.at['BtL', 'efficiency'] * costs.loc["BtL", "VOM"] + + #BioSNG from solid biomass + if options["biosng"]: + n.madd("Link", + spatial.biomass.nodes, + suffix=" solid biomass to gas", + bus0=spatial.biomass.nodes, + bus1=spatial.gas.nodes, + bus3="co2 atmosphere", + carrier="BioSNG", + lifetime=costs.at['BioSNG', 'lifetime'], + efficiency=costs.at['BioSNG', 'efficiency'], + efficiency3=-costs.at['solid biomass', 'CO2 intensity'] + costs.at['BioSNG', 'CO2 stored'], + p_nom_extendable=True, + capital_cost=costs.at['BioSNG', 'fixed'], + marginal_cost=costs.at['BioSNG', 'efficiency']*costs.loc["BioSNG", "VOM"] + ) + + #TODO: Update with energy penalty for CC + n.madd("Link", + spatial.biomass.nodes, + suffix=" solid biomass to gas CC", + bus0=spatial.biomass.nodes, + bus1=spatial.gas.nodes, + bus2=spatial.co2.nodes, + bus3="co2 atmosphere", + carrier="BioSNG", + lifetime=costs.at['BioSNG', 'lifetime'], + efficiency=costs.at['BioSNG', 'efficiency'], + efficiency2=costs.at['BioSNG', 'CO2 stored'] * costs.at['BioSNG', 'capture rate'], + efficiency3=-costs.at['solid biomass', 'CO2 intensity'] + costs.at['BioSNG', 'CO2 stored'] * (1 - costs.at['BioSNG', 'capture rate']), + p_nom_extendable=True, + capital_cost=costs.at['BioSNG', 'fixed'] + costs.at['biomass CHP capture', 'fixed'] * costs.at[ + "BioSNG", "CO2 stored"], + marginal_cost=costs.at['BioSNG', 'efficiency']*costs.loc["BioSNG", "VOM"] + ) @@ -2503,4 +2540,5 @@ if __name__ == "__main__": if options['electricity_grid_connection']: add_electricity_grid_connection(n, costs) + n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0]) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index b1c02500..563d8c29 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -296,7 +296,7 @@ if __name__ == "__main__": if tmpdir is not None: from pathlib import Path Path(tmpdir).mkdir(parents=True, exist_ok=True) - opts = snakemake.wildcards.opts.split('-') + opts = snakemake.wildcards.sector_opts.split('-') solve_opts = snakemake.config['solving']['options'] fn = getattr(snakemake.log, 'memory', None) @@ -315,6 +315,7 @@ if __name__ == "__main__": n.line_volume_limit = n.global_constraints.at["lv_limit", "constant"] n.line_volume_limit_dual = n.global_constraints.at["lv_limit", "mu"] + n.meta = dict(snakemake.config, **dict(wildcards=dict(snakemake.wildcards))) n.export_to_netcdf(snakemake.output[0]) logger.info("Maximum memory usage: {}".format(mem.mem_usage))