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
Daylight savings time adding incorrect month calculation in time of use tariff #7814
Comments
After fighting with my debugger, I think I've pinpointed something: it seems that To better illustrate my point, I've taken this block: EnergyPlus/src/EnergyPlus/EconomicTariff.cc Lines 2775 to 2777 in 36db22b
And replaced it with
Running with the defect file (or the MCVE I created) that has DST, and a season schedule like this:
The Fatal is issued. |
This does ring a bell. Just gotta remember where. |
I was thinking of #7462. Doesn't seem the same as your simple schedule. |
…fferent than LookUpScheduleValue Last two EXPECT_EQ are failing.
So, the question is which one is correct? #7462 would say that |
ScheduleManager.cc has three routines with similar blocks of code.
This one is much different: ScheduleManager::LookUpScheduleValues. It seems be doing stuff twice on some occasions (control flow can probably be improved), and appears to add the EnergyPlus/src/EnergyPlus/ScheduleManager.cc Line 2922 in 36db22b
EnergyPlus/src/EnergyPlus/ScheduleManager.cc Line 2954 in 36db22b
|
This block appears to produce no meaningful actions as it's all overwritten later no matter the branches taken. EnergyPlus/src/EnergyPlus/ScheduleManager.cc Lines 2910 to 2927 in 36db22b
|
@JasonGlazer What isn't clear here, is when in May the summer calcs are starting - is it just for that last hour on May 31? |
I don't remember for sure but I assume it was just an hour off in May. |
Then perhaps it's correct as-is. If the utility is collecting meter data hourly (or more often), then the last day of standard time will only have 23 hours of data, and the last day of DST would have 25. If I'm following this correctly, that seems to be what's happening here. There's still the issue of the two different functions returning different results, but that seems to be unrelated to tariff calcs. |
The entire month of may ends up billed at the summer rate, so the error isn't just one hour off. IIUC Tariff(n).seasonForMonth(CurMonth) is constantly overriden and only the last one to get in is used to compute the cost. I'll try the ScheduleManager refactor branch tomorrow. I do think GetScheduleValue and LookUpScheduleValue should return the same though. The different is the determination of the week/day schedule pointers, in one case(LookUp) it's done with HourOfDay then after determination is done DSTIndicator is added, for the other it's directly done with HourOfDay + DSTIndicator |
#7814 - Daylight savings time leading to incorrect season for tariff calculation
Issue overview
The UtilityCost:Tariff object with a time of use period schedule and a season schedule that both start the summer on June 1 are showing summer tariff calculations starting in May. This file has a RunPeriodControl:DaylightSavingTime which starts daylight savings saving in March. When the RunPeriodControl:DaylightSavingTime is removed, the summer calculations are started in June when it is supposed to be.
Details
Some additional details for this issue (if relevant):
Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
The text was updated successfully, but these errors were encountered: