Skip to content

Latest commit

 

History

History
514 lines (383 loc) · 22.9 KB

README.rst

File metadata and controls

514 lines (383 loc) · 22.9 KB

Overview

GEOPHIRES Logo

GEOPHIRES is a free and open-source geothermal techno-economic simulator. GEOPHIRES combines reservoir, wellbore, surface plant, and economic models to estimate the capital and operation and maintenance costs, instantaneous and lifetime energy production, and overall levelized cost of energy of a geothermal plant. Various reservoir conditions (EGS, doublets, etc.) and end-use options (electricity, direct-use heat, cogeneration) can be modeled. Users are encouraged to build upon to the GEOPHIRES framework to implement their own correlations and models. See the Documentation section below for more information.

GEOPHIRES-X is the successor version to GEOPHIRES v2.0 (see CHANGELOG for more info).

Free software: MIT license

tests
package

Getting Started

Web Interface

A web interface is available at gtp.scientificwebservices.com/geophires.

The short URL bit.ly/geophires redirects to the same location.

Installation

Pip Package

If you do not need to view or edit GEOPHIRES-X source code, you can consume GEOPHIRES-X as a regular, non-editable python package:

pip3 install https://github.com/NREL/GEOPHIRES-X/archive/main.zip

Editable Installation (Recommended)

An editable installation is recommended for most users. It will allow you to run GEOPHIRES-X locally, view its Python files in an IDE or text editor, and create your own extensions as described in How to extend GEOPHIRES-X.

Prerequisites:

  1. Python 3.8+: You must have Python 3.8 or later installed on your machine. Python can be downloaded at python.org/downloads. (On Ubuntu: alias python=python3 if not aliased already.)
  2. Git
  3. Virtual environment (aka virtualenv): Install virtual environment on your machine if you don't have it already
  4. On Windows, you will need Admin privileges (required to successfully activate the virtual environment)

Steps:

  1. Open a command line (i.e. Terminal on Mac, PowerShell on Windows)

  2. Create a directory for GEOPHIRES:

    mkdir my-geophires-project
    cd my-geophires-project
    
  3. Create a virtual environment:

    python -m venv venv
    
  4. Source the virtual environment:

    • Windows:

      venv\Scripts\activate
      
    • macOS/Linux:

      source venv/bin/activate
      
  5. Install the geophires-x package:

    pip3 install -e git+https://github.com/NREL/GEOPHIRES-X.git#egg=geophires-x --src .
    
  6. Run on an example file:

    cd geophires-x
    cd tests
    cd examples
    python -mgeophires_x example1.txt
    
  7. View and edit source code by opening the my-geophires-project/ directory in an IDE or editor such as PyCharm, Spyder, or Visual Studio Code. The GEOPHIRES-X source code will be located in the my-geophires-project/geophires-x directory. You can add your own python files in my-geophires-x/ that use the source as a module as shown below.

To update the editable installation with the latest GEOPHIRES version:

cd geophires-x
git pull
# resolve merge conflicts, if any
pip install -e .

Usage

Python

Example usage in Python:

from geophires_x_client import GeophiresXClient
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters

client = GeophiresXClient()
result = client.get_geophires_result(
            GeophiresInputParameters({
                "Gradient 1": "69",
                "Reservoir Depth": "5",
                "End-Use Option": "1",
                "Power Plant Type": "4"
            })
        )

with open(result.output_file_path, 'r') as f:
    print(f.read())

If you followed the editable installation example above, put this code in my-geophires-project/main.py, then run:

python main.py

You will then see output including a case report:

(venv) ➜  my-geophires-project python main.py
No valid plant outlet pressure provided. GEOPHIRES will assume default plant outlet pressure (100 kPa)
No valid plant outlet pressure provided. GEOPHIRES will assume default plant outlet pressure (100 kPa)

                               *****************
                               ***CASE REPORT***
                               *****************

Simulation Metadata
----------------------
 GEOPHIRES Version: 3.4.42
 Simulation Date: 2024-07-08
 Simulation Time:  10:07
 Calculation Time:      0.047 sec

                           ***SUMMARY OF RESULTS***

      End-Use Option: Electricity
      Average Net Electricity Production:                    23.94 MW
      Electricity breakeven price:                            5.04 cents/kWh

[...]

You may also pass parameters as a text file:

from pathlib import Path
from geophires_x_client import GeophiresXClient
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters

# https://github.com/NREL/GEOPHIRES-X/blob/main/tests/examples/example1.txt
example_file_path = Path('geophires-x/tests/examples/example1.txt').absolute()

client = GeophiresXClient()
result = client.get_geophires_result(
            GeophiresInputParameters(from_file_path=example_file_path)
        )

with open(result.output_file_path, 'r') as f:
    print(f.read())

test_geophires_x.py has additional examples of how to consume and call GeophiresXClient.

Command Line

If you installed with pip (editable or non-), you may run GEOPHIRES from the command line, passing your input file as an argument:

python -mgeophires_x my_geophires_input.txt

You may also optionally pass the output file as well:

python -mgeophires_x my_geophires_input.txt my_geophires_result.out

(If you do not pass an output file argument a default name will be used.)

Documentation

GEOPHIRES combines reservoir, wellbore, surface plant, and economic and cost models and correlations to estimate the capital and operation and maintenance costs, instantaneous and lifetime energy production, and overall levelized cost of energy of a geothermal plant.

