@@ -926,16 +926,15 @@ def Calculate(self, model: Model) -> None:
926
926
:type model: :class:`~geophires_x.Model.Model`
927
927
:return: None
928
928
"""
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 } ' )
930
930
931
931
self .Tini = model .reserv .Trock .value # initialize the temperature to be the initial temperature of the reservoir
932
932
if self .Tini > 375.0 or self .numnonverticalsections .value > 1 :
933
933
# must be a multilateral setup or too hot for CLGS, so must try to use wanju code.
934
934
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 } ' )
939
938
940
939
# handle special cases for the multilateral calc parameters you added
941
940
if self .nonverticalwellborediameter .value > 2.0 :
@@ -1104,7 +1103,12 @@ def Calculate(self, model: Model) -> None:
1104
1103
tot_length , vert_length , horizontal_lengths = self .calculatedrillinglengths (model )
1105
1104
1106
1105
# 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.
1108
1112
model .reserv .depth .value = model .reserv .InputDepth .quantity ().to (model .reserv .depth .CurrentUnits ).magnitude
1109
1113
1110
1114
# getTandP results must be rejiggered to match wellbores expected output. Once done,
0 commit comments