Skip to content

Commit 4adc2a1

Browse files
finish impl of royalty holder outputs
1 parent 0929835 commit 4adc2a1

File tree

6 files changed

+45
-8
lines changed

6 files changed

+45
-8
lines changed

src/geophires_x/Economics.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ def __init__(self, model: Model):
21572157
self.royalty_holder_annual_revenue = self.OutputParameterDict[
21582158
self.royalty_holder_annual_revenue.Name
21592159
] = OutputParameter(
2160-
'Royalty Holder Annual Revenue',
2160+
'Royalty Holder Average Annual Revenue',
21612161
UnitType=Units.CURRENCYFREQUENCY,
21622162
PreferredUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
21632163
CurrentUnits=CurrencyFrequencyUnit.MDOLLARSPERYEAR,
@@ -3289,7 +3289,7 @@ def _calculate_sam_economics(self, model: Model) -> None:
32893289

32903290

32913291
if self.royalty_rate.Provided:
3292-
average_annual_royalties = np.average(
3292+
average_annual_royalties = np.average( # TODO unit conversion
32933293
self.sam_economics_calculations.royalties_opex.value[1:] # ignore pre-revenue year(s) (Year 0)
32943294
)
32953295

@@ -3301,9 +3301,10 @@ def _calculate_sam_economics(self, model: Model) -> None:
33013301
self.sam_economics_calculations.royalties_opex.value,
33023302
self.discount_initial_year_cashflow.value
33033303
)
3304-
# FIXME WIP
3305-
# self.royalty_holder_annual_revenue
3306-
# self.royalty_holder_total_revenue
3304+
self.royalty_holder_annual_revenue.value = self.royalties_average_annual_cost.value
3305+
self.royalty_holder_total_revenue.value = np.sum( # TODO unit conversion
3306+
self.sam_economics_calculations.royalties_opex.value[1:] # ignore pre-revenue year(s) (Year 0)
3307+
)
33073308

33083309

33093310
self.wacc.value = self.sam_economics_calculations.wacc.value

src/geophires_x/Outputs.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,16 @@ def PrintOutputs(self, model: Model):
325325
f.write(f' Estimated Jobs Created: {model.economics.jobs_created.value}\n')
326326

327327
if econ.royalty_rate.Provided:
328-
royalty_holder_npv_label = Outputs._field_label(econ.royalty_holder_npv.display_name, 49)
329-
f.write(
330-
f' {royalty_holder_npv_label}{econ.royalty_holder_npv.value:10.2f} {econ.royalty_holder_npv.CurrentUnits.value}\n')
328+
for royalty_output in [
329+
econ.royalty_holder_npv,
330+
econ.royalty_holder_annual_revenue,
331+
econ.royalty_holder_total_revenue
332+
]:
333+
label = Outputs._field_label(royalty_output.display_name, 49)
334+
f.write(
335+
f' {label}{royalty_output.value:10.2f} {royalty_output.CurrentUnits.value}\n')
336+
337+
331338

332339

333340
f.write(NL)

src/geophires_x_client/geophires_x_result.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ class GeophiresXResult:
9494
'CHP: Percent cost allocation for electrical plant',
9595
'Estimated Jobs Created',
9696
'Royalty Holder NPV',
97+
'Royalty Holder Average Annual Revenue',
98+
'Royalty Holder Total Revenue',
9799
],
98100
'EXTENDED ECONOMICS': [
99101
'Adjusted Project LCOE (after incentives, grants, AddOns,etc)',

src/geophires_x_schema_generator/geophires-request.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,15 @@
16471647
"minimum": 0.0,
16481648
"maximum": 1.0
16491649
},
1650+
"Royalty Holder Discount Rate": {
1651+
"description": "Royalty holder discount rate used in SAM Economic Models.",
1652+
"type": "number",
1653+
"units": "",
1654+
"category": "Economics",
1655+
"default": 0.05,
1656+
"minimum": 0.0,
1657+
"maximum": 1.0
1658+
},
16501659
"Discount Initial Year Cashflow": {
16511660
"description": "Whether to discount cashflow in the initial project year when calculating NPV (Net Present Value). The default value of False conforms to NREL's standard convention for NPV calculation (Short W et al, 1995. https://www.nrel.gov/docs/legosti/old/5173.pdf). A value of True will, by contrast, cause NPV calculation to follow the convention used by Excel, Google Sheets, and other common spreadsheet software. Although NREL's NPV convention may typically be considered more technically correct, Excel-style NPV calculation might be preferred for familiarity or compatibility with existing business processes. See https://github.com/NREL/GEOPHIRES-X/discussions/344 for further details.",
16521661
"type": "boolean",

src/geophires_x_schema_generator/geophires-result.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,21 @@
143143
"type": "number",
144144
"description": "",
145145
"units": null
146+
},
147+
"Royalty Holder NPV": {
148+
"type": "number",
149+
"description": "Net Present Value (NPV) of the royalty holder's cash flow stream.",
150+
"units": "MUSD"
151+
},
152+
"Royalty Holder Average Annual Revenue": {
153+
"type": "number",
154+
"description": "The royalty holder's annual revenue stream from the royalty agreement.",
155+
"units": "MUSD/yr"
156+
},
157+
"Royalty Holder Total Revenue": {
158+
"type": "number",
159+
"description": "The total (undiscounted) revenue received by the royalty holder over the project lifetime.",
160+
"units": "MUSD"
146161
}
147162
}
148163
},

tests/test_geophires_x.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import numpy as np
1111

12+
# @formatter:off
1213
# noinspection PyProtectedMember
1314
from geophires_x.EconomicsSam import _cash_flow_profile_row
1415
from geophires_x.OptionList import PlantType
@@ -22,6 +23,8 @@
2223
from geophires_x_client.geophires_input_parameters import GeophiresInputParameters
2324
from geophires_x_client.geophires_input_parameters import ImmutableGeophiresInputParameters
2425
from geophires_x_tests.test_options_list import WellDrillingCostCorrelationTestCase
26+
27+
# @formatter:on
2528
from tests.base_test_case import BaseTestCase
2629

2730

0 commit comments

Comments
 (0)