@@ -413,7 +413,7 @@ def _get_single_owner_parameters(model: Model) -> dict[str, Any]:
413
413
ret ['ppa_price_input' ] = ppa_price_schedule_per_kWh
414
414
415
415
if model .economics .royalty_rate .Provided :
416
- ret ['om_production' ] = _get_royalties_variable_om_per_MWh_schedule (model )
416
+ ret ['om_production' ] = _get_royalties_variable_om_USD_per_MWh_schedule (model )
417
417
418
418
# Debt/equity ratio ('Fraction of Investment in Bonds' parameter)
419
419
ret ['debt_percent' ] = _pct (econ .FIB )
@@ -436,22 +436,21 @@ def _get_single_owner_parameters(model: Model) -> dict[str, Any]:
436
436
return ret
437
437
438
438
439
- def _get_royalties_variable_om_per_MWh_schedule (model : Model ):
440
- """TODO price unit in method name"""
441
-
439
+ def _get_royalties_variable_om_USD_per_MWh_schedule (model : Model ):
442
440
royalty_rate_schedule = _get_royalty_rate_schedule (model )
443
441
ppa_price_schedule_per_kWh = _get_ppa_price_schedule_per_kWh (model )
444
442
445
443
# For each year, calculate the royalty as a $/MWh variable cost.
446
444
# The royalty is a percentage of revenue (MWh * $/MWh). By setting the
447
445
# variable O&M rate to (PPA Price * Royalty Rate), SAM's calculation
448
446
# (Rate * MWh) will correctly yield the total royalty payment.
449
- variable_om_schedule_per_MWh = [
450
- (price_kWh * 1000 ) * royalty_fraction # TODO use pint unit conversion instead
447
+ variable_om_schedule_USD_per_MWh = [
448
+ quantity (price_kWh , model .economics .ElecStartPrice .CurrentUnits ).to ('USD / megawatt_hour' ).magnitude
449
+ * royalty_fraction
451
450
for price_kWh , royalty_fraction in zip (ppa_price_schedule_per_kWh , royalty_rate_schedule )
452
451
]
453
452
454
- return variable_om_schedule_per_MWh
453
+ return variable_om_schedule_USD_per_MWh
455
454
456
455
457
456
def _get_fed_and_state_tax_rates (geophires_ctr_tenths : float ) -> tuple [list [float ]]:
@@ -471,18 +470,22 @@ def _pct(econ_value: Parameter) -> float:
471
470
return econ_value .quantity ().to (convertible_unit ('%' )).magnitude
472
471
473
472
474
- def _get_ppa_price_schedule_per_kWh (model : Model ) -> list [float ]:
475
- """TODO price unit in method name"""
473
+ def _get_ppa_price_schedule_per_kWh (model : Model ) -> list :
474
+ """
475
+ :return: quantity list of PPA price schedule per kWh in econ.ElecStartPrice.CurrentUnits
476
+ """
476
477
477
478
econ = model .economics
478
- return _ppa_pricing_model (
479
+ pricing_model = _ppa_pricing_model (
479
480
model .surfaceplant .plant_lifetime .value ,
480
481
econ .ElecStartPrice .value ,
481
482
econ .ElecEndPrice .value ,
482
483
econ .ElecEscalationStart .value ,
483
484
econ .ElecEscalationRate .value ,
484
485
)
485
486
487
+ return [quantity (it , econ .ElecStartPrice .CurrentUnits ).magnitude for it in pricing_model ]
488
+
486
489
487
490
def _ppa_pricing_model (
488
491
plant_lifetime : int , start_price : float , end_price : float , escalation_start_year : int , escalation_rate : float
0 commit comments