Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.10.25
current_version = 3.11.1
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion .cookiecutterrc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ default_context:
sphinx_doctest: "no"
sphinx_theme: "sphinx-py3doc-enhanced-theme"
test_matrix_separate_coverage: "no"
version: 3.10.25
version: 3.11.1
version_manager: "bump2version"
website: "https://github.com/NREL"
year_from: "2023"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Changelog

GEOPHIRES v3 (2023-2025)
------------------------
3.11
^^^^

3.11: `SAM Economic Models Project Payback Period fix <https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/123>`__ | `release <https://github.com/NREL/GEOPHIRES-X/releases/tag/v3.11.1>`__


3.10
^^^^
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ Free software: `MIT license <LICENSE>`__
:alt: Supported implementations
:target: https://pypi.org/project/geophires-x

.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.10.25.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.11.1.svg
:alt: Commits since latest release
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.10.25...main
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.11.1...main

.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
:target: https://nrel.github.io/GEOPHIRES-X
Expand Down
192 changes: 96 additions & 96 deletions docs/_images/fervo_project_cape-5-sensitivity-analysis-irr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
186 changes: 93 additions & 93 deletions docs/_images/fervo_project_cape-5-sensitivity-analysis-lcoe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
202 changes: 101 additions & 101 deletions docs/_images/fervo_project_cape-5-sensitivity-analysis-project_npv.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
year = '2025'
author = 'NREL'
copyright = f'{year}, {author}'
version = release = '3.10.25'
version = release = '3.11.1'

pygments_style = 'trac'
templates_path = ['./templates']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read(*names, **kwargs):

