Skip to main content
Back to Projects
Open Source · Python · FEFLOW · ORC · LCOE · 2026

FEFLOW Geothermal Doublet: Reservoir-to-Economics Workflow

A reproducible Python pipeline coupling a 100-year FEFLOW 8.1 geothermal doublet simulation to an ORC power-cycle estimate and a CAPEX/LCOE techno-economic assessment — from a single Excel workbook to a validated LCOE figure, developed for the Erasmus+ BIP Geothermal Energy Summer School at Politecnico di Torino (2026).

Python 3.9+FEFLOW 8.1IFM APIORCTechno-EconomicsNumPyPandasMatplotlibMIT License

Overview

The pipeline takes a single Excel workbook and carries the study end-to-end: FEFLOW 8.1 reservoir simulation → thermal post-processing → ORC power-cycle estimate → CAPEX / LCOE techno-economic assessment → a 5-parameter sensitivity analysis. Every stage is auditable and reproducible, and no value is independently re-estimated — the ORC inlet temperature is read directly from the FEFLOW output, not assumed. Developed for the Erasmus+ Blended Intensive Programme "Geothermal Energy: Resource Assessment, Plants, and Environmental Impacts" (2nd edition, 2026) at Politecnico di Torino, simulating 100 years of doublet operation in a sedimentary reservoir at 870–1120 m depth.

Technical Contribution

The core contribution: a verified API workaround

FEFLOW 8.1's IFM Python API has a verified regression: getTimeSteps() / loadTimeStep() return only a single entry from a multi-snapshot DAC result file, even though the binary archive contains all snapshots. This pipeline solves it with a manual singleStep() control loop that captures field state at every accepted adaptive time step and writes all snapshots to a portable NumPy .npz archive — restoring reliable access to the full 100-year simulation history. Post-processing then reads the archive and restores each snapshot to the FEFLOW document, re-enabling the IFM results getters.

Pipeline · 11 stages

  1. 01
    Build supermesh geometry
  2. 02
    Generate triangular FE mesh
  3. 03
    Configure 3D layers (6 slices / 5 layers)
  4. 04
    Problem class + fluid properties (TH transient)
  5. 05
    Material properties (K, φ, Cv, λ)
  6. 06
    Initial conditions
  7. 07
    Boundary conditions
  8. 08
    Multilayer wells + injection BC
  9. 09
    Simulation settings (FE/BE adaptive)
  10. 10
    Run via singleStep() loop
  11. 11
    Post-processing (7 figures + CSV)

Example Results

8000 × 8000 m
Domain · ~28,236 mesh nodes
5 + 5
Production (+150 L/s) / Injection (−150 L/s) wells
134.1 °C → 50 °C
Initial reservoir T / Injection T
~52.8 → ~46.8 MW_th
Total thermal power (t=0 → t=100 yr)
~11%
Thermal degradation over 100 years
~6.9 min
Wall-clock · ~428 accepted adaptive steps

Economic Assessment

The FEFLOW production temperature feeds an ORC power-cycle model, which in turn feeds a CAPEX / LCOE techno-economic assessment — one continuous chain, no re-estimated intermediate values.

124.53 °C
Avg. production temperature (t = 100 yr)
~4.22 MW
Net electrical power (ORC)
~33.8 GWh/yr
Annual electricity production
≈ €51.9M
CAPEX (≈ €12,294 / kW net)
186.5 €/MWh
Levelised Cost of Electricity (LCOE)
5 parameters
Sensitivity: T_prod, T_reinj, flow rate, well depth, drilling cost

The LCOE calculation was independently validated against a worked reference example, and the ORC estimate was cross-checked via two independent calculation paths. The 5-parameter sensitivity analysis identifies drilling cost per metre and production temperature as the dominant drivers of LCOE.

Key Features

Zero-click pipeline

11 sequential stages from raw Excel workbook to final figures via a single command.

Coupled TH simulation

Transient thermo-hydraulic coupling with temperature-dependent fluid viscosity and density.

API regression workaround

singleStep() loop bypasses the FEFLOW 8.1 IFM DAC enumeration bug.

Seven diagnostic figures

Temperature maps, breakthrough curves, thermal power, head maps, and adaptive timestep diagnostics.

Licence-free test suite

37 pytest tests covering config, mesh, thermal power, and post-processing; no FEFLOW install required.

Parameterised design

Changing four constants in config.py adapts the full pipeline to any course group.

Tech Stack

LayerTechnologies
SimulationFEFLOW 8.1 (IFM Python API, ifm312.pyd)
CorePython 3.9+, NumPy, Pandas, openpyxl
VisualisationMatplotlib (tricontourf on Delaunay triangulation)
Testingpytest (37 tests, licence-free)
Data exchangeNumPy .npz snapshot archive
LicenseMIT
Attribution

Team project. This work was carried out as the Group 3 feasibility study for the Erasmus+ BIP at Politecnico di Torino. The automation pipeline and documentation were developed by Iman Saghafifar; the geological dataset, conceptual model, and feasibility analysis were a collaborative effort of the full Group 3 team. Based on the FEFLOW Geothermal Energy Tutorial by Alessandro Casasso (Politecnico di Torino).

View source code and documentation on GitHub

FEFLOW is a commercial product of DHI A/S. The repository contains no FEFLOW source or proprietary binaries; a valid FEFLOW licence is required to run the simulation stages.