Geothermal Example¶
This example demonstrates how to apply the geothermal workflow:
- Required packages are imported
- Default variables are imported
- Placement locations are defined
- Geometries are defined
- Calculation of temperature and heat flow
- Verifying that the calculated values correspond to the expected results
In [1]:
Copied!
import reskit as rk
import pandas as pd
import geokit as gk
from numpy import allclose
import reskit as rk
import pandas as pd
import geokit as gk
from numpy import allclose
In [2]:
Copied!
# just for knowledge, they are default variables
sourceTemperature = rk.geothermal.data.path_temperatures
sourceSustainableHeatflow = rk.geothermal.data.path_heat_flow_sustainable_W_per_m2
placements = pd.DataFrame()
placements["lat"] = [51.00, 37.0, 64.922, 0.0]
placements["lon"] = [9.00, -114.0, -18.854, 114.0]
geoms = []
for i in range(len(placements)):
x = placements["lon"][i]
y = placements["lat"][i]
geom = gk.geom.point(x, y, srs=gk.srs.loadSRS(4326))
geoms.append(geom)
placements["geom"] = geoms
out_xed8 = rk.geothermal.EGSworkflow(
placements=placements,
sourceTemperature=sourceTemperature,
sourceSustainableHeatflow=sourceSustainableHeatflow,
manual_values={"x_ED_1": 8},
savepath=None,
)
print(out_xed8)
# just for knowledge, they are default variables
sourceTemperature = rk.geothermal.data.path_temperatures
sourceSustainableHeatflow = rk.geothermal.data.path_heat_flow_sustainable_W_per_m2
placements = pd.DataFrame()
placements["lat"] = [51.00, 37.0, 64.922, 0.0]
placements["lon"] = [9.00, -114.0, -18.854, 114.0]
geoms = []
for i in range(len(placements)):
x = placements["lon"][i]
y = placements["lat"][i]
geom = gk.geom.point(x, y, srs=gk.srs.loadSRS(4326))
geoms.append(geom)
placements["geom"] = geoms
out_xed8 = rk.geothermal.EGSworkflow(
placements=placements,
sourceTemperature=sourceTemperature,
sourceSustainableHeatflow=sourceSustainableHeatflow,
manual_values={"x_ED_1": 8},
savepath=None,
)
print(out_xed8)
This workflow can be cited as:
Franzmann, David and Heinrichs, Heidi
and Stolten, Detlef, Global Electricity Potentials from Geothermal Power
Under Technical, Economic, Sustainable Evaluation.
Available at SSRN: https://ssrn.com/abstract=5029989
or http://dx.doi.org/10.2139/ssrn.5029989
Starting loading data = 2026-07-27 16:56:08.051369
Starting calc = 2026-07-27 16:56:08.233764
Starting cost calc = 2026-07-27 16:56:08.258328
No valid file type specified. Returning nc4 obj
Time eval.:
Data loading finished in 0s.
Calculation finished in 0s.
Cost calculation finished in 0s.
RESkit EGS done within 0s for 4 points..
<xarray.Dataset> Size: 2kB
Dimensions: (placements: 4)
Coordinates:
* placements (placements) int64 32B 0 1 2 3
Data variables: (12/60)
lat (placements) float64 32B 51.0 37.0 ... 0.0
lon (placements) float64 32B 9.0 ... 114.0
geom (placements) object 32B POINT Z (9 51 0)...
surface_temperature (placements) float64 32B 8.591 ... 23.85
qdot_sust_W_per_m2 (placements) float64 32B 0.05609 ... 0.0...
Total_thermal_energy_PJ (placements) float64 32B 368.7 ... 371.9
... ...
P_out_net_SU_MW (placements) float64 32B 0.006263 ... 0....
TOTEX_MUSD_SU_per_a (placements) float64 32B 3.229 ... 2.113
LCOE_gross_SU_EUR_per_kWh (placements) float64 32B 51.79 ... 20.23
LCOE_SU_EUR_per_kWh (placements) float64 32B 51.79 ... 20.23
regeneration_time_SU_a (placements) float64 32B 30.0 30.0 ... 30.0
opt_depth_SU_m (placements) float64 32B 7e+03 ... 5e+03
Attributes:
description: RESkit simulation results for EGS.
timestamp: Generated at: 2026-07-27 16:56:08.275884
UserWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/conda/align-docs-branding/lib/python3.12/site-packages/geokit/raster.py:1386 WARNING: 5 of the given points (or extraction windows) exceed/s the source's limits. Values were replaced with nan.UserWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/conda/align-docs-branding/lib/python3.12/site-packages/geokit/raster.py:1386 WARNING: 5 of the given points (or extraction windows) exceed/s the source's limits. Values were replaced with nan.UserWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/conda/align-docs-branding/lib/python3.12/site-packages/geokit/raster.py:1386 WARNING: 5 of the given points (or extraction windows) exceed/s the source's limits. Values were replaced with nan.RuntimeWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/geothermal/workflows/egs_workflow_manager.py:628 divide by zero encountered in divideRuntimeWarning: /home/docs/checkouts/readthedocs.org/user_builds/ethos-reskit/checkouts/align-docs-branding/reskit/geothermal/workflows/egs_workflow_manager.py:634 divide by zero encountered in divide
Verifying that the calculated values correspond to the expected results
In [3]:
Copied!
assert len(out_xed8.placements) == len(placements)
expected = [0.83377206, 0.52975674, 0.26825743, 0.50673514]
assert allclose(out_xed8.LCOE_VM_EUR_per_kWh, expected), "Values do not match!"
expected = [0.32707465, 0.12043728, 0.03419219, 0.10778247]
assert allclose(out_xed8.LCOE_GR_EUR_per_kWh, expected), "Values do not match!"
expected = [51.79376029, 28.61874858, 7.62909725, 20.23294058]
assert allclose(out_xed8.LCOE_SU_EUR_per_kWh, expected), "Values do not match!"
assert len(out_xed8.placements) == len(placements)
expected = [0.83377206, 0.52975674, 0.26825743, 0.50673514]
assert allclose(out_xed8.LCOE_VM_EUR_per_kWh, expected), "Values do not match!"
expected = [0.32707465, 0.12043728, 0.03419219, 0.10778247]
assert allclose(out_xed8.LCOE_GR_EUR_per_kWh, expected), "Values do not match!"
expected = [51.79376029, 28.61874858, 7.62909725, 20.23294058]
assert allclose(out_xed8.LCOE_SU_EUR_per_kWh, expected), "Values do not match!"