Skip to content

Commit cc8e665

Browse files
Update comment re: NREL#122 (comment)
1 parent 1c154f3 commit cc8e665

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/geophires_x/AGSWellBores.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,16 +926,15 @@ def Calculate(self, model: Model) -> None:
926926
:type model: :class:`~geophires_x.Model.Model`
927927
:return: None
928928
"""
929-
model.logger.info("Init " + str(__class__) + ": " + sys._getframe().f_code.co_name)
929+
model.logger.info(f'Init {__class__!s}: {sys._getframe().f_code.co_name}')
930930

931931
self.Tini = model.reserv.Trock.value # initialize the temperature to be the initial temperature of the reservoir
932932
if self.Tini > 375.0 or self.numnonverticalsections.value > 1:
933933
# must be a multilateral setup or too hot for CLGS, so must try to use wanju code.
934934
if self.Tini > 375.0:
935-
model.logger.warning("In AGS, but forced to use Wanju code because initial reservoir temperature \
936-
is too high for CLGS")
937-
print("In AGS, but forced to use Wanju code because initial reservoir temperature \
938-
is too high for CLGS")
935+
msg = 'In AGS, but forced to use Wanju code because initial reservoir temperature is too high for CLGS'
936+
model.logger.warning(msg)
937+
print(f'Warning: {msg}')
939938

940939
# handle special cases for the multilateral calc parameters you added
941940
if self.nonverticalwellborediameter.value > 2.0:
@@ -1104,7 +1103,12 @@ def Calculate(self, model: Model) -> None:
11041103
tot_length, vert_length, horizontal_lengths = self.calculatedrillinglengths(model)
11051104

11061105
# in this case, reserv.depth is just the vertical drill depth
1107-
# FIXME earlier calculations use depth before this value is set, meaning they're using the wrong value
1106+
# TODO earlier calculations use reserv.depth before it is recalculated here; this should be refactored to avoid
1107+
# potential for mix-ups. As of 2024-02-16, calculations correctly account for this on-the-fly change of
1108+
# reserv.depth - see https://github.com/NREL/GEOPHIRES-X/issues/122#issuecomment-194869313 - but this
1109+
# implementation is fragile and prone to introducing bugs in future changes. Ideally, parameters should
1110+
# not be changed once their value has been calculated, and especially not after the first calculated
1111+
# value has been used as an input for other calculations.
11081112
model.reserv.depth.value = model.reserv.InputDepth.quantity().to(model.reserv.depth.CurrentUnits).magnitude
11091113

11101114
# getTandP results must be rejiggered to match wellbores expected output. Once done,

0 commit comments

Comments
 (0)