The high-level software architecture is illustrated in the diagram below. Green, orange and blue rectangles refer to internal GEOPHIRES components, external user-interface components, and external reservoir simulators (TOUGH2), respectively. Rectangles with solid outline are always executed during a simulation run; rectangles with dashed outline refer to optional or user-provided components.

GEOPHIRES Architecture Diagram

GEOPHIRES has a variety of different reservoir models including (1) Multiple parallel fractures model; (2) 1-Dimensional linear heat sweep model; (3) M/A thermal drawdown parameter model; (4) Percentage temperature drawdown model; (5) User-provided reservoir temperature production data; (6) Coupling to TOUGH2 external reservoir simulator; (7) SUTRA: Reservoir Thermal Energy Storage (RTES; also known as Underground Thermal Energy Storage - UTES); (8) Slender Body Theory (SBT); (9) Cylindrical.

GEOPHIRES can simulate three different end-uses of the geothermal heat: (1) direct-use heat (e.g. for industrial processing heating or residential space heating); (2) electricity (with subcritical ORC, supercritical ORC, single-flash, or double-flash plant); (3) co-generation of heat and electricity. The co-generation option considers bottoming cycle, topping cycle, and parallel cycle.

GEOPHIRES has 4 economic models to calculate the levelized cost of heat or electricity: (1) fixed charge rate (FCR) model; (2) standard discounting levelized cost model; (3) BICYCLE model; (4) CLGS.

The capital and O&M costs for the different geothermal system components (exploration, well drilling, surface plant, etc.) are either provided by the user or calculated with built-in correlations.

Parameters

Available parameters are documented in the Parameters Reference.

Note that many parameters are interrelated and/or conditionally dependent on one another; reviewing the GEOPHIRES example(s) relevant to your use case in the following section is strongly recommended to gain a working understanding of how to construct valid sets of input parameters.

Examples

GEOPHIRES includes a variety of example input files demonstrating its features for different types of geothermal systems and case studies of real-world geothermal projects. Starting with an existing GEOPHIRES example that is similar to your intended use/application can be an easier approach to using GEOPHIRES than constructing your own inputs from scratch.

Example input .txt files and corresponding case report .out files are available in the tests/examples directory of the repository. Example-specific web interface deeplinks are listed in the Link column.

Example Input file Case report file Link
Example 1: EGS Electricity example1.txt .out link
Example 1 with Addons example1_addons.txt .out link
Example 2: EGS Direct-Use Heat example2.txt .out link
Example 3: EGS Co-generation example3.txt .out link
Example 4: Hydrothermal Electricity example4.txt .out link
Example 5: User-Provided Reservoir Data example5.txt .out link
Example 6: TOUGH2 (Multiple Gradients) example6.txt .out *
Example 7: TOUGH2 (Single Gradient) example7.txt .out *
Example 8: Cornell Direct-Use Heat example8.txt .out link
Example 9: Cornell Electricity example9.txt .out link
Example 10: Heat Pump example10_HP.txt .out link
Example 11: Absorption Chiller example11_AC.txt .out link
Example 12: District Heating example12_DH.txt .out link
Example 13: Redrilling due to Drawdown example13.txt .out link
CLGS: Coaxial sCO2: Heat Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.txt .out link
CLGS: Coaxial Water: Heat Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.txt .out link
CLGS: Uloop sCO2: Electricity Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.txt .out link
CLGS: Uloop sCO2: Heat Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.txt .out link
CLGS: Uloop Water: Electricity Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.txt .out link
CLGS: Uloop Water: Heat Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.txt .out link
CLGS: SBT High Temperature example_SBT_Hi_T.txt .out link
CLGS: SBT Low Temperature example_SBT_Lo_T.txt .out link
SUTRA Example 1 SUTRAExample1.txt .out link
Multiple Gradients example_multiple_gradients.txt .out link
Investment Tax Credit example_ITC.txt .out link
Production Tax Credit example_PTC.txt .out link
Fervo Project Red (2023) Fervo_Norbeck_Latimer_2023.txt .out link
Fervo Cape Station 1: 2023 Results Fervo_Project_Cape.txt .out link
Fervo Cape Station 2: 2024 Results Fervo_Project_Cape-2.txt .out link
Fervo Cape Station 3: 400 MWe Production Fervo_Project_Cape-3.txt .out link
Superhot Rock (SHR) Example 1 example_SHR-1.txt .out link
Superhot Rock (SHR) Example 2 example_SHR-2.txt .out link
* TOUGH2 is not currently supported in the web interface. Comment on this tracking issue to request web interface support for TOUGH2.

Videos

NREL GEOPHIRES Workshop: Features Overview & Examples

NREL GEOPHIRES Workshop: Case Studies

HIP-RA: Heat in Place - Resource Assessment

HIP-RA-X README

HIP-RA-X Parameters Reference

A HIP-RA web interface is available at gtp.scientificwebservices.com/hip-ra.

Monte Carlo

Monte Carlo User Guide

A Monte Carlo web interface is available at gtp.scientificwebservices.com/monte-carlo.

Extending GEOPHIRES-X

How to extend GEOPHIRES-X user guide

Extension example: SUTRA

Additional Documentation

Theoretical basis for GEOPHIRES: GEOPHIRES v2.0: updated geothermal techno‐economic simulation tool; accompanying GEOPHIRES v2.0 user manual.

Additional materials can be found in /References.

Development

If you are interested in sharing your extensions with others, or even contributing them back to this repository, you may want to follow the Development instructions. (You can also create a fork after doing an editable install so don't worry about picking this method if you're unsure.)