From f4facf5e89430deddd7c9df6379354bd4cce4b52 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 29 Nov 2023 13:56:57 -0600 Subject: [PATCH 1/5] Extend unit tests for surface order and first/last surface values --- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 2409 ++++++++++++++++++- 1 file changed, 2398 insertions(+), 11 deletions(-) diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 4c10d01f90a..5c9e8084f21 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -8661,10 +8661,6 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) SetupZoneGeometry(*state, ErrorsFound); EXPECT_FALSE(ErrorsFound); // expect no errors - - GetSurfaceData(*state, ErrorsFound); // setup zone geometry and get zone data - EXPECT_FALSE(ErrorsFound); // expect no errors - // compare_err_stream( "" ); // just for debugging // This tests the sorted order of surfaces in two ways: @@ -8718,11 +8714,11 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) // 12. Living:Ceiling (ceiling) // 13. Living:Floor (floor) // 14. WestDoor (door) - // 15. TubularDaylightingDiffuser1 ("window") - // 16. NorthWindow (window) - // 17. EastWindow (window) - // 18. SouthWindow (window) - // 19. WestWindow (window) + // 15. NorthWindow (window) + // 16. EastWindow (window) + // 17. SouthWindow (window) + // 18. WestWindow (window) + // 19. TubularDaylightingDiffuser1 ("window") // GARAGE ZONE: // 20. Garage:Interior (wall) // 21. Garage:EastWall (wall) @@ -8837,11 +8833,11 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(floorLivingFloor, 12); EXPECT_EQ(ceilingLivingCeiling, 13); EXPECT_EQ(doorWestDoor, 14); - EXPECT_EQ(windowTubularDaylightingDiffuser1, 19); EXPECT_EQ(windowNorthWindow, 15); EXPECT_EQ(windowEastWindow, 16); EXPECT_EQ(windowSouthWindow, 17); EXPECT_EQ(windowWestWindow, 18); + EXPECT_EQ(windowTubularDaylightingDiffuser1, 19); EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceFirst, 7); EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceLast, 19); EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceFirst, 7); @@ -8900,8 +8896,8 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_EQ(roofNorthRoof4, 36); EXPECT_EQ(roofEastRoof, 37); EXPECT_EQ(roofWestRoof, 38); - EXPECT_EQ(nonwindowTubularDaylightingDome1, 40); EXPECT_EQ(windowAtticSkylight, 39); + EXPECT_EQ(nonwindowTubularDaylightingDome1, 40); EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceFirst, wallEastGable); EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceLast, nonwindowTubularDaylightingDome1); EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceFirst, wallEastGable); @@ -9058,6 +9054,2397 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder) EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); } +TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder2) +{ + // First zone, LIVING ZONE, has no surfaces + + bool ErrorsFound(false); + + std::string const idf_objects = delimited_string({ + " Material,", + " A1 - 1 IN STUCCO, !- Name", + " Smooth, !- Roughness", + " 2.5389841E-02, !- Thickness {m}", + " 0.6918309, !- Conductivity {W/m-K}", + " 1858.142, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + " Material,", + " CB11, !- Name", + " MediumRough, !- Roughness", + " 0.2032000, !- Thickness {m}", + " 1.048000, !- Conductivity {W/m-K}", + " 1105.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material,", + " GP01, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1600000, !- Conductivity {W/m-K}", + " 801.0000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN02, !- Name", + " Rough, !- Roughness", + " 9.0099998E-02, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN05, !- Name", + " Rough, !- Roughness", + " 0.2458000, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " PW03, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1150000, !- Conductivity {W/m-K}", + " 545.0000, !- Density {kg/m3}", + " 1213.000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7800000, !- Solar Absorptance", + " 0.7800000; !- Visible Absorptance", + + " Material,", + " CC03, !- Name", + " MediumRough, !- Roughness", + " 0.1016000, !- Thickness {m}", + " 1.310000, !- Conductivity {W/m-K}", + " 2243.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.6500000, !- Solar Absorptance", + " 0.6500000; !- Visible Absorptance", + + " Material,", + " HF-A3, !- Name", + " Smooth, !- Roughness", + " 1.5000000E-03, !- Thickness {m}", + " 44.96960, !- Conductivity {W/m-K}", + " 7689.000, !- Density {kg/m3}", + " 418.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material:NoMass,", + " AR02, !- Name", + " VeryRough, !- Roughness", + " 7.8000002E-02, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7000000, !- Solar Absorptance", + " 0.7000000; !- Visible Absorptance", + + " Material:NoMass,", + " CP02, !- Name", + " Rough, !- Roughness", + " 0.2170000, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " WindowMaterial:Glazing,", + " CLEAR 3MM, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.837, !- Solar Transmittance at Normal Incidence", + " 0.075, !- Front Side Solar Reflectance at Normal Incidence", + " 0.075, !- Back Side Solar Reflectance at Normal Incidence", + " 0.898, !- Visible Transmittance at Normal Incidence", + " 0.081, !- Front Side Visible Reflectance at Normal Incidence", + " 0.081, !- Back Side Visible Reflectance at Normal Incidence", + " 0.0, !- Infrared Transmittance at Normal Incidence", + " 0.84, !- Front Side Infrared Hemispherical Emissivity", + " 0.84, !- Back Side Infrared Hemispherical Emissivity", + " 0.9; !- Conductivity {W/m-K}", + + " WindowMaterial:Gas,", + " AIR 6MM, !- Name", + " AIR, !- Gas Type", + " 0.006; !- Thickness {m}", + + " Construction,", + " EXTWALL:LIVING, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " INTERIORWall, !- Name", + " GP01, !- Outside Layer", + " IN02, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " FLOOR:GARAGE, !- Name", + " CC03; !- Outside Layer", + + " Construction,", + " FLOOR:LIVING, !- Name", + " CC03, !- Outside Layer", + " CP02; !- Layer 2", + + " Construction,", + " ROOF, !- Name", + " AR02, !- Outside Layer", + " PW03; !- Layer 2", + + " Construction,", + " EXTWALL:GARAGE, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11; !- Layer 2", + + " Construction,", + " CEILING:LIVING, !- Name", + " IN05, !- Outside Layer", + " GP01; !- Layer 2", + + " Construction,", + " reverseCEILING:LIVING, !- Name", + " GP01, !- Outside Layer", + " IN05; !- Layer 2", + + " Construction,", + " GABLE, !- Name", + " PW03; !- Outside Layer", + + " Construction,", + " Dbl Clr 3mm/6mm Air, !- Name", + " CLEAR 3MM, !- Outside Layer", + " AIR 6MM, !- Layer 2", + " CLEAR 3MM; !- Layer 3", + + " Construction,", + " Garage:SteelDoor, !- Name", + " HF-A3; !- Outside Layer", + + " Construction,", + " CEILING:Garage, !- Name", + " GP01; !- Outside Layer", + + " Zone,", + " LIVING ZONE; !- Name", + + " Zone,", + " GARAGE ZONE; !- Name", + + " Zone,", + " ATTIC ZONE; !- Name", + + " GlobalGeometryRules,", + " UpperLeftCorner, !- Starting Vertex Position", + " CounterClockWise, !- Vertex Entry Direction", + " World; !- Coordinate System", + + " WindowMaterial:Glazing,", + " Clear Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.92, !- Solar Transmittance at Normal Incidence", + " 0.05, !- Front Side Solar Reflectance at Normal Incidence", + " 0.05, !- Back Side Solar Reflectance at Normal Incidence", + " 0.92, !- Visible Transmittance at Normal Incidence", + " 0.05, !- Front Side Visible Reflectance at Normal Incidence", + " 0.05, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + + " WindowMaterial:Glazing,", + " Diffusing Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.0022, !- Thickness {m}", + " 0.90, !- Solar Transmittance at Normal Incidence", + " 0.08, !- Front Side Solar Reflectance at Normal Incidence", + " 0.08, !- Back Side Solar Reflectance at Normal Incidence", + " 0.90, !- Visible Transmittance at Normal Incidence", + " 0.08, !- Front Side Visible Reflectance at Normal Incidence", + " 0.08, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + "", + " Material,", + " Very High Reflectivity Surface, !- Name", + " Smooth, !- Roughness", + " 0.0005, !- Thickness {m}", + " 237, !- Conductivity {W/m-K}", + " 2702, !- Density {kg/m3}", + " 903, !- Specific Heat {J/kg-K}", + " 0.90, !- Thermal Absorptance", + " 0.05, !- Solar Absorptance", + " 0.05; !- Visible Absorptance", + " Construction,", + " TDD Pipe, !- Name", + " Very High Reflectivity Surface; !- Outside Layer", + "", + " Construction,", + " TDD Dome, !- Name", + " Clear Acrylic Plastic; !- Outside Layer", + "", + " Construction,", + " TDD Diffuser, !- Name", + " Diffusing Acrylic Plastic; !- Outside Layer", + + " DaylightingDevice:Tubular,", + " Pipe1, !- Name", + " TubularDaylightingDome1, !- Dome Name", + " TubularDaylightingDiffuser1, !- Diffuser Name", + " TDD Pipe, !- Construction Name", + " 0.3556, !- Diameter {m}", + " 1.4, !- Total Length {m}", + " 0.28, !- Effective Thermal Resistance {m2-K/W}", + " ATTIC ZONE, !- Transition Zone 1 Name", + " 1.1; !- Transition Zone 1 Length {m}", + + " FenestrationSurface:Detailed,", + " TubularDaylightingDome1, !- Name", + " TubularDaylightDome, !- Surface Type", + " TDD Dome, !- Construction Name", + " NorthRoof1, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.0, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 13.782,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,6.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 0,6.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 0,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof1, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 0,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 0,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " SouthRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0.000000,5.389000,4.683800, !- X,Y,Z ==> Vertex 1 {m}", + " 0.000000,0.000000,2.438400, !- X,Y,Z ==> Vertex 2 {m}", + " 17.24200,0.000000,2.438400, !- X,Y,Z ==> Vertex 3 {m}", + " 17.24200,5.389000,4.683800; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof2, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 10.332,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 0.0,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 0.0,7.3172,3.8804; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof3, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 13.782,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof4, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 17.242,7.3172,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " EastGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 17.242,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,0.0,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " WestGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 0.0,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 0.0,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 0.0,0.0,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " EastRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " WestRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 13.782,16.876,3.8804; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 13.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,16.876,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,16.876,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " Garage:EastWall, !- Name", + " WALL, !- Surface Type", + " EXTWALL:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,10.778,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,16.876,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:WestWall, !- Name", + " WALL, !- Surface Type", + " EXTWALL:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,16.876,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,10.778,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 10.323,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " InternalMass,", + " EVChargingStation, !- Name", + " Garage:SteelDoor, !- Construction Name", + " GARAGE ZONE, !- Zone or ZoneList Name", + " , !- Space Name", + " 88.249272671219; !- Surface Area {m2}", + + " BuildingSurface:Detailed,", + " Garage:FrontDoor, !- Name", + " WALL, !- Surface Type", + " Garage:SteelDoor, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,16.876,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,16.876,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 10.323,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Attic:GarageFloor, !- Name", + " FLOOR, !- Surface Type", + " CEILING:Garage, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Garage:Ceiling, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,16.876,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:Ceiling, !- Name", + " CEILING, !- Surface Type", + " CEILING:Garage, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Attic:GarageFloor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:Floor, !- Name", + " FLOOR, !- Surface Type", + " FLOOR:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Garage:Floor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,16.876,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,16.876,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,0; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " AtticSkylight, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " EastRoof, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 14.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 14.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 15.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 15.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + GetProjectControlData(*state, ErrorsFound); // read project control data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetMaterialData(*state, ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(*state, ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(*state, ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(*state, ErrorsFound); + EXPECT_TRUE(ErrorsFound); // expect errors due to zone with no surfaces + // compare_err_stream( "" ); // just for debugging + + // This tests the space surface first/last values after surfaces are sorted: + // + // Simulation Order: + // All shading surfaces (including mirrored surfaces) + // Shading:Site + // Shading:Building + // Shading:Zone (and variants) + // + // By zone (in the order the zones appear in the idf): + // Walls + // Floors + // Roofs + // Internal Mass + // Doors + // Windows + // TDD_Domes + // + // Special cases: + // TubularDaylightDome is treated as a separate surface type + // TubularDaylightDiffuser is treated as a window subsurface + + // For this test, the order should be + // Simulation Order (1-based): + // GARAGE ZONE: + // 1. Garage:EastWall (wall) + // 2. Garage:WestWall (wall) + // 3. Garage:FrontDoor (wall) + // 4. Garage:Floor (floor) + // 5. Garage:Ceiling (ceiling) + // 6. EVChargingStation (internal mass) + // + // ATTIC ZONE: + // 7. EastGable (wall) + // 8. WestGable (wall) + // 9. NorthGable (wall) + // 10. Attic:GarageFloor (floor) + // 11. NorthRoof1 (roof) + // 12. SouthRoof (roof) + // 13. NorthRoof2 (roof) + // 14. NorthRoof3 (roof) + // 15. NorthRoof4 (roof) + // 16. EastRoof (roof) + // 17. WestRoof (roof) + // 18. AtticSkylight (window) + // 19. TubularDaylightingDome1 (not a window) + + // Simulation Order (1-based): + + // LIVING ZONE - no surfaces + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceFirst, -0); + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceLast, -1); + + // GARAGE ZONE: + int wallGarageEast = Util::FindItemInList(Util::makeUPPER("Garage:EastWall"), state->dataSurface->Surface); + int wallGarageWest = Util::FindItemInList(Util::makeUPPER("Garage:WestWall"), state->dataSurface->Surface); + int wallGarageFrontDoor = Util::FindItemInList(Util::makeUPPER("Garage:FrontDoor"), state->dataSurface->Surface); + int floorGarageFloor = Util::FindItemInList(Util::makeUPPER("Garage:Floor"), state->dataSurface->Surface); + int ceilingGarageInterior = Util::FindItemInList(Util::makeUPPER("Garage:Ceiling"), state->dataSurface->Surface); + int intmassEVChargingStation = Util::FindItemInList(Util::makeUPPER("EVChargingStation"), state->dataSurface->Surface); + + EXPECT_EQ(wallGarageEast, 1); + EXPECT_EQ(wallGarageWest, 2); + EXPECT_EQ(wallGarageFrontDoor, 3); + EXPECT_EQ(floorGarageFloor, 4); + EXPECT_EQ(ceilingGarageInterior, 5); + EXPECT_EQ(intmassEVChargingStation, 6); + EXPECT_EQ(state->dataHeatBal->space(2).HTSurfaceFirst, wallGarageEast); + EXPECT_EQ(state->dataHeatBal->space(2).HTSurfaceLast, intmassEVChargingStation); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrIntMassSurfaceFirst, wallGarageEast); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrIntMassSurfaceLast, intmassEVChargingStation); + EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrWinSurfaceFirst, wallGarageEast); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrWinSurfaceLast, intmassEVChargingStation); + + // ATTIC ZONE: + int wallEastGable = Util::FindItemInList(Util::makeUPPER("EastGable"), state->dataSurface->Surface); + int wallWestGable = Util::FindItemInList(Util::makeUPPER("WestGable"), state->dataSurface->Surface); + int wallNorthGable = Util::FindItemInList(Util::makeUPPER("NorthGable"), state->dataSurface->Surface); + int floorAtticGarageFloor = Util::FindItemInList(Util::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); + int roofNorthRoof1 = Util::FindItemInList(Util::makeUPPER("NorthRoof1"), state->dataSurface->Surface); + int roofSouthRoof = Util::FindItemInList(Util::makeUPPER("SouthRoof"), state->dataSurface->Surface); + int roofNorthRoof2 = Util::FindItemInList(Util::makeUPPER("NorthRoof2"), state->dataSurface->Surface); + int roofNorthRoof3 = Util::FindItemInList(Util::makeUPPER("NorthRoof3"), state->dataSurface->Surface); + int roofNorthRoof4 = Util::FindItemInList(Util::makeUPPER("NorthRoof4"), state->dataSurface->Surface); + int roofEastRoof = Util::FindItemInList(Util::makeUPPER("EastRoof"), state->dataSurface->Surface); + int roofWestRoof = Util::FindItemInList(Util::makeUPPER("WestRoof"), state->dataSurface->Surface); + int nonwindowTubularDaylightingDome1 = Util::FindItemInList(Util::makeUPPER("TubularDaylightingDome1"), state->dataSurface->Surface); + int windowAtticSkylight = Util::FindItemInList(Util::makeUPPER("AtticSkylight"), state->dataSurface->Surface); + + EXPECT_EQ(wallEastGable, 7); + EXPECT_EQ(wallWestGable, 8); + EXPECT_EQ(wallNorthGable, 9); + EXPECT_EQ(floorAtticGarageFloor, 10); + EXPECT_EQ(roofNorthRoof1, 11); + EXPECT_EQ(roofSouthRoof, 12); + EXPECT_EQ(roofNorthRoof2, 13); + EXPECT_EQ(roofNorthRoof3, 14); + EXPECT_EQ(roofNorthRoof4, 15); + EXPECT_EQ(roofEastRoof, 16); + EXPECT_EQ(roofWestRoof, 17); + EXPECT_EQ(windowAtticSkylight, 18); + EXPECT_EQ(nonwindowTubularDaylightingDome1, 19); + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceLast, nonwindowTubularDaylightingDome1); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceLast, roofWestRoof); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceFirst, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceLast, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceLast, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeFirst, nonwindowTubularDaylightingDome1); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeLast, nonwindowTubularDaylightingDome1); + + // Extend test to check other surface lists + auto &HTSurfaces = state->dataSurface->AllHTSurfaceList; + auto &ExtSolarSurfaces = state->dataSurface->AllExtSolarSurfaceList; + auto &ExtSolAndShadingSurfaces = state->dataSurface->AllExtSolAndShadingSurfaceList; + auto &ShadowPossObstrSurfaces = state->dataSurface->AllShadowPossObstrSurfaceList; + auto &IZSurfaces = state->dataSurface->AllIZSurfaceList; + auto &HTNonWindowSurfaces = state->dataSurface->AllHTNonWindowSurfaceList; + auto &HTWindowSurfaces = state->dataSurface->AllHTWindowSurfaceList; + auto &ExtSolWindowSurfaces = state->dataSurface->AllExtSolWindowSurfaceList; + auto &ExtSolWinWithFrameSurfaces = state->dataSurface->AllExtSolWinWithFrameSurfaceList; + auto &HTKivaSurfaces = state->dataSurface->AllHTKivaSurfaceList; + + int thisSurface = wallEastGable; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_TRUE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = nonwindowTubularDaylightingDome1; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_TRUE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); +} + +TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder3) +{ + + // Middle zone, GARAGE ZONE, has no surfaces + + bool ErrorsFound(false); + + std::string const idf_objects = delimited_string({ + " Material,", + " A1 - 1 IN STUCCO, !- Name", + " Smooth, !- Roughness", + " 2.5389841E-02, !- Thickness {m}", + " 0.6918309, !- Conductivity {W/m-K}", + " 1858.142, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + " Material,", + " CB11, !- Name", + " MediumRough, !- Roughness", + " 0.2032000, !- Thickness {m}", + " 1.048000, !- Conductivity {W/m-K}", + " 1105.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material,", + " GP01, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1600000, !- Conductivity {W/m-K}", + " 801.0000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN02, !- Name", + " Rough, !- Roughness", + " 9.0099998E-02, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN05, !- Name", + " Rough, !- Roughness", + " 0.2458000, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " PW03, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1150000, !- Conductivity {W/m-K}", + " 545.0000, !- Density {kg/m3}", + " 1213.000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7800000, !- Solar Absorptance", + " 0.7800000; !- Visible Absorptance", + + " Material,", + " CC03, !- Name", + " MediumRough, !- Roughness", + " 0.1016000, !- Thickness {m}", + " 1.310000, !- Conductivity {W/m-K}", + " 2243.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.6500000, !- Solar Absorptance", + " 0.6500000; !- Visible Absorptance", + + " Material,", + " HF-A3, !- Name", + " Smooth, !- Roughness", + " 1.5000000E-03, !- Thickness {m}", + " 44.96960, !- Conductivity {W/m-K}", + " 7689.000, !- Density {kg/m3}", + " 418.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material:NoMass,", + " AR02, !- Name", + " VeryRough, !- Roughness", + " 7.8000002E-02, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7000000, !- Solar Absorptance", + " 0.7000000; !- Visible Absorptance", + + " Material:NoMass,", + " CP02, !- Name", + " Rough, !- Roughness", + " 0.2170000, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " WindowMaterial:Glazing,", + " CLEAR 3MM, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.837, !- Solar Transmittance at Normal Incidence", + " 0.075, !- Front Side Solar Reflectance at Normal Incidence", + " 0.075, !- Back Side Solar Reflectance at Normal Incidence", + " 0.898, !- Visible Transmittance at Normal Incidence", + " 0.081, !- Front Side Visible Reflectance at Normal Incidence", + " 0.081, !- Back Side Visible Reflectance at Normal Incidence", + " 0.0, !- Infrared Transmittance at Normal Incidence", + " 0.84, !- Front Side Infrared Hemispherical Emissivity", + " 0.84, !- Back Side Infrared Hemispherical Emissivity", + " 0.9; !- Conductivity {W/m-K}", + + " WindowMaterial:Gas,", + " AIR 6MM, !- Name", + " AIR, !- Gas Type", + " 0.006; !- Thickness {m}", + + " Construction,", + " EXTWALL:LIVING, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " INTERIORWall, !- Name", + " GP01, !- Outside Layer", + " IN02, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " FLOOR:GARAGE, !- Name", + " CC03; !- Outside Layer", + + " Construction,", + " FLOOR:LIVING, !- Name", + " CC03, !- Outside Layer", + " CP02; !- Layer 2", + + " Construction,", + " ROOF, !- Name", + " AR02, !- Outside Layer", + " PW03; !- Layer 2", + + " Construction,", + " EXTWALL:GARAGE, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11; !- Layer 2", + + " Construction,", + " CEILING:LIVING, !- Name", + " IN05, !- Outside Layer", + " GP01; !- Layer 2", + + " Construction,", + " reverseCEILING:LIVING, !- Name", + " GP01, !- Outside Layer", + " IN05; !- Layer 2", + + " Construction,", + " GABLE, !- Name", + " PW03; !- Outside Layer", + + " Construction,", + " Dbl Clr 3mm/6mm Air, !- Name", + " CLEAR 3MM, !- Outside Layer", + " AIR 6MM, !- Layer 2", + " CLEAR 3MM; !- Layer 3", + + " Construction,", + " Garage:SteelDoor, !- Name", + " HF-A3; !- Outside Layer", + + " Construction,", + " CEILING:Garage, !- Name", + " GP01; !- Outside Layer", + + " Zone,", + " LIVING ZONE; !- Name", + + " Zone,", + " GARAGE ZONE; !- Name", + + " Zone,", + " ATTIC ZONE; !- Name", + + " GlobalGeometryRules,", + " UpperLeftCorner, !- Starting Vertex Position", + " CounterClockWise, !- Vertex Entry Direction", + " World; !- Coordinate System", + + " WindowMaterial:Glazing,", + " Clear Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.92, !- Solar Transmittance at Normal Incidence", + " 0.05, !- Front Side Solar Reflectance at Normal Incidence", + " 0.05, !- Back Side Solar Reflectance at Normal Incidence", + " 0.92, !- Visible Transmittance at Normal Incidence", + " 0.05, !- Front Side Visible Reflectance at Normal Incidence", + " 0.05, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + + " WindowMaterial:Glazing,", + " Diffusing Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.0022, !- Thickness {m}", + " 0.90, !- Solar Transmittance at Normal Incidence", + " 0.08, !- Front Side Solar Reflectance at Normal Incidence", + " 0.08, !- Back Side Solar Reflectance at Normal Incidence", + " 0.90, !- Visible Transmittance at Normal Incidence", + " 0.08, !- Front Side Visible Reflectance at Normal Incidence", + " 0.08, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + "", + " Material,", + " Very High Reflectivity Surface, !- Name", + " Smooth, !- Roughness", + " 0.0005, !- Thickness {m}", + " 237, !- Conductivity {W/m-K}", + " 2702, !- Density {kg/m3}", + " 903, !- Specific Heat {J/kg-K}", + " 0.90, !- Thermal Absorptance", + " 0.05, !- Solar Absorptance", + " 0.05; !- Visible Absorptance", + " Construction,", + " TDD Pipe, !- Name", + " Very High Reflectivity Surface; !- Outside Layer", + "", + " Construction,", + " TDD Dome, !- Name", + " Clear Acrylic Plastic; !- Outside Layer", + "", + " Construction,", + " TDD Diffuser, !- Name", + " Diffusing Acrylic Plastic; !- Outside Layer", + + " DaylightingDevice:Tubular,", + " Pipe1, !- Name", + " TubularDaylightingDome1, !- Dome Name", + " TubularDaylightingDiffuser1, !- Diffuser Name", + " TDD Pipe, !- Construction Name", + " 0.3556, !- Diameter {m}", + " 1.4, !- Total Length {m}", + " 0.28, !- Effective Thermal Resistance {m2-K/W}", + " ATTIC ZONE, !- Transition Zone 1 Name", + " 1.1; !- Transition Zone 1 Length {m}", + + " FenestrationSurface:Detailed,", + " TubularDaylightingDome1, !- Name", + " TubularDaylightDome, !- Surface Type", + " TDD Dome, !- Construction Name", + " NorthRoof1, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.0, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 13.782,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,6.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 0,6.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 0,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " TubularDaylightingDiffuser1, !- Name", + " TubularDaylightDiffuser, !- Surface Type", + " TDD Diffuser, !- Construction Name", + " Living:Ceiling, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.0, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 2.3425,3.1575,2.5, !- X,Y,Z ==> Vertex 1 {m}", + " 2.3425,2.8425,2.5, !- X,Y,Z ==> Vertex 2 {m}", + " 2.6575,2.8425,2.5, !- X,Y,Z ==> Vertex 3 {m}", + " 2.6575,3.1575,2.5; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:North, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:East, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,0,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:South, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,2.4383, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,0,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:West, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,0,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:Floor, !- Name", + " FLOOR, !- Surface Type", + " FLOOR:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Living:Floor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- X,Y,Z ==> Vertex 1 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,0,0; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:Ceiling, !- Name", + " CEILING, !- Surface Type", + " CEILING:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Attic:LivingFloor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,0,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Attic:LivingFloor, !- Name", + " FLOOR, !- Surface Type", + " reverseCEILING:LIVING, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Living:Ceiling, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 0,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,0,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof1, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 0,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 0,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " SouthRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0.000000,5.389000,4.683800, !- X,Y,Z ==> Vertex 1 {m}", + " 0.000000,0.000000,2.438400, !- X,Y,Z ==> Vertex 2 {m}", + " 17.24200,0.000000,2.438400, !- X,Y,Z ==> Vertex 3 {m}", + " 17.24200,5.389000,4.683800; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof2, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 10.332,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 0.0,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 0.0,7.3172,3.8804; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof3, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 13.782,5.389,4.6838; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthRoof4, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 17.242,7.3172,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " EastGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 17.242,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,0.0,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " WestGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 0.0,5.389,4.6838, !- X,Y,Z ==> Vertex 1 {m}", + " 0.0,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 0.0,0.0,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " BuildingSurface:Detailed,", + " EastRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 13.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " WestRoof, !- Name", + " ROOF, !- Surface Type", + " ROOF, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.9, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 13.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 3 {m}", + " 13.782,16.876,3.8804; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " NorthGable, !- Name", + " WALL, !- Surface Type", + " GABLE, !- Construction Name", + " ATTIC ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 3, !- Number of Vertices", + " 13.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,16.876,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,16.876,2.4384; !- X,Y,Z ==> Vertex 3 {m}", + + " FenestrationSurface:Detailed,", + " NorthWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:North, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 6.572,10.778,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 6.572,10.778,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 2,10.778,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 2,10.778,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " EastWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:East, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 17.242,2,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,2,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,6.572,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,6.572,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " SouthWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:South, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 2,0,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 2,0,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 6.572,0,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 6.572,0,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " WestWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:West, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 0,6.572,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 0,6.572,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 0,2,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 0,2,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " WestDoor, !- Name", + " Door, !- Surface Type", + " Garage:SteelDoor, !- Construction Name", + " Living:West, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 0,9.0,2.0, !- X,Y,Z ==> Vertex 1 {m}", + " 0,9.0,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,8.0,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,8.0,2.0; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " AtticSkylight, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " EastRoof, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 14.782,16.876,3.8804, !- X,Y,Z ==> Vertex 1 {m}", + " 14.782,7.3172,3.8804, !- X,Y,Z ==> Vertex 2 {m}", + " 15.242,10.778,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 15.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + GetProjectControlData(*state, ErrorsFound); // read project control data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetMaterialData(*state, ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(*state, ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(*state, ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(*state, ErrorsFound); + EXPECT_TRUE(ErrorsFound); // expect errors due to zone with no surfaces + // compare_err_stream( "" ); // just for debugging + + // This tests the space surface first/last values after surfaces are sorted: + // + // Simulation Order: + // All shading surfaces (including mirrored surfaces) + // Shading:Site + // Shading:Building + // Shading:Zone (and variants) + // + // By zone (in the order the zones appear in the idf): + // Walls + // Floors + // Roofs + // Internal Mass + // Doors + // Windows + // TDD_Domes + // + // Special cases: + // TubularDaylightDome is treated as a separate surface type + // TubularDaylightDiffuser is treated as a window subsurface + + // For this test, the order should be + // Simulation Order (1-based): + // LIVING ZONE: + // 1. Living:North (wall) + // 2. Living:East (wall) + // 3. Living:South (wall) + // 4. Living:West (wall) + // 5. Living:Ceiling (ceiling) + // 6. Living:Floor (floor) + // 7. WestDoor (door) + // 8. NorthWindow (window) + // 9. EastWindow (window) + // 10. SouthWindow (window) + // 11. WestWindow (window) + // 12. TubularDaylightingDiffuser1 ("window") + // + // ATTIC ZONE: + // 13. EastGable (wall) + // 14. WestGable (wall) + // 15. NorthGable (wall) + // 16. Attic:LivingFloor (floor) + // 17. NorthRoof1 (roof) + // 18. SouthRoof (roof) + // 19. NorthRoof2 (roof) + // 20. NorthRoof3 (roof) + // 21. NorthRoof4 (roof) + // 22. EastRoof (roof) + // 23. WestRoof (roof) + // 24. AtticSkylight (window) + // 25. TubularDaylightingDome1 (not a window) + + // Simulation Order (1-based): + + // LIVING ZONE: + int wallLivingNorth = Util::FindItemInList(Util::makeUPPER("Living:North"), state->dataSurface->Surface); + int wallLivingEast = Util::FindItemInList(Util::makeUPPER("Living:East"), state->dataSurface->Surface); + int wallLivingSouth = Util::FindItemInList(Util::makeUPPER("Living:South"), state->dataSurface->Surface); + int wallLivingWest = Util::FindItemInList(Util::makeUPPER("Living:West"), state->dataSurface->Surface); + int wallLivingInterior = Util::FindItemInList(Util::makeUPPER("Living:Interior"), state->dataSurface->Surface); + int floorLivingFloor = Util::FindItemInList(Util::makeUPPER("Living:Floor"), state->dataSurface->Surface); + int ceilingLivingCeiling = Util::FindItemInList(Util::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); + int doorWestDoor = Util::FindItemInList(Util::makeUPPER("WestDoor"), state->dataSurface->Surface); + int windowTubularDaylightingDiffuser1 = Util::FindItemInList(Util::makeUPPER("TubularDaylightingDiffuser1"), state->dataSurface->Surface); + int windowNorthWindow = Util::FindItemInList(Util::makeUPPER("NorthWindow"), state->dataSurface->Surface); + int windowEastWindow = Util::FindItemInList(Util::makeUPPER("EastWindow"), state->dataSurface->Surface); + int windowSouthWindow = Util::FindItemInList(Util::makeUPPER("SouthWindow"), state->dataSurface->Surface); + int windowWestWindow = Util::FindItemInList(Util::makeUPPER("WestWindow"), state->dataSurface->Surface); + + EXPECT_EQ(wallLivingNorth, 1); + EXPECT_EQ(wallLivingEast, 2); + EXPECT_EQ(wallLivingSouth, 3); + EXPECT_EQ(wallLivingWest, 4); + EXPECT_EQ(floorLivingFloor, 5); + EXPECT_EQ(ceilingLivingCeiling, 6); + EXPECT_EQ(doorWestDoor, 7); + EXPECT_EQ(windowNorthWindow, 8); + EXPECT_EQ(windowEastWindow, 9); + EXPECT_EQ(windowSouthWindow, 10); + EXPECT_EQ(windowWestWindow, 11); + EXPECT_EQ(windowTubularDaylightingDiffuser1, 12); + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceLast, 12); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceLast, 7); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceFirst, 8); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceLast, 12); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceLast, 12); + + // ATTIC ZONE: + int wallEastGable = Util::FindItemInList(Util::makeUPPER("EastGable"), state->dataSurface->Surface); + int wallWestGable = Util::FindItemInList(Util::makeUPPER("WestGable"), state->dataSurface->Surface); + int wallNorthGable = Util::FindItemInList(Util::makeUPPER("NorthGable"), state->dataSurface->Surface); + int floorAtticLivingFloor = Util::FindItemInList(Util::makeUPPER("Attic:LivingFloor"), state->dataSurface->Surface); + int floorAtticGarageFloor = Util::FindItemInList(Util::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); + int roofNorthRoof1 = Util::FindItemInList(Util::makeUPPER("NorthRoof1"), state->dataSurface->Surface); + int roofSouthRoof = Util::FindItemInList(Util::makeUPPER("SouthRoof"), state->dataSurface->Surface); + int roofNorthRoof2 = Util::FindItemInList(Util::makeUPPER("NorthRoof2"), state->dataSurface->Surface); + int roofNorthRoof3 = Util::FindItemInList(Util::makeUPPER("NorthRoof3"), state->dataSurface->Surface); + int roofNorthRoof4 = Util::FindItemInList(Util::makeUPPER("NorthRoof4"), state->dataSurface->Surface); + int roofEastRoof = Util::FindItemInList(Util::makeUPPER("EastRoof"), state->dataSurface->Surface); + int roofWestRoof = Util::FindItemInList(Util::makeUPPER("WestRoof"), state->dataSurface->Surface); + int nonwindowTubularDaylightingDome1 = Util::FindItemInList(Util::makeUPPER("TubularDaylightingDome1"), state->dataSurface->Surface); + int windowAtticSkylight = Util::FindItemInList(Util::makeUPPER("AtticSkylight"), state->dataSurface->Surface); + + EXPECT_EQ(wallEastGable, 13); + EXPECT_EQ(wallWestGable, 14); + EXPECT_EQ(wallNorthGable, 15); + EXPECT_EQ(floorAtticLivingFloor, 16); + EXPECT_EQ(roofNorthRoof1, 17); + EXPECT_EQ(roofSouthRoof, 18); + EXPECT_EQ(roofNorthRoof2, 19); + EXPECT_EQ(roofNorthRoof3, 20); + EXPECT_EQ(roofNorthRoof4, 21); + EXPECT_EQ(roofEastRoof, 22); + EXPECT_EQ(roofWestRoof, 23); + EXPECT_EQ(windowAtticSkylight, 24); + EXPECT_EQ(nonwindowTubularDaylightingDome1, 25); + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceLast, nonwindowTubularDaylightingDome1); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceLast, roofWestRoof); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceFirst, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceLast, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceFirst, wallEastGable); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceLast, windowAtticSkylight); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeFirst, nonwindowTubularDaylightingDome1); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeLast, nonwindowTubularDaylightingDome1); + + // Extend test to check other surface lists + auto &HTSurfaces = state->dataSurface->AllHTSurfaceList; + auto &ExtSolarSurfaces = state->dataSurface->AllExtSolarSurfaceList; + auto &ExtSolAndShadingSurfaces = state->dataSurface->AllExtSolAndShadingSurfaceList; + auto &ShadowPossObstrSurfaces = state->dataSurface->AllShadowPossObstrSurfaceList; + auto &IZSurfaces = state->dataSurface->AllIZSurfaceList; + auto &HTNonWindowSurfaces = state->dataSurface->AllHTNonWindowSurfaceList; + auto &HTWindowSurfaces = state->dataSurface->AllHTWindowSurfaceList; + auto &ExtSolWindowSurfaces = state->dataSurface->AllExtSolWindowSurfaceList; + auto &ExtSolWinWithFrameSurfaces = state->dataSurface->AllExtSolWinWithFrameSurfaceList; + auto &HTKivaSurfaces = state->dataSurface->AllHTKivaSurfaceList; + + int thisSurface = wallEastGable; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_TRUE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = doorWestDoor; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = windowSouthWindow; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_FALSE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_TRUE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = windowTubularDaylightingDiffuser1; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_FALSE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_TRUE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = nonwindowTubularDaylightingDome1; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_TRUE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); +} + +TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder4) +{ + + // Last zone, ATTIC ZONE, has no surfaces + + bool ErrorsFound(false); + + std::string const idf_objects = delimited_string({ + " Material,", + " A1 - 1 IN STUCCO, !- Name", + " Smooth, !- Roughness", + " 2.5389841E-02, !- Thickness {m}", + " 0.6918309, !- Conductivity {W/m-K}", + " 1858.142, !- Density {kg/m3}", + " 836.8000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.9200000, !- Solar Absorptance", + " 0.9200000; !- Visible Absorptance", + + " Material,", + " CB11, !- Name", + " MediumRough, !- Roughness", + " 0.2032000, !- Thickness {m}", + " 1.048000, !- Conductivity {W/m-K}", + " 1105.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material,", + " GP01, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1600000, !- Conductivity {W/m-K}", + " 801.0000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN02, !- Name", + " Rough, !- Roughness", + " 9.0099998E-02, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " IN05, !- Name", + " Rough, !- Roughness", + " 0.2458000, !- Thickness {m}", + " 4.3000001E-02, !- Conductivity {W/m-K}", + " 10.00000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " Material,", + " PW03, !- Name", + " MediumSmooth, !- Roughness", + " 1.2700000E-02, !- Thickness {m}", + " 0.1150000, !- Conductivity {W/m-K}", + " 545.0000, !- Density {kg/m3}", + " 1213.000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.7800000, !- Solar Absorptance", + " 0.7800000; !- Visible Absorptance", + + " Material,", + " CC03, !- Name", + " MediumRough, !- Roughness", + " 0.1016000, !- Thickness {m}", + " 1.310000, !- Conductivity {W/m-K}", + " 2243.000, !- Density {kg/m3}", + " 837.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.6500000, !- Solar Absorptance", + " 0.6500000; !- Visible Absorptance", + + " Material,", + " HF-A3, !- Name", + " Smooth, !- Roughness", + " 1.5000000E-03, !- Thickness {m}", + " 44.96960, !- Conductivity {W/m-K}", + " 7689.000, !- Density {kg/m3}", + " 418.0000, !- Specific Heat {J/kg-K}", + " 0.9000000, !- Thermal Absorptance", + " 0.2000000, !- Solar Absorptance", + " 0.2000000; !- Visible Absorptance", + + " Material:NoMass,", + " AR02, !- Name", + " VeryRough, !- Roughness", + " 7.8000002E-02, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7000000, !- Solar Absorptance", + " 0.7000000; !- Visible Absorptance", + + " Material:NoMass,", + " CP02, !- Name", + " Rough, !- Roughness", + " 0.2170000, !- Thermal Resistance {m2-K/W}", + " 0.9000000, !- Thermal Absorptance", + " 0.7500000, !- Solar Absorptance", + " 0.7500000; !- Visible Absorptance", + + " WindowMaterial:Glazing,", + " CLEAR 3MM, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.837, !- Solar Transmittance at Normal Incidence", + " 0.075, !- Front Side Solar Reflectance at Normal Incidence", + " 0.075, !- Back Side Solar Reflectance at Normal Incidence", + " 0.898, !- Visible Transmittance at Normal Incidence", + " 0.081, !- Front Side Visible Reflectance at Normal Incidence", + " 0.081, !- Back Side Visible Reflectance at Normal Incidence", + " 0.0, !- Infrared Transmittance at Normal Incidence", + " 0.84, !- Front Side Infrared Hemispherical Emissivity", + " 0.84, !- Back Side Infrared Hemispherical Emissivity", + " 0.9; !- Conductivity {W/m-K}", + + " WindowMaterial:Gas,", + " AIR 6MM, !- Name", + " AIR, !- Gas Type", + " 0.006; !- Thickness {m}", + + " Construction,", + " EXTWALL:LIVING, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " INTERIORWall, !- Name", + " GP01, !- Outside Layer", + " IN02, !- Layer 2", + " GP01; !- Layer 3", + + " Construction,", + " FLOOR:GARAGE, !- Name", + " CC03; !- Outside Layer", + + " Construction,", + " FLOOR:LIVING, !- Name", + " CC03, !- Outside Layer", + " CP02; !- Layer 2", + + " Construction,", + " ROOF, !- Name", + " AR02, !- Outside Layer", + " PW03; !- Layer 2", + + " Construction,", + " EXTWALL:GARAGE, !- Name", + " A1 - 1 IN STUCCO, !- Outside Layer", + " CB11; !- Layer 2", + + " Construction,", + " CEILING:LIVING, !- Name", + " IN05, !- Outside Layer", + " GP01; !- Layer 2", + + " Construction,", + " reverseCEILING:LIVING, !- Name", + " GP01, !- Outside Layer", + " IN05; !- Layer 2", + + " Construction,", + " GABLE, !- Name", + " PW03; !- Outside Layer", + + " Construction,", + " Dbl Clr 3mm/6mm Air, !- Name", + " CLEAR 3MM, !- Outside Layer", + " AIR 6MM, !- Layer 2", + " CLEAR 3MM; !- Layer 3", + + " Construction,", + " Garage:SteelDoor, !- Name", + " HF-A3; !- Outside Layer", + + " Construction,", + " CEILING:Garage, !- Name", + " GP01; !- Outside Layer", + + " Zone,", + " LIVING ZONE; !- Name", + + " Zone,", + " GARAGE ZONE; !- Name", + + " Zone,", + " ATTIC ZONE; !- Name", + + " GlobalGeometryRules,", + " UpperLeftCorner, !- Starting Vertex Position", + " CounterClockWise, !- Vertex Entry Direction", + " World; !- Coordinate System", + + " WindowMaterial:Glazing,", + " Clear Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.003, !- Thickness {m}", + " 0.92, !- Solar Transmittance at Normal Incidence", + " 0.05, !- Front Side Solar Reflectance at Normal Incidence", + " 0.05, !- Back Side Solar Reflectance at Normal Incidence", + " 0.92, !- Visible Transmittance at Normal Incidence", + " 0.05, !- Front Side Visible Reflectance at Normal Incidence", + " 0.05, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + + " WindowMaterial:Glazing,", + " Diffusing Acrylic Plastic, !- Name", + " SpectralAverage, !- Optical Data Type", + " , !- Window Glass Spectral Data Set Name", + " 0.0022, !- Thickness {m}", + " 0.90, !- Solar Transmittance at Normal Incidence", + " 0.08, !- Front Side Solar Reflectance at Normal Incidence", + " 0.08, !- Back Side Solar Reflectance at Normal Incidence", + " 0.90, !- Visible Transmittance at Normal Incidence", + " 0.08, !- Front Side Visible Reflectance at Normal Incidence", + " 0.08, !- Back Side Visible Reflectance at Normal Incidence", + " 0.00, !- Infrared Transmittance at Normal Incidence", + " 0.90, !- Front Side Infrared Hemispherical Emissivity", + " 0.90, !- Back Side Infrared Hemispherical Emissivity", + " 0.90; !- Conductivity {W/m-K}", + "", + " Material,", + " Very High Reflectivity Surface, !- Name", + " Smooth, !- Roughness", + " 0.0005, !- Thickness {m}", + " 237, !- Conductivity {W/m-K}", + " 2702, !- Density {kg/m3}", + " 903, !- Specific Heat {J/kg-K}", + " 0.90, !- Thermal Absorptance", + " 0.05, !- Solar Absorptance", + " 0.05; !- Visible Absorptance", + " Construction,", + " TDD Pipe, !- Name", + " Very High Reflectivity Surface; !- Outside Layer", + "", + " Construction,", + " TDD Dome, !- Name", + " Clear Acrylic Plastic; !- Outside Layer", + "", + " Construction,", + " TDD Diffuser, !- Name", + " Diffusing Acrylic Plastic; !- Outside Layer", + + " BuildingSurface:Detailed,", + " Living:North, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:East, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,0,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:South, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,2.4383, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,0,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:West, !- Name", + " Wall, !- Surface Type", + " EXTWALL:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5000000, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,0,0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,0,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:Interior, !- Name", + " WALL, !- Surface Type", + " INTERIORWall, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Living:Interior, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:Interior, !- Name", + " WALL, !- Surface Type", + " INTERIORWall, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Garage:Interior, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 10.323,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:Floor, !- Name", + " FLOOR, !- Surface Type", + " FLOOR:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Living:Floor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- X,Y,Z ==> Vertex 1 {m}", + " 0,10.778,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,10.778,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,0,0; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Living:Ceiling, !- Name", + " CEILING, !- Surface Type", + " CEILING:LIVING, !- Construction Name", + " LIVING ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 0,0,2.4384, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,0,2.4384, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:EastWall, !- Name", + " WALL, !- Surface Type", + " EXTWALL:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,10.778,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,10.778,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,16.876,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:WestWall, !- Name", + " WALL, !- Surface Type", + " EXTWALL:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,16.876,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,10.778,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 10.323,10.778,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " InternalMass,", + " EVChargingStation, !- Name", + " Garage:SteelDoor, !- Construction Name", + " GARAGE ZONE, !- Zone or ZoneList Name", + " , !- Space Name", + " 88.249272671219; !- Surface Area {m2}", + + " BuildingSurface:Detailed,", + " Garage:FrontDoor, !- Name", + " WALL, !- Surface Type", + " Garage:SteelDoor, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Outdoors, !- Outside Boundary Condition", + " , !- Outside Boundary Condition Object", + " SunExposed, !- Sun Exposure", + " WindExposed, !- Wind Exposure", + " 0.5, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 17.242,16.876,2.4384, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,16.876,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 10.323,16.876,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 10.323,16.876,2.4384; !- X,Y,Z ==> Vertex 4 {m}", + + " BuildingSurface:Detailed,", + " Garage:Floor, !- Name", + " FLOOR, !- Surface Type", + " FLOOR:GARAGE, !- Construction Name", + " GARAGE ZONE, !- Zone Name", + " , !- Space Name", + " Surface, !- Outside Boundary Condition", + " Garage:Floor, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " 0, !- View Factor to Ground", + " 4, !- Number of Vertices", + " 10.323,10.778,0, !- X,Y,Z ==> Vertex 1 {m}", + " 10.323,16.876,0, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,16.876,0, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,10.778,0; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " NorthWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:North, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 6.572,10.778,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 6.572,10.778,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 2,10.778,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 2,10.778,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " EastWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:East, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 17.242,2,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 17.242,2,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 17.242,6.572,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 17.242,6.572,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " SouthWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:South, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 2,0,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 2,0,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 6.572,0,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 6.572,0,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " WestWindow, !- Name", + " Window, !- Surface Type", + " Dbl Clr 3mm/6mm Air, !- Construction Name", + " Living:West, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 0,6.572,2.1336, !- X,Y,Z ==> Vertex 1 {m}", + " 0,6.572,0.6096, !- X,Y,Z ==> Vertex 2 {m}", + " 0,2,0.6096, !- X,Y,Z ==> Vertex 3 {m}", + " 0,2,2.1336; !- X,Y,Z ==> Vertex 4 {m}", + + " FenestrationSurface:Detailed,", + " WestDoor, !- Name", + " Door, !- Surface Type", + " Garage:SteelDoor, !- Construction Name", + " Living:West, !- Building Surface Name", + " , !- Outside Boundary Condition Object", + " 0.5000000, !- View Factor to Ground", + " , !- Frame and Divider Name", + " 1.0, !- Multiplier", + " 4, !- Number of Vertices", + " 0,9.0,2.0, !- X,Y,Z ==> Vertex 1 {m}", + " 0,9.0,0.0, !- X,Y,Z ==> Vertex 2 {m}", + " 0,8.0,0.0, !- X,Y,Z ==> Vertex 3 {m}", + " 0,8.0,2.0; !- X,Y,Z ==> Vertex 4 {m}", + + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + GetProjectControlData(*state, ErrorsFound); // read project control data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetMaterialData(*state, ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(*state, ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(*state, ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(*state, ErrorsFound); + EXPECT_TRUE(ErrorsFound); // expect errors + std::string const error_string = delimited_string( + {" ** 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", + " ** ~~~ ** The calculated Zone Volume was=0.00", + " ** ~~~ ** The simulation will continue with the Zone Volume set to 10.0 m3. ", + " ** ~~~ ** ...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual zones.", + " ** Warning ** CalculateZoneVolume: 1 zone is not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; ", + " ** Severe ** SetUpZoneGeometry: Zone=\"ATTIC ZONE\" has only internal mass surfaces. Need at least one other surface."}); + + compare_err_stream(error_string); + + // This tests the space surface first/last values after surfaces are sorted: + // + // Simulation Order: + // All shading surfaces (including mirrored surfaces) + // Shading:Site + // Shading:Building + // Shading:Zone (and variants) + // + // By zone (in the order the zones appear in the idf): + // Walls + // Floors + // Roofs + // Internal Mass + // Doors + // Windows + // TDD_Domes + // + // Special cases: + // TubularDaylightDome is treated as a separate surface type + // TubularDaylightDiffuser is treated as a window subsurface + + // For this test, the order should be + // Simulation Order (1-based): + // LIVING ZONE: + // 1. Living:North (wall) + // 2. Living:East (wall) + // 3. Living:South (wall) + // 4. Living:West (wall) + // 5. Living:Interior (wall) + // 6. Living:Ceiling (ceiling) + // 7. Living:Floor (floor) + // 8. WestDoor (door) + // 9. NorthWindow (window) + // 10. EastWindow (window) + // 11. SouthWindow (window) + // 12. WestWindow (window) + // GARAGE ZONE: + // 13. Garage:Interior (wall) + // 14. Garage:EastWall (wall) + // 15. Garage:WestWall (wall) + // 16. Garage:FrontDoor (wall) + // 17. Garage:Floor (floor) + // 18. EVChargingStation (internal mass) + // + // Simulation Order (1-based): + + // LIVING ZONE: + int wallLivingNorth = Util::FindItemInList(Util::makeUPPER("Living:North"), state->dataSurface->Surface); + int wallLivingEast = Util::FindItemInList(Util::makeUPPER("Living:East"), state->dataSurface->Surface); + int wallLivingSouth = Util::FindItemInList(Util::makeUPPER("Living:South"), state->dataSurface->Surface); + int wallLivingWest = Util::FindItemInList(Util::makeUPPER("Living:West"), state->dataSurface->Surface); + int wallLivingInterior = Util::FindItemInList(Util::makeUPPER("Living:Interior"), state->dataSurface->Surface); + int floorLivingFloor = Util::FindItemInList(Util::makeUPPER("Living:Floor"), state->dataSurface->Surface); + int ceilingLivingCeiling = Util::FindItemInList(Util::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); + int doorWestDoor = Util::FindItemInList(Util::makeUPPER("WestDoor"), state->dataSurface->Surface); + int windowNorthWindow = Util::FindItemInList(Util::makeUPPER("NorthWindow"), state->dataSurface->Surface); + int windowEastWindow = Util::FindItemInList(Util::makeUPPER("EastWindow"), state->dataSurface->Surface); + int windowSouthWindow = Util::FindItemInList(Util::makeUPPER("SouthWindow"), state->dataSurface->Surface); + int windowWestWindow = Util::FindItemInList(Util::makeUPPER("WestWindow"), state->dataSurface->Surface); + + EXPECT_EQ(wallLivingNorth, 1); + EXPECT_EQ(wallLivingEast, 2); + EXPECT_EQ(wallLivingSouth, 3); + EXPECT_EQ(wallLivingWest, 4); + EXPECT_EQ(wallLivingInterior, 5); + EXPECT_EQ(floorLivingFloor, 6); + EXPECT_EQ(ceilingLivingCeiling, 7); + EXPECT_EQ(doorWestDoor, 8); + EXPECT_EQ(windowNorthWindow, 9); + EXPECT_EQ(windowEastWindow, 10); + EXPECT_EQ(windowSouthWindow, 11); + EXPECT_EQ(windowWestWindow, 12); + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).HTSurfaceLast, 12); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrIntMassSurfaceLast, 8); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceFirst, 9); + EXPECT_EQ(state->dataHeatBal->space(1).WindowSurfaceLast, 12); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceFirst, 1); + EXPECT_EQ(state->dataHeatBal->space(1).OpaqOrWinSurfaceLast, 12); + + // GARAGE ZONE: + int wallGarageInterior = Util::FindItemInList(Util::makeUPPER("Garage:Interior"), state->dataSurface->Surface); + int wallGarageEast = Util::FindItemInList(Util::makeUPPER("Garage:EastWall"), state->dataSurface->Surface); + int wallGarageWest = Util::FindItemInList(Util::makeUPPER("Garage:WestWall"), state->dataSurface->Surface); + int wallGarageFrontDoor = Util::FindItemInList(Util::makeUPPER("Garage:FrontDoor"), state->dataSurface->Surface); + int floorGarageFloor = Util::FindItemInList(Util::makeUPPER("Garage:Floor"), state->dataSurface->Surface); + int intmassEVChargingStation = Util::FindItemInList(Util::makeUPPER("EVChargingStation"), state->dataSurface->Surface); + + EXPECT_EQ(wallGarageInterior, 13); + EXPECT_EQ(wallGarageEast, 14); + EXPECT_EQ(wallGarageWest, 15); + EXPECT_EQ(wallGarageFrontDoor, 16); + EXPECT_EQ(floorGarageFloor, 17); + EXPECT_EQ(intmassEVChargingStation, 18); + EXPECT_EQ(state->dataHeatBal->space(2).HTSurfaceFirst, 13); + EXPECT_EQ(state->dataHeatBal->space(2).HTSurfaceLast, 18); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrIntMassSurfaceFirst, 13); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrIntMassSurfaceLast, 18); + EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(2).WindowSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrWinSurfaceFirst, 13); + EXPECT_EQ(state->dataHeatBal->space(2).OpaqOrWinSurfaceLast, 18); + + // ATTIC ZONE: + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(3).HTSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrIntMassSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(3).WindowSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(3).OpaqOrWinSurfaceLast, -1); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeFirst, 0); + EXPECT_EQ(state->dataHeatBal->space(3).TDDDomeLast, -1); + + // Extend test to check other surface lists + auto &HTSurfaces = state->dataSurface->AllHTSurfaceList; + auto &ExtSolarSurfaces = state->dataSurface->AllExtSolarSurfaceList; + auto &ExtSolAndShadingSurfaces = state->dataSurface->AllExtSolAndShadingSurfaceList; + auto &ShadowPossObstrSurfaces = state->dataSurface->AllShadowPossObstrSurfaceList; + auto &IZSurfaces = state->dataSurface->AllIZSurfaceList; + auto &HTNonWindowSurfaces = state->dataSurface->AllHTNonWindowSurfaceList; + auto &HTWindowSurfaces = state->dataSurface->AllHTWindowSurfaceList; + auto &ExtSolWindowSurfaces = state->dataSurface->AllExtSolWindowSurfaceList; + auto &ExtSolWinWithFrameSurfaces = state->dataSurface->AllExtSolWinWithFrameSurfaceList; + auto &HTKivaSurfaces = state->dataSurface->AllHTKivaSurfaceList; + + int thisSurface = doorWestDoor; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = wallGarageInterior; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_TRUE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_TRUE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_FALSE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); + + thisSurface = windowSouthWindow; + EXPECT_TRUE(std::find(HTSurfaces.begin(), HTSurfaces.end(), thisSurface) != HTSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolarSurfaces.begin(), ExtSolarSurfaces.end(), thisSurface) != ExtSolarSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolAndShadingSurfaces.begin(), ExtSolAndShadingSurfaces.end(), thisSurface) != ExtSolAndShadingSurfaces.end()); + EXPECT_FALSE(std::find(ShadowPossObstrSurfaces.begin(), ShadowPossObstrSurfaces.end(), thisSurface) != ShadowPossObstrSurfaces.end()); + EXPECT_FALSE(std::find(IZSurfaces.begin(), IZSurfaces.end(), thisSurface) != IZSurfaces.end()); + EXPECT_FALSE(std::find(HTNonWindowSurfaces.begin(), HTNonWindowSurfaces.end(), thisSurface) != HTNonWindowSurfaces.end()); + EXPECT_TRUE(std::find(HTWindowSurfaces.begin(), HTWindowSurfaces.end(), thisSurface) != HTWindowSurfaces.end()); + EXPECT_TRUE(std::find(ExtSolWindowSurfaces.begin(), ExtSolWindowSurfaces.end(), thisSurface) != ExtSolWindowSurfaces.end()); + EXPECT_FALSE(std::find(ExtSolWinWithFrameSurfaces.begin(), ExtSolWinWithFrameSurfaces.end(), thisSurface) != ExtSolWinWithFrameSurfaces.end()); + EXPECT_FALSE(std::find(HTKivaSurfaces.begin(), HTKivaSurfaces.end(), thisSurface) != HTKivaSurfaces.end()); +} + TEST_F(EnergyPlusFixture, Use_Gross_Roof_Area_for_Averge_Height) { bool ErrorsFound(false); From 6474cbcf8888b8340e758ee0304fa2ca2f87db02 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 29 Nov 2023 15:50:22 -0600 Subject: [PATCH 2/5] Cleanup --- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 5c9e8084f21..a4865c18131 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -10560,7 +10560,6 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder3) int wallLivingEast = Util::FindItemInList(Util::makeUPPER("Living:East"), state->dataSurface->Surface); int wallLivingSouth = Util::FindItemInList(Util::makeUPPER("Living:South"), state->dataSurface->Surface); int wallLivingWest = Util::FindItemInList(Util::makeUPPER("Living:West"), state->dataSurface->Surface); - int wallLivingInterior = Util::FindItemInList(Util::makeUPPER("Living:Interior"), state->dataSurface->Surface); int floorLivingFloor = Util::FindItemInList(Util::makeUPPER("Living:Floor"), state->dataSurface->Surface); int ceilingLivingCeiling = Util::FindItemInList(Util::makeUPPER("Living:Ceiling"), state->dataSurface->Surface); int doorWestDoor = Util::FindItemInList(Util::makeUPPER("WestDoor"), state->dataSurface->Surface); @@ -10596,7 +10595,6 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder3) int wallWestGable = Util::FindItemInList(Util::makeUPPER("WestGable"), state->dataSurface->Surface); int wallNorthGable = Util::FindItemInList(Util::makeUPPER("NorthGable"), state->dataSurface->Surface); int floorAtticLivingFloor = Util::FindItemInList(Util::makeUPPER("Attic:LivingFloor"), state->dataSurface->Surface); - int floorAtticGarageFloor = Util::FindItemInList(Util::makeUPPER("Attic:GarageFloor"), state->dataSurface->Surface); int roofNorthRoof1 = Util::FindItemInList(Util::makeUPPER("NorthRoof1"), state->dataSurface->Surface); int roofSouthRoof = Util::FindItemInList(Util::makeUPPER("SouthRoof"), state->dataSurface->Surface); int roofNorthRoof2 = Util::FindItemInList(Util::makeUPPER("NorthRoof2"), state->dataSurface->Surface); From 3c76a8b263570929d6c53d59fde4ee2c991247dc Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 29 Nov 2023 16:44:29 -0600 Subject: [PATCH 3/5] Redo surface first/last --- src/EnergyPlus/SurfaceGeometry.cc | 171 +++++++------------- src/EnergyPlus/SurfaceGeometry.hh | 4 +- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 3 +- 3 files changed, 65 insertions(+), 113 deletions(-) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 845a6766e4a..6a04ae22626 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -560,7 +560,7 @@ namespace SurfaceGeometry { bool nonInternalMassSurfacesPresent = false; Real64 TotSurfArea = 0.0; thisZone.Centroid = Vector(0.0, 0.0, 0.0); - if (state.dataSurface->Surface(thisZone.AllSurfaceFirst).Sides > 0) { + if ((thisZone.AllSurfaceFirst > 0) && (state.dataSurface->Surface(thisZone.AllSurfaceFirst).Sides > 0)) { thisZone.MinimumX = state.dataSurface->Surface(thisZone.AllSurfaceFirst).Vertex(1).x; thisZone.MaximumX = state.dataSurface->Surface(thisZone.AllSurfaceFirst).Vertex(1).x; thisZone.MinimumY = state.dataSurface->Surface(thisZone.AllSurfaceFirst).Vertex(1).y; @@ -1739,7 +1739,7 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp.deallocate(); // DeAllocate the Temp Surface derived type - createSpaceSurfaceLists(state, ErrorsFound); + createSpaceSurfaceLists(state); // For each Base Surface Type (Wall, Floor, Roof) @@ -2257,110 +2257,7 @@ namespace SurfaceGeometry { } } - //********************************************************************************** - // Set up Zone Surface Pointers - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); - for (int SurfNum = 1; SurfNum <= MovedSurfs; ++SurfNum) { // TotSurfaces - if (state.dataSurface->Surface(SurfNum).spaceNum == spaceNum) { - if (thisSpace.AllSurfaceFirst == 0) { - thisSpace.AllSurfaceFirst = SurfNum; - } - if (state.dataSurface->Surface(SurfNum).IsAirBoundarySurf) { - state.dataSurface->Surface(SurfNum).HeatTransSurf = false; - continue; - } - if (thisSpace.HTSurfaceFirst == 0) { - thisSpace.HTSurfaceFirst = SurfNum; - // Non window surfaces are grouped next within each zone - thisSpace.OpaqOrIntMassSurfaceFirst = SurfNum; - } - if ((thisSpace.WindowSurfaceFirst == 0) && - ((state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::Window) || - (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::GlassDoor) || - (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::TDD_Diffuser))) { - // Window surfaces are grouped last within each zone - thisSpace.WindowSurfaceFirst = SurfNum; - thisSpace.OpaqOrIntMassSurfaceLast = SurfNum - 1; - } - if ((thisSpace.TDDDomeFirst == 0) && (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::TDD_Dome)) { - // Window surfaces are grouped last within each zone - thisSpace.TDDDomeFirst = SurfNum; - if (thisSpace.WindowSurfaceFirst != 0) { - thisSpace.WindowSurfaceLast = SurfNum - 1; - } else { - // No window in the zone. - thisSpace.OpaqOrIntMassSurfaceLast = SurfNum - 1; - thisSpace.WindowSurfaceLast = -1; - } - break; - } - } - } - } - int firstSpaceNum = state.dataHeatBal->Zone(ZoneNum).spaceIndexes(1); - state.dataHeatBal->Zone(ZoneNum).AllSurfaceFirst = state.dataHeatBal->space(firstSpaceNum).AllSurfaceFirst; - } - // Surface First pointers are set, set last - if (state.dataGlobal->NumOfZones > 0) { - state.dataHeatBal->Zone(state.dataGlobal->NumOfZones).AllSurfaceLast = state.dataSurface->TotSurfaces; - int lastSpaceNum = state.dataHeatBal->Zone(state.dataGlobal->NumOfZones) - .spaceIndexes(state.dataHeatBal->Zone(state.dataGlobal->NumOfZones).spaceIndexes.size()); - state.dataHeatBal->space(lastSpaceNum).AllSurfaceLast = state.dataSurface->TotSurfaces; - } - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - if (ZoneNum < state.dataGlobal->NumOfZones) { - state.dataHeatBal->Zone(ZoneNum).AllSurfaceLast = state.dataHeatBal->Zone(ZoneNum + 1).AllSurfaceFirst - 1; - } - auto &thisSpaceList = state.dataHeatBal->Zone(ZoneNum).spaceIndexes; - int numSpacesInZone = thisSpaceList.size(); - if (numSpacesInZone > 1) { - for (int spaceCount = 1; spaceCount <= numSpacesInZone - 1; ++spaceCount) { - auto &thisSpace = state.dataHeatBal->space(thisSpaceList(spaceCount)); - auto &nextSpace = state.dataHeatBal->space(thisSpaceList(spaceCount + 1)); - thisSpace.AllSurfaceLast = nextSpace.AllSurfaceFirst - 1; - } - state.dataHeatBal->space(thisSpaceList(numSpacesInZone)).AllSurfaceLast = state.dataHeatBal->Zone(ZoneNum).AllSurfaceLast; - } else if (numSpacesInZone == 1) { - auto &thisSpace = state.dataHeatBal->space(thisSpaceList(numSpacesInZone)); - thisSpace.AllSurfaceFirst = state.dataHeatBal->Zone(ZoneNum).AllSurfaceFirst; - thisSpace.AllSurfaceLast = state.dataHeatBal->Zone(ZoneNum).AllSurfaceLast; - } - } - for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { - for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); - if (state.dataSurface->Surface(thisSpace.AllSurfaceLast).Class == DataSurfaces::SurfaceClass::TDD_Dome) { - thisSpace.TDDDomeLast = thisSpace.AllSurfaceLast; - } else if ((state.dataSurface->Surface(thisSpace.AllSurfaceLast).Class == DataSurfaces::SurfaceClass::Window) || - (state.dataSurface->Surface(thisSpace.AllSurfaceLast).Class == DataSurfaces::SurfaceClass::GlassDoor) || - (state.dataSurface->Surface(thisSpace.AllSurfaceLast).Class == DataSurfaces::SurfaceClass::TDD_Diffuser)) { - thisSpace.TDDDomeLast = -1; - thisSpace.WindowSurfaceLast = thisSpace.AllSurfaceLast; - } else { - // If there are no windows in the zone, then set this to -1 so any for loops on WindowSurfaceFirst to WindowSurfaceLast - // will not execute. Same for TDDDome and its indices - thisSpace.TDDDomeLast = -1; - thisSpace.WindowSurfaceLast = -1; - thisSpace.OpaqOrIntMassSurfaceLast = thisSpace.AllSurfaceLast; - } - if (thisSpace.HTSurfaceFirst > 0) { - thisSpace.OpaqOrWinSurfaceFirst = thisSpace.HTSurfaceFirst; - thisSpace.OpaqOrWinSurfaceLast = std::max(thisSpace.OpaqOrIntMassSurfaceLast, thisSpace.WindowSurfaceLast); - thisSpace.HTSurfaceLast = thisSpace.AllSurfaceLast; - } else { - // If no heat transfer surfaces, make sure all others are set correctly - thisSpace.HTSurfaceLast = -1; - thisSpace.WindowSurfaceFirst = 0; - thisSpace.WindowSurfaceLast = -1; - thisSpace.OpaqOrWinSurfaceFirst = 0; - thisSpace.OpaqOrWinSurfaceLast = -1; - thisSpace.OpaqOrIntMassSurfaceFirst = 0; - thisSpace.OpaqOrIntMassSurfaceLast = -1; - } - } - } + setSurfaceFirstLast(state); // Set up Floor Areas for Zones and Spaces Real64 constexpr floorAreaTolerance(0.05); @@ -3001,7 +2898,7 @@ namespace SurfaceGeometry { } } - void createSpaceSurfaceLists(EnergyPlusData &state, bool &ErrorsFound) + void createSpaceSurfaceLists(EnergyPlusData &state) { static constexpr std::string_view RoutineName("createSpaceSurfaceLists: "); // Build Space surface lists now that all of the surface sorting is complete @@ -3011,12 +2908,64 @@ namespace SurfaceGeometry { // Add to Space's list of surfaces state.dataHeatBal->space(thisSurf.spaceNum).surfaces.emplace_back(surfNum); } - // TODO MJW: Is this necessary? Check that all Spaces have at least one Surface - for (int spaceNum = 1; spaceNum < state.dataGlobal->numSpaces; ++spaceNum) { + for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) { if (int(state.dataHeatBal->space(spaceNum).surfaces.size()) == 0) { - ShowSevereError(state, format("{}Space = {} has no surfaces.", RoutineName, state.dataHeatBal->space(spaceNum).Name)); - ErrorsFound = true; + ShowWarningError(state, format("{}Space = {} has no surfaces.", RoutineName, state.dataHeatBal->space(spaceNum).Name)); + } + } + } + + void setSurfaceFirstLast(EnergyPlusData &state) + { + // Set Zone and Space Surface First/Last Pointers + // Space surface lists have been built earlier in createSpaceSurfaceLists + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + for (int spaceNum : state.dataHeatBal->Zone(ZoneNum).spaceIndexes) { + auto &thisSpace = state.dataHeatBal->space(spaceNum); + for (int SurfNum : thisSpace.surfaces) { + if (thisSpace.AllSurfaceFirst == 0) { + thisSpace.AllSurfaceFirst = SurfNum; + } + thisSpace.AllSurfaceLast = SurfNum; + + if (state.dataSurface->Surface(SurfNum).IsAirBoundarySurf) { + state.dataSurface->Surface(SurfNum).HeatTransSurf = false; + continue; + } + // Non window surfaces are grouped next within each space + if (thisSpace.HTSurfaceFirst == 0) { + thisSpace.HTSurfaceFirst = SurfNum; + thisSpace.OpaqOrIntMassSurfaceFirst = SurfNum; + thisSpace.OpaqOrWinSurfaceFirst = SurfNum; + } + thisSpace.HTSurfaceLast = SurfNum; + + // Window surfaces are grouped next within each space + if ((state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::Window) || + (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::GlassDoor) || + (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::TDD_Diffuser)) { + if (thisSpace.WindowSurfaceFirst == 0) { + thisSpace.WindowSurfaceFirst = SurfNum; + } + thisSpace.WindowSurfaceLast = SurfNum; + } else if (state.dataSurface->Surface(SurfNum).Class != DataSurfaces::SurfaceClass::TDD_Dome) { + thisSpace.OpaqOrIntMassSurfaceLast = SurfNum; + } + + // TDDDome surfaces are grouped last within each space + if (state.dataSurface->Surface(SurfNum).Class == DataSurfaces::SurfaceClass::TDD_Dome) { + if (thisSpace.TDDDomeFirst == 0) { + thisSpace.TDDDomeFirst = SurfNum; + } + thisSpace.TDDDomeLast = SurfNum; + } else { + thisSpace.OpaqOrWinSurfaceLast = SurfNum; + } + } + state.dataHeatBal->Zone(ZoneNum).AllSurfaceLast = thisSpace.AllSurfaceLast; } + int firstSpaceNum = state.dataHeatBal->Zone(ZoneNum).spaceIndexes(1); + state.dataHeatBal->Zone(ZoneNum).AllSurfaceFirst = state.dataHeatBal->space(firstSpaceNum).AllSurfaceFirst; } } diff --git a/src/EnergyPlus/SurfaceGeometry.hh b/src/EnergyPlus/SurfaceGeometry.hh index b9d940860bc..4693b69ce5a 100644 --- a/src/EnergyPlus/SurfaceGeometry.hh +++ b/src/EnergyPlus/SurfaceGeometry.hh @@ -90,7 +90,9 @@ namespace SurfaceGeometry { void CreateMissingSpaces(EnergyPlusData &state, Array1D &Surfaces); - void createSpaceSurfaceLists(EnergyPlusData &state, bool &ErrorsFound); + void createSpaceSurfaceLists(EnergyPlusData &state); + + void setSurfaceFirstLast(EnergyPlusData &state); void checkSubSurfAzTiltNorm(EnergyPlusData &state, SurfaceData &baseSurface, // Base surface data (in) diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index a4865c18131..94db2a88a29 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -11267,7 +11267,8 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder4) SetupZoneGeometry(*state, ErrorsFound); EXPECT_TRUE(ErrorsFound); // expect errors std::string const error_string = delimited_string( - {" ** Warning ** No floor exists in Zone=\"ATTIC ZONE\", zone floor area is zero. All values for this zone that are entered per floor " + {" ** 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", " ** ~~~ ** The calculated Zone Volume was=0.00", From d9aa4fe8455e8f179cc2e13cd6afbd7378257dd5 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 30 Nov 2023 13:24:46 -0600 Subject: [PATCH 4/5] Surface error cleanup --- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 3 ++- src/EnergyPlus/SurfaceGeometry.cc | 12 ++++++++---- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 7dd75b5388c..40402904f24 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -778,6 +778,7 @@ namespace HeatBalanceIntRadExchange { Array2D 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; @@ -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); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 6a04ae22626..a44115564f3 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -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)) { @@ -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)) { @@ -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; @@ -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)); } } } diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 94db2a88a29..3fd7b8084a8 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -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", From 405d8ea19b8aaa9137e4b0647b3f86032a309da5 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 30 Nov 2023 13:56:06 -0600 Subject: [PATCH 5/5] Surface error cleanup --- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 15 +++++++++++---- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 9 ++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 40402904f24..80fa4496c43 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -448,6 +448,7 @@ namespace HeatBalanceIntRadExchange { // the grey interchange between surfaces in an enclosure. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: + static constexpr std::string_view RoutineName("InitInteriorRadExchange: "); bool NoUserInputF; // Logical flag signifying no input F's for zone bool ErrorsFound(false); Real64 CheckValue1; @@ -499,7 +500,10 @@ namespace HeatBalanceIntRadExchange { thisEnclosure.NumOfSurfaces = numEnclosureSurfaces; state.dataHeatBalIntRadExchg->MaxNumOfRadEnclosureSurfs = max(state.dataHeatBalIntRadExchg->MaxNumOfRadEnclosureSurfs, numEnclosureSurfaces); - if (numEnclosureSurfaces < 1) ShowFatalError(state, "No surfaces in an enclosure in InitInteriorRadExchange"); + if (numEnclosureSurfaces < 1) { + ShowSevereError(state, format("{}No surfaces in enclosure={}.", RoutineName, thisEnclosure.Name)); + ErrorsFound = true; + } // Allocate the parts of the derived type thisEnclosure.F.dimension(numEnclosureSurfaces, numEnclosureSurfaces, 0.0); @@ -767,7 +771,7 @@ namespace HeatBalanceIntRadExchange { } if (ErrorsFound) { - ShowFatalError(state, "InitInteriorRadExchange: Errors found during initialization of radiant exchange. Program terminated."); + ShowFatalError(state, format("{}Errors found during initialization of radiant exchange. Program terminated.", RoutineName)); } } @@ -818,7 +822,10 @@ namespace HeatBalanceIntRadExchange { } } thisEnclosure.NumOfSurfaces = numEnclosureSurfaces; - if (numEnclosureSurfaces < 1) ShowFatalError(state, format("{}No surfaces in enclosure={}.", RoutineName, thisEnclosure.Name)); + if (numEnclosureSurfaces < 1) { + ShowSevereError(state, format("{}No surfaces in enclosure={}.", RoutineName, thisEnclosure.Name)); + ErrorsFound = true; + } // Allocate the parts of the derived type thisEnclosure.F.dimension(numEnclosureSurfaces, numEnclosureSurfaces, 0.0); @@ -1049,7 +1056,7 @@ namespace HeatBalanceIntRadExchange { } if (ErrorsFound) { - ShowFatalError(state, "InitSolarViewFactors: Errors found during initialization of diffuse solar distribution. Program terminated."); + ShowFatalError(state, format("{}Errors found during initialization of diffuse solar distribution. Program terminated.", RoutineName)); } } diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 3fd7b8084a8..94969fbec87 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -9645,7 +9645,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder2) EXPECT_FALSE(ErrorsFound); // expect no errors SetupZoneGeometry(*state, ErrorsFound); - EXPECT_TRUE(ErrorsFound); // expect errors due to zone with no surfaces + EXPECT_FALSE(ErrorsFound); // expect no errors // compare_err_stream( "" ); // just for debugging // This tests the space surface first/last values after surfaces are sorted: @@ -10498,7 +10498,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder3) EXPECT_FALSE(ErrorsFound); // expect no errors SetupZoneGeometry(*state, ErrorsFound); - EXPECT_TRUE(ErrorsFound); // expect errors due to zone with no surfaces + EXPECT_FALSE(ErrorsFound); // expect no errors // compare_err_stream( "" ); // just for debugging // This tests the space surface first/last values after surfaces are sorted: @@ -11265,7 +11265,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder4) EXPECT_FALSE(ErrorsFound); // expect no errors SetupZoneGeometry(*state, ErrorsFound); - EXPECT_TRUE(ErrorsFound); // expect errors + EXPECT_FALSE(ErrorsFound); // expect no errors, just warnings std::string const error_string = delimited_string( {" ** 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 " @@ -11274,8 +11274,7 @@ TEST_F(EnergyPlusFixture, GetSurfaceData_SurfaceOrder4) " ** ~~~ ** The calculated Zone Volume was=0.00", " ** ~~~ ** The simulation will continue with the Zone Volume set to 10.0 m3. ", " ** ~~~ ** ...use Output:Diagnostics,DisplayExtraWarnings; to show more details on individual zones.", - " ** Warning ** CalculateZoneVolume: 1 zone is not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; ", - " ** Severe ** SetUpZoneGeometry: Zone=\"ATTIC ZONE\" has only internal mass surfaces. Need at least one other surface."}); + " ** Warning ** CalculateZoneVolume: 1 zone is not fully enclosed. For more details use: Output:Diagnostics,DisplayExtrawarnings; "}); compare_err_stream(error_string);