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).
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.
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
- 01Build supermesh geometry
- 02Generate triangular FE mesh
- 03Configure 3D layers (6 slices / 5 layers)
- 04Problem class + fluid properties (TH transient)
- 05Material properties (K, φ, Cv, λ)
- 06Initial conditions
- 07Boundary conditions
- 08Multilayer wells + injection BC
- 09Simulation settings (FE/BE adaptive)
- 10Run via singleStep() loop
- 11Post-processing (7 figures + CSV)
Example Results
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.
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
11 sequential stages from raw Excel workbook to final figures via a single command.
Transient thermo-hydraulic coupling with temperature-dependent fluid viscosity and density.
singleStep() loop bypasses the FEFLOW 8.1 IFM DAC enumeration bug.
Temperature maps, breakthrough curves, thermal power, head maps, and adaptive timestep diagnostics.
37 pytest tests covering config, mesh, thermal power, and post-processing; no FEFLOW install required.
Changing four constants in config.py adapts the full pipeline to any course group.
Tech Stack
| Layer | Technologies |
|---|---|
| Simulation | FEFLOW 8.1 (IFM Python API, ifm312.pyd) |
| Core | Python 3.9+, NumPy, Pandas, openpyxl |
| Visualisation | Matplotlib (tricontourf on Delaunay triangulation) |
| Testing | pytest (37 tests, licence-free) |
| Data exchange | NumPy .npz snapshot archive |
| License | MIT |
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.