diff --git a/src/geophires_x/AGSEconomics.py b/src/geophires_x/AGSEconomics.py index 1b0258ff..4db72ec5 100644 --- a/src/geophires_x/AGSEconomics.py +++ b/src/geophires_x/AGSEconomics.py @@ -110,8 +110,8 @@ def read_parameters(self, model: Model) -> None: # including the ones that are specific to this class # inputs we already have - needs to be set at ReadParameter time so values set at the latest possible time - self.Discount_rate = model.economics.discountrate.value # same units are GEOPHIRES - self.Electricity_rate = model.surfaceplant.electricity_cost_to_buy.value # same units are GEOPHIRES + self.Discount_rate = model.economics.discountrate.value # same units as GEOPHIRES + self.Electricity_rate = model.surfaceplant.electricity_cost_to_buy.value # same units as GEOPHIRES model.logger.info(f'complete {__class__!s}: {sys._getframe().f_code.co_name}') diff --git a/src/geophires_x/Economics.py b/src/geophires_x/Economics.py index 75b80963..6590535e 100644 --- a/src/geophires_x/Economics.py +++ b/src/geophires_x/Economics.py @@ -837,15 +837,17 @@ def __init__(self, model: Model): ErrMessage="assume default fixed charge rate (0.1)", ToolTipText="Fixed charge rate (FCR) used in the Fixed Charge Rate Model" ) + + discount_rate_default_val = 0.0625 self.discountrate = self.ParameterDict[self.discountrate.Name] = floatParameter( "Discount Rate", - DefaultValue=0.07, + DefaultValue=discount_rate_default_val, Min=0.0, Max=1.0, UnitType=Units.PERCENT, - PreferredUnits=PercentUnit.TENTH, + PreferredUnits=PercentUnit.PERCENT, CurrentUnits=PercentUnit.TENTH, - ErrMessage="assume default discount rate (0.07)", + ErrMessage=f'assume default discount rate ({discount_rate_default_val})', ToolTipText="Discount rate used in the Standard Levelized Cost Model" ) self.FIB = self.ParameterDict[self.FIB.Name] = floatParameter( @@ -1379,15 +1381,18 @@ def __init__(self, model: Model): PreferredUnits=CurrencyUnit.MDOLLARS, CurrentUnits=CurrencyUnit.MDOLLARS ) + + fir_default_unit = PercentUnit.PERCENT + fir_default_val = self.discountrate.quantity().to(fir_default_unit.value).magnitude self.FixedInternalRate = self.ParameterDict[self.FixedInternalRate.Name] = floatParameter( "Fixed Internal Rate", - DefaultValue=6.25, + DefaultValue=fir_default_val, Min=0.0, Max=100.0, UnitType=Units.PERCENT, PreferredUnits=PercentUnit.PERCENT, - CurrentUnits=PercentUnit.PERCENT, - ErrMessage="assume default for fixed internal rate (6.25%)", + CurrentUnits=fir_default_unit, + ErrMessage=f'assume default for fixed internal rate ({fir_default_val}%)', ToolTipText="Fixed Internal Rate (used in NPV calculation)" ) self.CAPEX_heat_electricity_plant_ratio = self.ParameterDict[self.CAPEX_heat_electricity_plant_ratio.Name] = floatParameter( diff --git a/src/geophires_x/Outputs.py b/src/geophires_x/Outputs.py index 271c7bac..dd2c52e3 100644 --- a/src/geophires_x/Outputs.py +++ b/src/geophires_x/Outputs.py @@ -1634,7 +1634,11 @@ def PrintOutputs(self, model: Model): f.write(f' Fixed Charge Rate (FCR): {model.economics.FCR.value*100.0:10.2f} ' + model.economics.FCR.CurrentUnits.value + NL) elif model.economics.econmodel.value == EconomicModel.STANDARDIZED_LEVELIZED_COST: f.write(' Economic Model = ' + model.economics.econmodel.value.value + NL) - f.write(f' Interest Rate: {model.economics.discountrate.value*100.0:10.2f} ' + model.economics.discountrate.CurrentUnits.value + NL) + + # FIXME discountrate should not be multiplied by 100 here - + # it appears to be incorrectly claiming its units are percent when the actual value is in tenths. + f.write(f' Interest Rate: {model.economics.discountrate.value*100.0:10.2f} {model.economics.discountrate.CurrentUnits.value}\n') + elif model.economics.econmodel.value == EconomicModel.BICYCLE: f.write(' Economic Model = ' + model.economics.econmodel.value.value + NL) f.write(f' Accrued financing during construction: {model.economics.inflrateconstruction.value*100:10.2f} ' + model.economics.inflrateconstruction.CurrentUnits.value + NL) diff --git a/src/geophires_x/SUTRAEconomics.py b/src/geophires_x/SUTRAEconomics.py index 89537243..f1a00cb0 100644 --- a/src/geophires_x/SUTRAEconomics.py +++ b/src/geophires_x/SUTRAEconomics.py @@ -111,19 +111,6 @@ def __init__(self, model: Model): ToolTipText="Multiplier for built-in surface plant capital cost correlation", ) - self.discountrate = self.ParameterDict[self.discountrate.Name] = floatParameter( - "Discount Rate", - value=0.07, - DefaultValue=0.07, - Min=0.0, - Max=1.0, - UnitType=Units.PERCENT, - PreferredUnits=PercentUnit.PERCENT, - CurrentUnits=PercentUnit.TENTH, - ErrMessage="assume default discount rate (0.07)", - ToolTipText="Discount rate used in the Standard Levelized Cost Model", - ) - self.inflrateconstruction = self.ParameterDict[self.inflrateconstruction.Name] = floatParameter( "Inflation Rate During Construction", value=0.0, diff --git a/src/geophires_x/SUTRAOutputs.py b/src/geophires_x/SUTRAOutputs.py index b6c2a15c..4e644c21 100644 --- a/src/geophires_x/SUTRAOutputs.py +++ b/src/geophires_x/SUTRAOutputs.py @@ -83,7 +83,7 @@ def PrintOutputs(self, model: Model): f.write(f" Fixed Charge Rate (FCR): {model.economics.FCR.value*100.0:10.2f} " + model.economics.FCR.CurrentUnits.value + NL) elif model.economics.econmodel.value == EconomicModel.STANDARDIZED_LEVELIZED_COST: f.write(" Economic Model = " + model.economics.econmodel.value.value + NL) - f.write(f" Interest Rate: {model.economics.discountrate.value*100.0:10.2f} " + model.economics.discountrate.PreferredUnits.value + NL) + f.write(f" Interest Rate: {model.economics.discountrate.value*100.0:10.2f} " + model.economics.discountrate.CurrentUnits.value + NL) elif model.economics.econmodel.value == EconomicModel.BICYCLE: f.write(" Economic Model = " + model.economics.econmodel.value.value + NL) f.write(f" Accrued financing during construction: {model.economics.inflrateconstruction.value*100:10.2f} " + model.economics.inflrateconstruction.PreferredUnits.value + NL) diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out index 601ca766..11fef764 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_sCO2_heat.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:11 - Calculation Time: 1.178 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.730 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 40.0 kg/sec Lateral Length: 1000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/km + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -33,7 +33,7 @@ Simulation Metadata Drilling Cost: 7.0 MUSD Surface Plant Cost: 0.1 MUSD OPEX: 2.1 KUSD/yr - LCOH: 54.1 USD/MWh + LCOH: 50.1 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out index deb133e3..890d0307 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Coaxial_water_heat.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:12 - Calculation Time: 1.004 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.662 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 20.0 kg/sec Lateral Length: 9000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/m + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -33,7 +33,7 @@ Simulation Metadata Drilling Cost: 12.0 MUSD Surface Plant Cost: 0.5 MUSD OPEX: 142.2 KUSD/yr - LCOH: 29.7 USD/MWh + LCOH: 27.8 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out index a3f80275..f4c64fc0 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_elec.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:13 - Calculation Time: 1.085 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:55 + Calculation Time: 0.790 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 40.0 kg/sec Lateral Length: 9000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/m + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -35,7 +35,7 @@ Simulation Metadata Drilling Cost: 15.0 MUSD Surface Plant Cost: 0.9 MUSD OPEX: 13.2 KUSD/yr - LCOE: 601.4 USD/MWh + LCOE: 557.6 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out index 9f8b837f..d0d9a524 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_sCO2_heat.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:13 - Calculation Time: 1.093 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.724 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 40.0 kg/sec Lateral Length: 9000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/m + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -33,7 +33,7 @@ Simulation Metadata Drilling Cost: 15.0 MUSD Surface Plant Cost: 0.4 MUSD OPEX: 6.0 KUSD/yr - LCOH: 38.8 USD/MWh + LCOH: 35.9 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out index 337917d6..84ac47c2 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_elec.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:14 - Calculation Time: 1.073 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.741 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 20.0 kg/sec Lateral Length: 9000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/m + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -35,7 +35,7 @@ Simulation Metadata Drilling Cost: 15.0 MUSD Surface Plant Cost: 1.2 MUSD OPEX: 18.6 KUSD/yr - LCOE: 437.5 USD/MWh + LCOE: 405.7 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out index 48deb5ee..da264613 100644 --- a/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out +++ b/tests/examples/Beckers_et_al_2023_Tabulated_Database_Uloop_water_heat.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.4 - Simulation Date: 2024-03-02 - Simulation Time: 14:14 - Calculation Time: 1.026 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:55 + Calculation Time: 0.838 sec ***AGS/CLGS STYLE OUTPUT*** @@ -19,7 +19,7 @@ Simulation Metadata Flow rate: 20.0 kg/sec Lateral Length: 9000 meter Vertical Depth: 3 kilometer - Geothermal Gradient: 0.0600 degC/m + Geothermal Gradient: 60.0000 degC/km Wellbore Diameter: 8.5000 in Injection Temperature: 60.0 degC Thermal Conductivity: 3.00 W/m/K @@ -33,7 +33,7 @@ Simulation Metadata Drilling Cost: 15.0 MUSD Surface Plant Cost: 0.5 MUSD OPEX: 7.8 KUSD/yr - LCOH: 30.5 USD/MWh + LCOH: 28.3 USD/MWh ****************************** * POWER GENERATION PROFILE * diff --git a/tests/examples/SUTRAExample1.out b/tests/examples/SUTRAExample1.out index 848a42c6..225bdd9b 100644 --- a/tests/examples/SUTRAExample1.out +++ b/tests/examples/SUTRAExample1.out @@ -4,16 +4,16 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.0 - Simulation Date: 2023-11-06 - Simulation Time: 17:26 - Calculation Time: 1.566 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.510 sec ***SUMMARY OF RESULTS*** End-Use Option: Direct-Use Heat Reservoir Model = SUTRA Model - Direct-Use heat breakeven price: 1730.66 cents/kWh + Direct-Use heat breakeven price: 1703.38 cents/kWh Number of Production Wells: 1 Number of Injection Wells: 1 Lifetime Average Well Flow Rate: 16.2 kg/sec @@ -23,7 +23,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 7.00 % + Interest Rate: 6.25 Accrued financing during construction: 0.00 % Project lifetime: 30 yr diff --git a/tests/examples/example10_HP.out b/tests/examples/example10_HP.out index eb006d71..4ea9e015 100644 --- a/tests/examples/example10_HP.out +++ b/tests/examples/example10_HP.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.34 - Simulation Date: 2024-06-19 - Simulation Time: 07:42 - Calculation Time: 0.104 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.101 sec ***SUMMARY OF RESULTS*** @@ -25,7 +25,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 5.00 + Interest Rate: 5.00 % Accrued financing during construction: 5.00 Project lifetime: 30 yr Capacity factor: 90.0 % diff --git a/tests/examples/example11_AC.out b/tests/examples/example11_AC.out index 822c3601..7c607485 100644 --- a/tests/examples/example11_AC.out +++ b/tests/examples/example11_AC.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.34 - Simulation Date: 2024-06-19 - Simulation Time: 07:42 - Calculation Time: 0.106 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.100 sec ***SUMMARY OF RESULTS*** @@ -26,7 +26,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 5.00 + Interest Rate: 5.00 % Accrued financing during construction: 5.00 Project lifetime: 30 yr Capacity factor: 90.0 % diff --git a/tests/examples/example12_DH.out b/tests/examples/example12_DH.out index 340e952b..e4665283 100644 --- a/tests/examples/example12_DH.out +++ b/tests/examples/example12_DH.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.42 - Simulation Date: 2024-07-16 - Simulation Time: 17:55 - Calculation Time: 0.453 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.606 sec ***SUMMARY OF RESULTS*** @@ -28,7 +28,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 7.00 + Interest Rate: 7.00 % Accrued financing during construction: 0.00 Project lifetime: 20 yr Capacity factor: 96.3 % diff --git a/tests/examples/example13.out b/tests/examples/example13.out index a5acf112..b2e66a77 100644 --- a/tests/examples/example13.out +++ b/tests/examples/example13.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.37 - Simulation Date: 2024-06-24 - Simulation Time: 11:25 - Calculation Time: 0.037 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.034 sec ***SUMMARY OF RESULTS*** @@ -26,7 +26,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 5.00 + Interest Rate: 5.00 % Accrued financing during construction: 0.00 Project lifetime: 30 yr Capacity factor: 80.0 % diff --git a/tests/examples/example2.out b/tests/examples/example2.out index 1b9b377c..2d0f1af8 100644 --- a/tests/examples/example2.out +++ b/tests/examples/example2.out @@ -4,10 +4,10 @@ Simulation Metadata ---------------------- - GEOPHIRES Version: 3.4.34 - Simulation Date: 2024-06-19 - Simulation Time: 07:43 - Calculation Time: 0.210 sec + GEOPHIRES Version: 3.6.0 + Simulation Date: 2024-10-10 + Simulation Time: 11:54 + Calculation Time: 0.212 sec ***SUMMARY OF RESULTS*** @@ -24,7 +24,7 @@ Simulation Metadata ***ECONOMIC PARAMETERS*** Economic Model = Standard Levelized Cost - Interest Rate: 5.00 + Interest Rate: 5.00 % Accrued financing during construction: 0.00 Project lifetime: 25 yr Capacity factor: 90.0 %