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.24
current_version = 3.10.25
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.24
version: 3.10.25
version_manager: "bump2version"
website: "https://github.com/NREL"
year_from: "2023"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ GEOPHIRES v3 (2023-2025)
3.10
^^^^

3.10.25: `Add Number of Injection Wells per Production Well parameter <https://github.com/softwareengineerprogrammer/GEOPHIRES/pull/119>`__

3.10: `SAM Economic Models: Multiple Construction Years; Number of Fractures per Stimulated Well parameter; Royalty Rate Escalation Start Year parameter <https://github.com/NREL/GEOPHIRES-X/pull/440>`__ | `release <https://github.com/NREL/GEOPHIRES-X/releases/tag/v3.10.24>`__

3.9
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.24.svg
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.10.25.svg
:alt: Commits since latest release
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.10.24...main
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.10.25...main

.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
:target: https://nrel.github.io/GEOPHIRES-X
Expand Down
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.24'
version = release = '3.10.25'

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.24',
version='3.10.25',
license='MIT',
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
long_description='{}\n{}'.format(
Expand Down
41 changes: 34 additions & 7 deletions src/geophires_x/WellBores.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,18 @@ def __init__(self, model: Model):
ToolTipText="Pass this parameter to set the Number of Production Wells and Number of Injection Wells to "
"same value."
)
# noinspection SpellCheckingInspection
self.ninj_per_production_well = self.ParameterDict[self.ninj_per_production_well.Name] = floatParameter(
"Number of Injection Wells per Production Well",
DefaultValue=1,
Min=0,
Max=max_doublets-1,
UnitType=Units.NONE,
Required=False,
ToolTipText="Number of (identical) injection wells per production well. "
"For example, provide 0.666 to specify a 3:2 production:injection well ratio. "
"The number of injection wells will be rounded up to the nearest integer."
)

# noinspection SpellCheckingInspection
self.prodwelldiam = self.ParameterDict[self.prodwelldiam.Name] = floatParameter(
Expand Down Expand Up @@ -1361,20 +1373,35 @@ def read_parameters(self, model: Model) -> None:

coerce_int_params_to_enum_values(self.ParameterDict)

if self.doublets_count.Provided:
def _error(num_wells_param_:intParameter):
msg = f'{num_wells_param_.Name} may not be provided when {self.doublets_count.Name} is provided.'
model.logger.error(msg)
raise ValueError(msg)
self._set_well_counts_from_parameters(model)

model.logger.info(f"read parameters complete {self.__class__.__name__}: {__name__}")

def _set_well_counts_from_parameters(self, model: Model):
mutually_exclusive_well_count_params = [self.doublets_count, self.ninj_per_production_well]
provided_well_count_params = [it for it in mutually_exclusive_well_count_params if it.Provided]
if len(provided_well_count_params) > 1:
raise ValueError(f'Only one of [{", ".join([it.Name for it in mutually_exclusive_well_count_params])}] '
f'may be provided.')

def _raise_incompatible_param_error(incompatible_param: intParameter, with_param: intParameter):
msg = f'{incompatible_param.Name} may not be provided when {with_param.Name} is provided.'
model.logger.error(msg)
raise ValueError(msg)

if self.doublets_count.Provided:
for num_wells_param in [self.ninj, self.nprod]:
if num_wells_param.Provided:
_error(num_wells_param)
_raise_incompatible_param_error(num_wells_param, self.doublets_count)

self.ninj.value = self.doublets_count.value
self.nprod.value = self.doublets_count.value

model.logger.info(f"read parameters complete {self.__class__.__name__}: {__name__}")
if self.ninj_per_production_well.Provided:
if self.ninj.Provided:
_raise_incompatible_param_error(self.ninj, self.ninj_per_production_well)

self.ninj.value = int(math.ceil(self.nprod.value * self.ninj_per_production_well.value))

def Calculate(self, model: Model) -> None:
"""
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.24'
__version__ = '3.10.25'
9 changes: 9 additions & 0 deletions src/geophires_x_schema_generator/geophires-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,15 @@
"minimum": 0,
"maximum": 200
},
"Number of Injection Wells per Production Well": {
"description": "Number of (identical) injection wells per production well. For example, provide 0.666 to specify a 3:2 production:injection well ratio. The number of injection wells will be rounded up to the nearest integer.",
"type": "number",
"units": null,
"category": "Well Bores",
"default": 1,
"minimum": 0,
"maximum": 199
},
"Production Well Diameter": {
"description": "Inner diameter of production wellbore (assumed constant along the wellbore) to calculate frictional pressure drop and wellbore heat transmission with Rameys model",
"type": "number",
Expand Down
44 changes: 44 additions & 0 deletions tests/geophires_x_tests/test_well_bores.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,50 @@ def test_number_of_doublets_non_integer(self):
self.assertEqual(prod_inj_lcoe_2[0], 199)
self.assertEqual(prod_inj_lcoe_2[1], 199)

def test_number_of_injection_wells_per_production_well(self):
r_ratio: GeophiresXResult = self._get_result(
{
'Number of Production Wells': 63,
'Number of Injection Wells per Production Well': 0.666, # 3:2 ratio
}
)

r_explicit_counts: GeophiresXResult = self._get_result(
{'Number of Production Wells': 63, 'Number of Injection Wells': 42}
)

self.assertEqual(self._prod_inj_lcoe_production(r_explicit_counts), self._prod_inj_lcoe_production(r_ratio))

self.assertEqual(
self._prod_inj_lcoe_production(
self._get_result(
{
'Number of Production Wells': 2, # default value
'Number of Injection Wells per Production Well': 3,
}
)
),
self._prod_inj_lcoe_production(self._get_result({'Number of Injection Wells per Production Well': 3})),
)

with self.assertRaises(RuntimeError):
self._get_result(
{
'Number of Production Wells': 63,
'Number of Injection Wells per Production Well': 0.6666, # 3:2 ratio
'Number of Injection Wells': 42,
}
)

with self.assertRaises(RuntimeError):
self._get_result(
{
'Number of Production Wells': 63,
'Number of Injection Wells per Production Well': 0.6666, # 3:2 ratio
'Number of Doublets': 52,
}
)

# noinspection PyMethodMayBeStatic
def _get_result(self, _params) -> GeophiresXResult:
params = GeophiresInputParameters(
Expand Down