Skip to content

Commit bbea18f

Browse files
Remove redundant parameter declarations from SUTRAEconomics
1 parent 67bd265 commit bbea18f

File tree

1 file changed

+2
-223
lines changed

1 file changed

+2
-223
lines changed

src/geophires_x/SUTRAEconomics.py

Lines changed: 2 additions & 223 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,7 +138,7 @@ 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

0 commit comments

Comments
 (0)