Skip to content

Commit eb9899b

Browse files
WIP - adjust econ capex/opex with add ons for SAM-EM
1 parent 071744d commit eb9899b

File tree

3 files changed

+89
-4
lines changed

3 files changed

+89
-4
lines changed

src/geophires_x/EconomicsAddOns.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy_financial as npf
66
import geophires_x.Economics as Economics
77
import geophires_x.Model as Model
8-
from geophires_x.OptionList import EndUseOptions
8+
from geophires_x.OptionList import EndUseOptions, EconomicModel
99
from geophires_x.Parameter import listParameter, OutputParameter
1010
from geophires_x.Units import *
1111

@@ -271,7 +271,9 @@ def Calculate(self, model: Model) -> None:
271271
:type model: :class:`~geophires_x.Model.Model`
272272
:return: Nothing, but it does make calculations and set values in the model
273273
"""
274-
model.logger.info("Init " + str(__class__) + ": " + sys._getframe().f_code.co_name)
274+
model.logger.info(f"Init {str(__class__)}: {sys._getframe().f_code.co_name}")
275+
276+
is_sam_em = model.economics.econmodel.value == EconomicModel.SAM_SINGLE_OWNER_PPA
275277

276278
# sum all the AddOn values together, so we can treat all AddOns together. If an AddOn slot is not used,
277279
# it has zeros for the values, so this won't create problems
@@ -302,6 +304,12 @@ def Calculate(self, model: Model) -> None:
302304
# Calculate the adjusted OPEX and CAPEX
303305
self.AdjustedProjectCAPEX.value = model.economics.CCap.value + self.AddOnCAPEXTotal.value
304306
self.AdjustedProjectOPEX.value = model.economics.Coam.value + self.AddOnOPEXTotalPerYear.value
307+
308+
if is_sam_em:
309+
model.economics.CCap.value = self.AdjustedProjectCAPEX.value
310+
model.economics.Coam.value = self.AdjustedProjectOPEX.value
311+
# FIXME WIP
312+
305313
AddOnCapCostPerYear = self.AddOnCAPEXTotal.value / model.surfaceplant.construction_years.value
306314
ProjectCapCostPerYear = self.AdjustedProjectCAPEX.value / model.surfaceplant.construction_years.value
307315

@@ -386,8 +394,9 @@ def Calculate(self, model: Model) -> None:
386394
self.AdjustedProjectCAPEX.value + (
387395
self.AdjustedProjectOPEX.value * model.surfaceplant.plant_lifetime.value))
388396

389-
# recalculate LCOE/LCOH
390-
self.LCOE.value, self.LCOH.value, LCOC = Economics.CalculateLCOELCOHLCOC(self, model)
397+
if not is_sam_em:
398+
# recalculate LCOE/LCOH
399+
self.LCOE.value, self.LCOH.value, LCOC = Economics.CalculateLCOELCOHLCOC(self, model)
391400

392401
self._calculate_derived_outputs(model)
393402
model.logger.info(f'complete {str(__class__)}: {sys._getframe().f_code.co_name}')
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Reservoir Model, 1
2+
Reservoir Volume Option, 1
3+
Reservoir Density, 2800
4+
Reservoir Heat Capacity, 790
5+
Reservoir Thermal Conductivity, 3.05
6+
Reservoir Porosity, 0.0118
7+
Reservoir Impedance, 0.001
8+
9+
Number of Fractures, 149
10+
Fracture Shape, 4
11+
Fracture Height, 2000
12+
Fracture Width, 10000
13+
Fracture Separation, 30
14+
15+
Number of Segments, 1
16+
17+
Production Well Diameter, 7
18+
Injection Well Diameter, 7
19+
Well Separation, 365 feet
20+
Injection Temperature, 60 degC
21+
Injection Wellbore Temperature Gain, 3
22+
Plant Outlet Pressure, 1000 psi
23+
Ramey Production Wellbore Model, 1
24+
Utilization Factor, .9
25+
Water Loss Fraction, 0.05
26+
Maximum Drawdown, 1
27+
Ambient Temperature, 10 degC
28+
#Surface Temperature, 10 degC
29+
End-Use Option, 1
30+
31+
Plant Lifetime, 25
32+
33+
Circulation Pump Efficiency, 0.80
34+
35+
Economic Model, 5
36+
Starting Electricity Sale Price, 0.15
37+
Ending Electricity Sale Price, 1.00
38+
Electricity Escalation Rate Per Year, 0.004053223
39+
Electricity Escalation Start Year, 1
40+
Fraction of Investment in Bonds, .5
41+
Combined Income Tax Rate, .3
42+
Inflated Bond Interest Rate, .05
43+
Inflation Rate, .02
44+
Investment Tax Credit Rate, .3, -- https://programs.dsireusa.org/system/program/detail/658
45+
Production Tax Credit Electricity, 0.0275, -- https://programs.dsireusa.org/system/program/detail/734
46+
Property Tax Rate, 0
47+
Time steps per year, 10
48+
Maximum Temperature, 500
49+
50+
51+
Print Output to Console, 0
52+
Surface Temperature, 12
53+
Reservoir Depth, 5.4
54+
Gradient 1, 36.7
55+
Power Plant Type, 4
56+
57+
Number of Injection Wells, 54
58+
Number of Production Wells, 54
59+
Production Flow Rate per Well, 80
60+
61+
62+
# AddOns
63+
Do AddOn Calculations, True
64+
AddOn Nickname 1, Desalinization
65+
AddOn CAPEX 1, 10
66+
AddOn OPEX 1, 10
67+
AddOn Electricity Gained 1, -100
68+
AddOn Heat Gained 1, 0.0
69+
AddOn Profit Gained 1, 0.05

tests/geophires_x_tests/test_economics_sam.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,13 @@ def _accrued_financing(_r: GeophiresXResult) -> float:
572572
# )
573573
# self.assertEqual(15.0, _accrued_financing(r4))
574574

575+
def test_add_ons(self):
576+
add_ons_result = self._get_result({}, file_path=self._get_test_file_path('egs-sam-em-add-ons.txt'))
577+
self.assertIsNotNone(add_ons_result)
578+
579+
with open(add_ons_result.output_file_path, encoding='utf-8') as f:
580+
print(f.read())
581+
575582
@staticmethod
576583
def _new_model(input_file: Path, additional_params: dict[str, Any] | None = None, read_and_calculate=True) -> Model:
577584
if additional_params is not None:

0 commit comments

Comments
 (0)