Skip to content

Commit

Permalink
Take 2 - fix for Zone outside boundary condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Jan 23, 2025
1 parent db7d6b0 commit f3bf9be
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1208,16 +1208,7 @@ namespace SurfaceGeometry {
auto &newZone = state.dataHeatBal->Zone(Found);
newSurf.ZoneName = newZone.Name;
assert(newZone.spaceIndexes.size() >= 1);
newSurf.spaceNum = newZone.spaceIndexes[0];
if (newZone.spaceIndexes.size() > 1) {
ShowWarningError(
state, format("{}Outside Boundary Condition=Zone but Zone has more than one Space, Surface={}", RoutineName, curSurf.Name));
ShowContinueError(
state,
format("Zone={}. Setting outside boundary to first Space={}. For more control, use Outside Boundary Condition=Space.",
newZone.Name,
state.dataHeatBal->space(newSurf.spaceNum).Name));
}
newSurf.spaceNum = 0; // clear this here and set later
} else if (curSurf.ExtBoundCond == unenteredAdjacentSpaceSurface) {
int Found = Util::FindItemInList(curSurf.ExtBoundCondName, state.dataHeatBal->space, state.dataGlobal->numSpaces);
if (Found == 0) continue;
Expand Down Expand Up @@ -2721,7 +2712,10 @@ namespace SurfaceGeometry {
}
if (thisSurf.spaceNum > 0) {
anySurfacesWithSpace(thisSurf.Zone) = true;
} else {
} else if (thisSurf.ExtBoundCond != unreconciledZoneSurface) {
anySurfacesWithoutSpace(thisSurf.Zone) = true;
} else if (thisSurf.Name.substr(0, 3) != "iz-") {
// Only trigger a new space if the spaceless surface is not an autogenerated interzone surface
anySurfacesWithoutSpace(thisSurf.Zone) = true;
}
}
Expand All @@ -2736,6 +2730,7 @@ namespace SurfaceGeometry {
if (anySurfacesWithSpace(zoneNum)) {
// Add new space
++state.dataGlobal->numSpaces;
assert(state.dataHeatBal->space.size() >= state.dataGlobal->numSpaces);
state.dataHeatBal->space(state.dataGlobal->numSpaces).zoneNum = zoneNum;
// Add to zone's list of spaces
thisZone.spaceIndexes.emplace_back(state.dataGlobal->numSpaces);
Expand Down

3 comments on commit f3bf9be

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10697SurfaceBoundary (mjwitte) - x86_64-Linux-Ubuntu-24.04-gcc-13.3: OK (2920 of 2920 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10697SurfaceBoundary (mjwitte) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo: OK (2102 of 2102 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10697SurfaceBoundary (mjwitte) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-IntegrationCoverage-RelWithDebInfo: OK (801 of 801 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.