|
2 | 2 | import sys |
3 | 3 | import numpy as np |
4 | 4 | import numpy_financial as npf |
| 5 | +from pint.facets.plain import PlainQuantity |
| 6 | + |
5 | 7 | import geophires_x.Model as Model |
6 | 8 | from geophires_x import EconomicsSam |
7 | 9 | from geophires_x.EconomicsSam import calculate_sam_economics, SamEconomicsCalculations |
8 | 10 | from geophires_x.EconomicsUtils import BuildPricingModel, wacc_output_parameter, nominal_discount_rate_parameter, \ |
9 | 11 | real_discount_rate_parameter, after_tax_irr_parameter, moic_parameter, project_vir_parameter, \ |
10 | 12 | project_payback_period_parameter |
| 13 | +from geophires_x.GeoPHIRESUtils import quantity |
11 | 14 | from geophires_x.OptionList import Configuration, WellDrillingCostCorrelation, EconomicModel, EndUseOptions, PlantType, \ |
12 | 15 | _WellDrillingCostCorrelationCitation |
13 | 16 | from geophires_x.Parameter import intParameter, floatParameter, OutputParameter, ReadParameter, boolParameter, \ |
@@ -583,7 +586,7 @@ def __init__(self, model: Model): |
583 | 586 | CurrentUnits=CurrencyUnit.MDOLLARS, |
584 | 587 | Provided=False, |
585 | 588 | Valid=False, |
586 | | - ToolTipText="Total reservoir stimulation capital cost" |
| 589 | + ToolTipText="Total reservoir stimulation capital cost, including contingency and indirect costs." |
587 | 590 | ) |
588 | 591 |
|
589 | 592 | max_stimulation_cost_per_well_MUSD = 100 |
@@ -2390,26 +2393,7 @@ def Calculate(self, model: Model) -> None: |
2390 | 2393 | (self.cost_one_injection_well.value * model.wellbores.ninj.value) + |
2391 | 2394 | self.cost_lateral_section.value) |
2392 | 2395 |
|
2393 | | - # reservoir stimulation costs (M$/injection well). These are calculated whether totalcapcost.Valid = 1 |
2394 | | - if self.ccstimfixed.Valid: |
2395 | | - self.Cstim.value = self.ccstimfixed.value |
2396 | | - else: |
2397 | | - stim_cost_per_injection_well = self.stimulation_cost_per_injection_well.quantity().to( |
2398 | | - self.Cstim.CurrentUnits).magnitude |
2399 | | - stim_cost_per_production_well = self.stimulation_cost_per_production_well.quantity().to( |
2400 | | - self.Cstim.CurrentUnits).magnitude |
2401 | | - |
2402 | | - stimulation_indirect_cost_fraction = (self.stimulation_indirect_capital_cost.quantity() |
2403 | | - .to('dimensionless').magnitude) |
2404 | | - self.Cstim.value = ( |
2405 | | - ( |
2406 | | - stim_cost_per_injection_well * model.wellbores.ninj.value |
2407 | | - + stim_cost_per_production_well * model.wellbores.nprod.value |
2408 | | - ) |
2409 | | - * self.ccstimadjfactor.value |
2410 | | - * (1 + stimulation_indirect_cost_fraction) |
2411 | | - * 1.15 # 15% contingency TODO https://github.com/NREL/GEOPHIRES-X/issues/383 |
2412 | | - ) |
| 2396 | + self.Cstim.value = self.calculate_stimulation_costs(model).to(self.Cstim.CurrentUnits).magnitude |
2413 | 2397 |
|
2414 | 2398 | # field gathering system costs (M$) |
2415 | 2399 | if self.ccgathfixed.Valid: |
@@ -2714,7 +2698,30 @@ def Calculate(self, model: Model) -> None: |
2714 | 2698 | self._calculate_derived_outputs(model) |
2715 | 2699 | model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}') |
2716 | 2700 |
|
2717 | | - def calculate_plant_costs(self, model:Model) -> None: |
| 2701 | + def calculate_stimulation_costs(self, model: Model) -> PlainQuantity: |
| 2702 | + if self.ccstimfixed.Valid: |
| 2703 | + stimulation_costs = self.ccstimfixed.quantity().to(self.Cstim.CurrentUnits).magnitude |
| 2704 | + else: |
| 2705 | + stim_cost_per_injection_well = self.stimulation_cost_per_injection_well.quantity().to( |
| 2706 | + self.Cstim.CurrentUnits).magnitude |
| 2707 | + stim_cost_per_production_well = self.stimulation_cost_per_production_well.quantity().to( |
| 2708 | + self.Cstim.CurrentUnits).magnitude |
| 2709 | + |
| 2710 | + stimulation_indirect_cost_fraction = (self.stimulation_indirect_capital_cost.quantity() |
| 2711 | + .to('dimensionless').magnitude) |
| 2712 | + stimulation_costs = ( |
| 2713 | + ( |
| 2714 | + stim_cost_per_injection_well * model.wellbores.ninj.value |
| 2715 | + + stim_cost_per_production_well * model.wellbores.nprod.value |
| 2716 | + ) |
| 2717 | + * self.ccstimadjfactor.value |
| 2718 | + * (1 + stimulation_indirect_cost_fraction) |
| 2719 | + * 1.15 # 15% contingency TODO https://github.com/NREL/GEOPHIRES-X/issues/383 |
| 2720 | + ) |
| 2721 | + |
| 2722 | + return quantity(stimulation_costs, self.Cstim.CurrentUnits) |
| 2723 | + |
| 2724 | + def calculate_plant_costs(self, model: Model) -> None: |
2718 | 2725 | # plant costs |
2719 | 2726 | if (model.surfaceplant.enduse_option.value == EndUseOptions.HEAT |
2720 | 2727 | and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER, PlantType.HEAT_PUMP, PlantType.DISTRICT_HEATING]): # direct-use |
|
0 commit comments