Geothermal Example

Geothermal Example#

This example demonstrates how to apply the geothermal workflow:

  1. Required packages are imported

  2. Default variables are imported

  3. Placement locations are defined

  4. Geometries are defined

  5. Calculation of temperature and heat flow

  6. Verifying that the calculated values correspond to the expected results

import reskit as rk

import pandas as pd
import geokit as gk
from numpy import allclose
# 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-05-06 09:39:31.746695
Starting calc = 2026-05-06 09:39:31.835556
Starting cost calc = 2026-05-06 09:39:31.974844
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-05-06 09:39:31.981537 

Verifying that the calculated values correspond to the expected results

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!"