-
Notifications
You must be signed in to change notification settings - Fork 448
Correct Error Message Level when Node Types are Undefined #11104
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
Correct Error Message Level when Node Types are Undefined #11104
Conversation
Just a little experiment with our test suite to see if there are any other failures of this kind...
This commit corrects the temporary text of the fatal error. It also corrects the input file that now causes a severe/fatal error. This input file will have different results than develop because the node issue has been fixed in this input file.
This unit test causes the error message that was changed and tests to make sure that it is being correctly reported at the correct level.
|
I should have added that the changes will result in differences in the input files. The unrevised IDF will fatal out now rather than just have a warning message. Also when comparing the old input file run with develop to the new input file run in the revised code, there will be differences in the output. All other files should show no differences in the output. |
src/EnergyPlus/SimulationManager.cc
Outdated
ShowContinueError(state, " Node Types are still UNDEFINED -- See Branch/Node Details file for further information"); | ||
ShowContinueError(state, format(" Inlet Node : {}", state.dataBranchNodeConnections->CompSets(Count).InletNodeName)); | ||
ShowContinueError(state, format(" Outlet Node: {}", state.dataBranchNodeConnections->CompSets(Count).OutletNodeName)); | ||
ShowFatalError(state, "Please correct either the branch nodes or the component nodes so that they match."); |
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.
@RKStrand When I test the original file (with missing nodes) the new code crashes. I'm not sure why/how, but following this in the debugger, ShowFatalError
is being called multiple times. Adding a local error flag and moving the ShowFata to the end of ReportLoopConnections
seems to fix this.
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.
Note that this change will require some changes to your unit test.
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.
Weird. Not sure what happened there. I'll implement the recommended change and update the unit test. Look for the mods after the holiday weekend (hopefully). Thanks!
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.
@mjwitte Latest commit fixes this problem. Avoids a hard crash as per your suggestion. Unit test also updated.
Corrected a problem where the original IDF that revealed the problem was crashing after the fix was made. This commit corrects the problem and updates the unit test to reflect this change.
|
…ngNodesinWaterHeaterMixedErrorMessageLevel
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.
Original defect file now produces this error:
** Severe ** Potential Node Connection Error for object WATERHEATER:MIXED, name=SHWSYS1 WATER HEATER
** ~~~ ** Node Types are still UNDEFINED -- See Branch/Node Details file for further information
** ~~~ ** Inlet Node : SHWSYS1 PUMP-SHWSYS1 WATER HEATERNODE
** ~~~ ** Outlet Node: SHWSYS1 SUPPLY EQUIPMENT OUTLET NODE
************* There was 1 node connection error noted.
** Fatal ** Please see severe error(s) and correct either the branch nodes or the component nodes so that they match.
I'll merge in develop and let CI run one more time, then merge.
|
CI is all green. Setting this to merge queue since @Myoldmopar is busy merging at the moment. |
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 good, will check locally now.
|
||
if (nodeConnectionErrorFlag) { | ||
ShowFatalError(state, "Please see severe error(s) and correct either the branch nodes or the component nodes so that they match."); | ||
} |
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.
This is a fine fix, bumping it to a severe makes sense. And adding the separate flag to provide extra error context is a good change.
BLDG_SWH_SCH, !- Use Flow Rate Fraction Schedule Name | ||
, !- Cold Water Supply Temperature Schedule Name | ||
SHWSys1 Pump-SHWSys1 Water HeaterNode, !- Use Side Inlet Node Name | ||
SHWSys1 Supply Equipment Outlet Node; !- Use Side Outlet Node Name |
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.
And yeah, good stuff getting the test file fixed up.
" ..... Last severe error=Potential Node Connection Error for object WATERHEATER:MIXED, name=WaterHeaterMixed1", | ||
}); | ||
|
||
EXPECT_TRUE(compare_err_stream(error_string, true)); |
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.
As a quick aside, there is a separate unit test function that you can call that is a bit easier. In this case, we don't care what the exact error output looks like. We just really want to make sure it is reporting the node connection error. Instead of compare_err_stream()
, try compare_err_stream_substring()
. In that function you could call:
EXPECT_TRUE(compare_err_stream_substring("Potential Node Connection Error", true));
and that should be sufficient.
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.
@Myoldmopar That is very interesting and not something that I realized was an option. I will definitely try to remember that the next time I need to do something like this in a unit test. Thanks!
Passing happily here, merging. Thanks @RKStrand |
Pull request overview
Description of the purpose of this PR
In an example file in our test suite, there exists a water heater that does not have any nodes defined in its own object but it is part of a branch where nodes for this object are defined. This conflict is noted with a warning message, but the simulation is allowed to continue with unknown consequences. With this correction, the error message has been bumped up to a severe/fatal so that the user has to fix the problem/inconsistency in the input file. In addition, the input file (ASHRAE901_OfficeSmall_STD2019_Denver.idf) has been corrected so that the branch and the water heater object both have the inlet and outlet node names. A unit test that verifies the error occurrence and messages is also included.
In general, any connection error where the parent (in this case the Branch) has registered node connections that are not matched by a child object (in this case the water heater) leaving the node types unefined will now result in a severe/fatal error.
Previous error:
Revised error:
Pull Request Author
Reviewer