11import sys , math
22import numpy as np
33import 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
56from .OptionList import Configuration , WellDrillingCostCorrelation , PlantType
67from geophires_x .Parameter import floatParameter
78from 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
0 commit comments