Skip to content

Commit 95c37b7

Browse files
added some new parameters and changed the import of Economincs in SBT Economics
1 parent 69669eb commit 95c37b7

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

src/geophires_x/Economics.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,8 +1766,14 @@ def __init__(self, model: Model):
17661766
PreferredUnits=CurrencyUnit.MDOLLARS,
17671767
CurrentUnits=CurrencyUnit.MDOLLARS
17681768
)
1769-
self.cost_nonvertical_section = self.OutputParameterDict[self.cost_nonvertical_section.Name] = OutputParameter(
1770-
Name="Cost of the non-vertical section of a well",
1769+
self.cost_lateral_section = self.OutputParameterDict[self.cost_lateral_section.Name] = OutputParameter(
1770+
Name="Cost of the entire (multi-) lateral section of a well",
1771+
UnitType=Units.CURRENCY,
1772+
PreferredUnits=CurrencyUnit.MDOLLARS,
1773+
CurrentUnits=CurrencyUnit.MDOLLARS
1774+
)
1775+
self.cost_to_junction_section = self.OutputParameterDict[self.cost_to_junction_section.Name] = OutputParameter(
1776+
Name="Cost of the entire section of a well from bottom of vertical to junction with laterals",
17711777
UnitType=Units.CURRENCY,
17721778
PreferredUnits=CurrencyUnit.MDOLLARS,
17731779
CurrentUnits=CurrencyUnit.MDOLLARS
@@ -2177,7 +2183,7 @@ def Calculate(self, model: Model) -> None:
21772183
(self.cost_one_injection_well.value * model.wellbores.ninj.value))
21782184
else:
21792185
if hasattr(model.wellbores, 'numnonverticalsections') and model.wellbores.numnonverticalsections.Provided:
2180-
self.cost_nonvertical_section.value = 0.0
2186+
self.cost_lateral_section.value = 0.0
21812187
if not model.wellbores.IsAGS.value:
21822188
input_vert_depth_km = model.reserv.depth.quantity().to('km').magnitude
21832189
output_vert_depth_km = 0.0
@@ -2218,20 +2224,20 @@ def Calculate(self, model: Model) -> None:
22182224
self.injection_well_cost_adjustment_factor.value)
22192225

22202226
if hasattr(model.wellbores, 'numnonverticalsections') and model.wellbores.numnonverticalsections.Provided:
2221-
self.cost_nonvertical_section.value = calculate_cost_of_non_vertical_section(model, tot_horiz_m,
2227+
self.cost_lateral_section.value = calculate_cost_of_non_vertical_section(model, tot_horiz_m,
22222228
self.wellcorrelation.value,
22232229
self.Nonvertical_drilling_cost_per_m.value,
22242230
model.wellbores.numnonverticalsections.value,
22252231
self.per_injection_well_cost.Name,
22262232
model.wellbores.NonverticalsCased.value,
22272233
self.production_well_cost_adjustment_factor.value)
22282234
else:
2229-
self.cost_nonvertical_section.value = 0.0
2235+
self.cost_lateral_section.value = 0.0
22302236
# cost of the well field
22312237
# 1.05 for 5% indirect costs
22322238
self.Cwell.value = 1.05 * ((self.cost_one_production_well.value * model.wellbores.nprod.value) +
22332239
(self.cost_one_injection_well.value * model.wellbores.ninj.value) +
2234-
self.cost_nonvertical_section.value)
2240+
self.cost_lateral_section.value)
22352241

22362242
# reservoir stimulation costs (M$/injection well). These are calculated whether totalcapcost.Valid = 1
22372243
if self.ccstimfixed.Valid:

src/geophires_x/Outputs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1788,10 +1788,10 @@ def PrintOutputs(self, model: Model):
17881788
model.economics.cost_one_injection_well.value != -1:
17891789
f.write(f' Drilling and completion costs per production well: {econ.cost_one_production_well.value:10.2f} ' + econ.cost_one_production_well.CurrentUnits.value + NL)
17901790
f.write(f' Drilling and completion costs per injection well: {econ.cost_one_injection_well.value:10.2f} ' + econ.cost_one_injection_well.CurrentUnits.value + NL)
1791-
elif econ.cost_nonvertical_section.value > 0.0:
1791+
elif econ.cost_lateral_section.value > 0.0:
17921792
f.write(f' Drilling and completion costs per vertical production well: {econ.cost_one_production_well.value:10.2f} ' + econ.cost_one_production_well.CurrentUnits.value + NL)
17931793
f.write(f' Drilling and completion costs per vertical injection well: {econ.cost_one_injection_well.value:10.2f} ' + econ.cost_one_injection_well.CurrentUnits.value + NL)
1794-
f.write(f' Drilling and completion costs per non-vertical sections: {econ.cost_nonvertical_section.value:10.2f} ' + econ.cost_nonvertical_section.CurrentUnits.value + NL)
1794+
f.write(f' Drilling and completion costs per non-vertical sections: {econ.cost_lateral_section.value:10.2f} ' + econ.cost_lateral_section.CurrentUnits.value + NL)
17951795
else:
17961796
f.write(f' Drilling and completion costs per well: {model.economics.Cwell.value/(model.wellbores.nprod.value+model.wellbores.ninj.value):10.2f} ' + model.economics.Cwell.CurrentUnits.value + NL)
17971797
f.write(f' Stimulation costs: {model.economics.Cstim.value:10.2f} ' + model.economics.Cstim.CurrentUnits.value + NL)

