Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net billing with tiered rates sales/purchases incorrect for some time steps #1738

Closed
cpaulgilman opened this issue Mar 12, 2024 · 1 comment
Assignees
Labels

Comments

@cpaulgilman
Copy link
Collaborator

Describe the bug

For a Residential/Commercial case with tiered energy rates and net billing, electricity sales/purchases is incorrect for some time steps.

Example .sam file with Excel calculations: net-billing-tests.zip

Calculations for flat and TOU energy rates are correct.

To Reproduce

  1. Open .sam file in above zip archive.
  2. Run simulation for "tiered" case and note electricity sales/purchases. See "Tiered" sheet in attached Excel workbook.

Operating System and Version

  • SAM 2023.12.17 r1
  • Windows 11
@brtietz
Copy link
Collaborator

brtietz commented May 3, 2024

The cause of this error was on line https://github.com/NREL/ssc/blame/005b77b3c9fbe73c70806cebe631c30adf169433/ssc/cmod_utilityrate5.cpp#L2399. "tier_credit" should have been "sr". I've pushed a fix to that piece to ssc branch sam_1738_correct_net_billing_sell_rate.

The file above actually identifies a second issue, in that the code does not compute correctly when the energy use crosses multiple tiers in the same step. This looks like it affects the buy rates as well. I'll write up some additional ssc tests that address both of these scenarios (likely based on very helpful the Excel) and get a PR up before the 2nd patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants