-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
#7902 - Fix inappopriate severe error: Heater Control Type for WaterHeater:Stratified must be CYCLE #7934
Conversation
…rm will create the Severe in #7902
enum ControlTypeEnum | ||
{ | ||
Cycle, | ||
Cycle = 0, | ||
Modulate | ||
}; | ||
|
||
// order of ControlTypeEnum and PriorityEnum must be enforced | ||
// WaterThermalTankData uses the same int ControlType to assign either ControlTypeEnum (WaterHeater:Mixed) or PriorityEnum | ||
// (WaterHeater:Stratified), so in order to avoid problems, start the int value here as 2 so they don't risk collapsing. | ||
enum PriorityEnum | ||
{ | ||
MasterSlave, // water heater only, master-slave priority control of heater elements | ||
MasterSlave = 2, // water heater only, master-slave priority control of heater elements | ||
Simultaneous // water heater only, simultaneous control of heater elements | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid future collapses. (We should perhaps make a habit of using enum classes instead...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should definitely do enum classes. But I appreciate that that change is likely out of scope for this little defect fix.
// If WaterHeaterMixed: do not allow modulating control for HPWH's (i.e. modulating control usually used for tankless WH's) | ||
if ((Tank.TypeNum == DataPlant::TypeOf_WtrHeaterMixed) && (Tank.ControlType == ControlTypeEnum::Modulate)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be specific in the check here (this would have fixed the specific issue by itself too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
// Test for #7902: If the Stratified Tank Priority Mode is Simultaneous, it hits a check meant to test | ||
// for ControlTypeEnum::Modulate (for WH:Mixed) because these two enums are the same int values and stored in | ||
// the same int WaterThermalTankData::ControlType | ||
TEST_F(EnergyPlusFixture, HPWH_Wrapped_Stratified_Simultaneous) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One test for HPWH:WrappedCondenser
// Test for #7902: If the HPWH is Pumped, and it has a Stratified Tank which Priority Mode is Simultaneous, | ||
// it hits a check meant to test for ControlTypeEnum::Modulate (for WH:Mixed) | ||
// because these two enums are the same int values and stored in the same int WaterThermalTankData::ControlType | ||
TEST_F(EnergyPlusFixture, HPWH_Pumped_Stratified_Simultaneous) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One test for HPWH:PumpedCondenser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes make sense, great unit tests, and thanks for cleaning out that Python notebook while you were in there.
// If WaterHeaterMixed: do not allow modulating control for HPWH's (i.e. modulating control usually used for tankless WH's) | ||
if ((Tank.TypeNum == DataPlant::TypeOf_WtrHeaterMixed) && (Tank.ControlType == ControlTypeEnum::Modulate)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
enum ControlTypeEnum | ||
{ | ||
Cycle, | ||
Cycle = 0, | ||
Modulate | ||
}; | ||
|
||
// order of ControlTypeEnum and PriorityEnum must be enforced | ||
// WaterThermalTankData uses the same int ControlType to assign either ControlTypeEnum (WaterHeater:Mixed) or PriorityEnum | ||
// (WaterHeater:Stratified), so in order to avoid problems, start the int value here as 2 so they don't risk collapsing. | ||
enum PriorityEnum | ||
{ | ||
MasterSlave, // water heater only, master-slave priority control of heater elements | ||
MasterSlave = 2, // water heater only, master-slave priority control of heater elements | ||
Simultaneous // water heater only, simultaneous control of heater elements | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should definitely do enum classes. But I appreciate that that change is likely out of scope for this little defect fix.
Pulled in develop locally, resolved one unit test build problem. Ran the defect file with develop and found the severe error tucked in there with the other warnings/errors. Ran the defect file with this branch and that specific error is gone. As expected the file still fails for other reasons. Also ran the unit test suite with this branch and it passes fine. I'm pushing it up just to make sure CI is happy with my merge but I anticipate this will merge today. Thanks @jmarrec. |
All happy here, Windows CI failures are the known MTD regulars. Merging. |
Pull request overview
WaterThermalTanksData::ControlType
: theControlTypeEnum
(Cycle / Modulate, for WaterHeater:Mixed) and thePriorityEnum
(MasterSlave / Simultaneous, for WaterHeater:Stratified)(Also Fix #7892)
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.