src/geophires_x/SBTEconomics.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys, math
22
import numpy as np
33
import geophires_x.Model as Model
4-
import geophires_x.Economics as Economics
4+
from .Economics import Economics, calculate_cost_of_one_vertical_well, BuildPTCModel, BuildPricingModel, \
5+
CalculateRevenue, CalculateFinancialPerformance, CalculateLCOELCOHLCOC
56
from .OptionList import Configuration, WellDrillingCostCorrelation, PlantType
67
from geophires_x.Parameter import floatParameter
78
from geophires_x.Units import *
@@ -124,7 +125,7 @@ def calculate_cost_of_lateral_section(model: Model, length_m: float, well_correl
124125
return cost_of_lateral_section
125126

126127

127-
class SBTEconomics(Economics.Economics):
128+
class SBTEconomics(Economics):
128129
"""
129130
SBTEconomics Child class of Economics; it is the same, but has advanced SBT closed-loop functionality
130131
"""
@@ -269,7 +270,7 @@ def Calculate(self, model: Model) -> None:
269270
else:
270271
# calculate the cost of one vertical production well
271272
# 1.05 for 5% indirect costs
272-
self.cost_one_production_well.value = 1.05 * Economics.calculate_cost_of_one_vertical_well(model, model.wellbores.vertical_section_length.value,
273+
self.cost_one_production_well.value = 1.05 * calculate_cost_of_one_vertical_well(model, model.wellbores.vertical_section_length.value,
273274
self.wellcorrelation.value,
274275
self.Vertical_drilling_cost_per_m.value,
275276
self.per_production_well_cost.Name,
@@ -299,7 +300,7 @@ def Calculate(self, model: Model) -> None:
299300
# This section is not vertical, but it is cased, so we will estimate the cost
300301
# of this section as if it were a vertical section.
301302
if model.wellbores.Configuration.value == Configuration.EAVORLOOP:
302-
self.cost_to_junction_section.value = 1.05 * Economics.calculate_cost_of_one_vertical_well(model,
303+
self.cost_to_junction_section.value = 1.05 * calculate_cost_of_one_vertical_well(model,
303304
model.wellbores.tot_to_junction_m.value,
304305
self.wellcorrelation.value,
305306
self.Vertical_drilling_cost_per_m.value,
@@ -744,32 +745,32 @@ def Calculate(self, model: Model) -> None:
744745
self.PTCCoolingPrice = [0.0] * model.surfaceplant.plant_lifetime.value
745746
self.PTCCarbonPrice = [0.0] * model.surfaceplant.plant_lifetime.value
746747
if self.PTCElec.Provided:
747-
self.PTCElecPrice = Economics.BuildPTCModel(model.surfaceplant.plant_lifetime.value,
748+
self.PTCElecPrice = BuildPTCModel(model.surfaceplant.plant_lifetime.value,
748749
self.PTCDuration.value, self.PTCElec.value, self.PTCInflationAdjusted.value,
749750
self.RINFL.value)
750751
if self.PTCHeat.Provided:
751-
self.PTCHeatPrice = Economics.BuildPTCModel(model.surfaceplant.plant_lifetime.value,
752+
self.PTCHeatPrice = BuildPTCModel(model.surfaceplant.plant_lifetime.value,
752753
self.PTCDuration.value, self.PTCHeat.value, self.PTCInflationAdjusted.value,
753754
self.RINFL.value)
754755
if self.PTCCooling.Provided:
755-
self.PTCCoolingPrice = Economics.BuildPTCModel(model.surfaceplant.plant_lifetime.value,
756+
self.PTCCoolingPrice = BuildPTCModel(model.surfaceplant.plant_lifetime.value,
756757
self.PTCDuration.value, self.PTCCooling.value, self.PTCInflationAdjusted.value,
757758
self.RINFL.value)
758759

759760
# build the price models
760-
self.ElecPrice.value = Economics.BuildPricingModel(model.surfaceplant.plant_lifetime.value,
761+
self.ElecPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value,
761762
self.ElecStartPrice.value, self.ElecEndPrice.value,
762763
self.ElecEscalationStart.value, self.ElecEscalationRate.value,
763764
self.PTCElecPrice)
764-
self.HeatPrice.value = Economics.BuildPricingModel(model.surfaceplant.plant_lifetime.value,
765+
self.HeatPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value,
765766
self.HeatStartPrice.value, self.HeatEndPrice.value,
766767
self.HeatEscalationStart.value, self.HeatEscalationRate.value,
767768
self.PTCHeatPrice)
768-
self.CoolingPrice.value = Economics.BuildPricingModel(model.surfaceplant.plant_lifetime.value,
769+
self.CoolingPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value,
769770
self.CoolingStartPrice.value, self.CoolingEndPrice.value,
770771
self.CoolingEscalationStart.value, self.CoolingEscalationRate.value,
771772
self.PTCCoolingPrice)
772-
self.CarbonPrice.value = Economics.BuildPricingModel(model.surfaceplant.plant_lifetime.value,
773+
self.CarbonPrice.value = BuildPricingModel(model.surfaceplant.plant_lifetime.value,
773774
self.CarbonStartPrice.value, self.CarbonEndPrice.value,
774775
self.CarbonEscalationStart.value, self.CarbonEscalationRate.value,
775776
self.PTCCarbonPrice)
@@ -796,19 +797,19 @@ def Calculate(self, model: Model) -> None:
796797

797798
# Based on the style of the project, calculate the revenue & cumulative revenue
798799
if model.surfaceplant.enduse_option.value == EndUseOptions.ELECTRICITY:
799-
self.ElecRevenue.value, self.ElecCummRevenue.value = Economics.CalculateRevenue(
800+
self.ElecRevenue.value, self.ElecCummRevenue.value = CalculateRevenue(
800801
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
801802
model.surfaceplant.NetkWhProduced.value, self.ElecPrice.value)
802803
self.TotalRevenue.value = self.ElecRevenue.value
803804
#self.TotalCummRevenue.value = self.ElecCummRevenue.value
804805
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value not in [PlantType.ABSORPTION_CHILLER]:
805-
self.HeatRevenue.value, self.HeatCummRevenue.value = Economics.CalculateRevenue(
806+
self.HeatRevenue.value, self.HeatCummRevenue.value = CalculateRevenue(
806807
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
807808
model.surfaceplant.HeatkWhProduced.value, self.HeatPrice.value)
808809
self.TotalRevenue.value = self.HeatRevenue.value
809810
#self.TotalCummRevenue.value = self.HeatCummRevenue.value
810811
elif model.surfaceplant.enduse_option.value == EndUseOptions.HEAT and model.surfaceplant.plant_type.value in [PlantType.ABSORPTION_CHILLER]:
811-
self.CoolingRevenue.value, self.CoolingCummRevenue.value = Economics.CalculateRevenue(
812+
self.CoolingRevenue.value, self.CoolingCummRevenue.value = CalculateRevenue(
812813
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
813814
model.surfaceplant.cooling_kWh_Produced.value, self.CoolingPrice.value)
814815
self.TotalRevenue.value = self.CoolingRevenue.value
@@ -820,10 +821,10 @@ def Calculate(self, model: Model) -> None:
820821
EndUseOptions.COGENERATION_PARALLEL_EXTRA_HEAT,
821822
EndUseOptions.COGENERATION_PARALLEL_EXTRA_ELECTRICITY]: # co-gen
822823
# else:
823-
self.ElecRevenue.value, self.ElecCummRevenue.value = Economics.CalculateRevenue(
824+
self.ElecRevenue.value, self.ElecCummRevenue.value = CalculateRevenue(
824825
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
825826
model.surfaceplant.NetkWhProduced.value, self.ElecPrice.value)
826-
self.HeatRevenue.value, self.HeatCummRevenue.value = Economics.CalculateRevenue(
827+
self.HeatRevenue.value, self.HeatCummRevenue.value = CalculateRevenue(
827828
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
828829
model.surfaceplant.HeatkWhProduced.value, self.HeatPrice.value)
829830

@@ -834,7 +835,7 @@ def Calculate(self, model: Model) -> None:
834835

835836
if self.DoCarbonCalculations.value:
836837
self.CarbonRevenue.value, self.CarbonCummCashFlow.value, self.CarbonThatWouldHaveBeenProducedAnnually.value, \
837-
self.CarbonThatWouldHaveBeenProducedTotal.value = Economics.CalculateCarbonRevenue(model,
838+
self.CarbonThatWouldHaveBeenProducedTotal.value = CalculateCarbonRevenue(model,
838839
model.surfaceplant.plant_lifetime.value, model.surfaceplant.construction_years.value,
839840
self.CarbonPrice.value, self.GridCO2Intensity.value, self.NaturalGasCO2Intensity.value,
840841
model.surfaceplant.NetkWhProduced.value, model.surfaceplant.HeatkWhProduced.value)
@@ -871,7 +872,7 @@ def Calculate(self, model: Model) -> None:
871872

872873
# Calculate more financial values using numpy financials
873874
self.ProjectNPV.value, self.ProjectIRR.value, self.ProjectVIR.value, self.ProjectMOIC.value = \
874-
Economics.CalculateFinancialPerformance(model.surfaceplant.plant_lifetime.value, self.FixedInternalRate.value,
875+
CalculateFinancialPerformance(model.surfaceplant.plant_lifetime.value, self.FixedInternalRate.value,
875876
self.TotalRevenue.value, self.TotalCummRevenue.value, self.CCap.value,
876877
self.Coam.value)
877878

@@ -887,7 +888,7 @@ def Calculate(self, model: Model) -> None:
887888

888889

889890
# Calculate LCOE/LCOH
890-
self.LCOE.value, self.LCOH.value, self.LCOC.value = Economics.CalculateLCOELCOHLCOC(self, model)
891+
self.LCOE.value, self.LCOH.value, self.LCOC.value = CalculateLCOELCOHLCOC(self, model)
891892

892893
model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}')
893894

src/geophires_x/SBTReservoir.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ def __init__(self, model: Model):
233233
Max=1.0,
234234
UnitType=Units.PERCENT,
235235
PreferredUnits=PercentUnit.TENTH,
236+
CurrentUnits=PercentUnit.TENTH,
236237
ErrMessage="assume default percent implicit (1.0)",
237238
ToolTipText="Should be between 0 and 1. Most stable is setting it to 1 which results in \
238239
a fully implicit Euler scheme when calculating the fluid temperature at each time step. \

0 commit comments

Comments
 (0)