From a7376f542c38596eb47497d4606c4b57eab27e3d Mon Sep 17 00:00:00 2001 From: LukasFrankenQ Date: Sun, 24 Sep 2023 21:31:49 +0100 Subject: [PATCH] changed config name to egs_performant, added saturation check --- config/config.default.yaml | 2 +- scripts/solve_network.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 000f34a4..31775472 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -493,7 +493,7 @@ sector: biosng: false enhanced_geothermal: true enhanced_geothermal_optimism: false # if true, egs costs are reducing towards 2050 according to Aghahosseini et al., (2020) - enhanced_geothermal_best_only: true # if true, adds only the cheapest patch of EGS potential to each region + enhanced_geothermal_performant: true # if true, adds only the cheapest patch of EGS potential to each region # docs in https://pypsa-eur.readthedocs.io/en/latest/configuration.html#industry industry: diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 836544b4..0adb048c 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -643,6 +643,24 @@ def solve_network(n, config, solving, opts="", **kwargs): if "infeasible" in condition: raise RuntimeError("Solving status 'infeasible'") + # check if enhanced_geothermal_performant might have changed model results + if ( + snakemake.config["sector"]["enhanced_geothermal"] and + snakemake.config["sector"]["enhanced_geothermal_performant"] + ): + mask = ( + (mask := n.links.carrier == "geothermal heat") & + (n.links.loc[mask, "p_nom_max"] > 0.) + ) + + saturated = n.links.loc[mask, "p_nom_max"] == n.links.loc[mask, "p_nom_opt"] + + if len(satbus := n.links.loc[saturated, "location"].unique()) > 0: + logger.warning(( + f"Potential for enhanced geothermal heat is saturated at bus(es): {satbus}\n" + "Consider setting config['sector']['enhanced_geothermal_performant'] to False." + )) + return n