Skip to content

Commit 0e6fd72

Browse files
Merge pull request NREL#403 from softwareengineerprogrammer/main
Increase max exploration cost, redundant class cleanup [v3.9.36]
2 parents a07202c + 710cdd7 commit 0e6fd72

File tree

11 files changed

+44
-565
lines changed

11 files changed

+44
-565
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.9.35
2+
current_version = 3.9.36
33
commit = True
44
tag = True
55

.cookiecutterrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ default_context:
5454
sphinx_doctest: "no"
5555
sphinx_theme: "sphinx-py3doc-enhanced-theme"
5656
test_matrix_separate_coverage: "no"
57-
version: 3.9.35
57+
version: 3.9.36
5858
version_manager: "bump2version"
5959
website: "https://github.com/NREL"
6060
year_from: "2023"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ Free software: `MIT license <LICENSE>`__
5858
:alt: Supported implementations
5959
:target: https://pypi.org/project/geophires-x
6060

61-
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.35.svg
61+
.. |commits-since| image:: https://img.shields.io/github/commits-since/softwareengineerprogrammer/GEOPHIRES-X/v3.9.36.svg
6262
:alt: Commits since latest release
63-
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.35...main
63+
:target: https://github.com/softwareengineerprogrammer/GEOPHIRES-X/compare/v3.9.36...main
6464

6565
.. |docs| image:: https://readthedocs.org/projects/GEOPHIRES-X/badge/?style=flat
6666
:target: https://nrel.github.io/GEOPHIRES-X

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
year = '2025'
1919
author = 'NREL'
2020
copyright = f'{year}, {author}'
21-
version = release = '3.9.35'
21+
version = release = '3.9.36'
2222

2323
pygments_style = 'trac'
2424
templates_path = ['./templates']

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def read(*names, **kwargs):
1313

