Skip to content

Commit

Permalink
Set discount rate = fixed internal rate = 6.25%, per NREL#301. Includ…
Browse files Browse the repository at this point in the history
…es fixes/tweaks to outputting interest rate unit/percent. TODO: resolve missing interest rate percent sign in SUTRAExample1.out; set discount rate/fixed internal rate to same value if exactly one is provided
  • Loading branch information
softwareengineerprogrammer committed Oct 10, 2024
1 parent a19c652 commit 14bc59d
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 90 deletions.
4 changes: 2 additions & 2 deletions src/geophires_x/AGSEconomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down
17 changes: 11 additions & 6 deletions src/geophires_x/Economics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 5 additions & 1 deletion src/geophires_x/Outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions src/geophires_x/SUTRAEconomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/geophires_x/SUTRAOutputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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***
Expand All @@ -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
Expand All @@ -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 *
Expand Down
12 changes: 6 additions & 6 deletions tests/examples/SUTRAExample1.out
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example10_HP.out
Original file line number Diff line number Diff line change
Expand Up @@ -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***

Expand All @@ -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 %
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example11_AC.out
Original file line number Diff line number Diff line change
Expand Up @@ -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***

Expand All @@ -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 %
Expand Down
10 changes: 5 additions & 5 deletions tests/examples/example12_DH.out
Original file line number Diff line number Diff line change
Expand Up @@ -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***

Expand All @@ -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 %
Expand Down
Loading

0 comments on commit 14bc59d

Please sign in to comment.