diff --git a/Changelog.md b/Changelog.md index f7a017cf..5b49a65a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,5 @@ # Changelog +- Adjusting aviation demand (from Aladin) and emission accounting (only domestic aviation for national target) - Increase HVC_environment_sequestration_fraction from 0.1 to 0.6 - Disallow HVC to air in DE - Restricting the maximum capacity of CurrentPolicies and minus scenarios to the 'uba Projektionsbericht' diff --git a/config/config.yaml b/config/config.yaml index 6cc5bddd..6be1748f 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -4,8 +4,7 @@ # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#run run: - prefix: 20241202-more-waste-CHP - + prefix: 20241203-fix-aviation name: # - CurrentPolicies - KN2045_Bal_v4 diff --git a/workflow/Snakefile b/workflow/Snakefile index 1f171f96..9a162845 100644 --- a/workflow/Snakefile +++ b/workflow/Snakefile @@ -302,6 +302,7 @@ use rule solve_sector_network_myopic from pypsaeur with: custom_extra_functionality=os.path.join( os.path.dirname(workflow.snakefile), "scripts/additional_functionality.py" ), + energy_year=config_provider("energy", "energy_totals_year"), input: **{ k: v @@ -311,6 +312,7 @@ use rule solve_sector_network_myopic from pypsaeur with: network=RESULTS + "prenetworks-final/base_s_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc", co2_totals_name=resources("co2_totals.csv"), + energy_totals=resources("energy_totals.csv"), rule modify_existing_heating: diff --git a/workflow/scripts/additional_functionality.py b/workflow/scripts/additional_functionality.py index b47a4f90..2d167bcc 100644 --- a/workflow/scripts/additional_functionality.py +++ b/workflow/scripts/additional_functionality.py @@ -373,6 +373,9 @@ def add_co2limit_country(n, limit_countries, snakemake, debug=False): links = n.links.index[ (n.links.index.str[:2] == ct) & (n.links[f"bus{port}"] == "co2 atmosphere") + & ( + n.links.carrier != "kerosene for aviation" + ) # first exclude aviation to multiply it with a domestic factor later ] logger.info( @@ -394,6 +397,30 @@ def add_co2limit_country(n, limit_countries, snakemake, debug=False): ).sum() ) + # Aviation demand + energy_totals = pd.read_csv(snakemake.input.energy_totals, index_col=[0, 1]) + domestic_aviation = energy_totals.loc[ + ("DE", snakemake.params.energy_year), "total domestic aviation" + ] + international_aviation = energy_totals.loc[ + ("DE", snakemake.params.energy_year), "total international aviation" + ] + domestic_factor = domestic_aviation / ( + domestic_aviation + international_aviation + ) + aviation_links = n.links[ + (n.links.index.str[:2] == ct) & (n.links.carrier == "kerosene for aviation") + ] + lhs.append + ( + n.model["Link-p"].loc[:, aviation_links.index] + * aviation_links.efficiency2 + * n.snapshot_weightings.generators + ).sum() * domestic_factor + logger.info( + f"Adding domestic aviation emissions for {ct} with a factor of {domestic_factor}" + ) + # Adding Efuel imports and exports to constraint incoming_oil = n.links.index[n.links.index == "EU renewable oil -> DE oil"] outgoing_oil = n.links.index[n.links.index == "DE renewable oil -> EU oil"] diff --git a/workflow/scripts/build_scenarios.py b/workflow/scripts/build_scenarios.py index 4fba8ec7..3f0a18ec 100644 --- a/workflow/scripts/build_scenarios.py +++ b/workflow/scripts/build_scenarios.py @@ -18,13 +18,11 @@ def get_transport_growth(df, planning_horizons): - # Aviation growth factor - using REMIND-EU v1.1 since Aladin v1 does not include bunkers - aviation_model = snakemake.params.leitmodelle["general"] try: - aviation = df.loc[aviation_model, "Final Energy|Bunkers|Aviation", "PJ/yr"] + aviation = df.loc["Final Energy|Bunkers|Aviation", "PJ/yr"] except KeyError: aviation = ( - df.loc[aviation_model, "Final Energy|Bunkers|Aviation", "TWh/yr"] * 3.6 + df.loc["Final Energy|Bunkers|Aviation", "TWh/yr"] * 3.6 ) # TWh to PJ aviation_growth_factor = aviation / aviation[2020] @@ -139,11 +137,7 @@ def get_co2_budget(df, source): ## PyPSA disregards nonco2 GHG emissions, but includes bunkers - targets_pypsa = ( - targets_co2 - - nonco2 - + df.loc["Emissions|CO2|Energy|Demand|Bunkers", "Mt CO2/yr"] - ) + targets_pypsa = targets_co2 - nonco2 target_fractions_pypsa = targets_pypsa.loc[targets_co2.index] / baseline_pypsa @@ -160,10 +154,6 @@ def write_to_scenario_yaml(input, output, scenarios, df): fallback_reference_scenario = config[scenario]["iiasa_database"][ "fallback_reference_scenario" ] - if fallback_reference_scenario != reference_scenario: - logger.warning( - f"For aviation demand, using {fallback_reference_scenario} as fallback reference scenario for {scenario}." - ) planning_horizons = [ 2020, @@ -175,7 +165,7 @@ def write_to_scenario_yaml(input, output, scenarios, df): ] # for 2050 we still need data aviation_demand_factor = get_transport_growth( - df.loc[:, fallback_reference_scenario, :], planning_horizons + df.loc[snakemake.params.leitmodelle["transport"], reference_scenario, :], planning_horizons ) if reference_scenario.startswith(