cleanup of saturation check

This commit is contained in:
LukasFrankenQ 2023-09-25 15:15:51 +01:00
parent a7376f542c
commit e98430e3ce
2 changed files with 7 additions and 4 deletions

View File

@ -3301,6 +3301,7 @@ def add_enhanced_geothermal(
)
config = snakemake.config
print(costs.loc[costs.index.str.contains("geothermal")])
overlap = pd.read_csv(egs_overlap, index_col=0)
egs_potentials = pd.read_csv(egs_potentials, index_col=0)
@ -3360,7 +3361,7 @@ def add_enhanced_geothermal(
bus_egs["p_nom_max"] = bus_egs["p_nom_max"].multiply(bus_overlap)
bus_egs = bus_egs.loc[bus_egs.p_nom_max > 0.0]
if config["sector"]["enhanced_geothermal_best_only"]:
if config["sector"]["enhanced_geothermal_performant"]:
bus_egs = bus_egs.sort_values(by="capital_cost").iloc[:1]
appendix = pd.Index([""])
else:
@ -3377,6 +3378,7 @@ def add_enhanced_geothermal(
n.madd(
"Link",
f"{bus} enhanced geothermal" + appendix,
location=bus,
bus0="EU geothermal heat",
bus1=bus,
bus2="co2 atmosphere",

View File

@ -655,9 +655,10 @@ def solve_network(n, config, solving, opts="", **kwargs):
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:
if saturated.any():
logger.warning((
f"Potential for enhanced geothermal heat is saturated at bus(es): {satbus}\n"
"Potential for enhanced geothermal heat is saturated at bus(es):\n"
f"{', '.join(n.links.loc[saturated.loc[saturated.astype(bool)].index, 'location'].tolist())}.\n"
"Consider setting config['sector']['enhanced_geothermal_performant'] to False."
))