Skip to content

Commit dc1e0d6

Browse files
Merge pull request #45 from softwareengineerprogrammer/sync-well-drilling-and-completion-adjustment
Sync well drilling and completion adjustment factors - NREL#332
2 parents fc5bd8e + 460f8fc commit dc1e0d6

File tree

13 files changed

+175
-43
lines changed

13 files changed

+175
-43
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.7.4
2+
current_version = 3.7.5
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.7.4
57+
version: 3.7.5
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ GEOPHIRES-X (2023-2025)
1414

1515
3.7.3: Heat to Power Conversion Efficiency output added.
1616

17+
3.7.5: Injection Well Drilling and Completion Capital Cost Adjustment Factor, if not provided, is now automatically set to the provided value of Well Drilling and Completion Capital Cost Adjustment Factor.
18+
1719

1820
3.6
1921
^^^

README.rst

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

59-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.7.4.svg
59+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.7.5.svg
6060
:alt: Commits since latest release
61-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.7.4...main
61+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.7.5...main
6262

6363
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
6464
: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 = '2025'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.7.4'
21+
version = release = '3.7.5'
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.7.4',
16+
version='3.7.5',
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: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,10 @@ def __init__(self, model: Model):
647647
Valid=False,
648648
ToolTipText="Injection Well Drilling and Completion Capital Cost"
649649
)
650+
651+
# TODO parameterize/document default 5% indirect cost factor that is applied when neither of the well
652+
# drilling/completion capital cost adjustment factors are provided
653+
injection_well_cost_adjustment_factor_name = "Injection Well Drilling and Completion Capital Cost Adjustment Factor"
650654
self.production_well_cost_adjustment_factor = self.ParameterDict[self.production_well_cost_adjustment_factor.Name] = floatParameter(
651655
"Well Drilling and Completion Capital Cost Adjustment Factor",
652656
DefaultValue=1.0,
@@ -657,19 +661,23 @@ def __init__(self, model: Model):
657661
CurrentUnits=PercentUnit.TENTH,
658662
Provided=False,
659663
Valid=True,
660-
ToolTipText="Well Drilling and Completion Capital Cost Adjustment Factor"
664+
ToolTipText="Well Drilling and Completion Capital Cost Adjustment Factor. Applies to production wells; "
665+
f"also applies to injection wells unless a value is provided for "
666+
f"{injection_well_cost_adjustment_factor_name}."
661667
)
662668
self.injection_well_cost_adjustment_factor = self.ParameterDict[self.injection_well_cost_adjustment_factor.Name] = floatParameter(
663-
"Injection Well Drilling and Completion Capital Cost Adjustment Factor",
664-
DefaultValue=self.production_well_cost_adjustment_factor.value,
665-
Min=0,
666-
Max=10,
669+
injection_well_cost_adjustment_factor_name,
670+
DefaultValue=self.production_well_cost_adjustment_factor.DefaultValue,
671+
Min=self.production_well_cost_adjustment_factor.Min,
672+
Max=self.production_well_cost_adjustment_factor.Max,
667673
UnitType=Units.PERCENT,
668674
PreferredUnits=PercentUnit.TENTH,
669675
CurrentUnits=PercentUnit.TENTH,
670676
Provided=False,
671677
Valid=True,
672-
ToolTipText="Injection Well Drilling and Completion Capital Cost Adjustment Factor"
678+
ToolTipText="Injection Well Drilling and Completion Capital Cost Adjustment Factor. "
679+
f"If not provided, this value will be set automatically to the same value as "
680+
f"{self.production_well_cost_adjustment_factor.Name}."
673681
)
674682
self.oamwellfixed = self.ParameterDict[self.oamwellfixed.Name] = floatParameter(
675683
"Wellfield O&M Cost",
@@ -1753,7 +1761,8 @@ def __init__(self, model: Model):
17531761
CurrentUnits=PercentUnit.TENTH
17541762
)
17551763
self.ProjectMOIC = self.OutputParameterDict[self.ProjectMOIC.Name] = OutputParameter(
1756-
"Project Multiple of Invested Capital",
1764+
"Project MOIC",
1765+
ToolTipText="Project Multiple of Invested Capital",
17571766
UnitType=Units.PERCENT,
17581767
PreferredUnits=PercentUnit.TENTH,
17591768
CurrentUnits=PercentUnit.TENTH
@@ -1910,35 +1919,30 @@ def read_parameters(self, model: Model) -> None:
19101919
ParameterToModify.value = 1.0
19111920
elif ParameterToModify.Name == "Well Drilling and Completion Capital Cost Adjustment Factor":
19121921
if self.per_production_well_cost.Valid and ParameterToModify.Valid:
1913-
print("Warning: Provided well drilling and completion cost adjustment factor not" +
1914-
" considered because valid total well drilling and completion cost provided.")
1915-
model.logger.warning("Provided well drilling and completion cost adjustment factor not" +
1916-
" considered because valid total well drilling and completion cost provided.")
1922+
msg = ('Provided well drilling and completion cost adjustment factor not considered '
1923+
'because valid total well drilling and completion cost provided.')
1924+
print(f'Warning: {msg}')
1925+
model.logger.warning(msg)
19171926
elif not self.per_production_well_cost.Provided and not self.production_well_cost_adjustment_factor.Provided:
19181927
ParameterToModify.value = 1.0
1919-
print("Warning: No valid well drilling and completion total cost or adjustment" +
1920-
" factor provided. GEOPHIRES will assume default built-in well drilling and" +
1921-
" completion cost correlation with adjustment factor = 1.")
1922-
model.logger.warning(
1923-
"No valid well drilling and completion total cost or adjustment factor" +
1924-
" provided. GEOPHIRES will assume default built-in well drilling and completion cost" +
1925-
" correlation with adjustment factor = 1.")
1928+
msg = ("No valid well drilling and completion total cost or adjustment factor provided. "
1929+
"GEOPHIRES will assume default built-in well drilling and completion cost "
1930+
"correlation with adjustment factor = 1.")
1931+
print(f'Warning: {msg}')
1932+
model.logger.warning(msg)
19261933
elif self.per_production_well_cost.Provided and not self.per_production_well_cost.Valid:
1927-
print("Warning: Provided well drilling and completion cost outside of range 0-1000." +
1928-
" GEOPHIRES will assume default built-in well drilling and completion cost correlation" +
1929-
" with adjustment factor = 1.")
1930-
model.logger.warning("Provided well drilling and completion cost outside of range 0-1000." +
1931-
" GEOPHIRES will assume default built-in well drilling and completion cost correlation with" +
1932-
" adjustment factor = 1.")
1934+
msg = ("Provided well drilling and completion cost outside of range 0-1000. GEOPHIRES "
1935+
"will assume default built-in well drilling and completion cost correlation "
1936+
"with adjustment factor = 1.")
1937+
print(f'Warning: {msg}')
1938+
model.logger.warning(msg)
19331939
self.production_well_cost_adjustment_factor.value = 1.0
19341940
elif not self.per_production_well_cost.Provided and self.production_well_cost_adjustment_factor.Provided and not self.production_well_cost_adjustment_factor.Valid:
1935-
print("Warning: Provided well drilling and completion cost adjustment factor outside" +
1936-
" of range 0-10. GEOPHIRES will assume default built-in well drilling and completion" +
1937-
" cost correlation with adjustment factor = 1.")
1938-
model.logger.warning(
1939-
"Provided well drilling and completion cost adjustment factor outside" +
1940-
" of range 0-10. GEOPHIRES will assume default built-in well drilling and completion" +
1941-
" cost correlation with adjustment factor = 1.")
1941+
msg = ("Provided well drilling and completion cost adjustment factor outside of range "
1942+
"0-10. GEOPHIRES will assume default built-in well drilling and completion cost "
1943+
"correlation with adjustment factor = 1.")
1944+
print(f'Warning: {msg}')
1945+
model.logger.warning(msg)
19421946
self.production_well_cost_adjustment_factor.value = 1.0
19431947
elif ParameterToModify.Name == "Wellfield O&M Cost Adjustment Factor":
19441948
if self.oamtotalfixed.Valid:
@@ -2169,6 +2173,7 @@ def read_parameters(self, model: Model) -> None:
21692173

21702174
coerce_int_params_to_enum_values(self.ParameterDict)
21712175
self.sync_interest_rate(model)
2176+
self.sync_well_drilling_and_completion_capital_cost_adjustment_factor(model)
21722177

21732178
model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}')
21742179

