Skip to content

Inflation costs during construction for all econ models #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 70 additions & 32 deletions src/geophires_x/Economics.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/geophires_x/EconomicsUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def total_capex_parameter_output_parameter() -> OutputParameter:
UnitType=Units.CURRENCY,
CurrentUnits=CurrencyUnit.MDOLLARS,
PreferredUnits=CurrencyUnit.MDOLLARS,
ToolTipText="The total capital expenditure (CAPEX) required to construct the plant. "
"This value includes all direct and indirect costs, contingency, and any cost escalation from "
"inflation during construction. It is used as the total installed cost input for "
"SAM Economic Models."
ToolTipText='The total capital expenditure (CAPEX) required to construct the plant. '
'This value includes all direct and indirect costs, and contingency. '
'For SAM Economic models, it also includes any cost escalation from inflation during construction. '
'It is used as the total installed cost input for SAM Economic Models.'
)
18 changes: 16 additions & 2 deletions src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,20 @@ def PrintOutputs(self, model: Model):
acf_label = Outputs._field_label(acf.display_name, 49)
f.write(f' {acf_label}{acf.value:10.2f} {acf.CurrentUnits.value}\n')

display_inflation_costs_in_economic_parameters: bool = (
econ.econmodel.value in [EconomicModel.BICYCLE,
EconomicModel.FCR,
EconomicModel.STANDARDIZED_LEVELIZED_COST]
and
econ.inflation_cost_during_construction.value != 0.
)
if display_inflation_costs_in_economic_parameters:
# Inflation cost is displayed here for economic models that don't treat inflation cost as a
# capital cost
icc: OutputParameter = econ.inflation_cost_during_construction
icc_label = Outputs._field_label(icc.display_name, 49)
f.write(f' {icc_label}{icc.value:10.2f} {icc.CurrentUnits.value}\n')

f.write(f' Project lifetime: {model.surfaceplant.plant_lifetime.value:10.0f} {model.surfaceplant.plant_lifetime.CurrentUnits.value}\n')
f.write(f' Capacity factor: {model.surfaceplant.utilization_factor.value * 100:10.1f} %\n')

Expand Down Expand Up @@ -497,8 +511,8 @@ def PrintOutputs(self, model: Model):
# expenditure.
pass

if is_sam_econ_model:
# TODO calculate & display for other economic models
display_inflation_during_construction_in_capital_costs = is_sam_econ_model
if display_inflation_during_construction_in_capital_costs:
icc_label = Outputs._field_label(econ.inflation_cost_during_construction.display_name, 47)
f.write(f' {icc_label}{econ.inflation_cost_during_construction.value:10.2f} {econ.inflation_cost_during_construction.CurrentUnits.value}\n')

