Skip to content

Commit 7d1f8b5

Browse files
SBTEconomics - remove commented code, call calculate_field_gathering_costs
1 parent b36c453 commit 7d1f8b5

File tree

1 file changed

+1
-97
lines changed

1 file changed

+1
-97
lines changed

src/geophires_x/SBTEconomics.py

Lines changed: 1 addition & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -101,67 +101,7 @@ def __init__(self, model: Model):
101101
sclass = str(__class__).replace("<class \'", "")
102102
self.MyClass = sclass.replace("\'>", "")
103103
self.MyPath = os.path.abspath(__file__)
104-
#self.Electricity_rate = None
105-
#self.Discount_rate = None
106-
#self.error = 0
107-
#self.AverageOPEX_Plant = 0
108-
#self.OPEX_Plant = 0
109-
#self.TotalCAPEX = 0
110-
#self.CAPEX_Surface_Plant = 0
111-
#self.CAPEX_Drilling = 0
112-
113-
# Set up all the Parameters that will be predefined by this class using the different types of parameter classes.
114-
# Setting up includes giving it a name, a default value, The Unit Type (length, volume, temperature, etc.)
115-
# and Unit Name of that value, sets it as required (or not), sets allowable range,
116-
# the error message if that range is exceeded, the ToolTip Text, and the name of the class that created it.
117-
# This includes setting up temporary variables that will be available to all the class but noy read in by user,
118-
# or used for Output
119-
# This also includes all Parameters that are calculated and then published using the Printouts function.
120-
# If you choose to subclass this master class, you can do so before or after you create your own parameters.
121-
# If you do, you can also choose to call this method from you class, which will effectively add
122-
# and set all these parameters to your class.
123-
# NB: inputs we already have ("already have it") need to be set at ReadParameter time so values
124-
# are set at the last possible time
125104

126-
"""
127-
self.O_and_M_cost_plant = self.ParameterDict[self.O_and_M_cost_plant.Name] = floatParameter(
128-
"Operation & Maintenance Cost of Surface Plant",
129-
DefaultValue=0.015,
130-
Min=0.0,
131-
Max=0.2,
132-
UnitType=Units.PERCENT,
133-
PreferredUnits=PercentUnit.TENTH,
134-
CurrentUnits=PercentUnit.TENTH,
135-
Required=True,
136-
ErrMessage="assume default Operation & Maintenance cost of surface plant expressed as fraction of total surface plant capital cost (0.015)"
137-
)
138-
self.Direct_use_heat_cost_per_kWth = self.ParameterDict[
139-
self.Direct_use_heat_cost_per_kWth.Name] = floatParameter(
140-
"Capital Cost for Surface Plant for Direct-use System",
141-
DefaultValue=100.0,
142-
Min=0.0,
143-
Max=10000.0,
144-
UnitType=Units.ENERGYCOST,
145-
PreferredUnits=EnergyCostUnit.DOLLARSPERKW,
146-
CurrentUnits=EnergyCostUnit.DOLLARSPERKW,
147-
Required=False,
148-
ErrMessage="assume default Capital cost for surface plant for direct-use system (100 $/kWth)"
149-
)
150-
self.Power_plant_cost_per_kWe = self.ParameterDict[self.Power_plant_cost_per_kWe.Name] = floatParameter(
151-
"Capital Cost for Power Plant for Electricity Generation",
152-
DefaultValue=3000.0,
153-
Min=0.0,
154-
Max=10000.0,
155-
UnitType=Units.ENERGYCOST,
156-
PreferredUnits=EnergyCostUnit.DOLLARSPERKW,
157-
CurrentUnits=EnergyCostUnit.DOLLARSPERKW,
158-
Required=True,
159-
ErrMessage="assume default Power plant capital cost per kWe (3000 USD/kWe)"
160-
)
161-
162-
# results are stored here and in the parent ProducedTemperature array
163-
164-
"""
165105
model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}')
166106

167107
def __str__(self):
@@ -183,10 +123,6 @@ def read_parameters(self, model: Model) -> None:
183123
# because the call to the super.readparameters will set all the variables,
184124
# including the ones that are specific to this class
185125

186-
# inputs we already have - needs to be set at ReadParameter time so values set at the latest possible time
187-
# self.Discount_rate = model.economics.discountrate.value # same units are GEOPHIRES
188-
# self.Electricity_rate = model.surfaceplant.electricity_cost_to_buy.value # same units are GEOPHIRES
189-
190126
model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}')
191127

192128
def Calculate(self, model: Model) -> None:
@@ -281,39 +217,7 @@ def Calculate(self, model: Model) -> None:
281217

282218
self.Cstim.value = self.calculate_stimulation_costs(model).to(self.Cstim.CurrentUnits).magnitude
283219

284-
# field gathering system costs (M$)
285-
if self.ccgathfixed.Valid:
286-
self.Cgath.value = self.ccgathfixed.value
287-
else:
288-
self.Cgath.value = self.ccgathadjfactor.value * 50 - 6 * np.max(
289-
model.surfaceplant.HeatExtracted.value) * 1000. # (GEOPHIRES v1 correlation)
290-
if model.wellbores.impedancemodelused.value:
291-
pumphp = np.max(model.wellbores.PumpingPower.value) * 1341
292-
numberofpumps = np.ceil(pumphp / 2000) # pump can be maximum 2,000 hp
293-
if numberofpumps == 0:
294-
self.Cpumps = 0.0
295-
else:
296-
pumphpcorrected = pumphp / numberofpumps
297-
self.Cpumps = numberofpumps * 1.5 * (
298-
(1750 * pumphpcorrected ** 0.7) * 3 * pumphpcorrected ** (-0.11))
299-
else:
300-
if model.wellbores.productionwellpumping.value:
301-
prodpumphp = np.max(model.wellbores.PumpingPowerProd.value) / model.wellbores.nprod.value * 1341
302-
Cpumpsprod = model.wellbores.nprod.value * 1.5 * (1750 * prodpumphp ** 0.7 + 5750 *
303-
prodpumphp ** 0.2 + 10000 + np.max(
304-
model.wellbores.pumpdepth.value) * 50 * 3.281) # see page 46 in user's manual assuming rental of rig for 1 day.
305-
else:
306-
Cpumpsprod = 0
307-
308-
injpumphp = np.max(model.wellbores.PumpingPowerInj.value) * 1341
309-
numberofinjpumps = np.ceil(injpumphp / 2000) # pump can be maximum 2,000 hp
310-
if numberofinjpumps == 0:
311-
Cpumpsinj = 0
312-
else:
313-
injpumphpcorrected = injpumphp / numberofinjpumps
314-
Cpumpsinj = numberofinjpumps * 1.5 * (
315-
1750 * injpumphpcorrected ** 0.7) * 3 * injpumphpcorrected ** (-0.11)
316-
self.Cpumps = Cpumpsinj + Cpumpsprod
220+
self.calculate_field_gathering_costs(model)
317221

318222
# Based on GETEM 2016 #1.15 for 15% contingency
319223
self.Cgath.value = 1.15 * self.ccgathadjfactor.value * self._indirect_cost_factor * (

0 commit comments

Comments
 (0)