|
3 | 3 | import tempfile
|
4 | 4 | import uuid
|
5 | 5 | from pathlib import Path
|
| 6 | +from typing import Any |
6 | 7 | from typing import Optional
|
7 | 8 |
|
8 | 9 | from geophires_x.OptionList import PlantType
|
@@ -965,38 +966,68 @@ def test_sbt_coaxial_raises_error(self):
|
965 | 966 | self.assertIn('SBT with coaxial configuration is not implemented', str(e.exception))
|
966 | 967 |
|
967 | 968 | 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 | + |
969 | 977 | p = {}
|
970 | 978 | if prod_well_stim_MUSD is not None:
|
971 | 979 | 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 |
972 | 982 |
|
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}, |
978 | 986 | )
|
| 987 | + return GeophiresXClient().get_geophires_result(input_params) |
979 | 988 |
|
980 | 989 | result_no_prod_stim: GeophiresXResult = _get_result()
|
981 | 990 |
|
982 | 991 | result_prod_stim: GeophiresXResult = _get_result(1.25)
|
983 | 992 |
|
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 |
986 | 995 |
|
987 | 996 | self.assertAlmostEqual(
|
988 | 997 | (
|
989 | 998 | 2
|
990 | 999 | * (
|
991 | 1000 | result_no_prod_stim.result['CAPITAL COSTS (M$)']['Stimulation costs']['value']
|
992 |
| - / (indirect_and_contingency) |
| 1001 | + / indirect_and_contingency |
993 | 1002 | )
|
994 | 1003 | )
|
995 | 1004 | * indirect_and_contingency,
|
996 | 1005 | result_prod_stim.result['CAPITAL COSTS (M$)']['Stimulation costs']['value'],
|
997 | 1006 | places=1,
|
998 | 1007 | )
|
999 | 1008 |
|
| 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 | + |
1000 | 1031 | def test_indirect_costs(self):
|
1001 | 1032 | def _get_result(
|
1002 | 1033 | indirect_cost_percent: Optional[int] = None,
|
|
0 commit comments