diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index e26dd39e..595bfa27 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -3473,12 +3473,13 @@ def add_enhanced_geothermal( n.links.at[bus + " geothermal organic rankine cycle", "efficiency"] = efficiency_orc if snakemake.params.sector["enhanced_geothermal_flexible"]: - # this StorageUnit represents flexible operation using the geothermal reservoir. # Hence, it is counter-intuitive to install it at the surface bus, # this is however the more lean and computationally efficient solution. - - max_hours = snakemake.params.sector["enhanced_geothermal_reservoir_max_hours"] + + max_hours = snakemake.params.sector[ + "enhanced_geothermal_reservoir_max_hours" + ] boost = snakemake.params.sector["enhanced_geothermal_reservoir_max_boost"] max_hours = max_hours * boost @@ -3488,7 +3489,7 @@ def add_enhanced_geothermal( bus=f"{bus} geothermal heat surface", carrier="geothermal heat", p_nom_extendable=True, - p_min_pu=-1. - boost, + p_min_pu=-1.0 - boost, max_hours=max_hours, ) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 3c29e295..deb456c5 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -779,15 +779,13 @@ def add_geothermal_chp_constraint(n): def add_flexible_egs_constraint(n): - well_index = n.links.loc[n.links.carrier == 'geothermal heat'].index - storage_index = n.storage_units.loc[n.storage_units.carrier == 'geothermal heat '].index + well_index = n.links.loc[n.links.carrier == "geothermal heat"].index + storage_index = n.storage_units.loc[ + n.storage_units.carrier == "geothermal heat " + ].index - p_nom_rhs = ( - n.model["Link-p_nom"].loc[well_index] - ) - p_nom_lhs = ( - n.model["StorageUnit-p_nom"].loc[storage_index] - ) + p_nom_rhs = n.model["Link-p_nom"].loc[well_index] + p_nom_lhs = n.model["StorageUnit-p_nom"].loc[storage_index] n.model.add_constraints( p_nom_lhs <= p_nom_rhs,