/python-geophires-x

Primary LanguagePythonMIT LicenseMIT

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.

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 tinyurl.com/geophires

Installation

Strongly recommended prerequisite: always install in a virtual environment (rather than global site-packages).

To consume GEOPHIRES-X as a python package, install the in-development version with:

pip install https://github.com/NREL/python-geophires-x/archive/main.zip

If you wish to add your own extensions (as described in How to extend GEOPHIRES-X) one option is to do an editable install:

pip install -e git+https://github.com/NREL/python-geophires-x.git#egg=geophires-x

If you are interested in sharing your extensions with others (or even contributing them back to this repository), follow the Development instructions instead.

Usage

Example usage:

from geophires_x_client import GeophiresXClient
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters

client = GeophiresXClient()
result = client.get_geophires_result(
            GeophiresInputParameters(
                {
                    'End-Use Option': 2,
                    'Reservoir Model': 1,
                    'Time steps per year': 1,
                    'Reservoir Depth': 3,
                    'Gradient 1': 50,
                    'Maximum Temperature': 250,
                }
            )
        )

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

Available parameters are documented in the Parameters Reference.

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/python-geophires-x/blob/main/tests/examples/example1.txt
example_file_path = Path('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())

A variety of examples input .txt files are available in the tests/examples directory of the repository.

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

Documentation

The GEOPHIRES v2.0 (previous version's) user manual describes GEOPHIRES's high-level software architecture.

Other Documentation:

Development

See Development instructions in CONTRIBUTING