Skip to content

Allow for zero time series buy and sell rates#1264

Merged
brtietz merged 3 commits into
developfrom
ssc_1964_allow_zero_ts_rates
Dec 11, 2024
Merged

Allow for zero time series buy and sell rates#1264
brtietz merged 3 commits into
developfrom
ssc_1964_allow_zero_ts_rates

Conversation

@brtietz

@brtietz brtietz commented Dec 10, 2024

Copy link
Copy Markdown
Collaborator

Use a boolean instead of tier_charge == 0 to determine whether time series rates or table rates should be used.

Fixes NatLabRockies/SAM#1964

@brtietz

brtietz commented Dec 10, 2024

Copy link
Copy Markdown
Collaborator Author

Added new SSC test to capture this behavior. The test file from the issue works as well:

image

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAM issue 1964 resolved using this update!

Comment thread ssc/cmod_utilityrate5.cpp

// Fall back to TOU rates if m_ec_ts_sell_rate.size() is too small
if (tier_credit == 0) { // So AFAICT this is to make sure we don't compute both time step and TOU. Maybe better as an else?
if (use_ec_table_sell_rates) { // So AFAICT this is to make sure we don't compute both time step and TOU. Maybe better as an else?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay - not sure is else is more clear or confusing...

EXPECT_TRUE(status);
}

TEST(cmod_utilityrate5_eqns, Test_Residential_TOU_Rates_buyall_sellall_ts_buy_rate) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test!

@brtietz brtietz merged commit 7e7c049 into develop Dec 11, 2024
@brtietz brtietz deleted the ssc_1964_allow_zero_ts_rates branch December 13, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Electricity purchases incorrect with hourly buy rate of zero

3 participants