Skip to content

Commit 3897230

Browse files
add test_stimulation_cost_per_fracture_surface_area_injection_only, test_stimulation_cost_mutually_exclusive_validation, test_stimulation_cost_invalid_negative_production_cost
1 parent 8baab1d commit 3897230

2 files changed

Lines changed: 45 additions & 2 deletions

File tree

tests/geophires_x_tests/generic-egs-case-5_no-stim-costs-specified.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ Maximum Drawdown, 0.0025
117117
Maximum Temperature, 500
118118
Time steps per year, 12
119119

120-
Project Latitude, 38.506196
121-
Project Longitude, -112.918155
120+
Gringarten-Stehfest Precision, 8

tests/geophires_x_tests/test_economics.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,50 @@ def _get_result() -> GeophiresXResult:
156156

157157
self.assertAlmostEqual(4.83, cap_costs['Stimulation costs per well']['value'], delta=0)
158158

159+
def test_stimulation_cost_per_fracture_surface_area_injection_only(self):
160+
r: GeophiresXResult = GeophiresXClient().get_geophires_result(
161+
ImmutableGeophiresInputParameters(
162+
from_file_path=self._get_test_file_path('generic-egs-case-5_no-stim-costs-specified.txt'),
163+
params={
164+
'Reservoir Stimulation Capital Cost per Fracture Surface Area': 0.87431693989,
165+
'Print Output to Console': True,
166+
},
167+
)
168+
)
169+
170+
cap_costs = r.result['CAPITAL COSTS (M$)']
171+
172+
# Total cost should remain identical, but injection wells absorb 100% of the cost.
173+
self.assertAlmostEqual(184, cap_costs['Stimulation costs']['value'], places=0)
174+
self.assertIsNone(cap_costs['Stimulation costs per well'])
175+
176+
def test_stimulation_cost_mutually_exclusive_validation(self):
177+
with self.assertRaises(RuntimeError) as context:
178+
GeophiresXClient().get_geophires_result(
179+
ImmutableGeophiresInputParameters(
180+
from_file_path=self._get_test_file_path('generic-egs-case-5_no-stim-costs-specified.txt'),
181+
params={
182+
'Reservoir Stimulation Capital Cost per Fracture Surface Area': 0.87431693989,
183+
'Reservoir Stimulation Capital Cost per Injection Well': 5,
184+
},
185+
)
186+
)
187+
self.assertIn('Cannot provide both', str(context.exception))
188+
189+
def test_stimulation_cost_invalid_negative_production_cost(self):
190+
with self.assertRaises(RuntimeError) as context:
191+
GeophiresXClient().get_geophires_result(
192+
ImmutableGeophiresInputParameters(
193+
from_file_path=self._get_test_file_path('generic-egs-case-5_no-stim-costs-specified.txt'),
194+
params={
195+
'Reservoir Stimulation Capital Cost per Production Well': -5,
196+
},
197+
)
198+
)
199+
self.assertIn(
200+
' Reservoir Stimulation Capital Cost per Production Well outside of valid range', str(context.exception)
201+
)
202+
159203
# noinspection PyMethodMayBeStatic
160204
def _new_model(
161205
self, input_file: Path | None = None, additional_params: dict[str, Any] | None = None, read_and_calculate=False

0 commit comments

Comments
 (0)