Skip to content

Commit 6f50d1b

Browse files
test_indirect_costs
1 parent 698d913 commit 6f50d1b

File tree

1 file changed

+81
-9
lines changed

1 file changed

+81
-9
lines changed

tests/test_geophires_x.py

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -993,30 +993,102 @@ def _get_result(prod_well_stim_MUSD: Optional[int] = None) -> GeophiresXResult:
993993
places=1,
994994
)
995995

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:
9981003
p = {}
1004+
9991005
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
10011013

10021014
return (
10031015
GeophiresXClient()
10041016
.get_geophires_result(
10051017
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),
10071019
params=p,
10081020
)
10091021
)
1010-
.result['CAPITAL COSTS (M$)']['Stimulation costs']['value']
1022+
.result['CAPITAL COSTS (M$)']
10111023
)
10121024

10131025
result_default_indirect_cost: GeophiresXResult = _get_result()
10141026

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+
)
10171053

10181054
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)),
10211057
places=1,
10221058
)
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

Comments
 (0)