Skip to content

Commit 05d15c2

Browse files
Merge pull request NREL#148 from softwareengineerprogrammer/main
Better drilling cost correlation for depth >7km; HIP-RA deprecated in favor of HIP-RA-X
2 parents 926dda3 + aed5196 commit 05d15c2

20 files changed

+160
-135
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.4.16
2+
current_version = 3.4.19
33
commit = True
44
tag = True
55

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ default_context:
5454
sphinx_doctest: "no"
5555
sphinx_theme: "sphinx-py3doc-enhanced-theme"
5656
test_matrix_separate_coverage: "no"
57-
version: 3.4.16
57+
version: 3.4.19
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Free software: `MIT license <LICENSE>`__
4747
:alt: Supported implementations
4848
:target: https://pypi.org/project/geophires-x
4949

50-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.16.svg
50+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.4.19.svg
5151
:alt: Commits since latest release
52-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.16...main
52+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.4.19...main
5353

5454
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
5555
:target: https://nrel.github.io/GEOPHIRES-X

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2023'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.4.16'
21+
version = release = '3.4.19'
2222

2323
pygments_style = 'trac'
2424
templates_path = ['./templates']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(*names, **kwargs):
1313

1414
setup(
1515
name='geophires-x',
16-
version='3.4.16',
16+
version='3.4.19',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_x/Economics.py

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,17 +1974,33 @@ def Calculate(self, model: Model) -> None:
19741974
self.C1well = self.ccwellfixed.value
19751975
self.Cwell.value = self.C1well * (model.wellbores.nprod.value + model.wellbores.ninj.value)
19761976
else:
1977-
# if depth is > 7000 m, we don't have a correlation for it, so we must use the SIMPLE logic
1978-
checkdepth = model.reserv.depth.quantity().to('m').magnitude
1979-
if ((checkdepth > 7000.0 or checkdepth < 500) and
1980-
not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):
1981-
msg = (f'Invalid cost correlation specified for drilling depth <500 or >7000 m ({checkdepth}m), '
1982-
f'falling back to simple user-specified cost '
1983-
f'({self.Vertical_drilling_cost_per_m.value} per meter)')
1984-
model.logger.warning(msg)
1977+
# Check if well depth is out of standard bounds for cost correlation
1978+
checkdepth_m = model.reserv.depth.quantity().to('m').magnitude
1979+
1980+
correlations_min_valid_depth_m = 500.
1981+
correlations_max_valid_depth_m = 7000.
1982+
1983+
if (checkdepth_m < correlations_min_valid_depth_m
1984+
and not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):
1985+
19851986
self.wellcorrelation.value = WellDrillingCostCorrelation.SIMPLE
1987+
model.logger.warning(
1988+
f'Invalid cost correlation specified ({self.wellcorrelation.value}) for drilling depth '
1989+
f'<{correlations_min_valid_depth_m}m ({checkdepth_m}m). '
1990+
f'Falling back to simple user-specified cost '
1991+
f'({self.Vertical_drilling_cost_per_m.value} per meter)'
1992+
)
1993+
1994+
if (checkdepth_m > correlations_max_valid_depth_m
1995+
and not self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE):
1996+
model.logger.warning(
1997+
f'{self.wellcorrelation.value} may be invalid for drilling depth '
1998+
f'>{correlations_max_valid_depth_m}m ({checkdepth_m}m). '
1999+
f'Consider using {WellDrillingCostCorrelation.SIMPLE} (per-meter cost) or '
2000+
f'{self.ccwellfixed.Name} (fixed cost per well) instead.'
2001+
)
2002+
19862003

1987-
# use SIMPLE approach if user has specified it
19882004
if self.wellcorrelation.value == WellDrillingCostCorrelation.SIMPLE:
19892005
# using the "Configuration" keywords means we are doing an AGS calculation
19902006
if hasattr(model.wellbores, 'Configuration'):
@@ -2009,18 +2025,17 @@ def Calculate(self, model: Model) -> None:
20092025
'm').magnitude * 1E-6
20102026