setup(
name='geophires-x',
version='3.10.25',
version='3.11.1',
license='MIT',
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
long_description='{}\n{}'.format(
Expand Down
46 changes: 34 additions & 12 deletions src/geophires_x/EconomicsSam.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,21 +521,43 @@ def _calculate_project_vir(cash_flow: list[list[Any]], model: Model) -> float:

def _calculate_project_payback_period(cash_flow: list[list[Any]], model) -> float | None:
"""
See payback period output parameter's tooltip text for details relevant to this implementation.
"""
Calculates the Simple Payback Period (SPB).
SPB is the time required for the cumulative non-discounted after-tax net cash flow to turn positive.

The calculation assumes annual cash flows. The returned value represents the number of years
from the start of the provided cash flow list until the investment is recovered.
"""
try:
# Get flattened annual after-tax cash flow
after_tax_cash_flow = _after_tax_net_cash_flow_all_years(cash_flow, _pre_revenue_years_count(model))
cumm_cash_flow = np.zeros(len(after_tax_cash_flow))
cumm_cash_flow[0] = after_tax_cash_flow[0]
for year in range(1, len(after_tax_cash_flow)):
cumm_cash_flow[year] = cumm_cash_flow[year - 1] + after_tax_cash_flow[year]
if cumm_cash_flow[year] >= 0:
year_before_full_recovery = year - 1
payback_period = (
year_before_full_recovery
+ abs(cumm_cash_flow[year_before_full_recovery]) / after_tax_cash_flow[year]
)

cumulative_cash_flow = np.zeros(len(after_tax_cash_flow))
cumulative_cash_flow[0] = after_tax_cash_flow[0]

# Handle edge case where the first year is already positive
if cumulative_cash_flow[0] >= 0:
# If the project is profitable immediately (rare for SPB), return 0 or fraction.
# For standard SPB logic where Index 0 is an investment year, this is an edge case.
pass

for year_index in range(1, len(after_tax_cash_flow)):
cumulative_cash_flow[year_index] = cumulative_cash_flow[year_index - 1] + after_tax_cash_flow[year_index]

if cumulative_cash_flow[year_index] >= 0:
# Payback occurred in this year (year_index).
# We need to calculate how far into this year the break-even point occurred.

previous_year_index = year_index - 1
unrecovered_cost_at_start_of_year = abs(cumulative_cash_flow[previous_year_index])
cash_flow_in_current_year = after_tax_cash_flow[year_index]

# Fraction of the current year required to recover the remaining cost
fraction_of_year = unrecovered_cost_at_start_of_year / cash_flow_in_current_year

# Total years elapsed = Full years prior to this one + fraction of this one.
# If we are at year_index, the number of full years passed is equal to year_index.
# Example: If year_index is 5 (6th year), 5 full years (Indices 0..4) have passed.
payback_period = year_index + fraction_of_year

return float(payback_period)

Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.10.25'
__version__ = '3.11.1'
10 changes: 5 additions & 5 deletions tests/examples/Fervo_Project_Cape-4.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.25
Simulation Date: 2026-01-13
Simulation Time: 11:08
Calculation Time: 1.855 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:41
Calculation Time: 1.775 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 27.55 %
Project VIR=PI=PIR: 1.45
Project MOIC: 4.20
Project Payback Period: 2.33 yr
Project Payback Period: 3.33 yr
Estimated Jobs Created: 1300

***ENGINEERING PARAMETERS***
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/Fervo_Project_Cape-5.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.25
Simulation Date: 2026-01-14
Simulation Time: 11:38
Calculation Time: 1.828 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:42
Calculation Time: 1.791 sec

***SUMMARY OF RESULTS***

Expand Down Expand Up @@ -38,7 +38,7 @@ Simulation Metadata
After-tax IRR: 24.46 %
Project VIR=PI=PIR: 1.45
Project MOIC: 5.05
Project Payback Period: 4.93 yr
Project Payback Period: 5.93 yr
Estimated Jobs Created: 1269

***ENGINEERING PARAMETERS***
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/Fervo_Project_Cape-6.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.25
Simulation Date: 2026-01-15
Simulation Time: 11:34
Calculation Time: 1.834 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:42
Calculation Time: 1.811 sec

***SUMMARY OF RESULTS***

Expand Down Expand Up @@ -38,7 +38,7 @@ Simulation Metadata
After-tax IRR: 35.45 %
Project VIR=PI=PIR: 1.69
Project MOIC: 5.26
Project Payback Period: 2.88 yr
Project Payback Period: 3.88 yr
Estimated Jobs Created: 272

***ENGINEERING PARAMETERS***
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/Fervo_Project_Cape-6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Reservoir Volume Option, 1, -- FRAC_NUM_SEP: Reservoir volume calculated with fr
Number of Fractures per Stimulated Well, 150, -- The model assumes an Extreme Limited Entry stimulation design (Fervo Energy, 2023) utilizing 12 stages with 15 clusters per stage (derived from Singh et al., 2025) and 81–85% stimulation success rate per 2024b ATB Moderate Scenario (NREL, 2025).
Fracture Separation, 9.8255, -- Based on 30 foot cluster spacing (Singh et al., 2025) marginally uprated to align with long-term thermal decline behavior trend towards wider fracture spacing (Fercho et al., 2025).

Fracture Shape, 4, -- Bench design and fracture geometry Singh et al., 2025 are given in rectangular dimensions.
Fracture Shape, 4, -- Bench design and fracture geometry in Singh et al., 2025 are given in rectangular dimensions.
Fracture Width, 305, -- Matches intra-bench well spacing of 500 ft (corresponding to fracture length of 1000 ft) (Singh. et al., 2025)
Fracture Height, 95, -- Actual fracture geometry is irregular and heterogeneous; this height complies with the minimum height required by the implemented bench design (200 ft; 60.96 meters) and yields an effective fracture surface area consistent with simulation results in Singh. et al., 2025.

Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example_SAM-single-owner-PPA-2.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.22
Simulation Date: 2025-12-15
Simulation Time: 09:15
Calculation Time: 1.013 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:42
Calculation Time: 1.086 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 59.73 %
Project VIR=PI=PIR: 4.58
Project MOIC: 9.59
Project Payback Period: 1.13 yr
Project Payback Period: 2.13 yr
Estimated Jobs Created: 976

***ENGINEERING PARAMETERS***
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example_SAM-single-owner-PPA-3.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.22
Simulation Date: 2025-12-15
Simulation Time: 09:15
Calculation Time: 1.189 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:41
Calculation Time: 1.221 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 30.00 %
Project VIR=PI=PIR: 2.27
Project MOIC: 4.61
Project Payback Period: 2.94 yr
Project Payback Period: 3.94 yr
Estimated Jobs Created: 125

***ENGINEERING PARAMETERS***
Expand Down
11 changes: 5 additions & 6 deletions tests/examples/example_SAM-single-owner-PPA-4.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.22
Simulation Date: 2025-12-15
Simulation Time: 09:15
Calculation Time: 1.205 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:42
Calculation Time: 1.231 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 22.13 %
Project VIR=PI=PIR: 1.76
Project MOIC: 3.38
Project Payback Period: 4.29 yr
Project Payback Period: 5.29 yr
Estimated Jobs Created: 125

***ENGINEERING PARAMETERS***
Expand Down Expand Up @@ -434,7 +434,6 @@ Interest earned on reserves ($) 0 0 0
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



***EXTENDED ECONOMICS***

Royalty Holder NPV: 50.59 MUSD
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example_SAM-single-owner-PPA-5.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.24
Simulation Date: 2025-12-24
Simulation Time: 15:35
Calculation Time: 1.840 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:42
Calculation Time: 1.865 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 16.54 %
Project VIR=PI=PIR: 1.58
Project MOIC: 5.72
Project Payback Period: 8.92 yr
Project Payback Period: 9.92 yr
Estimated Jobs Created: 250

***ENGINEERING PARAMETERS***
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example_SAM-single-owner-PPA.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.10.22
Simulation Date: 2025-12-15
Simulation Time: 09:15
Calculation Time: 1.196 sec
GEOPHIRES Version: 3.11.0
Simulation Date: 2026-01-16
Simulation Time: 11:41
Calculation Time: 1.222 sec

***SUMMARY OF RESULTS***

Expand All @@ -34,7 +34,7 @@ Simulation Metadata
After-tax IRR: 24.35 %
Project VIR=PI=PIR: 1.93
Project MOIC: 3.85
Project Payback Period: 3.91 yr
Project Payback Period: 4.91 yr
Estimated Jobs Created: 125

***ENGINEERING PARAMETERS***
Expand Down