Skip to content

Commit 2a9af95

Browse files
Additional case in test_production_well_stimulation_cost
1 parent 6cd7180 commit 2a9af95

File tree

1 file changed

+40
-9
lines changed

1 file changed

+40
-9
lines changed

tests/test_geophires_x.py

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import tempfile
44
import uuid
55
from pathlib import Path
6+
from typing import Any
67
from typing import Optional
78

89
from geophires_x.OptionList import PlantType
@@ -965,38 +966,68 @@ def test_sbt_coaxial_raises_error(self):
965966
self.assertIn('SBT with coaxial configuration is not implemented', str(e.exception))
966967

967968
def test_production_well_stimulation_cost(self):
968-
def _get_result(prod_well_stim_MUSD: Optional[int] = None) -> GeophiresXResult:
969+
def _get_result(
970+
prod_well_stim_MUSD: Optional[int] = None,
971+
inj_well_stim_MUSD: Optional[int] = None,
972+
additional_params: Optional[dict[str, Any]] = None,
973+
) -> GeophiresXResult:
974+
if additional_params is None:
975+
additional_params = {}
976+
969977
p = {}
970978
if prod_well_stim_MUSD is not None:
971979
p['Reservoir Stimulation Capital Cost per Production Well'] = prod_well_stim_MUSD
980+
if inj_well_stim_MUSD is not None:
981+
p['Reservoir Stimulation Capital Cost per Injection Well'] = inj_well_stim_MUSD
972982

973-
return GeophiresXClient().get_geophires_result(
974-
ImmutableGeophiresInputParameters(
975-
from_file_path=self._get_test_file_path('geophires_x_tests/generic-egs-case.txt'),
976-
params=p,
977-
)
983+
input_params: ImmutableGeophiresInputParameters = ImmutableGeophiresInputParameters(
984+
from_file_path=self._get_test_file_path('geophires_x_tests/generic-egs-case.txt'),
985+
params={**p, **additional_params},
978986
)
987+
return GeophiresXClient().get_geophires_result(input_params)
979988

980989
result_no_prod_stim: GeophiresXResult = _get_result()
981990

982991
result_prod_stim: GeophiresXResult = _get_result(1.25)
983992

984-
# TODO https://github.com/NREL/GEOPHIRES-X/issues/383?title=Parameterize+indirect+cost+factor
985-
indirect_and_contingency = 1.05 * 1.15
993+
default_contingency_factor = 1.15
994+
indirect_and_contingency = 1.05 * default_contingency_factor # default indirect cost factor and contingency
986995

987996
self.assertAlmostEqual(
988997
(
989998
2
990999
* (
9911000
result_no_prod_stim.result['CAPITAL COSTS (M$)']['Stimulation costs']['value']
992-
/ (indirect_and_contingency)
1001+
/ indirect_and_contingency
9931002
)
9941003
)
9951004
* indirect_and_contingency,
9961005
result_prod_stim.result['CAPITAL COSTS (M$)']['Stimulation costs']['value'],
9971006
places=1,
9981007
)
9991008

1009+
doublets = 59
1010+
# fmt:off
1011+
result_4M_per_well: GeophiresXResult = _get_result(
1012+
4,
1013+
4,
1014+
{
1015+
'Reservoir Stimulation Indirect Capital Cost Percentage': 0,
1016+
'Number of Production Wells': doublets,
1017+
'Number of Injection Wells': doublets,
1018+
1019+
# offset contingency
1020+
'Reservoir Stimulation Capital Cost Adjustment Factor': 1/default_contingency_factor,
1021+
}
1022+
)
1023+
# fmt:on
1024+
1025+
self.assertAlmostEqual(
1026+
(4 * doublets * 2),
1027+
result_4M_per_well.result['CAPITAL COSTS (M$)']['Stimulation costs']['value'],
1028+
places=1,
1029+
)
1030+
10001031
def test_indirect_costs(self):
10011032
def _get_result(
10021033
indirect_cost_percent: Optional[int] = None,

0 commit comments

Comments
 (0)