Skip to content

Commit

Permalink
Surface error cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Nov 30, 2023
1 parent 3c76a8b commit d9aa4fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/EnergyPlus/HeatBalanceIntRadExchange.cc
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ namespace HeatBalanceIntRadExchange {

Array2D<Real64> SaveApproximateViewFactors; // Save for View Factor reporting
std::string Option1; // view factor report option
static constexpr std::string_view RoutineName("InitSolarViewFactors: ");

bool ErrorsFound = false;
bool ViewFactorReport = false;
Expand Down Expand Up @@ -817,7 +818,7 @@ namespace HeatBalanceIntRadExchange {
}
}
thisEnclosure.NumOfSurfaces = numEnclosureSurfaces;
if (numEnclosureSurfaces < 1) ShowFatalError(state, "No surfaces in an enclosure in InitSolarViewFactors");
if (numEnclosureSurfaces < 1) ShowFatalError(state, format("{}No surfaces in enclosure={}.", RoutineName, thisEnclosure.Name));

// Allocate the parts of the derived type
thisEnclosure.F.dimension(numEnclosureSurfaces, numEnclosureSurfaces, 0.0);
Expand Down
12 changes: 8 additions & 4 deletions src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ namespace SurfaceGeometry {
for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
auto &thisZone = state.dataHeatBal->Zone(ZoneNum);
bool nonInternalMassSurfacesPresent = false;
bool internalMassSurfacesPresent = false;
Real64 TotSurfArea = 0.0;
thisZone.Centroid = Vector(0.0, 0.0, 0.0);
if ((thisZone.AllSurfaceFirst > 0) && (state.dataSurface->Surface(thisZone.AllSurfaceFirst).Sides > 0)) {
Expand All @@ -573,8 +574,11 @@ namespace SurfaceGeometry {

for (int SurfNum = thisSpace.AllSurfaceFirst; SurfNum <= thisSpace.AllSurfaceLast; ++SurfNum) {
auto &thisSurface = state.dataSurface->Surface(SurfNum);
if (thisSurface.Class == SurfaceClass::IntMass) continue;
nonInternalMassSurfacesPresent = true;
if (thisSurface.Class == SurfaceClass::IntMass) {
internalMassSurfacesPresent = true;
continue;
}
if (!thisSurface.IsAirBoundarySurf) nonInternalMassSurfacesPresent = true;
if (thisSurface.Class == SurfaceClass::Wall || (thisSurface.Class == SurfaceClass::Roof) ||
(thisSurface.Class == SurfaceClass::Floor)) {

Expand All @@ -596,7 +600,7 @@ namespace SurfaceGeometry {
thisZone.Centroid.y /= TotSurfArea;
thisZone.Centroid.z /= TotSurfArea;
}
if (!nonInternalMassSurfacesPresent) {
if (internalMassSurfacesPresent && !nonInternalMassSurfacesPresent) {
ShowSevereError(
state, format("{}Zone=\"{}\" has only internal mass surfaces. Need at least one other surface.", RoutineName, thisZone.Name));
ErrorsFound = true;
Expand Down Expand Up @@ -2910,7 +2914,7 @@ namespace SurfaceGeometry {
}
for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) {
if (int(state.dataHeatBal->space(spaceNum).surfaces.size()) == 0) {
ShowWarningError(state, format("{}Space = {} has no surfaces.", RoutineName, state.dataHeatBal->space(spaceNum).Name));
ShowWarningError(state, format("{}Space={} has no surfaces.", RoutineName, state.dataHeatBal->space(spaceNum).Name));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/SurfaceGeometry.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11267,7 +11267,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder4)
SetupZoneGeometry(*state, ErrorsFound);
EXPECT_TRUE(ErrorsFound); // expect errors
std::string const error_string = delimited_string(
{" ** Warning ** createSpaceSurfaceLists: Space = ATTIC ZONE has no surfaces.",
{" ** Warning ** createSpaceSurfaceLists: Space=ATTIC ZONE has no surfaces.",
" ** Warning ** No floor exists in Zone=\"ATTIC ZONE\", zone floor area is zero. All values for this zone that are entered per floor "
"area will be zero.",
" ** Warning ** Indicated Zone Volume <= 0.0 for Zone=ATTIC ZONE",
Expand Down

5 comments on commit d9aa4fe

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

ZoneNoSurfs10305 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3584 of 3587 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1483
  • Failed: 3

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

ZoneNoSurfs10305 (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2756 of 2759 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1481
  • Failed: 3

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

ZoneNoSurfs10305 (mjwitte) - x86_64-MacOS-10.17-clang-14.0.0: OK (3543 of 3546 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1483
  • Failed: 3

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.

ZoneNoSurfs10305 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1969 of 1972 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 1483
  • Failed: 3

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

ZoneNoSurfs10305 (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (790 of 790 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.