@@ -2198,6 +2203,16 @@ def discount_rate_display() -> str:
21982203

21992204
self.interest_rate.value = self.discountrate.quantity().to(convertible_unit(self.interest_rate.CurrentUnits)).magnitude
22002205

2206+
def sync_well_drilling_and_completion_capital_cost_adjustment_factor(self, model):
2207+
if (self.production_well_cost_adjustment_factor.Provided
2208+
and not self.injection_well_cost_adjustment_factor.Provided):
2209+
factor = self.production_well_cost_adjustment_factor.value
2210+
self.injection_well_cost_adjustment_factor.value = factor
2211+
model.logger.info(
2212+
f'Set {self.injection_well_cost_adjustment_factor.Name} to {factor} because '
2213+
f'{self.production_well_cost_adjustment_factor.Name} was provided.')
2214+
2215+
22012216
def Calculate(self, model: Model) -> None:
22022217
"""
22032218
The Calculate function is where all the calculations are done.
@@ -2281,7 +2296,7 @@ def Calculate(self, model: Model) -> None:
22812296
else:
22822297
self.cost_lateral_section.value = 0.0
22832298
# cost of the well field
2284-
# 1.05 for 5% indirect costs
2299+
# 1.05 for 5% indirect costs - see TODO re:parameterizing at src/geophires_x/Economics.py:652
22852300
self.Cwell.value = 1.05 * ((self.cost_one_production_well.value * model.wellbores.nprod.value) +
22862301
(self.cost_one_injection_well.value * model.wellbores.ninj.value) +
22872302
self.cost_lateral_section.value)

src/geophires_x/Outputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ def PrintOutputs(self, model: Model):
16461646
f.write(f' Project NPV: {model.economics.ProjectNPV.value:10.2f} ' + model.economics.ProjectNPV.PreferredUnits.value + NL)
16471647
f.write(f' Project IRR: {model.economics.ProjectIRR.value:10.2f} ' + model.economics.ProjectIRR.PreferredUnits.value + NL)
16481648
f.write(f' Project VIR=PI=PIR: {model.economics.ProjectVIR.value:10.2f}' + NL)
1649-
f.write(f' Project MOIC: {model.economics.ProjectMOIC.value:10.2f}' + NL)
1649+
f.write(f' {model.economics.ProjectMOIC.Name}: {model.economics.ProjectMOIC.value:10.2f}' + NL)
16501650

16511651
payback_period_val = model.economics.ProjectPaybackPeriod.value
16521652
project_payback_period_display = f'{payback_period_val:10.2f} {model.economics.ProjectPaybackPeriod.PreferredUnits.value}' \

src/geophires_x/OutputsCCUS.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def PrintOutputs(self, model):
3636
f.write(f" Project NPV (including carbon credit): {model.ccuseconomics.ProjectNPV.value:10.2f} " + model.ccuseconomics.ProjectNPV.PreferredUnits.value + NL)
3737
f.write(f" Project IRR (including carbon credit): {model.ccuseconomics.ProjectIRR.value:10.2f} " + model.ccuseconomics.ProjectIRR.PreferredUnits.value + NL)
3838
f.write(f" Project VIR=IR=PIR (including carbon credit): {model.ccuseconomics.ProjectVIR.value:10.2f}" + NL)
39-
f.write(f" Project MOIC (including carbon credit): {model.ccuseconomics.ProjectMOIC.value:10.2f}" + NL)
39+
f.write(f" {model.economics.ProjectMOIC.Name} (including carbon credit): {model.ccuseconomics.ProjectMOIC.value:10.2f}" + NL)
4040
f.write(NL)
4141
f.write(NL)
4242
f.write(" ******************" + NL)

src/geophires_x/__init__.py

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

0 commit comments

Comments
 (0)