@@ -993,30 +993,102 @@ def _get_result(prod_well_stim_MUSD: Optional[int] = None) -> GeophiresXResult:
993
993
places = 1 ,
994
994
)
995
995
996
- def test_stimulation_indirect_cost (self ):
997
- def _get_result (indirect_cost_percent : Optional [int ] = None ) -> float :
996
+ def test_indirect_costs (self ):
997
+ def _get_result (
998
+ indirect_cost_percent : Optional [int ] = None ,
999
+ stimulation_indirect_cost_percent : Optional [int ] = None ,
1000
+ wellfield_indirect_cost_percent : Optional [int ] = None ,
1001
+ input_file_path : str = 'geophires_x_tests/generic-egs-case.txt' ,
1002
+ ) -> float :
998
1003
p = {}
1004
+
999
1005
if indirect_cost_percent is not None :
1000
- p ['Reservoir Stimulation Indirect Capital Cost Percentage' ] = indirect_cost_percent
1006
+ p ['Indirect Capital Cost Percentage' ] = indirect_cost_percent
1007
+
1008
+ if stimulation_indirect_cost_percent is not None :
1009
+ p ['Reservoir Stimulation Indirect Capital Cost Percentage' ] = stimulation_indirect_cost_percent
1010
+
1011
+ if wellfield_indirect_cost_percent is not None :
1012
+ p ['Well Drilling and Completion Indirect Capital Cost Percentage' ] = wellfield_indirect_cost_percent
1001
1013
1002
1014
return (
1003
1015
GeophiresXClient ()
1004
1016
.get_geophires_result (
1005
1017
ImmutableGeophiresInputParameters (
1006
- from_file_path = self ._get_test_file_path ('geophires_x_tests/generic-egs-case.txt' ),
1018
+ from_file_path = self ._get_test_file_path (input_file_path ),
1007
1019
params = p ,
1008
1020
)
1009
1021
)
1010
- .result ['CAPITAL COSTS (M$)' ][ 'Stimulation costs' ][ 'value' ]
1022
+ .result ['CAPITAL COSTS (M$)' ]
1011
1023
)
1012
1024
1013
1025
result_default_indirect_cost : GeophiresXResult = _get_result ()
1014
1026
1015
- higher_indirect = 12
1016
- result_higher_indirect_cost : GeophiresXResult = _get_result (higher_indirect )
1027
+ def capex (result_cap_costs ):
1028
+ if result_cap_costs .get ('Total CAPEX' ) is not None :
1029
+ return result_cap_costs ['Total CAPEX' ]['value' ]
1030
+
1031
+ return result_cap_costs ['Total capital costs' ]['value' ]
1032
+
1033
+ lower_indirect = 10
1034
+ result_lower_indirect_cost : GeophiresXResult = _get_result (indirect_cost_percent = lower_indirect )
1035
+ self .assertGreater (
1036
+ capex (result_default_indirect_cost ),
1037
+ capex (result_lower_indirect_cost ),
1038
+ )
1039
+
1040
+ def stim_cost (result_cap_costs ):
1041
+ return result_cap_costs ['Stimulation costs' ]['value' ]
1042
+
1043
+ higher_stim_indirect = 12
1044
+ result_higher_stim_indirect_cost : GeophiresXResult = _get_result (
1045
+ stimulation_indirect_cost_percent = higher_stim_indirect
1046
+ )
1047
+
1048
+ self .assertAlmostEqual (
1049
+ stim_cost (result_default_indirect_cost ) / 1.05 ,
1050
+ stim_cost (result_higher_stim_indirect_cost ) / (1 + (higher_stim_indirect / 100 )),
1051
+ places = 1 ,
1052
+ )
1017
1053
1018
1054
self .assertAlmostEqual (
1019
- result_default_indirect_cost / 1.05 ,
1020
- result_higher_indirect_cost / (1 + (higher_indirect / 100 )),
1055
+ stim_cost ( result_default_indirect_cost ) / 1.05 ,
1056
+ stim_cost ( result_higher_stim_indirect_cost ) / (1 + (higher_stim_indirect / 100 )),
1021
1057
places = 1 ,
1022
1058
)
1059
+
1060
+ def wellfield_cost (result_cap_costs ):
1061
+ return result_cap_costs ['Drilling and completion costs' ]['value' ]
1062
+
1063
+ result_default_indirect_cost_2 : GeophiresXResult = _get_result (
1064
+ input_file_path = 'examples/Fervo_Project_Cape-4.txt'
1065
+ )
1066
+
1067
+ higher_wellfield_indirect = 15
1068
+ result_higher_wellfield_indirect_cost : GeophiresXResult = _get_result (
1069
+ wellfield_indirect_cost_percent = higher_wellfield_indirect ,
1070
+ input_file_path = 'examples/Fervo_Project_Cape-4.txt' ,
1071
+ )
1072
+ self .assertGreater (
1073
+ wellfield_cost (result_higher_wellfield_indirect_cost ), wellfield_cost (result_default_indirect_cost_2 )
1074
+ )
1075
+
1076
+ self .assertGreater (capex (result_higher_wellfield_indirect_cost ), capex (result_default_indirect_cost_2 ))
1077
+
1078
+ self .assertEqual (stim_cost (result_higher_wellfield_indirect_cost ), stim_cost (result_default_indirect_cost_2 ))
1079
+
1080
+ result_higher_wellfield_lower_default : GeophiresXResult = _get_result (
1081
+ indirect_cost_percent = lower_indirect ,
1082
+ wellfield_indirect_cost_percent = higher_wellfield_indirect ,
1083
+ input_file_path = 'examples/Fervo_Project_Cape-4.txt' ,
1084
+ )
1085
+
1086
+ self .assertEqual (
1087
+ wellfield_cost (result_higher_wellfield_indirect_cost ), wellfield_cost (result_higher_wellfield_lower_default )
1088
+ )
1089
+ self .assertLess (
1090
+ capex (result_higher_wellfield_lower_default ),
1091
+ capex (result_higher_wellfield_indirect_cost ),
1092
+ # Note this is not necessarily true for all cases, but generally would be expected,
1093
+ # and is true for Fervo_Project_Cape-4 specifically.
1094
+ )
0 commit comments