20112027
elif self.wellcorrelation.value == WellDrillingCostCorrelation.VERTICAL_SMALL:
2012-
self.C1well = ((0.3021 * checkdepth ** 2 + 584.9112 * checkdepth + 751368.)
2028+
self.C1well = ((0.3021 * checkdepth_m ** 2 + 584.9112 * checkdepth_m + 751368.)
20132029
* 1E-6) # well drilling and completion cost in M$/well
20142030

20152031
elif self.wellcorrelation.value == WellDrillingCostCorrelation.DEVIATED_SMALL:
2016-
self.C1well = (0.2898 * checkdepth ** 2 + 822.1507 * checkdepth + 680563.) * 1E-6
2032+
self.C1well = (0.2898 * checkdepth_m ** 2 + 822.1507 * checkdepth_m + 680563.) * 1E-6
20172033

20182034
elif self.wellcorrelation.value == WellDrillingCostCorrelation.VERTICAL_LARGE:
2019-
2020-
self.C1well = (0.2818 * checkdepth ** 2 + 1275.5213 * checkdepth + 632315.) * 1E-6
2035+
self.C1well = (0.2818 * checkdepth_m ** 2 + 1275.5213 * checkdepth_m + 632315.) * 1E-6
20212036

20222037
elif self.wellcorrelation.value == WellDrillingCostCorrelation.DEVIATED_LARGE:
2023-
self.C1well = (0.2553 * checkdepth ** 2 + 1716.7157 * checkdepth + 500867.) * 1E-6
2038+
self.C1well = (0.2553 * checkdepth_m ** 2 + 1716.7157 * checkdepth_m + 500867.) * 1E-6
20242039

20252040
# account for adjustment factor
20262041
self.C1well = self.ccwelladjfactor.value * self.C1well

src/geophires_x/GEOPHIRESv3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def main(enable_geophires_logging_config=True):
7373
outputfile = sys.argv[2]
7474

7575
with open(outputfile, 'r', encoding='UTF-8') as f:
76+
sys.stdout.write('\n')
7677
content = f.readlines() # store all output in one long list
7778

7879
# Now write each line to the screen

src/geophires_x/SurfacePlant.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,8 @@ def read_parameters(self, model:Model) -> None:
591591
if ParameterToModify.value < 0 or ParameterToModify.value > 10000:
592592
if self.setinjectionpressurefixed:
593593
ParameterToModify.value = 100
594-
msg = f'Provided plant outlet pressure outside of range 0-10000. GEOPHIRES will assume default plant outlet pressure ({ParameterToModify.value} kPa)'
594+
msg = (f'Provided plant outlet pressure outside of range 0-10000. GEOPHIRES will '
595+
f'assume default plant outlet pressure ({ParameterToModify.value} kPa)')
595596
print(f'Warning: {msg}')
596597
model.logger.warning(msg)
597598
else:
@@ -607,13 +608,11 @@ def read_parameters(self, model:Model) -> None:
607608
self.plant_outlet_pressure.value = 100
608609
msg = (f'No valid plant outlet pressure provided. '
609610
f'GEOPHIRES will assume default plant outlet pressure ({self.plant_outlet_pressure.value} kPa)')
610-
print(f'Warning: {msg}')
611611
model.logger.warning(msg)
612612
else:
613613
self.usebuiltinoutletplantcorrelation.value = True
614614
msg = (f'No valid plant outlet pressure provided. GEOPHIRES will calculate plant outlet pressure '
615615
f'based on production wellhead pressure and surface equipment pressure drop of 10 psi')
616-
print(f'Warning: {msg}')
617616
model.logger.warning(msg)
618617
else:
619618
model.logger.info('No parameters read because no content provided')

src/geophires_x/WellBores.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ def ProdPressureDropAndPumpingPowerUsingIndexes(
396396
elif pumpdepthfinal_m > 600.0:
397397
msg = (f'GEOPHIRES calculates production pump depth to be deeper than 600m ({pumpdepthfinal_m:.2f}m). '
398398
f'Verify reservoir pressure, production well flow rate and production well dimensions')
399-
print(f'Warning: {msg}')
400399
model.logger.warning(msg)
401400

402401
# calculate production well pumping pressure [kPa]

src/geophires_x/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.4.16'
1+
__version__ = '3.4.19'

0 commit comments

Comments
 (0)