Repository navigation
Fix #5665 - ForwardTranslator segfault for SetpointManager on HeatPumpAirToWaterHeating - #5670
Open
PranaySiddharthBhange wants to merge 1 commit into
Conversation
…terHeating setpointComponents() replaced each on-loop component with operationSchemeComponent(comp) before inletNode/outletNode/flowrate were looked up against it. For components reported via their containing component (eg: HeatPumpAirToWaterHeating -> HeatPumpAirToWater), that container isn't itself on the plant loop's supply branch, so supplyComponents() can't locate it and the OS_ASSERT in inletNode/outletNode trips, segfaulting in Release builds. Keep the on-loop component for node/flowrate/componentType lookups, and only switch to the containing component for IDF translation and naming. Also turn the OS_ASSERT in inletNode/outletNode into a boost::none return so any other case where the component isn't found on the branch fails gracefully instead of crashing. Fixes NatLabRockies#5665
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request overview
ForwardTranslatorsegfaults when aSetpointManageris placed on theoutlet node of a
HeatPumpAirToWaterHeatingthat is on a plant loop'ssupply side.
Root cause
setpointComponents()replaced each on-loop component withoperationSchemeComponent(comp)before the caller looked up the loopinlet/outlet nodes and flow rate against it. For components reported via
their containing component (eg:
HeatPumpAirToWaterHeating->HeatPumpAirToWater), that container isn't itself on the plant loop'ssupply branch, so
supplyComponents()can't locate it and theOS_ASSERTininletNode/outletNodetrips, segfaulting in Releasebuilds.
Fix
Keep the actual on-loop component for node/flowrate/componentType
lookups, and only switch to the containing component for IDF translation
and naming. Also turn the
OS_ASSERTininletNode/outletNodeinto aboost::nonereturn so any other case where the component isn't foundon the branch fails gracefully instead of crashing.
Pull Request Author
src/model/test)src/energyplus/Test)src/osversion/VersionTranslator.cpp)No API changes, no new/modified IDD fields, no VersionTranslation needed - this is a pure logic fix in the ForwardTranslator plus a regression test. Built locally (Conan2/CMake/Ninja, Release) and ran the full
openstudio_energyplus_testssuite: 636/636 passed, no regressions. Did not build C# bindings locally.