Expand Down
3 changes: 3 additions & 0 deletions src/geophires_x_client/geophires_x_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class GeophiresXResult:
'Nominal Discount Rate',
'WACC',
'Accrued financing during construction',
# Displayed for economic models that don't treat inflation costs as capital costs (non-SAM-EM)
'Inflation costs during construction',
'Project lifetime',
'Capacity factor',
'Project NPV',
Expand Down Expand Up @@ -261,6 +263,7 @@ class GeophiresXResult:
'Total surface equipment costs',
'Exploration costs',
'Investment Tax Credit',
# Displayed for economic models that treat inflation costs as capital costs (SAM-EM)
'Inflation costs during construction',
'Total Add-on CAPEX',
'Total capital costs',
Expand Down
9 changes: 7 additions & 2 deletions src/geophires_x_schema_generator/geophires-result.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"Total CAPEX": {
"type": "number",
"description": "The total capital expenditure (CAPEX) required to construct the plant. This value includes all direct and indirect costs, contingency, and any cost escalation from inflation during construction. It is used as the total installed cost input for SAM Economic Models.",
"description": "The total capital expenditure (CAPEX) required to construct the plant. This value includes all direct and indirect costs, and contingency. For SAM Economic models, it also includes any cost escalation from inflation during construction. It is used as the total installed cost input for SAM Economic Models.",
"units": "MUSD"
},
"Average Direct-Use Heat Production": {},
Expand Down Expand Up @@ -100,6 +100,11 @@
"description": "The accrued inflation on total capital costs over the construction period, as defined by Inflation Rate During Construction. For SAM Economic Models, this is calculated automatically by compounding Inflation Rate over Construction Years if Inflation Rate During Construction is not provided.",
"units": "%"
},
"Inflation costs during construction": {
"type": "number",
"description": "The calculated amount of cost escalation due to inflation over the construction period.",
"units": "MUSD"
},
"Project lifetime": {},
"Capacity factor": {},
"Project NPV": {
Expand Down Expand Up @@ -432,7 +437,7 @@
"Annualized capital costs": {},
"Total CAPEX": {
"type": "number",
"description": "The total capital expenditure (CAPEX) required to construct the plant. This value includes all direct and indirect costs, contingency, and any cost escalation from inflation during construction. It is used as the total installed cost input for SAM Economic Models.",
"description": "The total capital expenditure (CAPEX) required to construct the plant. This value includes all direct and indirect costs, and contingency. For SAM Economic models, it also includes any cost escalation from inflation during construction. It is used as the total installed cost input for SAM Economic Models.",
"units": "MUSD"
},
"Drilling Cost": {},
Expand Down
11 changes: 6 additions & 5 deletions tests/examples/Fervo_Norbeck_Latimer_2023.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.28
Simulation Date: 2025-07-02
Simulation Time: 12:19
Calculation Time: 0.481 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.475 sec

***SUMMARY OF RESULTS***

Expand All @@ -24,7 +24,8 @@ Simulation Metadata
***ECONOMIC PARAMETERS***

Economic Model = BICYCLE
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 1.41 MUSD
Project lifetime: 10 yr
Capacity factor: 90.0 %
Project NPV: -13.03 MUSD
Expand Down
11 changes: 6 additions & 5 deletions tests/examples/Fervo_Project_Cape-2.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.28
Simulation Date: 2025-07-02
Simulation Time: 12:19
Calculation Time: 0.722 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.709 sec

***SUMMARY OF RESULTS***

Expand All @@ -24,7 +24,8 @@ Simulation Metadata
***ECONOMIC PARAMETERS***

Economic Model = BICYCLE
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 2.54 MUSD
Project lifetime: 15 yr
Capacity factor: 90.0 %
Project NPV: 42.34 MUSD
Expand Down
11 changes: 6 additions & 5 deletions tests/examples/Fervo_Project_Cape-3.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.28
Simulation Date: 2025-07-02
Simulation Time: 12:19
Calculation Time: 0.956 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.951 sec

***SUMMARY OF RESULTS***

Expand All @@ -24,7 +24,8 @@ Simulation Metadata
***ECONOMIC PARAMETERS***

Economic Model = BICYCLE
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 53.65 MUSD
Project lifetime: 20 yr
Capacity factor: 90.0 %
Project NPV: 4580.36 MUSD
Expand Down
11 changes: 6 additions & 5 deletions tests/examples/Fervo_Project_Cape.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.28
Simulation Date: 2025-07-02
Simulation Time: 12:19
Calculation Time: 0.720 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.712 sec

***SUMMARY OF RESULTS***

Expand All @@ -24,7 +24,8 @@ Simulation Metadata
***ECONOMIC PARAMETERS***

Economic Model = BICYCLE
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 24.14 MUSD
Project lifetime: 15 yr
Capacity factor: 90.0 %
Project NPV: 520.01 MUSD
Expand Down
13 changes: 7 additions & 6 deletions tests/examples/example10_HP.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.7
Simulation Date: 2025-05-15
Simulation Time: 10:13
Calculation Time: 0.096 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.105 sec

***SUMMARY OF RESULTS***

Expand All @@ -26,7 +26,8 @@ Simulation Metadata

Economic Model = Standard Levelized Cost
Interest Rate: 5.00 %
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 1.39 MUSD
Project lifetime: 30 yr
Capacity factor: 90.0 %
Project NPV: 15.18 MUSD
Expand Down Expand Up @@ -64,7 +65,7 @@ Simulation Metadata
m/A Drawdown Parameter: 0.00002 1/year
Bottom-hole temperature: 109.50 degC
Reservoir volume calculated with fracture separation and number of fractures as input
Number of fractures: 12.00
Number of fractures: 12
Fracture separation: 80.00 meter
Reservoir volume: 176000000 m**3
Reservoir hydrostatic pressure: 20488.96 kPa
Expand Down
13 changes: 7 additions & 6 deletions tests/examples/example11_AC.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.7
Simulation Date: 2025-05-15
Simulation Time: 10:13
Calculation Time: 0.096 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.107 sec

***SUMMARY OF RESULTS***

Expand All @@ -27,7 +27,8 @@ Simulation Metadata

Economic Model = Standard Levelized Cost
Interest Rate: 5.00 %
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 1.32 MUSD
Project lifetime: 30 yr
Capacity factor: 90.0 %
Project NPV: 10.11 MUSD
Expand Down Expand Up @@ -65,7 +66,7 @@ Simulation Metadata
m/A Drawdown Parameter: 0.00002 1/year
Bottom-hole temperature: 109.50 degC
Reservoir volume calculated with fracture separation and number of fractures as input
Number of fractures: 12.00
Number of fractures: 12
Fracture separation: 80.00 meter
Reservoir volume: 176000000 m**3
Reservoir hydrostatic pressure: 20488.96 kPa
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example13.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.36
Simulation Date: 2025-07-25
Simulation Time: 11:30
Calculation Time: 0.037 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:44
Calculation Time: 0.036 sec

***SUMMARY OF RESULTS***

Expand All @@ -27,7 +27,7 @@ Simulation Metadata

Economic Model = Standard Levelized Cost
Interest Rate: 5.00 %
Accrued financing during construction: 0.00 %
Accrued financing during construction: 0.00 %
Project lifetime: 30 yr
Capacity factor: 80.0 %
Project NPV: -31.42 MUSD
Expand Down
13 changes: 7 additions & 6 deletions tests/examples/example3.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Simulation Metadata
----------------------
GEOPHIRES Version: 3.9.7
Simulation Date: 2025-05-15
Simulation Time: 10:12
Calculation Time: 0.113 sec
GEOPHIRES Version: 3.9.47
Simulation Date: 2025-07-31
Simulation Time: 08:57
Calculation Time: 0.124 sec

***SUMMARY OF RESULTS***

Expand All @@ -26,7 +26,8 @@ Simulation Metadata
***ECONOMIC PARAMETERS***

Economic Model = BICYCLE
Accrued financing during construction: 5.00 %
Accrued financing during construction: 5.00 %
Inflation costs during construction: 5.18 MUSD
Project lifetime: 35 yr
Capacity factor: 90.0 %
Project NPV: -2.38 MUSD
Expand Down Expand Up @@ -66,7 +67,7 @@ Simulation Metadata
m/A Drawdown Parameter: 0.00002 1/year
Bottom-hole temperature: 232.00 degC
Reservoir volume calculated with fracture separation and number of fractures as input
Number of fractures: 12.00
Number of fractures: 12
Fracture separation: 80.00 meter
Reservoir volume: 176000000 m**3
Reservoir hydrostatic pressure: 29019.48 kPa
Expand Down
19 changes: 10 additions & 9 deletions tests/test_geophires_x.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from __future__ import annotations

import math
import os
import tempfile
import uuid
from pathlib import Path
from typing import Any
from typing import Optional

from geophires_x.OptionList import PlantType
from geophires_x.OptionList import WellDrillingCostCorrelation
Expand Down Expand Up @@ -270,7 +271,7 @@ def _sanitize_nan(self, r: GeophiresXResult) -> None:
except TypeError:
pass

def _get_unequal_dicts_approximate_percent_difference(self, d1: dict, d2: dict) -> Optional[float]:
def _get_unequal_dicts_approximate_percent_difference(self, d1: dict, d2: dict) -> float | None:
for i in range(99):
try:
self.assertDictAlmostEqual(d1, d2, percent=i)
Expand Down Expand Up @@ -967,9 +968,9 @@ def test_sbt_coaxial_raises_error(self):

def test_production_well_stimulation_cost(self):
def _get_result(
prod_well_stim_MUSD: Optional[int] = None,
inj_well_stim_MUSD: Optional[int] = None,
additional_params: Optional[dict[str, Any]] = None,
prod_well_stim_MUSD: int | None = None,
inj_well_stim_MUSD: int | None = None,
additional_params: dict[str, Any] | None = None,
) -> GeophiresXResult:
if additional_params is None:
additional_params = {}
Expand Down Expand Up @@ -1030,9 +1031,9 @@ def _get_result(

def test_indirect_costs(self):
def _get_result(
indirect_cost_percent: Optional[int] = None,
stimulation_indirect_cost_percent: Optional[int] = None,
wellfield_indirect_cost_percent: Optional[int] = None,
indirect_cost_percent: int | None = None,
stimulation_indirect_cost_percent: int | None = None,
wellfield_indirect_cost_percent: int | None = None,
input_file_path: str = 'geophires_x_tests/generic-egs-case.txt',
) -> float:
p = {}
Expand Down Expand Up @@ -1130,7 +1131,7 @@ def wellfield_cost(result_cap_costs):

def test_contingency(self):
def _get_result(
contingency_percentage: Optional[int] = None,
contingency_percentage: int | None = None,
input_file_path: str = 'geophires_x_tests/generic-egs-case.txt',
) -> float:
p = {}
Expand Down
Loading