From 9abe1a10d8f9fb853fc7986265c9a5c96a7b0c17 Mon Sep 17 00:00:00 2001 From: LukasFrankenQ Date: Wed, 27 Mar 2024 00:04:51 +0100 Subject: [PATCH] removed geothermal chp constraint --- scripts/prepare_sector_network.py | 2 +- scripts/solve_network.py | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 71445735..aa9c9801 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -3607,7 +3607,7 @@ def add_enhanced_geothermal( egs_potentials["capital_cost"] = ( (egs_annuity + FOM / (1.0 + FOM)) - * (egs_potentials["CAPEX"] * 1000.0 - orc_capex) + * (egs_potentials["CAPEX"] * 1e3 - orc_capex) * Nyears ) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 9477ce6d..1f0096ba 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -797,23 +797,11 @@ def add_pipe_retrofit_constraint(n): n.model.add_constraints(lhs == rhs, name="Link-pipe_retrofit") -def add_geothermal_chp_constraint(n): - elec_index = n.links.loc[ - n.links.carrier == "geothermal organic rankine cycle" - ].index - heat_index = n.links.loc[n.links.carrier == "geothermal district heat"].index - - p_nom_lhs = ( - n.model["Link-p_nom"].loc[heat_index] - n.model["Link-p_nom"].loc[elec_index] - ) - - n.model.add_constraints( - p_nom_lhs == 0, - name="equalizes_p_nom_of_chp_elec_and_chp_district_heat", - ) - - def add_flexible_egs_constraint(n): + """ + Upper bounds the charging capacity of the geothermal reservoir according to + the well capacity. + """ well_index = n.links.loc[n.links.carrier == "geothermal heat"].index storage_index = n.storage_units.loc[ n.storage_units.carrier == "geothermal heat" @@ -824,7 +812,7 @@ def add_flexible_egs_constraint(n): n.model.add_constraints( p_nom_lhs <= p_nom_rhs, - name="Upper bounds the charging capacity of the geothermal reservoir according to the well capacity", + name="upper_bound_charging_capacity_of_geothermal_reservoir", ) @@ -883,13 +871,12 @@ def extra_functionality(n, snapshots): add_carbon_constraint(n, snapshots) add_carbon_budget_constraint(n, snapshots) add_retrofit_gas_boiler_constraint(n, snapshots) - if "geothermal district heat" in n.links.carrier: - add_geothermal_chp_constraint(n) - if config["sector"]["enhanced_geothermal_flexible"]: - add_flexible_egs_constraint(n) else: add_co2_atmosphere_constraint(n, snapshots) + if config["sector"]["enhanced_geothermal_flexible"]: + add_flexible_egs_constraint(n) + if snakemake.params.custom_extra_functionality: source_path = snakemake.params.custom_extra_functionality assert os.path.exists(source_path), f"{source_path} does not exist"