diff --git a/.gitignore b/.gitignore index fafa28c2..0ea1d517 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,13 @@ data/industry_sector_ratios_NZ_2030.csv #/data/Industrial_Database.csv /data/retro/tabula-calculator-calcsetbuilding.csv /data/nuts* +/data/demand/unsd/data +/data/ports.csv +/data/energy_totals_DF_2030 +/data/energy_totals_XX_2038 + +/data/airports.csv +/data/energy_totals_base.csv /scripts/old doc/_build /cutouts @@ -46,6 +53,8 @@ doc/_build /scripts/data /sample_pypsa_eur +/notebooks + # File extensions *.org *.nc @@ -53,3 +62,5 @@ doc/_build *.xlsx *~ *.pyc + +!data/demand/unsd/paths/Energy_Statistics_Database.xlsx diff --git a/Snakefile b/Snakefile index 10c54642..58745499 100644 --- a/Snakefile +++ b/Snakefile @@ -242,6 +242,24 @@ rule prepare_heat_data: "scripts/prepare_heat_data.py" +rule build_base_energy_totals: + input: + unsd_paths="data/demand/unsd/paths/Energy_Statistics_Database.xlsx", + output: + energy_totals_base="data/energy_totals_base.csv", + script: + "scripts/build_base_energy_totals.py" + + +rule prepare_energy_totals: + input: + unsd_paths="data/energy_totals_base.csv", + output: + energy_totals="data/energy_totals_{demand}_{planning_horizons}.csv", + script: + "scripts/prepare_energy_totals.py" + + rule build_solar_thermal_profiles: input: pop_layout_total="resources/population_shares/pop_layout_total.nc", diff --git a/config.default.yaml b/config.default.yaml index a7bea787..b3791230 100644 --- a/config.default.yaml +++ b/config.default.yaml @@ -39,6 +39,10 @@ clustering_options: countries: ['MA'] +demand_data: + update_data: true # if true, the workflow downloads the energy balances data saved in data/demand/unsd/data again. Turn on for the first run. + base_year: 2019 + H2_network: false H2_network_limit: 2000 #GWkm H2_repurposed_network: false @@ -216,6 +220,9 @@ sector: biomass_transport: true # biomass transport between nodes + efficiency_heat_oil_to_elec: 0.9 + efficiency_heat_biomass_to_elec: 0.9 + efficiency_heat_gas_to_elec: 0.9 land_transport_fuel_cell_share: # 1 means all FCEVs HERE BU_2030: 0.00 @@ -263,7 +270,7 @@ sector: SMR: true cc_fraction: 0.9 cc: true - + space_heat_share: 0.6 # the share of space heating from all heating. Remainder goes to water heating. conventional_generation: # generator : carrier OCGT: gas #Gen_Test: oil # Just for testing purposes diff --git a/data/demand/district_heating.csv b/data/demand/district_heating.csv new file mode 100644 index 00000000..122a5a1d --- /dev/null +++ b/data/demand/district_heating.csv @@ -0,0 +1,4 @@ +country,current,potential +MA, 0, 0 +NG, 0, 0 +BJ, 0, 0 diff --git a/data/demand/efficiency_gains_cagr.csv b/data/demand/efficiency_gains_cagr.csv new file mode 100644 index 00000000..8c9d8680 --- /dev/null +++ b/data/demand/efficiency_gains_cagr.csv @@ -0,0 +1,5 @@ +,total residential space,total residential water,electricity residential,total services space,total services water,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,total road ev,total road fcev,total road ice,total navigation oil,total navigation hydrogen,residential heat biomass,residential heat oil,residential heat gas +MA,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0 +NG,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0 +BJ,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0 +EG,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0 diff --git a/data/demand/fuel_shares.csv b/data/demand/fuel_shares.csv new file mode 100644 index 00000000..a380b12e --- /dev/null +++ b/data/demand/fuel_shares.csv @@ -0,0 +1,4 @@ +country,oil residential heat share,biomass residential heat share,biomass to elec heat share,oil to elec heat share,biomass to elec share,oil to elec share,space to water heat share,gas to elec share,gas to elec heat share,gas residential heat share +MA, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75 +NG, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75 +BJ, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75 diff --git a/data/demand/growth_factors_cagr.csv b/data/demand/growth_factors_cagr.csv new file mode 100644 index 00000000..f857d5fe --- /dev/null +++ b/data/demand/growth_factors_cagr.csv @@ -0,0 +1,5 @@ +,total residential space,total residential water,electricity residential,total services space,total services water,total road,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,residential heat oil,residential heat biomass,residential heat gas +MA,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0 +NG,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0 +BJ,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0 +EG,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0 diff --git a/data/demand/unsd/paths/Energy_Statistics_Database.xlsx b/data/demand/unsd/paths/Energy_Statistics_Database.xlsx new file mode 100644 index 00000000..631ceabb Binary files /dev/null and b/data/demand/unsd/paths/Energy_Statistics_Database.xlsx differ diff --git a/data/energy_totals_DF_2030.csv b/data/energy_totals_DF_2030.csv index d558dc9b..0cccb008 100644 --- a/data/energy_totals_DF_2030.csv +++ b/data/energy_totals_DF_2030.csv @@ -1,7 +1,2 @@ -country,total residential space,electricity residential space,total residential water,electricity residential water,total residential cooking,electricity residential cooking,total residential,electricity residential,derived heat residential,thermal uses residential,total services space,electricity services space,total services water,electricity services water,total services cooking,electricity services cooking,total services,electricity services,derived heat services,thermal uses services,total agriculture electricity,total agriculture heat,total agriculture machinery,total agriculture,total road,electricity road,total two-wheel,total passenger cars,electricity passenger cars,total other road passenger,electricity other road passenger,total light duty road freight,electricity light duty road freight,total heavy duty road freight,total rail,electricity rail,total rail passenger,electricity rail passenger,total rail freight,electricity rail freight,total aviation passenger,total aviation freight,total domestic aviation passenger,total international aviation passenger,total domestic aviation freight,total international aviation freight,total domestic aviation,total international aviation,total domestic navigation,district heat share,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass -MA,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 -NG,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 -BJ,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 -NA,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 -BR,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 -AE,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7 +,agriculture biomass,agriculture electricity,agriculture oil,electricity rail,electricity residential,residential biomass,residential gas,residential oil,services biomass,services electricity,services gas,services oil,total domestic aviation,total domestic navigation,total international aviation,total international navigation,total rail,total residential space,total residential water,total road,total services space,total services water,district heat share,electricity residential water,electricity residential space,electricity services space,electricity services water +MA,0.0,3.7943233899999993,12.220265024000001,0.4112628,11.8740713,7.0544838,0.0,25.168813287999996,4.96120807,5.9330894999999995,0.0,0.765688,0.3847932,0.0,12.69355680000002,1.9635325499999998,0.1264536,0.0,0.0,85.52591748000002,0.0,0.0,0,0,0,0,0 diff --git a/scripts/build_base_energy_totals.py b/scripts/build_base_energy_totals.py new file mode 100644 index 00000000..273b3d58 --- /dev/null +++ b/scripts/build_base_energy_totals.py @@ -0,0 +1,380 @@ +# -*- coding: utf-8 -*- +import glob +import os +import sys +from io import BytesIO +from pathlib import Path +from urllib.request import urlopen +from zipfile import ZipFile + +import country_converter as coco +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import py7zr +import requests +from helpers import sets_path_to_root, three_2_two_digits_country + +pd.options.mode.chained_assignment = None + + +def calc_sector(sector): + for country in countries: + # print(country, sector) + df_co = df_yr[df_yr.country == country] + + if sector != "navigation": + df_sector = df_co.loc[ + df["Commodity - Transaction"].str.lower().str.contains(sector) + ] + # assert df_yr[df_yr["Commodity - Transaction"].str.contains(sector)]["Unit"].unique() == 'Metric tons, thousand', "Not all quantities have the expected unit: {}".format(expected_unit) + else: + df_sector = df_co.loc[ + (df["Commodity - Transaction"].str.lower().str.contains(sector)) + | ( + df["Commodity - Transaction"] + .str.lower() + .str.contains("marine bunkers") + ) + ] + + if df_sector.empty: + pass + else: + index_mass = df_sector.loc[ + df_sector["Unit"] == "Metric tons, thousand" + ].index + df_sector.loc[index_mass, "Quantity_TWh"] = df_sector.loc[index_mass].apply( + lambda x: x["Quantity"] * fuels_conv_toTWh[x["Commodity"]], axis=1 + ) + + index_energy = df_sector[ + df_sector["Unit"] == "Kilowatt-hours, million" + ].index + df_sector.loc[index_energy, "Quantity_TWh"] = df_sector.loc[ + index_energy + ].apply(lambda x: x["Quantity"] / 1e3, axis=1) + + index_energy_TJ = df_sector[df_sector["Unit"] == "Terajoules"].index + df_sector.loc[index_energy_TJ, "Quantity_TWh"] = df_sector.loc[ + index_energy_TJ + ].apply(lambda x: x["Quantity"] / 3600, axis=1) + + index_volume = df_sector[ + df_sector["Unit"] == "Cubic metres, thousand" + ].index + df_sector.loc[index_volume, "Quantity_TWh"] = df_sector.loc[ + index_volume + ].apply(lambda x: x["Quantity"] * fuels_conv_toTWh[x["Commodity"]], axis=1) + + sectors_dfs[sector] = df_sector.copy() + + if sector == "consumption by households": + energy_totals_base.at[country, "electricity residential"] = ( + df_sector[ + (df_sector.Commodity == "Electricity") + | df_sector.Commodity.isin(other_fuels) + ] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "residential oil"] = ( + df_sector[df_sector.Commodity.isin(oil_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "residential biomass"] = ( + df_sector[df_sector.Commodity.isin(biomass_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "residential gas"] = ( + df_sector[df_sector.Commodity.isin(gas_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "total residential space"] = ( + df_sector[df_sector.Commodity.isin(heat)] + .Quantity_TWh.sum() + .round(4) + * snakemake.config["sector"]["space_heat_share"] + ) + energy_totals_base.at[country, "total residential water"] = df_sector[ + df_sector.Commodity.isin(heat) + ].Quantity_TWh.sum().round(4) * ( + 1 - snakemake.config["sector"]["space_heat_share"] + ) + + elif sector == "services": + energy_totals_base.at[country, "services electricity"] = ( + df_sector[ + (df_sector.Commodity == "Electricity") + | df_sector.Commodity.isin(other_fuels) + ] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "services oil"] = ( + df_sector[df_sector.Commodity.isin(oil_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "services biomass"] = ( + df_sector[df_sector.Commodity.isin(biomass_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "services gas"] = ( + df_sector[df_sector.Commodity.isin(gas_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "total services space"] = ( + df_sector[df_sector.Commodity.isin(heat)] + .Quantity_TWh.sum() + .round(4) + * snakemake.config["sector"]["space_heat_share"] + ) + energy_totals_base.at[country, "total services water"] = df_sector[ + df_sector.Commodity.isin(heat) + ].Quantity_TWh.sum().round(4) * ( + 1 - snakemake.config["sector"]["space_heat_share"] + ) + + elif sector == "road": + energy_totals_base.at[ + country, "total road" + ] = df_sector.Quantity_TWh.sum().round(4) + + elif sector == "agriculture": + energy_totals_base.at[country, "agriculture electricity"] = ( + df_sector[ + (df_sector.Commodity == "Electricity") + | df_sector.Commodity.isin(other_fuels) + ] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "agriculture oil"] = ( + df_sector[df_sector.Commodity.isin(oil_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "agriculture biomass"] = ( + df_sector[df_sector.Commodity.isin(biomass_fuels)] + .Quantity_TWh.sum() + .round(4) + ) + # energy_totals_base.at[country, "electricity rail"] = df_house[(df_house.Commodity=="Electricity")].Quantity_TWh.sum().round(4) + + elif sector == "rail": + energy_totals_base.at[country, "total rail"] = ( + df_sector[ + (df_sector.Commodity == "Gas Oil/ Diesel Oil") + | (df_sector.Commodity == "Biodiesel") + | (df_sector.Commodity == "Electricity") + ] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "electricity rail"] = ( + df_sector[(df_sector.Commodity == "Electricity")] + .Quantity_TWh.sum() + .round(4) + ) + + elif sector == "aviation": + energy_totals_base.at[country, "total international aviation"] = ( + df_sector[ + (df_sector.Commodity == "Kerosene-type Jet Fuel") + & (df_sector.Transaction == "International aviation bunkers") + ] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "total domestic aviation"] = ( + df_sector[ + (df_sector.Commodity == "Kerosene-type Jet Fuel") + & (df_sector.Transaction == "Consumption by domestic aviation") + ] + .Quantity_TWh.sum() + .round(4) + ) + + elif sector == "navigation": + energy_totals_base.at[country, "total international navigation"] = ( + df_sector[df_sector.Transaction == "International marine bunkers"] + .Quantity_TWh.sum() + .round(4) + ) + energy_totals_base.at[country, "total domestic navigation"] = ( + df_sector[ + df_sector.Transaction == "Consumption by domestic navigation" + ] + .Quantity_TWh.sum() + .round(4) + ) + + else: + print("wrong sector") + + +if __name__ == "__main__": + if "snakemake" not in globals(): + from helpers import mock_snakemake, sets_path_to_root + + os.chdir(os.path.dirname(os.path.abspath(__file__))) + + snakemake = mock_snakemake( + "build_base_energy_totals", + simpl="", + clusters=10, + demand="DF", + planning_horizons=2030, + ) + sets_path_to_root("pypsa-earth-sec") + + energy_stat_database = pd.read_excel( + snakemake.input.unsd_paths, index_col=0, header=0 + ) # pd.read_excel("/nfs/home/haz43975/pypsa-earth-sec/scripts/Energy_Statistics_Database.xlsx" + + # Load the links and make a dictionary + df = energy_stat_database.copy() + df = df.dropna(axis=0, subset=["Link"]) + df = df.to_dict("dict") + d = df["Link"] + + if snakemake.config["demand_data"]["update_data"]: + # Delete and existing files to avoid duplication and double counting + + files = glob.glob("data/demand/unsd/data/*.txt") + for f in files: + os.remove(f) + + # Feed the dictionary of links to the for loop, download and unzip all files + for key, value in d.items(): + zipurl = value + + with urlopen(zipurl) as zipresp: + with ZipFile(BytesIO(zipresp.read())) as zfile: + zfile.extractall("data/demand/unsd/data") + + path = "data/demand/unsd/data" + + # Get the files from the path provided in the OP + all_files = Path("data/demand/unsd/data").glob("*.txt") + + # Create a dataframe from all downloaded files + df = pd.concat( + (pd.read_csv(f, encoding="utf8", sep=";") for f in all_files), ignore_index=True + ) + + # Split 'Commodity', 'Transaction' column to two + df[["Commodity", "Transaction", "extra"]] = df["Commodity - Transaction"].str.split( + " - ", expand=True + ) + + # Remove Foootnote and Estimate from 'Commodity - Transaction' column + df = df.loc[df["Commodity - Transaction"] != "Footnote"] + df = df.loc[df["Commodity - Transaction"] != "Estimate"] + + # Create a column with iso2 country code + cc = coco.CountryConverter() + Country = pd.Series(df["Country or Area"]) + + df["country"] = cc.pandas_convert(series=Country, to="ISO2", not_found="not found") + + # remove countries or areas that have no iso2 such as former countries names + df = df.loc[df["country"] != "not found"] + + # Convert country column that contains lists for some country names that are identified with more than one country. + df["country"] = df["country"].astype(str) + + # Remove all iso2 conversions for some country names that are identified with more than one country. + df = df[~df.country.str.contains(",", na=False)].reset_index(drop=True) + + # Create a dictionary with all the conversion factors from ktons or m3 to TWh based on https://unstats.un.org/unsd/energy/balance/2014/05.pdf + fuels_conv_toTWh = { + "Gas Oil/ Diesel Oil": 0.01194, + "Motor Gasoline": 0.01230, + "Kerosene-type Jet Fuel": 0.01225, + "Aviation gasoline": 0.01230, + "Biodiesel": 0.01022, + "Natural gas liquids": 0.01228, + "Biogasoline": 0.007444, + "Bitumen": 0.01117, + "Fuel oil": 0.01122, + "Liquefied petroleum gas (LPG)": 0.01313, + "Liquified Petroleum Gas (LPG)": 0.01313, + "Lubricants": 0.01117, + "Naphtha": 0.01236, + "Fuelwood": 0.00254, + "Charcoal": 0.00819, + "Patent fuel": 0.00575, + "Brown coal briquettes": 0.00575, + "Hard coal": 0.007167, + "Other bituminous coal": 0.005556, + "Anthracite": 0.005, + "Peat": 0.00271, + "Peat products": 0.00271, + "Lignite": 0.003889, + "Brown coal": 0.003889, + "Sub-bituminous coal": 0.005555, + "Coke-oven coke": 0.0002778, + "Coke oven coke": 0.0002778, + "Coke Oven Coke": 0.0002778, + "Gasoline-type jet fuel": 0.01230, + "Conventional crude oil": 0.01175, + "Brown Coal Briquettes": 0.00575, + "Refinery Gas": 0.01375, + "Petroleum coke": 0.009028, + "Coking coal": 0.007833, + "Peat Products": 0.00271, + "Petroleum Coke": 0.009028, + } + + # Fetch country list and demand base year from the config file + year = snakemake.config["demand_data"]["base_year"] + countries = snakemake.config["countries"] + # countries = ["NG", "BJ"] + + # Filter for the year and country + df_yr = df[df.Year == year] + df_yr = df_yr[df_yr.country.isin(countries)] + + # Create an empty dataframe for energy_totals_base + energy_totals_cols = pd.read_csv("data/energy_totals_DF_2030.csv").columns + energy_totals_base = pd.DataFrame(columns=energy_totals_cols, index=countries) + + # Lists that combine the different fuels in the dataset to the model's carriers + oil_fuels = [ + "Patent fuel", + "Gas Oil/ Diesel Oil", + "Motor Gasoline", + "Liquefied petroleum gas (LPG)", + ] + gas_fuels = ["Natural gas (including LNG)", "Gasworks Gas"] + biomass_fuels = ["Biodiesel", "Biogases", "Fuelwood"] + other_fuels = ["Charcoal", "Brown coal briquettes", "Other bituminous coal"] + heat = ["Heat", "Direct use of geothermal heat", "Direct use of solar thermal heat"] + + # Create a dictionary to save the data if need to be checked + sectors_dfs = {} + + # Run the function that processes the data for all the sectors + sectors = [ + "consumption by households", + "road", + "rail", + "aviation", + "navigation", + "agriculture", + "services", + ] + for sector in sectors: + calc_sector(sector) + + # Export the base energy totals file + energy_totals_base.dropna(axis=1, how="all").to_csv( + snakemake.output.energy_totals_base + ) diff --git a/scripts/prepare_energy_totals.py b/scripts/prepare_energy_totals.py new file mode 100644 index 00000000..c4ba94bc --- /dev/null +++ b/scripts/prepare_energy_totals.py @@ -0,0 +1,273 @@ +# -*- coding: utf-8 -*- +import glob +import os +import sys +from io import BytesIO +from pathlib import Path +from urllib.request import urlopen +from zipfile import ZipFile + +import country_converter as coco +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import py7zr +import requests +from helpers import sets_path_to_root, three_2_two_digits_country + + +def get(item, investment_year=None): + """Check whether item depends on investment year""" + if isinstance(item, dict): + return item[investment_year] + else: + return item + + +def calculate_end_values(df): + return (1 + df) ** no_years + + +if __name__ == "__main__": + if "snakemake" not in globals(): + from helpers import mock_snakemake, sets_path_to_root + + os.chdir(os.path.dirname(os.path.abspath(__file__))) + + snakemake = mock_snakemake( + "prepare_energy_totals", + simpl="", + clusters=32, + demand="EG", + planning_horizons=2030, + ) + sets_path_to_root("pypsa-earth-sec") + + countries = snakemake.config["countries"] + # countries = ["NG", "BJ"] + investment_year = int(snakemake.wildcards.planning_horizons) + demand_sc = snakemake.wildcards.demand # loading the demand scenrario wildcard + + base_energy_totals = pd.read_csv("data/energy_totals_base.csv", index_col=0) + growth_factors_cagr = pd.read_csv( + "data/demand/growth_factors_cagr.csv", index_col=0 + ) + efficiency_gains_cagr = pd.read_csv( + "data/demand/efficiency_gains_cagr.csv", index_col=0 + ) + fuel_shares = pd.read_csv("data/demand/fuel_shares.csv", index_col=0) + district_heating = pd.read_csv("data/demand/district_heating.csv", index_col=0) + + no_years = int(snakemake.wildcards.planning_horizons) - int( + snakemake.config["demand_data"]["base_year"] + ) + growth_factors = calculate_end_values(growth_factors_cagr) + efficiency_gains = calculate_end_values(efficiency_gains_cagr) + # efficiency_gains = efficiency_gains[efficiency_gains.index.isin(countries)] + # fuel_shares = fuel_shares[fuel_shares.index.isin(countries)] + # district_heating = district_heating[district_heating.index.isin(countries)] + + options = snakemake.config["sector"] + + fuel_cell_share = get( + options["land_transport_fuel_cell_share"], + demand_sc + "_" + str(investment_year), + ) + electric_share = get( + options["land_transport_electric_share"], demand_sc + "_" + str(investment_year) + ) + + hydrogen_shipping_share = get( + options["shipping_hydrogen_share"], demand_sc + "_" + str(investment_year) + ) + + energy_totals = base_energy_totals * efficiency_gains * growth_factors + + # Residential + efficiency_heat_oil_to_elec = snakemake.config["sector"][ + "efficiency_heat_oil_to_elec" + ] + efficiency_heat_biomass_to_elec = snakemake.config["sector"][ + "efficiency_heat_biomass_to_elec" + ] + efficiency_heat_gas_to_elec = snakemake.config["sector"][ + "efficiency_heat_gas_to_elec" + ] + + energy_totals["electricity residential space"] = ( + base_energy_totals["total residential space"] + + ( + fuel_shares["biomass to elec heat share"] + * fuel_shares["biomass residential heat share"] + * (fuel_shares["space to water heat share"]) + * base_energy_totals["residential biomass"] + * efficiency_heat_biomass_to_elec + ) + + ( + fuel_shares["oil to elec heat share"] + * fuel_shares["oil residential heat share"] + * (fuel_shares["space to water heat share"]) + * base_energy_totals["residential oil"] + * efficiency_heat_oil_to_elec + ) + + ( + fuel_shares["gas to elec heat share"] + * fuel_shares["gas residential heat share"] + * (fuel_shares["space to water heat share"]) + * base_energy_totals["residential gas"] + * efficiency_heat_gas_to_elec + ) + ) + + energy_totals["electricity residential water"] = ( + base_energy_totals["total residential water"] + + ( + fuel_shares["biomass to elec heat share"] + * fuel_shares["biomass residential heat share"] + * (1 - fuel_shares["space to water heat share"]) + * base_energy_totals["residential biomass"] + * efficiency_heat_biomass_to_elec + ) + + ( + fuel_shares["oil to elec heat share"] + * fuel_shares["oil residential heat share"] + * (1 - fuel_shares["space to water heat share"]) + * base_energy_totals["residential oil"] + * efficiency_heat_oil_to_elec + ) + + ( + fuel_shares["gas to elec heat share"] + * fuel_shares["gas residential heat share"] + * (1 - fuel_shares["space to water heat share"]) + * base_energy_totals["residential gas"] + * efficiency_heat_gas_to_elec + ) + ) + + energy_totals["residential heat oil"] = ( + base_energy_totals["residential oil"] + * fuel_shares["oil residential heat share"] + * (1 - fuel_shares["oil to elec heat share"]) + * efficiency_gains["residential heat oil"] + * growth_factors["residential heat oil"] + ) + + energy_totals["residential oil"] = ( + base_energy_totals["residential oil"] + * (1 - fuel_shares["oil residential heat share"]) + * (1 - fuel_shares["oil to elec share"]) + * efficiency_gains["residential oil"] + * growth_factors["residential oil"] + ) + + energy_totals["residential heat biomass"] = ( + base_energy_totals["residential biomass"] + * fuel_shares["biomass residential heat share"] + * (1 - fuel_shares["biomass to elec heat share"]) + * efficiency_gains["residential heat biomass"] + * growth_factors["residential heat biomass"] + ) + + energy_totals["residential biomass"] = ( + base_energy_totals["residential biomass"] + * (1 - fuel_shares["biomass residential heat share"]) + * (1 - fuel_shares["biomass to elec share"]) + * efficiency_gains["residential biomass"] + * growth_factors["residential biomass"] + ) + + energy_totals["residential heat gas"] = ( + base_energy_totals["residential gas"] + * fuel_shares["gas residential heat share"] + * (1 - fuel_shares["gas to elec heat share"]) + * efficiency_gains["residential heat gas"] + * growth_factors["residential heat gas"] + ) + + energy_totals["residential gas"] = ( + base_energy_totals["residential gas"] + * (1 - fuel_shares["gas residential heat share"]) + * (1 - fuel_shares["gas to elec share"]) + * efficiency_gains["residential gas"] + * growth_factors["residential gas"] + ) + + energy_totals["total residential space"] = energy_totals[ + "electricity residential space" + ] + ( + energy_totals["residential heat oil"] + + energy_totals["residential heat biomass"] + + energy_totals["residential heat gas"] + ) * ( + fuel_shares["space to water heat share"] + ) + + energy_totals["total residential water"] = energy_totals[ + "electricity residential water" + ] + ( + energy_totals["residential heat oil"] + + energy_totals["residential heat biomass"] + + energy_totals["residential heat gas"] + ) * ( + 1 - fuel_shares["space to water heat share"] + ) + + energy_totals["electricity residential"] = ( + energy_totals["electricity residential"] + + ( + fuel_shares["oil to elec share"] + * (1 - fuel_shares["oil residential heat share"]) + * base_energy_totals["residential oil"] + ) + + ( + fuel_shares["biomass to elec share"] + * (1 - fuel_shares["biomass residential heat share"]) + * base_energy_totals["residential biomass"] + ) + + ( + fuel_shares["gas to elec share"] + * (1 - fuel_shares["gas residential heat share"]) + * base_energy_totals["residential gas"] + ) + ) + + # Road + energy_totals["total road"] = ( + (1 - fuel_cell_share - electric_share) + * efficiency_gains["total road ice"] + * base_energy_totals["total road"] + + fuel_cell_share + * efficiency_gains["total road fcev"] + * base_energy_totals["total road"] + + electric_share + * efficiency_gains["total road ev"] + * base_energy_totals["total road"] + ) * growth_factors["total road"] + + # Navigation + energy_totals["total domestic navigation"] = ( + (1 - hydrogen_shipping_share) + * efficiency_gains["total navigation oil"] + * base_energy_totals["total domestic navigation"] + + hydrogen_shipping_share + * efficiency_gains["total navigation hydrogen"] + * base_energy_totals["total domestic navigation"] + ) * growth_factors["total domestic navigation"] + + energy_totals["total international navigation"] = ( + (1 - hydrogen_shipping_share) + * efficiency_gains["total navigation oil"] + * base_energy_totals["total international navigation"] + + hydrogen_shipping_share + * efficiency_gains["total navigation hydrogen"] + * base_energy_totals["total international navigation"] + ) * growth_factors["total international navigation"] + + energy_totals["district heat share"] = district_heating["current"] + + energy_totals["electricity services space"] = 0 + energy_totals["electricity services water"] = 0 + + energy_totals = energy_totals.dropna(axis=1, how="all") + + energy_totals.to_csv(snakemake.output.energy_totals) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index ce8ea030..87684f29 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1296,24 +1296,22 @@ def add_industry(n, costs): if n.loads_t.p_set[loads_i].empty: continue - if not snakemake.config["custom_data"]["elec_demand"]: - # if electricity demand is provided by pypsa-earth, the electricty used - # in industry is included, and need to be removed from the default elec - # demand here, and added as "industry electricity" - factor = ( - 1 - - industrial_demand.loc[loads_i, "current electricity"].sum() - / n.loads_t.p_set[loads_i].sum().sum() - ) - n.loads_t.p_set[loads_i] *= factor - industrial_elec = industrial_demand["current electricity"].apply( - lambda frac: frac / 8760 - ) + # if not snakemake.config["custom_data"]["elec_demand"]: + # # if electricity demand is provided by pypsa-earth, the electricty used + # # in industry is included, and need to be removed from the default elec + # # demand here, and added as "industry electricity" + # factor = ( + # 1 + # - industrial_demand.loc[loads_i, "current electricity"].sum() + # / n.loads_t.p_set[loads_i].sum().sum() + # ) + # n.loads_t.p_set[loads_i] *= factor + # industrial_elec = industrial_demand["current electricity"].apply( + # lambda frac: frac / 8760 + # ) - else: - industrial_elec = industrial_demand["electricity"].apply( - lambda frac: frac / 8760 - ) + # else: + industrial_elec = industrial_demand["electricity"].apply(lambda frac: frac / 8760) n.madd( "Load", @@ -2058,184 +2056,188 @@ def add_agriculture(n, costs): def add_residential(n, costs): # need to adapt for many countries #TODO - if snakemake.config["custom_data"]["heat_demand"]: - # heat_demand_index=n.loads_t.p.filter(like='residential').filter(like='heat').dropna(axis=1).index - # oil_res_index=n.loads_t.p.filter(like='residential').filter(like='oil').dropna(axis=1).index + # if snakemake.config["custom_data"]["heat_demand"]: + # heat_demand_index=n.loads_t.p.filter(like='residential').filter(like='heat').dropna(axis=1).index + # oil_res_index=n.loads_t.p.filter(like='residential').filter(like='oil').dropna(axis=1).index - heat_ind = ( - n.loads_t.p_set.filter(like=countries[0]) - .filter(like="residential") - .filter(like="heat") - .dropna(axis=1) - .columns - ) - oil_ind = ( - n.loads_t.p_set.filter(like=countries[0]) - .filter(like="residential") - .filter(like="oil") - .dropna(axis=1) - .columns - ) - bio_ind = ( - n.loads_t.p_set.filter(like=countries[0]) - .filter(like="residential") - .filter(like="biomass") - .dropna(axis=1) - .columns - ) + heat_ind = ( + n.loads_t.p_set.filter(like="residential") + .filter(like="heat") + .dropna(axis=1) + .columns + ) + oil_ind = ( + n.loads_t.p_set.filter(like="residential") + .filter(like="oil") + .dropna(axis=1) + .columns + ) + bio_ind = ( + n.loads_t.p_set.filter(like="residential") + .filter(like="biomass") + .dropna(axis=1) + .columns + ) - gas_ind = ( - n.loads_t.p_set.filter(like=countries[0]) - .filter(like="residential") - .filter(like="gas") - .dropna(axis=1) - .columns - ) + gas_ind = ( + n.loads_t.p_set.filter(like="residential") + .filter(like="gas") + .dropna(axis=1) + .columns + ) - heat_shape = ( - n.loads_t.p_set.loc[:, heat_ind] - / n.loads_t.p_set.loc[:, heat_ind].sum().sum() - ) - heat_oil_demand = ( - heat_shape * energy_totals.loc[countries[0], "residential heat oil"] * 1e6 - ) + heat_shape = ( + n.loads_t.p_set.loc[:, heat_ind] / n.loads_t.p_set.loc[:, heat_ind].sum().sum() + ) - heat_biomass_demand = ( - heat_shape - * energy_totals.loc[countries[0], "residential heat biomass"] - * 1e6 - ) + heat_shape = heat_shape.groupby( + lambda x: next((substring for substring in nodes if substring in x), x), axis=1 + ).sum() - heat_gas_demand = ( - heat_shape * energy_totals.loc[countries[0], "residential heat gas"] * 1e6 - ) + heat_oil_demand = ( + heat_shape * energy_totals.loc[countries[0], "residential heat oil"] * 1e6 + ) - n.loads_t.p_set.loc[:, heat_ind] = ( - heat_shape - * ( - energy_totals.loc[countries, "total residential space"].sum() - + energy_totals.loc[countries, "total residential water"].sum() - - energy_totals.loc[countries[0], "residential heat biomass"] - - energy_totals.loc[countries[0], "residential heat oil"] - - energy_totals.loc[countries[0], "residential heat gas"] - ) - * 1e6 - ) + heat_biomass_demand = ( + heat_shape * energy_totals.loc[countries[0], "residential heat biomass"] * 1e6 + ) - # TODO make compatible with more counties - profile_residential = ( - n.loads_t.p_set[nodes] / n.loads_t.p_set[nodes].sum().sum() + heat_gas_demand = ( + heat_shape * energy_totals.loc[countries[0], "residential heat gas"] * 1e6 + ) + + n.loads_t.p_set.loc[:, heat_ind] = ( + heat_shape + * ( + energy_totals.loc[countries, "total residential space"].sum() + + energy_totals.loc[countries, "total residential water"].sum() + - energy_totals.loc[countries[0], "residential heat biomass"] + - energy_totals.loc[countries[0], "residential heat oil"] + - energy_totals.loc[countries[0], "residential heat gas"] ) + * 1e6 + ) - p_set_oil = ( - profile_residential - * energy_totals.loc[countries, "residential oil"].sum() - * 1e6 - ) + heat_oil_demand.values + print("#############################################") + print("#############################################") + print("#############################################") + print(nodes) + print("#############################################") + print("#############################################") + print("#############################################") + print(heat_shape) + print("#############################################") + print("#############################################") + print("#############################################") - p_set_biomass = ( - profile_residential - * energy_totals.loc[countries, "residential biomass"].sum() - * 1e6 - ) + heat_biomass_demand.values + # TODO make compatible with more counties + profile_residential = n.loads_t.p_set[nodes] / n.loads_t.p_set[nodes].sum().sum() - p_set_gas = ( - profile_residential - * energy_totals.loc[countries, "residential gas"].sum() - * 1e6 - ) + heat_gas_demand.values + p_set_oil = ( + profile_residential + * energy_totals.loc[countries, "residential oil"].sum() + * 1e6 + ) + heat_oil_demand.values - n.madd( - "Load", - nodes, - suffix=" residential oil", - bus=spatial.oil.nodes, - carrier="residential oil", - p_set=p_set_oil, - ) - co2 = (p_set_oil.sum().sum() * costs.at["oil", "CO2 intensity"]) / 8760 + p_set_biomass = ( + profile_residential + * energy_totals.loc[countries, "residential biomass"].sum() + * 1e6 + ) + heat_biomass_demand.values - n.add( - "Load", - "residential oil emissions", - bus="co2 atmosphere", - carrier="oil emissions", - p_set=-co2, - ) - n.madd( - "Load", - nodes, - suffix=" residential biomass", - bus=spatial.biomass.nodes, - carrier="residential biomass", - p_set=p_set_biomass, - ) + p_set_gas = ( + profile_residential + * energy_totals.loc[countries, "residential gas"].sum() + * 1e6 + ) + heat_gas_demand.values - n.madd( - "Load", - nodes, - suffix=" residential gas", - bus=spatial.gas.nodes, - carrier="residential gas", - p_set=p_set_gas, - ) - co2 = (p_set_gas.sum().sum() * costs.at["gas", "CO2 intensity"]) / 8760 + n.madd( + "Load", + nodes, + suffix=" residential oil", + bus=spatial.oil.nodes, + carrier="residential oil", + p_set=p_set_oil, + ) + co2 = (p_set_oil.sum().sum() * costs.at["oil", "CO2 intensity"]) / 8760 - n.add( - "Load", - "residential gas emissions", - bus="co2 atmosphere", - carrier="gas emissions", - p_set=-co2, - ) + n.add( + "Load", + "residential oil emissions", + bus="co2 atmosphere", + carrier="oil emissions", + p_set=-co2, + ) + n.madd( + "Load", + nodes, + suffix=" residential biomass", + bus=spatial.biomass.nodes, + carrier="residential biomass", + p_set=p_set_biomass, + ) - co2 = ( - p_set_oil.sum().sum() * costs.at["solid biomass", "CO2 intensity"] - ) / 8760 + n.madd( + "Load", + nodes, + suffix=" residential gas", + bus=spatial.gas.nodes, + carrier="residential gas", + p_set=p_set_gas, + ) + co2 = (p_set_gas.sum().sum() * costs.at["gas", "CO2 intensity"]) / 8760 - n.add( - "Load", - "residential biomass emissions", - bus="co2 atmosphere", - carrier="biomass emissions", - p_set=-co2, + n.add( + "Load", + "residential gas emissions", + bus="co2 atmosphere", + carrier="gas emissions", + p_set=-co2, + ) + + co2 = (p_set_oil.sum().sum() * costs.at["solid biomass", "CO2 intensity"]) / 8760 + + n.add( + "Load", + "residential biomass emissions", + bus="co2 atmosphere", + carrier="biomass emissions", + p_set=-co2, + ) + + for country in countries: + rem_heat_demand = ( + energy_totals.loc[country, "total residential space"] + + energy_totals.loc[country, "total residential water"] + - energy_totals.loc[country, "residential heat biomass"] + - energy_totals.loc[country, "residential heat oil"] + - energy_totals.loc[country, "residential heat gas"] ) - for country in countries: - rem_heat_demand = ( - energy_totals.loc[country, "total residential space"] - + energy_totals.loc[country, "total residential water"] - - energy_totals.loc[country, "residential heat biomass"] - - energy_totals.loc[country, "residential heat oil"] - - energy_totals.loc[country, "residential heat gas"] + heat_buses = (n.loads_t.p_set.filter(regex="heat").filter(like=country)).columns + n.loads_t.p_set.loc[:, heat_buses] = ( + ( + n.loads_t.p_set.filter(like=country)[heat_buses] + / n.loads_t.p_set.filter(like=country)[heat_buses].sum().sum() ) + * rem_heat_demand + * 1e6 + ) - heat_buses = (n.loads_t.p_set.filter(regex="heat")).columns - n.loads_t.p_set.loc[:, heat_buses] = ( - ( - n.loads_t.p_set.filter(like=country)[heat_buses] - / n.loads_t.p_set.filter(like=country)[heat_buses].sum().sum() - ) - * rem_heat_demand - * 1e6 - ) + # if snakemake.config["custom_data"]["elec_demand"]: + for country in countries: + # indd=n.loads_t.p_set[n.loads_t.p_set.columns.str.contains(country)] - if snakemake.config["custom_data"]["elec_demand"]: - for country in countries: - # indd=n.loads_t.p_set[n.loads_t.p_set.columns.str.contains(country)] - - buses = n.buses[ - (n.buses.carrier == "AC") & (n.buses.country == country) - ].index - - n.loads_t.p_set.loc[:, buses] = ( - ( - n.loads_t.p_set.filter(like=country)[buses] - / n.loads_t.p_set.filter(like=country)[buses].sum().sum() - ) - * energy_totals.loc[country, "electricity residential"] - * 1e6 - ) + buses = n.buses[(n.buses.carrier == "AC") & (n.buses.country == country)].index + + n.loads_t.p_set.loc[:, buses] = ( + ( + n.loads_t.p_set.filter(like=country)[buses] + / n.loads_t.p_set.filter(like=country)[buses].sum().sum() + ) + * energy_totals.loc[country, "electricity residential"] + * 1e6 + ) # def add_co2limit(n, Nyears=1.0, limit=0.0): @@ -2314,13 +2316,13 @@ def add_rail_transport(n, costs): snakemake = mock_snakemake( "prepare_sector_network", simpl="", - clusters="11", + clusters="14", ll="c1.0", opts="Co2L", planning_horizons="2030", sopts="24H", discountrate="0.071", - demand="DF", + demand="XX", ) # Load population layout @@ -2457,13 +2459,13 @@ def add_rail_transport(n, costs): add_land_transport(n, costs) - if snakemake.config["custom_data"]["transport_demand"]: - add_rail_transport(n, costs) + # if snakemake.config["custom_data"]["transport_demand"]: + add_rail_transport(n, costs) - if snakemake.config["custom_data"]["custom_sectors"]: - add_agriculture(n, costs) - add_residential(n, costs) - add_services(n, costs) + # if snakemake.config["custom_data"]["custom_sectors"]: + add_agriculture(n, costs) + add_residential(n, costs) + add_services(n, costs) sopts = snakemake.wildcards.sopts.split("-") diff --git a/scripts/prepare_transport_data.py b/scripts/prepare_transport_data.py index a7a04a18..a1d61f93 100644 --- a/scripts/prepare_transport_data.py +++ b/scripts/prepare_transport_data.py @@ -206,7 +206,7 @@ def prepare_transport_data(n): "prepare_transport_data", simpl="", clusters="10", - demand="DF", + demand="AB", planning_horizons=2030, ) diff --git a/test/config.test1.yaml b/test/config.test1.yaml index c0ad2928..9d418201 100644 --- a/test/config.test1.yaml +++ b/test/config.test1.yaml @@ -23,7 +23,7 @@ scenario: sopts: - "144H" demand: - - "DF" + - "AB" policy_config: @@ -40,6 +40,10 @@ clustering_options: countries: ['NG', 'BJ'] +demand_data: + update_data: true # if true, the workflow downloads the energy balances data saved in data/demand/unsd/data again. Turn on for the first run. + base_year: 2019 + H2_network: false H2_network_limit: 2000 #GWkm H2_repurposed_network: false @@ -217,13 +221,16 @@ sector: transport_internal_combustion_efficiency: 0.3 biomass_transport: true # biomass transport between nodes - + efficiency_heat_oil_to_elec: 0.9 + efficiency_heat_biomass_to_elec: 0.9 + efficiency_heat_gas_to_elec: 0.9 land_transport_fuel_cell_share: # 1 means all FCEVs HERE BU_2030: 0.00 AP_2030: 0.004 NZ_2030: 0.02 DF_2030: 0.01 + AB_2030: 0.01 BU_2050: 0.00 AP_2050: 0.06 NZ_2050: 0.28 @@ -234,6 +241,7 @@ sector: AP_2030: 0.075 NZ_2030: 0.13 DF_2030: 0.01 + AB_2030: 0.01 BU_2050: 0.00 AP_2050: 0.42 NZ_2050: 0.68 @@ -251,6 +259,7 @@ sector: AP_2030: 0.00 NZ_2030: 0.10 DF_2030: 0.05 + AB_2030: 0.05 BU_2050: 0.00 AP_2050: 0.25 NZ_2050: 0.36 @@ -265,6 +274,7 @@ sector: SMR: true cc_fraction: 0.9 cc: true + space_heat_share: 0.6 # the share of space heating from all heating. Remainder goes to water heating. conventional_generation: # generator : carrier OCGT: gas