1414
setup(
1515
name='geophires-x',
16-
version='3.9.35',
16+
version='3.9.36',
1717
license='MIT',
1818
description='GEOPHIRES is a free and open-source geothermal techno-economic simulator.',
1919
long_description='{}\n{}'.format(

src/geophires_x/Economics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ def __init__(self, model: Model):
650650
"Exploration Capital Cost",
651651
DefaultValue=-1.0,
652652
Min=0,
653-
Max=100,
653+
Max=1000,
654654
UnitType=Units.CURRENCY,
655655
PreferredUnits=CurrencyUnit.MDOLLARS,
656656
CurrentUnits=CurrencyUnit.MDOLLARS,

src/geophires_x/SBTEconomics.py

Lines changed: 2 additions & 327 deletions
Large diffs are not rendered by default.

src/geophires_x/SUTRAEconomics.py

Lines changed: 7 additions & 225 deletions
Original file line numberDiff line numberDiff line change
@@ -14,194 +14,9 @@ class SUTRAEconomics(Economics.Economics):
1414
"""
1515

1616
def __init__(self, model: Model):
17-
"""
18-
The __init__ function is called automatically when a class is instantiated.
19-
It initializes the attributes of an object, and sets default values for certain arguments that can be overridden
20-
by user input.
21-
The __init__ function is used to set up all the parameters in Economics.
22-
:param model: The container class of the application, giving access to everything else, including the logger
23-
:type model: :class:`~geophires_x.Model.Model`
24-
:return: None
25-
"""
2617
model.logger.info(f'Init {str(__class__)}: {sys._getframe().f_code.co_name}')
2718
super().__init__(model)
2819

29-
# Set up all the Parameters that will be predefined by this class using the different types of parameter classes.
30-
# Setting up includes giving it a name, a default value, The Unit Type (length, volume, temperature, etc.) and
31-
# Unit Name of that value, sets it as required (or not), sets allowable range, the error message if that range
32-
# is exceeded, the ToolTip Text, and the name of teh class that created it.
33-
# This includes setting up temporary variables that will be available to all the class but noy read in by user,
34-
# or used for Output
35-
# This also includes all Parameters that are calculated and then published using the Printouts function.
36-
# If you choose to subclass this master class, you can do so before or after you create your own parameters.
37-
# If you do, you can also choose to call this method from you class, which will effectively add and set all
38-
# these parameters to your class.
39-
40-
# These dictionaries contain a list of all the parameters set in this object, stored as "Parameter" and
41-
# "OutputParameter" Objects. This will allow us later to access them in a user interface and get that list,
42-
# along with unit type, preferred units, etc.
43-
self.ParameterDict = {}
44-
self.OutputParameterDict = {}
45-
46-
# Note: setting Valid to False for any of the cost parameters forces GEOPHIRES to use it's builtin cost engine.
47-
# This is the default.
48-
self.econmodel = self.ParameterDict[self.econmodel.Name] = intParameter(
49-
"Economic Model",
50-
value=EconomicModel.STANDARDIZED_LEVELIZED_COST,
51-
DefaultValue=EconomicModel.STANDARDIZED_LEVELIZED_COST,
52-
ValuesEnum=EconomicModel,
53-
AllowableRange=[1, 2, 3],
54-
Required=True,
55-
ErrMessage="assume default economic model (2)",
56-
ToolTipText="Specify the economic model to calculate the levelized cost of energy. " +
57-
'; '.join([f'{it.int_value}: {it.value}' for it in EconomicModel])
58-
)
59-
60-
self.ccwellfixed = self.ParameterDict[self.ccwellfixed.Name] = floatParameter(
61-
"Well Drilling and Completion Capital Cost",
62-
value=-1.0,
63-
DefaultValue=-1.0,
64-
Min=0,
65-
Max=200,
66-
UnitType=Units.CURRENCY,
67-
PreferredUnits=CurrencyUnit.MDOLLARS,
68-
CurrentUnits=CurrencyUnit.MDOLLARS,
69-
Provided=False,
70-
Valid=False,
71-
ToolTipText="Well Drilling and Completion Capital Cost",
72-
)
73-
self.ccwelladjfactor = self.ParameterDict[self.ccwelladjfactor.Name] = floatParameter(
74-
"Well Drilling and Completion Capital Cost Adjustment Factor",
75-
value=1.0,
76-
DefaultValue=1.0,
77-
Min=0,
78-
Max=10,
79-
UnitType=Units.PERCENT,
80-
PreferredUnits=PercentUnit.TENTH,
81-
CurrentUnits=PercentUnit.TENTH,
82-
Provided=False,
83-
Valid=True,
84-
ToolTipText="Well Drilling and Completion Capital Cost Adjustment Factor",
85-
)
86-
87-
self.ccplantfixed = self.ParameterDict[self.ccplantfixed.Name] = floatParameter(
88-
"Surface Plant Capital Cost",
89-
value=-1.0,
90-
DefaultValue=-1.0,
91-
Min=0,
92-
Max=1000,
93-
UnitType=Units.CURRENCY,
94-
PreferredUnits=CurrencyUnit.MDOLLARS,
95-
CurrentUnits=CurrencyUnit.MDOLLARS,
96-
Provided=False,
97-
Valid=False,
98-
ToolTipText="Total surface plant capital cost",
99-
)
100-
self.ccplantadjfactor = self.ParameterDict[self.ccplantadjfactor.Name] = floatParameter(
101-
"Surface Plant Capital Cost Adjustment Factor",
102-
value=1.0,
103-
DefaultValue=1.0,
104-
Min=0,
105-
Max=10,
106-
UnitType=Units.PERCENT,
107-
PreferredUnits=PercentUnit.TENTH,
108-
CurrentUnits=PercentUnit.TENTH,
109-
Provided=False,
110-
Valid=True,
111-
ToolTipText="Multiplier for built-in surface plant capital cost correlation",
112-
)
113-
114-
self.inflrateconstruction = self.ParameterDict[self.inflrateconstruction.Name] = floatParameter(
115-
"Inflation Rate During Construction",
116-
value=0.0,
117-
DefaultValue=0.0,
118-
Min=0.0,
119-
Max=1.0,
120-
UnitType=Units.PERCENT,
121-
PreferredUnits=PercentUnit.PERCENT,
122-
CurrentUnits=PercentUnit.TENTH,
123-
ErrMessage="assume default inflation rate during construction (0)",
124-
)
125-
self.wellcorrelation = self.ParameterDict[self.wellcorrelation.Name] = intParameter(
126-
"Well Drilling Cost Correlation",
127-
DefaultValue=WellDrillingCostCorrelation.VERTICAL_LARGE_INT1.int_value,
128-
AllowableRange=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
129-
ValuesEnum=WellDrillingCostCorrelation,
130-
UnitType=Units.NONE,
131-
ErrMessage="assume default well drilling cost correlation (10)",
132-
ToolTipText="Select the built-in well drilling and completion cost correlation: " +
133-
'; '.join([f'{it.int_value}: {it.value}' for it in WellDrillingCostCorrelation])
134-
)
135-
136-
self.timestepsperyear = self.ParameterDict[self.timestepsperyear.Name] = intParameter(
137-
"Time steps per year",
138-
value=4,
139-
DefaultValue=4,
140-
AllowableRange=list(range(1, 101, 1)),
141-
UnitType=Units.NONE,
142-
Required=True,
143-
ErrMessage="assume default number of time steps per year (4)",
144-
ToolTipText="Number of internal simulation time steps per year",
145-
)
146-
147-
self.DoAddOnCalculations = self.ParameterDict[self.DoAddOnCalculations.Name] = boolParameter(
148-
"Do AddOn Calculations",
149-
value=False,
150-
DefaultValue=False,
151-
UnitType=Units.NONE,
152-
Required=False,
153-
ErrMessage="assume default: no economics calculations",
154-
ToolTipText="Set to true if you want the add-on economics calculations to be made",
155-
)
156-
self.DoSDACGTCalculations = self.ParameterDict[self.DoSDACGTCalculations.Name] = boolParameter(
157-
"Do S-DAC-GT Calculations",
158-
value=False,
159-
DefaultValue=False,
160-
UnitType=Units.NONE,
161-
Required=False,
162-
ErrMessage="assume default: no S-DAC-GT calculations",
163-
ToolTipText="Set to true if you want the S-DAC-GT economics calculations to be made",
164-
)
165-
166-
# heat pump
167-
self.heatpumpcapex = self.ParameterDict[self.heatpumpcapex.Name] = floatParameter(
168-
"Heat Pump Capital Cost",
169-
value=-1.0,
170-
Min=0,
171-
Max=100,
172-
UnitType=Units.CURRENCY,
173-
PreferredUnits=CurrencyUnit.MDOLLARS,
174-
CurrentUnits=CurrencyUnit.MDOLLARS,
175-
Provided=False,
176-
Valid=False,
177-
ToolTipText="Heat pump capital cost",
178-
)
179-
180-
self.ngprice = self.ParameterDict[self.ngprice.Name] = floatParameter(
181-
"Peaking Fuel Cost Rate",
182-
value=0.034,
183-
Min=0.0,
184-
Max=1.0,
185-
UnitType=Units.ENERGYCOST,
186-
PreferredUnits=EnergyCostUnit.DOLLARSPERKWH,
187-
CurrentUnits=EnergyCostUnit.DOLLARSPERKWH,
188-
ErrMessage="assume default peaking fuel rate ($0.034/kWh)",
189-
ToolTipText="Price of peaking fuel for peaking boilers",
190-
)
191-
self.peakingboilerefficiency = self.ParameterDict[self.peakingboilerefficiency.Name] = floatParameter(
192-
"Peaking Boiler Efficiency",
193-
value=0.85,
194-
Min=0,
195-
Max=1,
196-
UnitType=Units.PERCENT,
197-
PreferredUnits=PercentUnit.TENTH,
198-
CurrentUnits=PercentUnit.TENTH,
199-
Provided=False,
200-
Valid=False,
201-
ErrMessage="assume default peaking boiler efficiency (85%)",
202-
ToolTipText="Peaking boiler efficiency",
203-
)
204-
20520
self.LCOH = self.OutputParameterDict[self.LCOH.Name] = OutputParameter(
20621
"Heat Sale Price Model",
20722
display_name='Direct-Use heat breakeven price (LCOH)',
@@ -219,22 +34,6 @@ def __init__(self, model: Model):
21934
self.MyClass = sclass.replace("\'>", "")
22035
self.MyPath = os.path.abspath(__file__)
22136

222-
# results
223-
self.Cwell = self.OutputParameterDict[self.Cwell.Name] = OutputParameter(
224-
Name="Wellfield cost",
225-
value=-999.9,
226-
UnitType=Units.CURRENCY,
227-
PreferredUnits=CurrencyUnit.MDOLLARS,
228-
CurrentUnits=CurrencyUnit.MDOLLARS,
229-
)
230-
231-
self.CCap = self.OutputParameterDict[self.CCap.Name] = OutputParameter(
232-
Name="Total Capital Cost",
233-
value=-999.9,
234-
UnitType=Units.CURRENCY,
235-
PreferredUnits=CurrencyUnit.MDOLLARS,
236-
CurrentUnits=CurrencyUnit.MDOLLARS,
237-
)
23837
self.Coam = self.OutputParameterDict[self.Coam.Name] = OutputParameter(
23938
Name="Total O&M Cost",
24039
value=-999.9,
@@ -249,26 +48,6 @@ def __init__(self, model: Model):
24948
PreferredUnits=CurrencyFrequencyUnit.KDOLLARSPERYEAR,
25049
CurrentUnits=CurrencyFrequencyUnit.KDOLLARSPERYEAR,
25150
)
252-
253-
# heat pump
254-
self.averageannualheatpumpelectricitycost = self.OutputParameterDict[
255-
self.averageannualheatpumpelectricitycost.Name
256-
] = OutputParameter(
257-
Name="Average Annual Heat Pump Electricity Cost",
258-
value=0.0,
259-
UnitType=Units.CURRENCYFREQUENCY,
260-
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
261-
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
262-
)
263-
264-
self.peakingboilercost = self.OutputParameterDict[self.peakingboilercost.Name] = OutputParameter(
265-
Name="Peaking boiler cost",
266-
value=0,
267-
UnitType=Units.CURRENCY,
268-
PreferredUnits=CurrencyUnit.MDOLLARS,
269-
CurrentUnits=CurrencyUnit.MDOLLARS,
270-
)
271-
27251
self.annualngcost = self.OutputParameterDict[self.annualngcost.Name] = OutputParameter(
27352
Name="Annual Peaking Fuel Cost",
27453
value=0,
@@ -347,7 +126,7 @@ def Calculate(self, model: Model) -> None:
347126
# Drilling
348127

349128
self.C1well = 0
350-
if self.ccwellfixed.Valid:
129+
if self.per_production_well_cost.Valid:
351130
self.C1well = self.ccwellfixed.value
352131
self.Cwell.value = self.C1well * (model.wellbores.nprod.value + model.wellbores.ninj.value)
353132
else:
@@ -359,13 +138,16 @@ def Calculate(self, model: Model) -> None:
359138

360139
self.C1well = self.wellcorrelation.value.calculate_cost_MUSD(model.reserv.depth.value)
361140

362-
self.C1well = self.C1well * self.ccwelladjfactor.value
141+
self.C1well = self.C1well * self.production_well_cost_adjustment_factor.value
363142
self.Cwell.value = self.C1well * (model.wellbores.nprod.value + model.wellbores.ninj.value)
364143

365144
# Boiler
366145
self.peakingboilercost.value = (
367-
65 * model.surfaceplant.max_peaking_boiler_demand.value / self.peakingboilerefficiency.value / 1000
368-
) # add 65$/KW for peaking boiler
146+
self.peaking_boiler_cost_per_kW.quantity().to('USD/kW').magnitude
147+
* model.surfaceplant.max_peaking_boiler_demand.value
148+
/ self.peakingboilerefficiency.value
149+
/ 1000
150+
)
369151

370152
# Circulation Pump
371153
pumphp = np.max(model.wellbores.PumpingPower.value) * 1.341

src/geophires_x/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.9.35'
1+
__version__ = '3.9.36'

src/geophires_x_schema_generator/geophires-request.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@
14381438
"category": "Economics",
14391439
"default": -1.0,
14401440
"minimum": 0,
1441-
"maximum": 100
1441+
"maximum": 1000
14421442
},
14431443
"Exploration Capital Cost Adjustment Factor": {
14441444
"description": "Multiplier for built-in exploration capital cost correlation",

0 commit comments

Comments
 (0)