@@ -716,28 +716,24 @@ def verify(self, model: Model) -> int:
716
716
errors = []
717
717
718
718
def on_invalid_parameter_value (err_msg ):
719
- errors .append (err_msg )
720
- print (err_msg )
721
- model .logger .fatal (err_msg )
719
+ s = f'Error: CLGS model database imposes additional range restrictions: { err_msg } . Simulation terminated.'
720
+ errors .append (s )
721
+ print (s )
722
+ model .logger .fatal (s )
722
723
self .error = 1
723
724
724
725
if self .Nonvertical_length .value < 1000 or self .Nonvertical_length .value > 20000 :
725
- on_invalid_parameter_value (
726
- 'Error: CLGS model database imposes additional range restrictions: Nonvertical length must be '
727
- 'between 1,000 and 20,000 m. Simulation terminated.'
728
- )
726
+ on_invalid_parameter_value ('Nonvertical length must be between 1,000 and 20,000 m' )
729
727
730
728
if self .Tinj .value < 30.0 or self .Tinj .value > 60.0 :
731
- on_invalid_parameter_value (
732
- 'Error: CLGS model database imposes additional range restrictions: Injection temperature '
733
- 'must be between 30 and 60 C. Simulation terminated.'
734
- )
729
+ on_invalid_parameter_value ('Injection temperature must be between 30 and 60 C' )
735
730
736
731
if self .krock < 1.5 or self .krock > 4.5 :
737
- on_invalid_parameter_value (
738
- 'Error: CLGS model database imposes additional range restrictions: '
739
- 'Rock thermal conductivity must be between 1.5 and 4.5 W/m/K. Simulation terminated.'
740
- )
732
+ on_invalid_parameter_value ('Rock thermal conductivity must be between 1.5 and 4.5 W/m/K' )
733
+
734
+ if model .reserv .gradient .value [0 ] < 0.03 or model .reserv .gradient .value [0 ] > 0.07 :
735
+ on_invalid_parameter_value (f'{ model .reserv .gradient1 .Name } must be between '
736
+ f'30 and 70 { TemperatureGradientUnit .DEGREESCPERKM .value } ' )
741
737
742
738
model .logger .info (f'complete { str (__class__ )} : { sys ._getframe ().f_code .co_name } ' )
743
739
@@ -816,6 +812,12 @@ def Calculate(self, model: Model) -> None:
816
812
"""
817
813
model .logger .info (f'Init { __class__ !s} : { sys ._getframe ().f_code .co_name } ' )
818
814
815
+ if model .reserv .Trock .value > model .reserv .Tmax .value :
816
+ s = f'{ model .reserv .Trock .Name } ({ model .reserv .Trock .value } ) exceeds ' \
817
+ f'{ model .reserv .Tmax .Name } ({ model .reserv .Tmax .value } )'
818
+ model .logger .critical (s )
819
+ raise ValueError (s )
820
+
819
821
self .Tini = model .reserv .Trock .value # initialize the temperature to be the initial temperature of the reservoir
820
822
if self .Tini > 375.0 or self .numnonverticalsections .value > 1 :
821
823
# must be a multilateral setup or too hot for CLGS, so must try to use wanju code.
0 commit comments