1
1
import sys , math
2
2
import numpy as np
3
3
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
5
6
from .OptionList import Configuration , WellDrillingCostCorrelation , PlantType
6
7
from geophires_x .Parameter import floatParameter
7
8
from geophires_x .Units import *
@@ -124,7 +125,7 @@ def calculate_cost_of_lateral_section(model: Model, length_m: float, well_correl
124
125
return cost_of_lateral_section
125
126
126
127
127
- class SBTEconomics (Economics . Economics ):
128
+ class SBTEconomics (Economics ):
128
129
"""
129
130
SBTEconomics Child class of Economics; it is the same, but has advanced SBT closed-loop functionality
130
131
"""
@@ -269,7 +270,7 @@ def Calculate(self, model: Model) -> None:
269
270
else :
270
271
# calculate the cost of one vertical production well
271
272
# 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 ,
273
274
self .wellcorrelation .value ,
274
275
self .Vertical_drilling_cost_per_m .value ,
275
276
self .per_production_well_cost .Name ,
@@ -299,7 +300,7 @@ def Calculate(self, model: Model) -> None:
299
300
# This section is not vertical, but it is cased, so we will estimate the cost
300
301
# of this section as if it were a vertical section.
301
302
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 ,
303
304
model .wellbores .tot_to_junction_m .value ,
304
305
self .wellcorrelation .value ,
305
306
self .Vertical_drilling_cost_per_m .value ,
@@ -744,32 +745,32 @@ def Calculate(self, model: Model) -> None:
744
745
self .PTCCoolingPrice = [0.0 ] * model .surfaceplant .plant_lifetime .value
745
746
self .PTCCarbonPrice = [0.0 ] * model .surfaceplant .plant_lifetime .value
746
747
if self .PTCElec .Provided :
747
- self .PTCElecPrice = Economics . BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
748
+ self .PTCElecPrice = BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
748
749
self .PTCDuration .value , self .PTCElec .value , self .PTCInflationAdjusted .value ,
749
750
self .RINFL .value )
750
751
if self .PTCHeat .Provided :
751
- self .PTCHeatPrice = Economics . BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
752
+ self .PTCHeatPrice = BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
752
753
self .PTCDuration .value , self .PTCHeat .value , self .PTCInflationAdjusted .value ,
753
754
self .RINFL .value )
754
755
if self .PTCCooling .Provided :
755
- self .PTCCoolingPrice = Economics . BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
756
+ self .PTCCoolingPrice = BuildPTCModel (model .surfaceplant .plant_lifetime .value ,
756
757
self .PTCDuration .value , self .PTCCooling .value , self .PTCInflationAdjusted .value ,
757
758
self .RINFL .value )
758
759
759
760
# 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 ,
761
762
self .ElecStartPrice .value , self .ElecEndPrice .value ,
762
763
self .ElecEscalationStart .value , self .ElecEscalationRate .value ,
763
764
self .PTCElecPrice )
764
- self .HeatPrice .value = Economics . BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
765
+ self .HeatPrice .value = BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
765
766
self .HeatStartPrice .value , self .HeatEndPrice .value ,
766
767
self .HeatEscalationStart .value , self .HeatEscalationRate .value ,
767
768
self .PTCHeatPrice )
768
- self .CoolingPrice .value = Economics . BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
769
+ self .CoolingPrice .value = BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
769
770
self .CoolingStartPrice .value , self .CoolingEndPrice .value ,
770
771
self .CoolingEscalationStart .value , self .CoolingEscalationRate .value ,
771
772
self .PTCCoolingPrice )
772
- self .CarbonPrice .value = Economics . BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
773
+ self .CarbonPrice .value = BuildPricingModel (model .surfaceplant .plant_lifetime .value ,
773
774
self .CarbonStartPrice .value , self .CarbonEndPrice .value ,
774
775
self .CarbonEscalationStart .value , self .CarbonEscalationRate .value ,
775
776
self .PTCCarbonPrice )
@@ -796,19 +797,19 @@ def Calculate(self, model: Model) -> None:
796
797
797
798
# Based on the style of the project, calculate the revenue & cumulative revenue
798
799
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 (
800
801
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
801
802
model .surfaceplant .NetkWhProduced .value , self .ElecPrice .value )
802
803
self .TotalRevenue .value = self .ElecRevenue .value
803
804
#self.TotalCummRevenue.value = self.ElecCummRevenue.value
804
805
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 (
806
807
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
807
808
model .surfaceplant .HeatkWhProduced .value , self .HeatPrice .value )
808
809
self .TotalRevenue .value = self .HeatRevenue .value
809
810
#self.TotalCummRevenue.value = self.HeatCummRevenue.value
810
811
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 (
812
813
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
813
814
model .surfaceplant .cooling_kWh_Produced .value , self .CoolingPrice .value )
814
815
self .TotalRevenue .value = self .CoolingRevenue .value
@@ -820,10 +821,10 @@ def Calculate(self, model: Model) -> None:
820
821
EndUseOptions .COGENERATION_PARALLEL_EXTRA_HEAT ,
821
822
EndUseOptions .COGENERATION_PARALLEL_EXTRA_ELECTRICITY ]: # co-gen
822
823
# else:
823
- self .ElecRevenue .value , self .ElecCummRevenue .value = Economics . CalculateRevenue (
824
+ self .ElecRevenue .value , self .ElecCummRevenue .value = CalculateRevenue (
824
825
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
825
826
model .surfaceplant .NetkWhProduced .value , self .ElecPrice .value )
826
- self .HeatRevenue .value , self .HeatCummRevenue .value = Economics . CalculateRevenue (
827
+ self .HeatRevenue .value , self .HeatCummRevenue .value = CalculateRevenue (
827
828
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
828
829
model .surfaceplant .HeatkWhProduced .value , self .HeatPrice .value )
829
830
@@ -834,7 +835,7 @@ def Calculate(self, model: Model) -> None:
834
835
835
836
if self .DoCarbonCalculations .value :
836
837
self .CarbonRevenue .value , self .CarbonCummCashFlow .value , self .CarbonThatWouldHaveBeenProducedAnnually .value , \
837
- self .CarbonThatWouldHaveBeenProducedTotal .value = Economics . CalculateCarbonRevenue (model ,
838
+ self .CarbonThatWouldHaveBeenProducedTotal .value = CalculateCarbonRevenue (model ,
838
839
model .surfaceplant .plant_lifetime .value , model .surfaceplant .construction_years .value ,
839
840
self .CarbonPrice .value , self .GridCO2Intensity .value , self .NaturalGasCO2Intensity .value ,
840
841
model .surfaceplant .NetkWhProduced .value , model .surfaceplant .HeatkWhProduced .value )
@@ -871,7 +872,7 @@ def Calculate(self, model: Model) -> None:
871
872
872
873
# Calculate more financial values using numpy financials
873
874
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 ,
875
876
self .TotalRevenue .value , self .TotalCummRevenue .value , self .CCap .value ,
876
877
self .Coam .value )
877
878
@@ -887,7 +888,7 @@ def Calculate(self, model: Model) -> None:
887
888
888
889
889
890
# 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 )
891
892
892
893
model .logger .info (f'complete { __class__ !s} : { sys ._getframe ().f_code .co_name } ' )
893
894
0 commit comments