@@ -413,7 +413,7 @@ def _get_single_owner_parameters(model: Model) -> dict[str, Any]:
413413 ret ['ppa_price_input' ] = ppa_price_schedule_per_kWh
414414
415415 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 )
417417
418418 # Debt/equity ratio ('Fraction of Investment in Bonds' parameter)
419419 ret ['debt_percent' ] = _pct (econ .FIB )
@@ -436,22 +436,21 @@ def _get_single_owner_parameters(model: Model) -> dict[str, Any]:
436436 return ret
437437
438438
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 ):
442440 royalty_rate_schedule = _get_royalty_rate_schedule (model )
443441 ppa_price_schedule_per_kWh = _get_ppa_price_schedule_per_kWh (model )
444442
445443 # For each year, calculate the royalty as a $/MWh variable cost.
446444 # The royalty is a percentage of revenue (MWh * $/MWh). By setting the
447445 # variable O&M rate to (PPA Price * Royalty Rate), SAM's calculation
448446 # (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
451450 for price_kWh , royalty_fraction in zip (ppa_price_schedule_per_kWh , royalty_rate_schedule )
452451 ]
453452
454- return variable_om_schedule_per_MWh
453+ return variable_om_schedule_USD_per_MWh
455454
456455
457456def _get_fed_and_state_tax_rates (geophires_ctr_tenths : float ) -> tuple [list [float ]]:
@@ -471,18 +470,22 @@ def _pct(econ_value: Parameter) -> float:
471470 return econ_value .quantity ().to (convertible_unit ('%' )).magnitude
472471
473472
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+ """
476477
477478 econ = model .economics
478- return _ppa_pricing_model (
479+ pricing_model = _ppa_pricing_model (
479480 model .surfaceplant .plant_lifetime .value ,
480481 econ .ElecStartPrice .value ,
481482 econ .ElecEndPrice .value ,
482483 econ .ElecEscalationStart .value ,
483484 econ .ElecEscalationRate .value ,
484485 )
485486
487+ return [quantity (it , econ .ElecStartPrice .CurrentUnits ).magnitude for it in pricing_model ]
488+
486489
487490def _ppa_pricing_model (
488491 plant_lifetime : int , start_price : float , end_price : float , escalation_start_year : int , escalation_rate : float
0 commit comments