Skip to content

Commit

Permalink
final corrections, improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasFrankenQ committed May 31, 2024
1 parent 2801b00 commit 2f1d6d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions rules/build_sector.smk
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ rule build_solar_thermal_profiles:
output:
solar_thermal=resources("solar_thermal_{scope}_elec_s{simpl}_{clusters}.nc"),
resources:
mem_mb=8000,
threads: 1
mem_mb=20000,
threads: 16
log:
logs("build_solar_thermal_profiles_{scope}_s{simpl}_{clusters}.log"),
benchmark:
Expand Down
14 changes: 10 additions & 4 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ def insert_electricity_distribution_grid(n, costs):
.get("efficiency_static")
):
logger.info(
f"Deducting distribution losses from electricity demand: {100*(1-efficiency)}%"
f"Deducting distribution losses from electricity demand: {np.around(100*(1-efficiency), decimals=2)}%"
)
n.loads_t.p_set.loc[:, n.loads.carrier == "electricity"] *= efficiency

Expand Down Expand Up @@ -3742,6 +3742,12 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
logger.warning(
"'add_enhanced_geothermal' not implemented for multiple geothermal nodes."
)
logger.info(
"EGS implemented with 2020 CAPEX from Aghahosseini et al 2021: 'From hot rock to...'."
)
logger.info(
"Recommended usage scales CAPEX to future cost expectations using config 'adjustments'."
)

egs_config = snakemake.params["sector"]["enhanced_geothermal"]
costs_config = snakemake.config["costs"]
Expand Down Expand Up @@ -3780,7 +3786,7 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
orc_capital_cost = (orc_annuity + FOM / (1 + FOM)) * orc_capex * Nyears

efficiency_orc = costs.at["organic rankine cycle", "efficiency"]
efficiency_dh = costs.at["geothermal", "efficiency residential heat"]
efficiency_dh = costs.at["geothermal", "district heat-input"]

# p_nom_max conversion GW -> MW
egs_potentials["p_nom_max"] = egs_potentials["p_nom_max"] * 1000.0
Expand All @@ -3791,7 +3797,6 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
n.madd(
"Bus",
spatial.geothermal_heat.nodes,
location=spatial.geothermal_heat.locations,
carrier="geothermal heat",
unit="MWh_th",
)
Expand Down Expand Up @@ -3894,7 +3899,8 @@ def add_enhanced_geothermal(n, egs_potentials, egs_overlap, costs):
carrier="geothermal district heat",
capital_cost=orc_capital_cost
* efficiency_orc
* costs.at["geothermal", "district heating cost"],
* costs.at["geothermal", "district heat surcharge"]
/ 100.0,
efficiency=efficiency_dh,
p_nom_extendable=True,
)
Expand Down
4 changes: 3 additions & 1 deletion scripts/solve_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ def extra_functionality(n, snapshots):
else:
add_co2_atmosphere_constraint(n, snapshots)

if config["sector"]["enhanced_geothermal_flexible"]:
if config["sector"]["enhanced_geothermal"]["enable"]:
add_flexible_egs_constraint(n)

if snakemake.params.custom_extra_functionality:
Expand Down Expand Up @@ -1102,6 +1102,8 @@ def solve_network(n, config, solving, **kwargs):
n.model.print_infeasibilities()
raise RuntimeError("Solving status 'infeasible'")

return n


if __name__ == "__main__":
if "snakemake" not in globals():
Expand Down

0 comments on commit 2f1d6d2

Please sign in to comment.