diff --git a/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex b/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex index 970a562e0ec..1c52343c75d 100644 --- a/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex +++ b/doc/input-output-reference/src/overview/group-advanced-surface-concepts.tex @@ -2560,7 +2560,7 @@ \subsubsection{Field: Name}\label{field-srd-surfs-name} \subsubsection{Field: Sky View Factor}\label{field-sky-view-factor} -This field defines the constant sky view factor to an external surface. The sky view factor used in solar radiation calculation of the surface would be overwritten with the value of the fraction if defined here. If the field is left blank, the sky view factor of this surface will be calculated with the rules demonstrated above. +This field defines the constant sky view factor to an external surface. The sky view factor used in solar radiation calculation of the surface would be overwritten with the value of the fraction if defined here. This value can be autocalculated (the default); if it is, the sky view factor of this surface will be calculated with the rules demonstrated above. \subsubsection{Field: Sky Temperature Schedule Name}\label{field-sky-temperature-schedule-name} @@ -2568,7 +2568,7 @@ \subsubsection{Field: Sky Temperature Schedule Name}\label{field-sky-temperature \subsubsection{Field: Ground View Factor}\label{field-ground-view-factor} -This field defines the constant ground view factor to an external surface. The ground view factor used in solar radiation calculation of the surface would be overwritten with the value of the fraction if defined here. If the field is left blank, the ground view factor of this surface will be calculated with the rules demonstrated above. Ground surface view factor defined in \textit{SurfaceProperty:GroundSurfaces} object overrides the value specified in this field. +This field defines the constant ground view factor to an external surface. The ground view factor used in solar radiation calculation of the surface would be overwritten with the value of the fraction if defined here. This value can be autocalculated (the default); if it is, the ground view factor of this surface will be calculated with the rules demonstrated above. Ground surface view factor defined in \textit{SurfaceProperty:GroundSurfaces} object overrides the value specified in this field. \subsubsection{Field: Ground Temperature Schedule Name}\label{field-ground-temperature-schedule-name} @@ -2713,7 +2713,7 @@ \subsubsection{References}\label{references-gnd-srfs} \subsection{SurfaceProperty:LocalEnvironment}\label{surfacePropertylocalEnvironment} -The object links to an exterior surface object \textbf{BuildingSurface:Detailed} or an exterior fenestration object \textbf{FenestrationSurface:Detailed} and is used when there is a need to calculate surface level environmental data externally and import them into the simulation to override existing environmental data, including external solar shading fractions, local air velocity, temperature and humidity, and surrounding surface temperatures, sky view factor, ground surfaces view factors, ground surfaces temperature and ground surfaces reflectance. The object links to four optional objects including a schedule object declared by \textbf{Field: Sunlit Fraction Schedule Name}, a \textbf{\hyperref[surfacePropertySurroundingSurfaces]{SurfaceProperty:SurroundingSurfaces}} object declared by \textbf{Field: Surrounding Surfaces Object Name}, an \textbf{\hyperref[outdoorairnode]{OutdoorAir:Node}} object declared by \textbf{Field: Outdoor Air Node Name}, and a \textbf{\hyperref[surfacePropertyGroundSurfaces]{SurfaceProperty:GroundSurfaces}} object declared by +The object links to an exterior surface object (e.g., \textbf{BuildingSurface:Detailed}) or an exterior fenestration object (e.g., \textbf{FenestrationSurface:Detailed}) and is used when there is a need to calculate surface level environmental data externally and import them into the simulation to override existing environmental data, including external solar shading fractions, local air velocity, temperature and humidity, and surrounding surface temperatures, sky view factor, ground surfaces view factors, ground surfaces temperature and ground surfaces reflectance. The object links to four optional objects including a schedule object declared by \textbf{Field: Sunlit Fraction Schedule Name}, a \textbf{\hyperref[surfacePropertySurroundingSurfaces]{SurfaceProperty:SurroundingSurfaces}} object declared by \textbf{Field: Surrounding Surfaces Object Name}, an \textbf{\hyperref[outdoorairnode]{OutdoorAir:Node}} object declared by \textbf{Field: Outdoor Air Node Name}, and a \textbf{\hyperref[surfacePropertyGroundSurfaces]{SurfaceProperty:GroundSurfaces}} object declared by \textbf{Field: Ground Surfaces Object Name}. The object provides inputs to calculate shading, solar radiation, zone air balance, and surface exterior heat balance. \subsubsection{Field: Name}\label{field-surf-localenv-name} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 8f9912ae00a..31febbaa6bf 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -18873,7 +18873,7 @@ SurfaceProperty:LocalEnvironment, \reference SurfaceLocalEnvironmentNames A2, \field Exterior Surface Name \type object-list - \object-list SurfaceNames + \object-list AllHeatTranSurfNames \note Enter the name of an exterior surface object A3, \field Sunlit Fraction Schedule Name \type object-list @@ -18918,9 +18918,11 @@ SurfaceProperty:SurroundingSurfaces, \type alpha \reference SurroundingSurfacesNames N1, \field Sky View Factor + \type real \minimum 0.0 \maximum 1.0 - \default 0.5 + \autocalculatable + \default autocalculate \note optional A2, \field Sky Temperature Schedule Name \type object-list @@ -18928,9 +18930,11 @@ SurfaceProperty:SurroundingSurfaces, \note Schedule values are real numbers, -100.0 to 100.0, units C \note optional N2, \field Ground View Factor + \type real \minimum 0.0 \maximum 1.0 - \default 0.5 + \autocalculatable + \default autocalculate \note optional A3, \field Ground Temperature Schedule Name \type object-list diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 9d73fcd2ac6..ac7bc86fd5e 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -1812,11 +1812,11 @@ namespace HeatBalanceManager { // METHODOLOGY EMPLOYED: // The GetObjectItem routines are employed to retrieve the data. - SolarShading::GetShadowingInput(state); - GetZoneData(state, ErrorsFound); // Read Zone data from input file SurfaceGeometry::SetupZoneGeometry(state, ErrorsFound); + + SolarShading::GetShadowingInput(state); } void GetZoneData(EnergyPlusData &state, bool &ErrorsFound) // If errors found in input diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 11c8870535b..1db07ee96b0 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -9922,13 +9922,15 @@ void InitSurfacePropertyViewFactors(EnergyPlusData &state) auto &SrdSurfsProperty = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum); SurfsSkyViewFactor = SrdSurfsProperty.SkyViewFactor; IsSkyViewFactorSet = SrdSurfsProperty.IsSkyViewFactorSet; - if (SurfsSkyViewFactor > 0.0) { + if (SurfsSkyViewFactor != DataSizing::AutoSize) { SrdSurfsViewFactor += SurfsSkyViewFactor; } if (!Surface.IsSurfPropertyGndSurfacesDefined) { - SrdSurfsViewFactor += SrdSurfsProperty.GroundViewFactor; - IsGroundViewFactorSet = SrdSurfsProperty.IsGroundViewFactorSet; GroundSurfsViewFactor = SrdSurfsProperty.GroundViewFactor; + IsGroundViewFactorSet = SrdSurfsProperty.IsGroundViewFactorSet; + if (GroundSurfsViewFactor != DataSizing::AutoSize) { + SrdSurfsViewFactor += GroundSurfsViewFactor; + } } for (int SrdSurfNum = 1; SrdSurfNum <= SrdSurfsProperty.TotSurroundingSurface; SrdSurfNum++) { SrdSurfsViewFactor += SrdSurfsProperty.SurroundingSurfs(SrdSurfNum).ViewFactor; @@ -9936,8 +9938,9 @@ void InitSurfacePropertyViewFactors(EnergyPlusData &state) } if (Surface.IsSurfPropertyGndSurfacesDefined) { GndSurfsNum = Surface.SurfPropertyGndSurfIndex; - IsGroundViewFactorSet = state.dataSurface->GroundSurfsProperty(GndSurfsNum).IsGroundViewFactorSet; - GroundSurfsViewFactor = state.dataSurface->GroundSurfsProperty(GndSurfsNum).SurfsViewFactorSum; + auto &GrndSurfsProperty = state.dataSurface->GroundSurfsProperty(GndSurfsNum); + GroundSurfsViewFactor = GrndSurfsProperty.SurfsViewFactorSum; + IsGroundViewFactorSet = GrndSurfsProperty.IsGroundViewFactorSet; SrdSurfsViewFactor += GroundSurfsViewFactor; } diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index bef75f7191d..7748eabc286 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -494,12 +494,15 @@ void GetShadowingInput(EnergyPlusData &state) EnergyPlus::format("Value entered=\"{}\" while no Schedule:File:Shading object is defined, InternalCalculation will be used.", state.dataIPShortCut->cAlphaArgs(aNum))); } + checkNotScheduledSurfacePresent(state); } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PolygonClipping")) { state.dataSysVars->shadingMethod = ShadingMethod::PolygonClipping; state.dataIPShortCut->cAlphaArgs(aNum) = "PolygonClipping"; + checkNotScheduledSurfacePresent(state); } else if (Util::SameString(state.dataIPShortCut->cAlphaArgs(aNum), "PixelCounting")) { state.dataSysVars->shadingMethod = ShadingMethod::PixelCounting; state.dataIPShortCut->cAlphaArgs(aNum) = "PixelCounting"; + checkNotScheduledSurfacePresent(state); if (NumNumbers >= 3) { pixelRes = (unsigned)state.dataIPShortCut->rNumericArgs(3); } @@ -531,6 +534,7 @@ void GetShadowingInput(EnergyPlusData &state) } else { state.dataIPShortCut->cAlphaArgs(aNum) = "PolygonClipping"; state.dataSysVars->shadingMethod = ShadingMethod::PolygonClipping; + checkNotScheduledSurfacePresent(state); } aNum++; @@ -831,7 +835,7 @@ void processShadowingInput(EnergyPlusData &state) void checkScheduledSurfacePresent(EnergyPlusData &state) { - // User has chosen "Scheduled" for sunlit fraction so check to see which surfaces don't have a schedule + // User has chosen "Scheduled" for sunlit fraction so check to see which surfaces don't have a schedule. int numNotDef = 0; int constexpr maxErrMessages = 50; auto &surfData = state.dataSurface; @@ -846,7 +850,7 @@ void checkScheduledSurfacePresent(EnergyPlusData &state) if (numNotDef == 1) { ShowWarningError( state, - EnergyPlus::format("ShadowCalculation specified Schedule for the Shading Calculation Method but no schedule provided for {}", + EnergyPlus::format("ShadowCalculation specified Schedule for the Shading Calculation Method but no schedule provided for {}.", thisSurf.Name)); ShowContinueError( state, "When Schedule is selected for the Shading Calculation Method and no schedule is provided for a particular surface,"); @@ -855,7 +859,37 @@ void checkScheduledSurfacePresent(EnergyPlusData &state) ShowContinueError(state, "for sunlit fraction if this was not desired. Otherwise, this surface will not be shaded at all."); } else if (numNotDef <= maxErrMessages) { ShowWarningError( - state, EnergyPlus::format("No schedule was provided for {} either. See above error message for more details", thisSurf.Name)); + state, EnergyPlus::format("No schedule was provided for {} either. See above error message for more details.", thisSurf.Name)); + } + } + } + if (numNotDef > maxErrMessages) { + ShowContinueError(state, EnergyPlus::format("This message is only shown for the first {} occurrences of this issue.", maxErrMessages)); + } +} + +void checkNotScheduledSurfacePresent(EnergyPlusData &state) +{ + // User has *not* chosen "Scheduled" for sunlit fraction so check to see which surfaces *have* a schedule. + int numNotDef = 0; + int constexpr maxErrMessages = 50; + auto &surfData = state.dataSurface; + for (int surfNum = 1; surfNum <= surfData->TotSurfaces; ++surfNum) { + auto &thisSurf = surfData->Surface(surfNum); + if ((thisSurf.Class == SurfaceClass::Shading || thisSurf.Class == SurfaceClass::Detached_F || thisSurf.Class == SurfaceClass::Detached_B || + thisSurf.Class == SurfaceClass::Overhang || thisSurf.Class == SurfaceClass::Fin)) { + continue; // skip shading surfaces + } + if (thisSurf.SurfSchedExternalShadingFrac) { + numNotDef += 1; + if (numNotDef == 1) { + ShowWarningError( + state, + EnergyPlus::format("ShadowCalculation did not specify Schedule for the Shading Calculation Method but schedule provided for {}.", + thisSurf.Name)); + } else if (numNotDef <= maxErrMessages) { + ShowWarningError(state, + EnergyPlus::format("Schedule was also provided for {}. See above error message for more details.", thisSurf.Name)); } } } diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index bd6426e93f8..751930945d1 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -103,6 +103,8 @@ namespace SolarShading { void checkScheduledSurfacePresent(EnergyPlusData &state); + void checkNotScheduledSurfacePresent(EnergyPlusData &state); + void AllocateModuleArrays(EnergyPlusData &state); void AnisoSkyViewFactors(EnergyPlusData &state); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 83e0ddeb60c..50e1120e510 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -8183,8 +8183,8 @@ namespace SurfaceGeometry { SrdSurfsProp.Name = s_ipsc->cAlphaArgs(1); // N1: sky view factor - if (!s_ipsc->lNumericFieldBlanks(1)) { - SrdSurfsProp.SkyViewFactor = s_ipsc->rNumericArgs(1); + SrdSurfsProp.SkyViewFactor = s_ipsc->rNumericArgs(1); + if (SrdSurfsProp.SkyViewFactor != DataSizing::AutoSize) { SrdSurfsProp.IsSkyViewFactorSet = true; } @@ -8195,8 +8195,8 @@ namespace SurfaceGeometry { } // N2: ground view factor - if (!s_ipsc->lNumericFieldBlanks(2)) { - SrdSurfsProp.GroundViewFactor = s_ipsc->rNumericArgs(2); + SrdSurfsProp.GroundViewFactor = s_ipsc->rNumericArgs(2); + if (SrdSurfsProp.GroundViewFactor != DataSizing::AutoSize) { SrdSurfsProp.IsGroundViewFactorSet = true; } diff --git a/testfiles/SolarShadingTest_ExternalFraction.idf b/testfiles/SolarShadingTest_ExternalFraction.idf index f9e819a4759..8f547e48b43 100644 --- a/testfiles/SolarShadingTest_ExternalFraction.idf +++ b/testfiles/SolarShadingTest_ExternalFraction.idf @@ -670,215 +670,6 @@ , !- Sky Diffuse Modeling Algorithm Yes; !- Output External Shading Calculation Results - SurfaceProperty:LocalEnvironment, - LocEnv:EAST SIDE TREE, !- Name - EAST SIDE TREE, !- Exterior Surface Name - ExtShadingSch:EAST SIDE TREE, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:EAST SIDE TREE, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 2, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:WEST SIDE TREE, !- Name - WEST SIDE TREE, !- Exterior Surface Name - ExtShadingSch:WEST SIDE TREE, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:WEST SIDE TREE, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 4, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN001:WALL001:SHADE001, !- Name - ZN001:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN001:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN001:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 6, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN002:WALL001:SHADE001, !- Name - ZN002:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN002:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN002:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 8, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN003:WALL001:SHADE001, !- Name - ZN003:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN003:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN003:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 10, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN004:WALL001:SHADE001, !- Name - ZN004:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN004:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN004:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 12, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN005:WALL001:SHADE001, !- Name - ZN005:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN005:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN005:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 14, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN006:WALL001:SHADE001, !- Name - ZN006:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN006:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN006:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 16, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN007:WALL001:SHADE001, !- Name - ZN007:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN007:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN007:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 18, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN008:WALL001:SHADE001, !- Name - ZN008:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN008:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN008:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 20, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - - SurfaceProperty:LocalEnvironment, - LocEnv:ZN009:WALL001:SHADE001, !- Name - ZN009:WALL001:SHADE001, !- Exterior Surface Name - ExtShadingSch:ZN009:WALL001:SHADE001, !- Sunlit Fraction Schedule Name - , !- Surrounding Surfaces Object Name - ; !- Outdoor Air Node Name - - Schedule:File, - ExtShadingSch:ZN009:WALL001:SHADE001, !- Name - Fraction, !- Schedule Type Limits Name - SolarShadingTest_Shading_Data.csv, !- File Name - 22, !- Column Number - 1, !- Rows to Skip at Top - , !- Number of Hours of Data - , !- Column Separator - , !- Interpolate to Timestep - 15, !- Minutes per Item - ; !- Adjust Schedule for Daylight Savings - SurfaceProperty:LocalEnvironment, LocEnv:ZN001:WALL001, !- Name ZN001:WALL001, !- Exterior Surface Name diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 06cdf9ebf16..e396443a2a2 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -6518,7 +6518,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyViewFactorsI EXPECT_TRUE(SrdSurfsProperty_2.IsSkyViewFactorSet); EXPECT_DOUBLE_EQ(0.0, GndSurfsProperty_2.GndSurfs(1).ViewFactor); EXPECT_FALSE(GndSurfsProperty_2.IsGroundViewFactorSet); - EXPECT_DOUBLE_EQ(0.0, SrdSurfsProperty_3.SkyViewFactor); + EXPECT_EQ(DataSizing::AutoSize, SrdSurfsProperty_3.SkyViewFactor); EXPECT_FALSE(SrdSurfsProperty_3.IsSkyViewFactorSet); EXPECT_DOUBLE_EQ(0.0, GndSurfsProperty_3.GndSurfs(1).ViewFactor); EXPECT_FALSE(GndSurfsProperty_3.IsGroundViewFactorSet); @@ -8404,7 +8404,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyViewFactorsR auto &GndSurfsProperty_3 = state->dataSurface->GroundSurfsProperty(GndSurfsNum); // check user input sky view factor is blank - EXPECT_DOUBLE_EQ(0.0, SrdSurfsProperty_1.SkyViewFactor); + EXPECT_EQ(DataSizing::AutoSize, SrdSurfsProperty_1.SkyViewFactor); EXPECT_FALSE(SrdSurfsProperty_1.IsSkyViewFactorSet); EXPECT_DOUBLE_EQ(0.2, SrdSurfsProperty_1.SurroundingSurfs(1).ViewFactor); // check user input ground view factor is not blank @@ -8419,7 +8419,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyViewFactorsR EXPECT_DOUBLE_EQ(0.0, GndSurfsProperty_2.GndSurfs(1).ViewFactor); EXPECT_FALSE(GndSurfsProperty_2.IsGroundViewFactorSet); // check user input sky and ground view factors are blank - EXPECT_DOUBLE_EQ(0.0, SrdSurfsProperty_3.SkyViewFactor); + EXPECT_EQ(DataSizing::AutoSize, SrdSurfsProperty_3.SkyViewFactor); EXPECT_FALSE(SrdSurfsProperty_3.IsSkyViewFactorSet); EXPECT_DOUBLE_EQ(0.4, SrdSurfsProperty_3.SurroundingSurfs(1).ViewFactor); EXPECT_DOUBLE_EQ(0.0, GndSurfsProperty_3.GndSurfs(1).ViewFactor); diff --git a/tst/EnergyPlus/unit/InputProcessor.unit.cc b/tst/EnergyPlus/unit/InputProcessor.unit.cc index a08913495af..8ee9d9b2f26 100644 --- a/tst/EnergyPlus/unit/InputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/InputProcessor.unit.cc @@ -4365,9 +4365,9 @@ TEST_F(InputProcessorFixture, reportIDFRecordsStats_extensible_fields) // 1 fields defaulted , 0 Autosizable, 0 Autocalculatable "SurfaceProperty:SurroundingSurfaces,", " SrdSurfs:Living:East, !- Name", - " 0.3, !- Sky View Factor", // Has numeric default + " 0.3, !- Sky View Factor", // Has autocalculate default " , !- Sky Temperature Schedule Name", - " 0.1, !- Ground View Factor", // Has numeric default + " 0.1, !- Ground View Factor", // Has autocalculate default " , !- Ground Temperature Schedule Name", " SurroundingSurface1, !- Surrounding Surface 1 Name", // (begin extensible) " 0.6, !- Surrounding Surface 1 View Factor", // Has numeric default @@ -4386,13 +4386,13 @@ TEST_F(InputProcessorFixture, reportIDFRecordsStats_extensible_fields) state->dataInputProcessing->inputProcessor->reportIDFRecordsStats(*state); // TOTAL: - // 16 fields with defaults, 0 Autosizable, 0 Autocalculatable + // 16 fields with defaults, 0 Autosizable, 2 Autocalculatable // 2 fields defaulted , 0 Autosized , 0 Autocalculated EXPECT_EQ(5, state->dataOutput->iNumberOfRecords); // Number of IDF Records (=Objects) EXPECT_EQ(16, state->dataOutput->iTotalFieldsWithDefaults); // Total number of fields that could be defaulted EXPECT_EQ(0, state->dataOutput->iTotalAutoSizableFields); // Total number of autosizeable fields - EXPECT_EQ(0, state->dataOutput->iTotalAutoCalculatableFields); // Total number of autocalculatable fields + EXPECT_EQ(2, state->dataOutput->iTotalAutoCalculatableFields); // Total number of autocalculatable fields EXPECT_EQ(2, state->dataOutput->iNumberOfDefaultedFields); // Number of defaulted fields in IDF EXPECT_EQ(0, state->dataOutput->iNumberOfAutoSizedFields); // Number of autosized fields in IDF EXPECT_EQ(0, state->dataOutput->iNumberOfAutoCalcedFields); // Number of autocalculated fields diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index d880abdffa7..7dfe5f51a2e 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -5262,7 +5262,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_checkScheduledSurfacePresent) // Test of check to see if all surfaces have a sunlit schedule when shadow calculations are set to "Scheduled" { auto &surfData = state->dataSurface; - surfData->TotSurfaces = 5; + surfData->TotSurfaces = 6; surfData->Surface.allocate(surfData->TotSurfaces); // Set up data for test: three of five surfaces are non-shading and two are shading. Shading surfaces @@ -5283,17 +5283,57 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_checkScheduledSurfacePresent) surfData->Surface(5).Class = SurfaceClass::Overhang; surfData->Surface(5).SurfSchedExternalShadingFrac = false; surfData->Surface(5).Name = "SHADING2NOTOK"; + surfData->Surface(6).Class = SurfaceClass::Window; + surfData->Surface(6).SurfSchedExternalShadingFrac = false; + surfData->Surface(6).Name = "WINDOW2NOTOK"; checkScheduledSurfacePresent(*state); std::string const error_string = delimited_string({ - " ** Warning ** ShadowCalculation specified Schedule for the Shading Calculation Method but no schedule provided for WINDOW1NOTOK", + " ** Warning ** ShadowCalculation specified Schedule for the Shading Calculation Method but no schedule provided for WINDOW1NOTOK.", " ** ~~~ ** When Schedule is selected for the Shading Calculation Method and no schedule is provided for a particular surface,", " ** ~~~ ** EnergyPlus will assume that the surface is not shaded. Use SurfaceProperty:LocalEnvironment to specify a schedule", " ** ~~~ ** for sunlit fraction if this was not desired. Otherwise, this surface will not be shaded at all.", + " ** Warning ** No schedule was provided for WINDOW2NOTOK either. See above error message for more details.", + }); + EXPECT_TRUE(compare_err_stream(error_string, true)); +} + +TEST_F(EnergyPlusFixture, SolarShadingTest_checkNotScheduledSurfacePresent) +// Test of check to see if all surfaces do not have a sunlit schedule when shadow calculations are not set to "Scheduled" +{ + auto &surfData = state->dataSurface; + surfData->TotSurfaces = 5; + surfData->Surface.allocate(surfData->TotSurfaces); + + // Set up data for test: three of five surfaces are non-shading and two are shading. Shading surfaces + // are skipped so they should not report any errors. Two of the surfaces will be correctly defined while + // one surface will not be correctly defined and will generate an error. + surfData->Surface(1).Class = SurfaceClass::Wall; + surfData->Surface(1).SurfSchedExternalShadingFrac = true; + surfData->Surface(1).Name = "WALL1OK"; + surfData->Surface(2).Class = SurfaceClass::Roof; + surfData->Surface(2).SurfSchedExternalShadingFrac = true; + surfData->Surface(2).Name = "ROOF1OK"; + surfData->Surface(3).Class = SurfaceClass::Window; + surfData->Surface(3).SurfSchedExternalShadingFrac = false; + surfData->Surface(3).Name = "WINDOW1NOTOK"; + surfData->Surface(4).Class = SurfaceClass::Shading; + surfData->Surface(4).SurfSchedExternalShadingFrac = true; + surfData->Surface(4).Name = "SHADING1OK"; + surfData->Surface(5).Class = SurfaceClass::Overhang; + surfData->Surface(5).SurfSchedExternalShadingFrac = false; + surfData->Surface(5).Name = "SHADING2NOTOK"; + + checkNotScheduledSurfacePresent(*state); + + std::string const error_string = delimited_string({ + " ** Warning ** ShadowCalculation did not specify Schedule for the Shading Calculation Method but schedule provided for WALL1OK.", + " ** Warning ** Schedule was also provided for ROOF1OK. See above error message for more details.", }); EXPECT_TRUE(compare_err_stream(error_string, true)); } + TEST_F(EnergyPlusFixture, SolarShadingTest_CalcBeamSolarOnWinRevealSurface) { state->dataGlobal->TimeStepsInHour = 6; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 916378adc5b..8fcd601df81 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -12686,7 +12687,7 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_GetSurfaceGroundSurfsTest) auto &GndSurfsProperty = state->dataSurface->GroundSurfsProperty(GndSurfsNum); // check sky view factors EXPECT_DOUBLE_EQ(0.5, SrdSurfsProperty.SkyViewFactor); - EXPECT_DOUBLE_EQ(0.0, SrdSurfsProperty.GroundViewFactor); + EXPECT_EQ(DataSizing::AutoSize, SrdSurfsProperty.GroundViewFactor); // check surrounding surfaces view factors EXPECT_DOUBLE_EQ(0.1, SrdSurfsProperty.SurroundingSurfs(1).ViewFactor); // check ground surfaces view factors