Fix Unitary System Multispeed Heat Pump Not Propagating Error Flag#11433
Fix Unitary System Multispeed Heat Pump Not Propagating Error Flag#11433
Conversation
| UnitarySystemPerformance:Multispeed, | ||
| MultiSpeed Performance, !- Name | ||
| 1, !- Number of Speeds for Heating | ||
| 2, !- Number of Speeds for Cooling |
There was a problem hiding this comment.
This doesn't match the name of the test ("ZeroCoolingSpeedTest"). @rraustad thoughts on whether this or the test name needs to change?
There was a problem hiding this comment.
Well first off, the name of this new object, MultiSpeed Performance doesn't match what is used in the UnitarySystem object as Sys 1 Furnace DX Cool Unitary System MultiSpeed Performance at line 26819. So I would guess this new object isn't even used and the rest of the unit test (e.g., EXPECT_EQ) wasn't affected. I'm not exactly sure what this "ZeroCoolingSpeedTest" is testing for but I suspect if the name of the UnitarySystemPerformance:Multispeed is corrected it will quickly become apparent.
There was a problem hiding this comment.
Good catch, I thought I corrected that. Just checked locally, and either way, it doesn't appear to matter what the name is. Fun.
There was a problem hiding this comment.
It may not matter in this unit test, but I hope it matters in a simulation. I do see that the EXPECT_EQ's are looking for the cooling coil to be off. Whether that's a result of the multispeed performance object (obviously not) or something else is the question. I think the unit test is testing this line so adding a multispeed performance object will likely not change the result.
thisSys->m_CoolingSpeedNum = 0;
There was a problem hiding this comment.
It looks like getDesignSpecMSHPIndex raises a severe error message and returns a -1 when a matching object isn't found. However, errorsFound never gets raised. There also are a handful of places where we are doing something if the index is >-1 (i.e. we have a valid, named performance object), but then don't catch the other side of it.
Are there any legitimate cases where we don't find the object, and then just continue on? It seems to me we should either find a valid object, or fatal out. Thoughts?
There was a problem hiding this comment.
I think it would be fair to say that if the inputs are blank then -1 is valid, otherwise a valid object should be found.
| } | ||
|
|
||
| void DesignSpecMSHP::getDesignSpecMSHPdata(EnergyPlusData &state, bool errorsFound) | ||
| void DesignSpecMSHP::getDesignSpecMSHPdata(EnergyPlusData &state, bool &errorsFound) |
There was a problem hiding this comment.
Agreed!
DesignSpecMSHP::getDesignSpecMSHPdata(state, errorsFound);
if (errorsFound) {
ShowFatalError(state, "Design Specification MultiSpeed Heat Pump: Previous errors cause termination.");
}
There was a problem hiding this comment.
So with this fix how could the original unit test have completed without fatal'ing out?
Pull request overview
The unitary system getDesignSpecMSHPdata function has an
errorsFoundflag that was getting passed by value. However, right above it it's clear it should be passing by ref soerrorsFoundcan be bubbled up to the where it should fatal out when errors are raised.Description of the purpose of this PR
Pull Request Author
Reviewer