NREL / SAM

System Advisor Model (SAM)
BSD 3-Clause "New" or "Revised" License
337 stars 139 forks source link

REopt API callback error about URDB V7 net metering option #1621

Closed cpaulgilman closed 9 months ago

cpaulgilman commented 10 months ago

Describe the bug

REopt API call fails for net energy metering with $ credits option.

Could not evaluate callback function:call_reopt->on_change
[71]: error in call to 'reopt_size_battery()': ElectricityRates_format_as_URDBv7 error. ur_net_metering_option not available in URDBv7.[12]: eval error in statement list

For description and example file, see https://sam.nrel.gov/forum/forum-general/4427-get-battery-size-with-reopt-under-net-energy-metering-with-credits-error.html#12703

Further testing required. For example, changing to net metering results in:

Could not evaluate callback function:call_reopt->on_change
[71]: error in call to 'reopt_size_battery()': access violation: expected hash table, but found null[12]: eval error in statement list

To Reproduce

  1. Download .sam file from forum discussion (see above).
  2. On Location and Resource page, change weather file to one in library, or download TMY file for Ithaca, NY.
  3. On Battery Cell and System page, click Get size and dispatch.

Expected behavior

REopt API call should handle different metering and billing options without causing a callback error.

Operating System and Version

brtietz commented 9 months ago

The first error is correct - the net metering with $ credits is not supported by the URDB:

image

The error message is written at https://github.com/NREL/ssc/blob/2b168560725379cd23e35538450e5952760610aa/ssc/cmod_utilityrate5_eqns.cpp#L130

Do you have suggestions on how to make the error message more transparent?

I was not able to reproduce the second error. When changing back to net metering the REopt call was successful for me.