From 0f089cf5eb189ee719576fc3f9b335ef9c596f21 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sun, 18 Apr 2021 16:27:47 -0700 Subject: [PATCH 01/25] hb arrays --- src/EnergyPlus/ConvectionCoefficients.cc | 170 +++++++-------- src/EnergyPlus/DataSurfaces.hh | 196 ++++++++++-------- src/EnergyPlus/DaylightingManager.cc | 32 +-- src/EnergyPlus/EMSManager.cc | 32 +-- src/EnergyPlus/HeatBalFiniteDiffManager.cc | 13 +- src/EnergyPlus/HeatBalanceHAMTManager.cc | 8 +- src/EnergyPlus/HeatBalanceManager.cc | 36 ++++ src/EnergyPlus/HeatBalanceSurfaceManager.cc | 160 +++++++------- src/EnergyPlus/HeatBalanceSurfaceManager.hh | 2 +- src/EnergyPlus/OutputReports.cc | 16 +- src/EnergyPlus/SolarReflectionManager.cc | 11 +- src/EnergyPlus/SurfaceGeometry.cc | 11 +- src/EnergyPlus/WindowManager.cc | 6 +- .../unit/ConvectionCoefficients.unit.cc | 4 +- .../unit/HeatBalanceManager.unit.cc | 4 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 42 ++-- tst/EnergyPlus/unit/ICSCollector.unit.cc | 2 +- 17 files changed, 419 insertions(+), 326 deletions(-) diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 8ab36307c9d..c364e775ff8 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -185,12 +185,20 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, } if (state.dataGlobal->BeginEnvrnFlag && state.dataConvectionCoefficient->MyEnvirnFlag) { - if (std::any_of(Surface.begin(), - Surface.end(), - [](DataSurfaces::SurfaceData const &e) { return e.IntConvCoeff == DataHeatBalance::AdaptiveConvectionAlgorithm; }) || - std::any_of(Zone.begin(), Zone.end(), [](DataHeatBalance::ZoneData const &e) { - return e.InsideConvectionAlgo == DataHeatBalance::AdaptiveConvectionAlgorithm; - })) { + bool anyAdaptiveConvectionAlgorithm = false; + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) == DataHeatBalance::AdaptiveConvectionAlgorithm) { + anyAdaptiveConvectionAlgorithm = true; + break; + } + } + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { + if (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == DataHeatBalance::AdaptiveConvectionAlgorithm) { + anyAdaptiveConvectionAlgorithm = true; + break; + } + } + if (anyAdaptiveConvectionAlgorithm) { // need to clear out node conditions because dynamic assignments will be affected if (state.dataLoopNodes->NumOfNodes > 0 && allocated(state.dataLoopNodes->Node)) { for (auto &e : state.dataLoopNodes->Node) { @@ -257,10 +265,10 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, int algoNum; bool standardAlgo; - if (Surface(SurfNum).IntConvCoeff <= -1) { // Set by user using one of the standard algorithms... - algoNum = std::abs(Surface(SurfNum).IntConvCoeff); + if (state.dataSurface->SurfIntConvCoeff(SurfNum) <= -1) { // Set by user using one of the standard algorithms... + algoNum = std::abs(state.dataSurface->SurfIntConvCoeff(SurfNum)); standardAlgo = true; - } else if (Surface(SurfNum).IntConvCoeff == 0) { // Not set by user, uses Zone Setting + } else if (state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) { // Not set by user, uses Zone Setting algoNum = Zone(ZoneNum).InsideConvectionAlgo; standardAlgo = true; } else { @@ -309,10 +317,10 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, state.dataHeatBal->HConvIn(SurfNum) = state.dataHeatBal->LowHConvLimit; } - if (Surface(SurfNum).EMSOverrideIntConvCoef) { - state.dataHeatBal->HConvIn(SurfNum) = Surface(SurfNum).EMSValueForIntConvCoef; + if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) { + state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - Real64 hConst = Surface(SurfNum).EMSValueForIntConvCoef; + Real64 hConst = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(hConst); } } @@ -414,10 +422,10 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, int algoNum; bool standardAlgo; - if (Surface(SurfNum).ExtConvCoeff <= -1) { // Set by user using one of the standard algorithms... - algoNum = std::abs(Surface(SurfNum).ExtConvCoeff); + if (state.dataSurface->SurfExtConvCoeff(SurfNum) <= -1) { // Set by user using one of the standard algorithms... + algoNum = std::abs(state.dataSurface->SurfExtConvCoeff(SurfNum)); standardAlgo = true; - } else if (Surface(SurfNum).ExtConvCoeff == 0) { // Not set by user, uses Zone Setting + } else if (state.dataSurface->SurfExtConvCoeff(SurfNum) == 0) { // Not set by user, uses Zone Setting algoNum = Zone(Surface(SurfNum).Zone).OutsideConvectionAlgo; standardAlgo = true; } else { @@ -590,11 +598,11 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, HExt = SetExtConvectionCoeff(state, SurfNum); } - if (Surface(SurfNum).EMSOverrideExtConvCoef) { - HExt = Surface(SurfNum).EMSValueForExtConvCoef; + if (state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum)) { + HExt = state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; - Real64 hConst = Surface(SurfNum).EMSValueForExtConvCoef; + Real64 hConst = state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum); state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(hConst); } } @@ -1351,12 +1359,12 @@ void GetUserConvectionCoefficients(EnergyPlusData &state) ShowContinueError(state, "Check Input Entered :" + Alphas(Ptr + 1)); ErrorsFound = true; } - if (Surface(Found).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(Found) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", invalid value"); ShowContinueError(state, "Duplicate (Outside) assignment attempt"); ErrorsFound = true; } else { - Surface(Found).ExtConvCoeff = PotentialAssignedValue; + state.dataSurface->SurfExtConvCoeff(Found) = PotentialAssignedValue; } } @@ -1457,12 +1465,12 @@ void GetUserConvectionCoefficients(EnergyPlusData &state) } } } - if (Surface(Found).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(Found) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", duplicate (inside)"); ShowContinueError(state, "Duplicate (Inside) assignment attempt."); ErrorsFound = true; } else { - Surface(Found).IntConvCoeff = PotentialAssignedValue; + state.dataSurface->SurfIntConvCoeff(Found) = PotentialAssignedValue; } } else if (SELECT_CASE_var == std::string()) { // Blank @@ -1958,7 +1966,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -1967,10 +1975,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -1979,7 +1987,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2006,7 +2014,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2015,10 +2023,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2027,7 +2035,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2054,7 +2062,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2063,10 +2071,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2075,7 +2083,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2102,7 +2110,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2111,10 +2119,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2123,7 +2131,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2150,7 +2158,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2159,10 +2167,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2171,7 +2179,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2197,7 +2205,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2206,10 +2214,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2218,7 +2226,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2245,7 +2253,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2254,10 +2262,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2266,7 +2274,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2293,7 +2301,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2302,10 +2310,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2314,7 +2322,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2341,7 +2349,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2350,10 +2358,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2362,7 +2370,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2389,7 +2397,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (Surface(SurfNum).ExtConvCoeff != 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2398,10 +2406,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - Surface(SurfNum).ExtConvCoeff = Value; + state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; } } else { - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2410,7 +2418,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - Surface(SurfNum).IntConvCoeff = Value; + state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; } } } @@ -2670,7 +2678,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, state.dataRoomAirMod->AirModel(Surface(SurfNum).Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum); @@ -2685,7 +2693,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, Hf = 4.3 * Vhc()(Surface(SurfNum).Zone); // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf - if (Surface(SurfNum).IntConvCoeff != 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum); @@ -3252,10 +3260,10 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac auto &Surface(state.dataSurface->Surface); { - auto const SELECT_CASE_var(state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).OverrideType); + auto const SELECT_CASE_var(state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { - HExt = state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).OverrideValue; + HExt = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).OverrideValue; if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); @@ -3263,7 +3271,7 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac Surface(SurfNum).OutConvHfModelEq = HcExt_UserValue; // reporting Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HExt = GetCurrentScheduleValue(state, state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).ScheduleIndex); + HExt = GetCurrentScheduleValue(state, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; @@ -3273,19 +3281,19 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedOutsideHcModel( - state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).UserCurveIndex, HExt); + state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).UserCurveIndex, HExt); // Kiva convection handled in function above Surface(SurfNum).OutConvHfModelEq = HcExt_UserCurve; // reporting Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { EvaluateExtHcModels(state, SurfNum, - state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).HcModelEq, - state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).HcModelEq, + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, HExt); // Kiva convection handled in function above - Surface(SurfNum).OutConvHfModelEq = state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).HcModelEq; // reporting - Surface(SurfNum).OutConvHnModelEq = state.dataSurface->UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).HcModelEq; // reporting + Surface(SurfNum).OutConvHfModelEq = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + Surface(SurfNum).OutConvHnModelEq = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting } else { assert(false); } @@ -3322,16 +3330,16 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac auto &Surface(state.dataSurface->Surface); { - auto const SELECT_CASE_var(state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).OverrideType); + auto const SELECT_CASE_var(state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { - HInt = state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).OverrideValue; + HInt = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).OverrideValue; if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } Surface(SurfNum).IntConvHcModelEq = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HInt = GetCurrentScheduleValue(state, state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).ScheduleIndex); + HInt = GetCurrentScheduleValue(state, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); @@ -3339,13 +3347,13 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac Surface(SurfNum).IntConvHcModelEq = HcInt_UserSchedule; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedInsideHcModel( - state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).UserCurveIndex, HInt); + state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).UserCurveIndex, HInt); // Kiva convection handled in function above Surface(SurfNum).IntConvHcModelEq = HcInt_UserCurve; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { - EvaluateIntHcModels(state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).HcModelEq, HInt); + EvaluateIntHcModels(state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq, HInt); // Kiva convection handled in function above - Surface(SurfNum).IntConvHcModelEq = state.dataSurface->UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).HcModelEq; + Surface(SurfNum).IntConvHcModelEq = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; } else { assert(false); } @@ -3509,7 +3517,7 @@ void CalcISO15099WindowIntConvCoeff(EnergyPlusData &state, CalcISO15099WindowIntConvCoeff(state, SurfaceTemperature, AirTemperature, AirHumRat, Height, TiltDeg, sineTilt); // EMS override point (Violates Standard 15099? throw warning? scary. - if (Surface(SurfNum).EMSOverrideIntConvCoef) state.dataHeatBal->HConvIn(SurfNum) = Surface(SurfNum).EMSValueForIntConvCoef; + if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) @@ -4073,11 +4081,11 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) print(state.files.eio, Format_901, Surface(SurfLoop).Name, - Surface(SurfLoop).ExtConvCoeff, + state.dataSurface->SurfExtConvCoeff(SurfLoop), Surface(SurfLoop).OutConvFaceArea, Surface(SurfLoop).OutConvFacePerimeter, Surface(SurfLoop).OutConvFaceHeight, - Surface(SurfLoop).IntConvCoeff, + state.dataSurface->SurfIntConvCoeff(SurfLoop), Surface(SurfLoop).IntConvZoneWallHeight, Surface(SurfLoop).IntConvZonePerimLength, Surface(SurfLoop).IntConvZoneHorizHydrDiam, diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 84d13497796..f02540f1111 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -555,92 +555,72 @@ namespace DataSurfaces { // Members std::string Name; // User supplied name of the surface (must be unique) int Construction; // Pointer to the construction in the Construct derived type - bool EMSConstructionOverrideON; // if true, EMS is calling to override the construction value - int EMSConstructionOverrideValue; // pointer value to use for Construction when overridden int ConstructionStoredInputValue; // holds the original value for Construction per surface input SurfaceClass Class; + // Geometry related parameters - SurfaceShape Shape; // Surface shape (Triangle=1,Quadrilateral=2,Rectangle=3, - // Rectangular Window/Door=4,Rectangular Overhang=5, - // Rectangular Left Fin=6,Rectangular Right Fin=7, - // Triangular Window=8) + SurfaceShape Shape; // Surface shape (Triangle=1,Quadrilateral=2,Rectangle=3, + // Rectangular Window/Door=4,Rectangular Overhang=5, + // Rectangular Left Fin=6,Rectangular Right Fin=7, + // Triangular Window=8) int Sides; // Number of side/vertices for this surface (based on Shape) Real64 Area; // Surface area of the surface (less any subsurfaces) {m2} Real64 GrossArea; // Surface area of the surface (including subsurfaces) {m2} - Real64 NetAreaShadowCalc; // Area of a wall/floor/ceiling less subsurfaces assuming - // all windows, if present, have unity multiplier. - // Wall/floor/ceiling/roof areas that include windows include - // frame (unity) areas. - // Areas of Windows including divider (unity) area. - // These areas are used in shadowing / sunlit area calculations. - Real64 Perimeter; // Perimeter length of the surface {m} - Real64 Azimuth; // Direction the surface outward normal faces (degrees) or FACING - Real64 Height; // Height of the surface (m) - Real64 Reveal; // Depth of the window reveal (m) if this surface is a window - Real64 Tilt; // Angle (deg) between the ground outward normal and the surface outward normal - Real64 Width; // Width of the surface (m) + Real64 NetAreaShadowCalc; // Area of a wall/floor/ceiling less subsurfaces assuming all windows, if present, have unity multiplier. + // Wall/floor/ceiling/roof areas that include windows include frame (unity) areas. + // Areas of Windows including divider (unity) area. + // These areas are used in shadowing / sunlit area calculations. + Real64 Perimeter; // Perimeter length of the surface {m} + Real64 Azimuth; // Direction the surface outward normal faces (degrees) or FACING + Real64 Height; // Height of the surface (m) + Real64 Reveal; // Depth of the window reveal (m) if this surface is a window + Real64 Tilt; // Angle (deg) between the ground outward normal and the surface outward normal + Real64 Width; // Width of the surface (m) + // Boundary conditions and interconnections - bool HeatTransSurf; // True if surface is a heat transfer surface, - int OutsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the outside surface - int InsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the inside surface - // False if a (detached) shadowing (sub)surface + bool HeatTransSurf; // True if surface is a heat transfer surface, + int OutsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the outside surface + int InsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the inside surface + // False if a (detached) shadowing (sub)surface iHeatTransferModel HeatTransferAlgorithm; // used for surface-specific heat transfer algorithm. std::string BaseSurfName; // Name of BaseSurf - int BaseSurf; // "Base surface" for this surface. Applies mainly to subsurfaces - // in which case it points back to the base surface number. - // Equals 0 for detached shading. - // BaseSurf equals surface number for all other surfaces. - int NumSubSurfaces; // Number of subsurfaces this surface has (doors/windows) - std::string ZoneName; // User supplied name of the Zone - int Zone; // Interior environment or zone the surface is a part of - // Note that though attached shading surfaces are part of a zone, this - // value is 0 there to facilitate using them as detached surfaces (more - // accurate shading. - std::string ExtBoundCondName; // Name for the Outside Environment Object - int ExtBoundCond; // For an "interzone" surface, this is the adjacent surface number. - // for an internal/adiabatic surface this is the current surface number. - // Otherwise, 0=external environment, -1=ground, - // -2=other side coefficients (OSC--won't always use CTFs) - // -3=other side conditions model - // During input, interim values of UnreconciledZoneSurface ("Surface") and - // UnenteredAdjacentZoneSurface ("Zone") are used until reconciled. - int LowTempErrCount; - int HighTempErrCount; - bool ExtSolar; // True if the "outside" of the surface is exposed to solar - bool ExtWind; // True if the "outside" of the surface is exposed to wind - // Heat transfer coefficients - int IntConvCoeff; // Interior Convection Coefficient pointer (different data structure) - // when being overridden - bool EMSOverrideIntConvCoef; // if true, EMS is calling to override interior convection coefficeint - Real64 EMSValueForIntConvCoef; // Value EMS is calling to use for interior convection coefficient [W/m2-K] - int ExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) - // when being overridden - bool EMSOverrideExtConvCoef; // if true, EMS is calling to override exterior convection coefficeint - Real64 EMSValueForExtConvCoef; // Value EMS is calling to use for exterior convection coefficient [W/m2-K] - Real64 ViewFactorGround; // View factor to the ground from the exterior of the surface - // for diffuse solar radiation - Real64 ViewFactorSky; // View factor to the sky from the exterior of the surface - // for diffuse solar radiation - Real64 ViewFactorGroundIR; // View factor to the ground and shadowing surfaces from the - // exterior of the surface for IR radiation - Real64 ViewFactorSkyIR; // View factor to the sky from the exterior of the surface for IR radiation - // Special/optional other side coefficients (OSC) - int OSCPtr; // Pointer to OSC data structure - int OSCMPtr; // "Pointer" to OSCM data structure (other side conditions from a model) + int BaseSurf; // "Base surface" for this surface. Applies mainly to subsurfaces in which case it points back to the base surface number. + // Equals 0 for detached shading. BaseSurf equals surface number for all other surfaces. + int NumSubSurfaces; // Number of subsurfaces this surface has (doors/windows) + std::string ZoneName; // User supplied name of the Zone + int Zone; // Interior environment or zone the surface is a part of + // Note that though attached shading surfaces are part of a zone, this + // value is 0 there to facilitate using them as detached surfaces (more accurate shading. + std::string ExtBoundCondName; // Name for the Outside Environment Object + int ExtBoundCond; // For an "interzone" surface, this is the adjacent surface number. + // for an internal/adiabatic surface this is the current surface number. + // Otherwise, 0=external environment, -1=ground, + // -2=other side coefficients (OSC--won't always use CTFs) + // -3=other side conditions model + // During input, interim values of UnreconciledZoneSurface ("Surface") and + // UnenteredAdjacentZoneSurface ("Zone") are used until reconciled. + bool ExtSolar; // True if the "outside" of the surface is exposed to solar + bool ExtWind; // True if the "outside" of the surface is exposed to wind Heat transfer coefficients + Real64 ViewFactorGround; // View factor to the ground from the exterior of the surface for diffuse solar radiation + Real64 ViewFactorSky; // View factor to the sky from the exterior of the surface for diffuse solar radiation + Real64 ViewFactorGroundIR; // View factor to the ground and shadowing surfaces from the exterior of the surface for IR radiation + Real64 ViewFactorSkyIR; // View factor to the sky from the exterior of the surface for IR radiation Special/optional other side coefficients (OSC) + int OSCPtr; // Pointer to OSC data structure + int OSCMPtr; // "Pointer" to OSCM data structure (other side conditions from a model) + // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.) int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface bool ShadowSurfSchedVaries; // true if the scheduling (transmittance) on a shading surface varies. bool ShadowingSurf; // True if a surface is a shadowing surface bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0) Real64 SchedMinValue; // Schedule minimum value. + // Optional parameters specific to solar reflection from surfaces Real64 ShadowSurfDiffuseSolRefl; // Diffuse solar reflectance of opaque portion Real64 ShadowSurfDiffuseVisRefl; // Diffuse visible reflectance of opaque portion Real64 ShadowSurfGlazingFrac; // Glazing fraction int ShadowSurfGlazingConstruct; // Glazing construction number - bool ShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction - bool ShadowSurfPossibleReflector; // True if a surface can be an exterior reflector, not used! - int ShadowSurfRecSurfNum; // Receiving surface number + // Optional movable insulation parameters int MaterialMovInsulExt; // Pointer to the material used for exterior movable insulation int MaterialMovInsulInt; // Pointer to the material used for interior movable insulation @@ -648,6 +628,7 @@ namespace DataSurfaces { int SchedMovInsulInt; // Schedule for interior movable insulation bool MovInsulIntPresent; // True when movable insulation is present bool MovInsulIntPresentPrevTS; // True when movable insulation was present during the previous time step + // Vertices Array1D NewVertex; Vertices Vertex; // Surface Vertices are represented by Number of Sides and Vector (type) @@ -667,10 +648,12 @@ namespace DataSurfaces { bool VerticesProcessed; // true if vertices have been processed (only used for base surfaces) Real64 XShift; // relative coordinate shift data - used by child subsurfaces Real64 YShift; // relative coordinate shift data - used by child subsurfaces + // Precomputed parameters for PierceSurface performance ShapeCat shapeCat; // Shape category Plane plane; // Plane Surface2D surface2d; // 2D projected surface for efficient intersection testing + // Window Parameters (when surface is Window) int activeWindowShadingControl; // Active window shading control (windows only) std::vector windowShadingControlList; // List of possible window shading controls @@ -682,6 +665,7 @@ namespace DataSurfaces { // controls (windows only - same indexes as windowShadingControlList) int FrameDivider; // Pointer to frame and divider information (windows only) Real64 Multiplier; // Multiplies glazed area, frame area and divider area (windows only) + // Daylighting pointers int Shelf; // Pointer to daylighting shelf int TAirRef; // Flag for reference air temperature @@ -693,20 +677,9 @@ namespace DataSurfaces { // Default value is 'ZoneMeanAirTemp' and value for each particular surface will be changed only if // the inlet-dependent convection algorithm and/or nodal and zonal air models are used. Real64 OutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C) - bool OutDryBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor air temp - Real64 OutDryBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air drybulb temp (C) Real64 OutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) - bool OutWetBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wetbulb - Real64 OutWetBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air wetbulb temp (C) Real64 WindSpeed; // Surface outside wind speed, for surface heat balance (m/s) - bool WindSpeedEMSOverrideOn; - Real64 WindSpeedEMSOverrideValue; - bool ViewFactorGroundEMSOverrideOn; // if true, EMS is calling to override the surface's view factor to ground - Real64 ViewFactorGroundEMSOverrideValue; // value to use for EMS override of the surface's view factor to ground - Real64 WindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) - bool WindDirEMSOverrideOn; // if true, EMS is calling to override the surface's outside wind direction - Real64 WindDirEMSOverrideValue; // value to use for EMS override of the surface's outside wind speed bool SchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported int ExternalShadingSchInd; // Schedule for a the external shading bool HasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface @@ -727,6 +700,7 @@ namespace DataSurfaces { int ICSPtr; // Index to ICS collector // TH added 3/26/2010 bool MirroredSurf; // True if it is a mirrored surface + // additional attributes for convection correlations int IntConvClassification; // current classification for inside face air flow regime and surface orientation int IntConvHcModelEq; // current convection model for inside face @@ -759,27 +733,23 @@ namespace DataSurfaces { // Default Constructor SurfaceData() - : Construction(0), EMSConstructionOverrideON(false), EMSConstructionOverrideValue(0), ConstructionStoredInputValue(0), + : Construction(0), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None), Sides(0), Area(0.0), GrossArea(0.0), NetAreaShadowCalc(0.0), Perimeter(0.0), Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0), Width(0.0), HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), - ExtBoundCond(0), LowTempErrCount(0), HighTempErrCount(0), ExtSolar(false), ExtWind(false), IntConvCoeff(0), - EMSOverrideIntConvCoef(false), EMSValueForIntConvCoef(0.0), ExtConvCoeff(0), EMSOverrideExtConvCoef(false), EMSValueForExtConvCoef(0.0), + ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), SchedShadowSurfIndex(0), ShadowSurfSchedVaries(false), ShadowingSurf(false), IsTransparent(false), SchedMinValue(0.0), ShadowSurfDiffuseSolRefl(0.0), ShadowSurfDiffuseVisRefl(0.0), ShadowSurfGlazingFrac(0.0), ShadowSurfGlazingConstruct(0), - ShadowSurfPossibleObstruction(true), ShadowSurfPossibleReflector(false), ShadowSurfRecSurfNum(0), MaterialMovInsulExt(0), + MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), MovInsulIntPresent(false), MovInsulIntPresentPrevTS(false), Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), Shelf(0), - TAirRef(ZoneMeanAirTemp), OutDryBulbTemp(0.0), OutDryBulbTempEMSOverrideOn(false), OutDryBulbTempEMSOverrideValue(0.0), - OutWetBulbTemp(0.0), OutWetBulbTempEMSOverrideOn(false), OutWetBulbTempEMSOverrideValue(0.0), WindSpeed(0.0), - WindSpeedEMSOverrideOn(false), WindSpeedEMSOverrideValue(0.0), ViewFactorGroundEMSOverrideOn(false), - ViewFactorGroundEMSOverrideValue(0.0), - - WindDir(0.0), WindDirEMSOverrideOn(false), WindDirEMSOverrideValue(0.0), + TAirRef(ZoneMeanAirTemp), OutDryBulbTemp(0.0), + OutWetBulbTemp(0.0),WindSpeed(0.0), + WindDir(0.0), SchedExternalShadingFrac(false), ExternalShadingSchInd(0), HasSurroundingSurfProperties(false), SurroundingSurfacesNum(0), HasLinkedOutAirNode(false), LinkedOutAirNode(0), PenumbraID(-1), @@ -1375,6 +1345,34 @@ struct SurfacesData : BaseGlobalStruct std::vector AllHTWindowSurfaceList; // List of all window surfaces std::vector AllSurfaceListReportOrder; // List of all surfaces - output reporting order + // Surface EMS + Array1D SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value + Array1D SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden + Array1D SurfEMSOverrideIntConvCoef; // if true, EMS is calling to override the interior convection coefficient value + Array1D SurfEMSValueForIntConvCoef; // Value EMS is calling to use for interior convection coefficient [W/m2-K] + Array1D SurfEMSOverrideExtConvCoef; // if true, EMS is calling to override the exterior convection coefficient value + Array1D SurfEMSValueForExtConvCoef; // Value EMS is calling to use for exterior convection coefficient [W/m2-K] + Array1D SurfOutDryBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor air temp + Array1D SurfOutDryBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air drybulb temp (C) + Array1D SurfOutWetBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wetbulb temp + Array1D SurfOutWetBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air wetbulb temp (C) + Array1D SurfWindSpeedEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wind speed + Array1D SurfWindSpeedEMSOverrideValue; // value to use for EMS override of outdoor wind speed (m/s) + Array1D SurfViewFactorGroundEMSOverrideOn; // if true, EMS is calling to override the surface's view factor to ground + Array1D SurfViewFactorGroundEMSOverrideValue; // value to use for EMS override of surface's view factor to ground + Array1D SurfWindDirEMSOverrideOn; // if true, EMS is calling to override the outside wind direction + Array1D SurfWindDirEMSOverrideValue; // value to use for EMS override of outside wind direction (deg) + + // Surface Properties + Array1D SurfLowTempErrCount; + Array1D SurfHighTempErrCount; + Array1D SurfIntConvCoeff; // Interior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) when being overridden + + // Surface Shadow Properties + Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction + Array1D SurfShadowSurfRecSurfNum; // Receiving surface number + // Surface Window Heat Balance Array1D SurfWinTransSolar; // Exterior beam plus diffuse solar transmitted through window, or window plus shade/blind, into zone (W) Array1D SurfWinBmSolar; // Exterior beam solar transmitted through window, or window plus blind, into zone (W) @@ -1674,6 +1672,30 @@ struct SurfacesData : BaseGlobalStruct this->AllHTNonWindowSurfaceList.clear(); this->AllHTWindowSurfaceList.clear(); this->AllSurfaceListReportOrder.clear(); + this->SurfEMSConstructionOverrideON.deallocate(); + this->SurfEMSConstructionOverrideValue.deallocate(); + this->SurfEMSOverrideIntConvCoef.deallocate(); + this->SurfEMSValueForIntConvCoef.deallocate(); + this->SurfEMSOverrideExtConvCoef.deallocate(); + this->SurfEMSValueForExtConvCoef.deallocate(); + this->SurfOutDryBulbTempEMSOverrideOn.deallocate(); + this->SurfOutDryBulbTempEMSOverrideValue.deallocate(); + this->SurfOutWetBulbTempEMSOverrideOn.deallocate(); + this->SurfOutWetBulbTempEMSOverrideValue.clear(); + this->SurfWindSpeedEMSOverrideOn.deallocate(); + this->SurfWindSpeedEMSOverrideValue.deallocate(); + this->SurfViewFactorGroundEMSOverrideOn.deallocate(); + this->SurfViewFactorGroundEMSOverrideValue.deallocate(); + this->SurfWindDirEMSOverrideOn.deallocate(); + this->SurfWindDirEMSOverrideValue.deallocate(); + + this->SurfLowTempErrCount.deallocate(); + this->SurfHighTempErrCount.deallocate(); + this->SurfIntConvCoeff.deallocate(); + this->SurfExtConvCoeff.deallocate(); + this->SurfShadowSurfPossibleObstruction.deallocate(); + this->SurfShadowSurfRecSurfNum.deallocate(); + this->SurfWinTransSolar.deallocate(); this->SurfWinBmSolar.deallocate(); this->SurfWinBmBmSolar.deallocate(); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index cc0e94c6718..eb36b064b2e 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -3135,7 +3135,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) { + if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { PierceSurface(state, ObsSurfNum, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface if (hitObs) break; } @@ -3144,8 +3144,10 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, } else { // Surface octree search // Lambda function for the octree to test for surface hit - auto surfaceHit = [&GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { - if (surface.ShadowSurfPossibleObstruction) { + auto surfaceHit = [&state, &GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { + // todo - how to find index of object objArr + int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { PierceSurface(surface, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface return hitObs; // Ray pierces surface } else { @@ -3500,7 +3502,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; PierceSurface(state, ObsSurfNum, GroundHitPt, SUNCOS_iHour, ObsHitPt, hitObs); if (hitObs) break; } @@ -3707,7 +3709,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( if (state.dataSurface->CalcSolRefl) { // Receiving surface number corresponding this window - RecSurfNum = state.dataSurface->Surface(IWin2).ShadowSurfRecSurfNum; + RecSurfNum = state.dataSurface->SurfShadowSurfRecSurfNum(IWin2); if (RecSurfNum > 0) { // interior windows do not apply if (state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NumPossibleObs > 0) { // This window has associated obstructions that could reflect beam onto the window @@ -3767,7 +3769,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window) { // Reflecting surface is a window. // Receiving surface number for this reflecting window. - ReflSurfRecNum = state.dataSurface->Surface(ReflSurfNum).ShadowSurfRecSurfNum; + ReflSurfRecNum = state.dataSurface->SurfShadowSurfRecSurfNum(ReflSurfNum); if (ReflSurfRecNum > 0) { // Loop over possible obstructions for this reflecting window for (int loop2 = 1, loop2_end = state.dataSolarReflectionManager->SolReflRecSurf(ReflSurfRecNum).NumPossibleObs; @@ -3782,7 +3784,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; if (ObsSurfNum == ReflSurfNum) continue; PierceSurface(state, ObsSurfNum, HitPtRefl, RAYCOS, HitPtObs, hitObs); if (hitObs) break; @@ -5874,7 +5876,7 @@ void DayltgHitObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); - if (!surface.ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ISurf)) continue; IType = surface.Class; if ((IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf)) { PierceSurface(state, ISurf, R1, RN, DayltgHitObstructionHP, hit); @@ -5904,7 +5906,8 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { - if (!surface.ShadowSurfPossibleObstruction) return false; // Do Consider separate octree without filtered surfaces + int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); @@ -7853,7 +7856,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; PierceSurface(state, ObsSurfNum, DayltgInterReflectedIllumGroundHitPt, SUNCOS_IHR, DayltgInterReflectedIllumObsHitPt, hitObs); if (hitObs) break; } @@ -8621,7 +8624,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; if (CalledFrom == DataDaylighting::iCalledFor::RefPoint) { ComplexFenestrationLuminancesGroundHitPt(1) = state.dataBSDFWindow->ComplexWind(IWin).DaylghtGeom(CurCplxFenState).RefPoint(iRefPoint).GndPt(iGndElem, WinEl).x; @@ -9225,7 +9228,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) { + if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(state, ObsSurfNum, RecPt, RayVec, HitPt, hit); if (hit) { // Ray pierces surface @@ -9254,7 +9257,8 @@ void DayltgClosestObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &state, &RecPt, &RayVec, &hit, &NearestHitDistance_sq, &nearestHitSurface, &NearestHitPt](SurfaceData const &surface) { - if (surface.ShadowSurfPossibleObstruction) { + int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(surface, RecPt, RayVec, state.dataDaylightingManager->HitPt, hit); // Check if ray pierces surface if (hit) { // Ray pierces surface @@ -9340,7 +9344,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, // Sun reaches ReflHitPt if vector from ReflHitPt to sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; // Exclude as a possible obstructor ReflSurfNum and its base surface (if it has one) if (ObsSurfNum == ReflSurfNum || ObsSurfNum == state.dataSurface->Surface(ReflSurfNum).BaseSurf) continue; PierceSurface(state, ObsSurfNum, ReflHitPt, SUNCOS_IHR, DayltgSurfaceLumFromSunObsHitPt, hitObs); diff --git a/src/EnergyPlus/EMSManager.cc b/src/EnergyPlus/EMSManager.cc index 1c439b36def..15af212670c 100644 --- a/src/EnergyPlus/EMSManager.cc +++ b/src/EnergyPlus/EMSManager.cc @@ -2102,15 +2102,15 @@ namespace EMSManager { state.dataSurface->Surface(SurfNum).Name, "Interior Surface Convection Heat Transfer Coefficient", "[W/m2-K]", - state.dataSurface->Surface(SurfNum).EMSOverrideIntConvCoef, - state.dataSurface->Surface(SurfNum).EMSValueForIntConvCoef); + state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum), + state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum)); SetupEMSActuator(state, "Surface", state.dataSurface->Surface(SurfNum).Name, "Exterior Surface Convection Heat Transfer Coefficient", "[W/m2-K]", - state.dataSurface->Surface(SurfNum).EMSOverrideExtConvCoef, - state.dataSurface->Surface(SurfNum).EMSValueForExtConvCoef); + state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum), + state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum)); } } @@ -2138,8 +2138,8 @@ namespace EMSManager { state.dataSurface->Surface(SurfNum).Name, "Construction State", "[ ]", - state.dataSurface->Surface(SurfNum).EMSConstructionOverrideON, - state.dataSurface->Surface(SurfNum).EMSConstructionOverrideValue); + state.dataSurface->SurfEMSConstructionOverrideON(SurfNum), + state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)); } // Setup error checking storage @@ -2184,39 +2184,39 @@ namespace EMSManager { state.dataSurface->Surface(SurfNum).Name, "View Factor To Ground", "[ ]", - state.dataSurface->Surface(SurfNum).ViewFactorGroundEMSOverrideOn, - state.dataSurface->Surface(SurfNum).ViewFactorGroundEMSOverrideValue); + state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum), + state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum)); SetupEMSActuator(state, "Surface", state.dataSurface->Surface(SurfNum).Name, "Outdoor Air Drybulb Temperature", "[C]", - state.dataSurface->Surface(SurfNum).OutDryBulbTempEMSOverrideOn, - state.dataSurface->Surface(SurfNum).OutDryBulbTempEMSOverrideValue); + state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum), + state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum)); SetupEMSActuator(state, "Surface", state.dataSurface->Surface(SurfNum).Name, "Outdoor Air Wetbulb Temperature", "[C]", - state.dataSurface->Surface(SurfNum).OutWetBulbTempEMSOverrideOn, - state.dataSurface->Surface(SurfNum).OutWetBulbTempEMSOverrideValue); + state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum), + state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum)); if (state.dataSurface->Surface(SurfNum).ExtWind) { SetupEMSActuator(state, "Surface", state.dataSurface->Surface(SurfNum).Name, "Outdoor Air Wind Speed", "[m/s]", - state.dataSurface->Surface(SurfNum).WindSpeedEMSOverrideOn, - state.dataSurface->Surface(SurfNum).WindSpeedEMSOverrideValue); + state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum), + state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum)); SetupEMSActuator(state, "Surface", state.dataSurface->Surface(SurfNum).Name, "Outdoor Air Wind Direction", "[degree]", - state.dataSurface->Surface(SurfNum).WindDirEMSOverrideOn, - state.dataSurface->Surface(SurfNum).WindDirEMSOverrideValue); + state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum), + state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum)); } } } diff --git a/src/EnergyPlus/HeatBalFiniteDiffManager.cc b/src/EnergyPlus/HeatBalFiniteDiffManager.cc index b8287202714..367a2f69336 100644 --- a/src/EnergyPlus/HeatBalFiniteDiffManager.cc +++ b/src/EnergyPlus/HeatBalFiniteDiffManager.cc @@ -2325,6 +2325,7 @@ namespace HeatBalFiniteDiffManager { state.dataHeatBalSurf->SurfOpaqInsFaceConduction(Surf) = QNetSurfInside * surface.Area; // for reporting as in CTF, PT } + // todo - function not used void CheckFDSurfaceTempLimits(EnergyPlusData &state, int const SurfNum, // surface number Real64 const CheckTemperature // calculated temperature, not reset @@ -2354,7 +2355,7 @@ namespace HeatBalFiniteDiffManager { if (state.dataGlobal->WarmupFlag) ++state.dataHeatBalFiniteDiffMgr->WarmupSurfTemp; if (!state.dataGlobal->WarmupFlag || state.dataHeatBalFiniteDiffMgr->WarmupSurfTemp > 10 || state.dataGlobal->DisplayExtraWarnings) { if (CheckTemperature < MinSurfaceTempLimit) { - if (state.dataSurface->Surface(SurfNum).LowTempErrCount == 0) { + if (state.dataSurface->SurfLowTempErrCount(SurfNum) == 0) { ShowSevereMessage(state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", CheckTemperature, @@ -2389,7 +2390,7 @@ namespace HeatBalFiniteDiffManager { ShowRecurringSevereErrorAtEnd(state, "Temperature (low) out of bounds for zone=" + state.dataHeatBal->Zone(ZoneNum).Name + " for surface=" + state.dataSurface->Surface(SurfNum).Name, - state.dataSurface->Surface(SurfNum).LowTempErrCount, + state.dataSurface->SurfLowTempErrCount(SurfNum), CheckTemperature, CheckTemperature, _, @@ -2399,7 +2400,7 @@ namespace HeatBalFiniteDiffManager { ShowRecurringSevereErrorAtEnd(state, "Temperature (low) out of bounds for zone=" + state.dataHeatBal->Zone(ZoneNum).Name + " for surface=" + state.dataSurface->Surface(SurfNum).Name, - state.dataSurface->Surface(SurfNum).LowTempErrCount, + state.dataSurface->SurfLowTempErrCount(SurfNum), CheckTemperature, CheckTemperature, _, @@ -2407,7 +2408,7 @@ namespace HeatBalFiniteDiffManager { "C"); } } else { - if (state.dataSurface->Surface(SurfNum).HighTempErrCount == 0) { + if (state.dataSurface->SurfHighTempErrCount(SurfNum) == 0) { ShowSevereMessage(state, format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", CheckTemperature, @@ -2442,7 +2443,7 @@ namespace HeatBalFiniteDiffManager { ShowRecurringSevereErrorAtEnd(state, "Temperature (high) out of bounds for zone=" + state.dataHeatBal->Zone(ZoneNum).Name + " for surface=" + state.dataSurface->Surface(SurfNum).Name, - state.dataSurface->Surface(SurfNum).HighTempErrCount, + state.dataSurface->SurfHighTempErrCount(SurfNum), CheckTemperature, CheckTemperature, _, @@ -2452,7 +2453,7 @@ namespace HeatBalFiniteDiffManager { ShowRecurringSevereErrorAtEnd(state, "Temperature (high) out of bounds for zone=" + state.dataHeatBal->Zone(ZoneNum).Name + " for surface=" + state.dataSurface->Surface(SurfNum).Name, - state.dataSurface->Surface(SurfNum).HighTempErrCount, + state.dataSurface->SurfHighTempErrCount(SurfNum), CheckTemperature, CheckTemperature, _, diff --git a/src/EnergyPlus/HeatBalanceHAMTManager.cc b/src/EnergyPlus/HeatBalanceHAMTManager.cc index ff72818362e..814831d4a62 100644 --- a/src/EnergyPlus/HeatBalanceHAMTManager.cc +++ b/src/EnergyPlus/HeatBalanceHAMTManager.cc @@ -1371,7 +1371,7 @@ namespace HeatBalanceHAMTManager { tempmin = minval(cells, &subcell::tempp1); if (tempmax > state.dataHeatBalSurf->MaxSurfaceTempLimit) { if (!state.dataGlobal->WarmupFlag) { - if (state.dataSurface->Surface(sid).HighTempErrCount == 0) { + if (state.dataSurface->SurfHighTempErrCount(sid) == 0) { ShowSevereMessage( state, format("HAMT: Temperature (high) out of bounds ({:.2R}) for surface={}", tempmax, state.dataSurface->Surface(sid).Name)); @@ -1380,7 +1380,7 @@ namespace HeatBalanceHAMTManager { ShowRecurringWarningErrorAtEnd(state, "HAMT: Temperature Temperature (high) out of bounds; Surface=" + state.dataSurface->Surface(sid).Name, - state.dataSurface->Surface(sid).HighTempErrCount, + state.dataSurface->SurfHighTempErrCount(sid), tempmax, tempmax, _, @@ -1400,7 +1400,7 @@ namespace HeatBalanceHAMTManager { } if (tempmin < MinSurfaceTempLimit) { if (!state.dataGlobal->WarmupFlag) { - if (state.dataSurface->Surface(sid).HighTempErrCount == 0) { + if (state.dataSurface->SurfHighTempErrCount(sid) == 0) { ShowSevereMessage( state, format("HAMT: Temperature (low) out of bounds ({:.2R}) for surface={}", tempmin, state.dataSurface->Surface(sid).Name)); @@ -1409,7 +1409,7 @@ namespace HeatBalanceHAMTManager { ShowRecurringWarningErrorAtEnd(state, "HAMT: Temperature Temperature (high) out of bounds; Surface=" + state.dataSurface->Surface(sid).Name, - state.dataSurface->Surface(sid).HighTempErrCount, + state.dataSurface->SurfHighTempErrCount(sid), tempmin, tempmin, _, diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 86cfc5deee7..924aa2dd164 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -217,6 +217,42 @@ namespace HeatBalanceManager { } bool anyRan; + if (state.dataGlobal->BeginSimFlag) { + state.dataSurface->SurfEMSConstructionOverrideON.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSConstructionOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSOverrideIntConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSValueForIntConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSOverrideExtConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSValueForExtConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutDryBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutDryBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWetBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWetBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindSpeedEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindSpeedEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfViewFactorGroundEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfViewFactorGroundEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindDirEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindDirEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfEMSConstructionOverrideON(SurfNum) = false; + state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum) = false; + state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum) = 0.0; + state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum) = false; + state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum) = 0.0; + state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum) = 0.0; + } + } ManageEMS(state, EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, anyRan, diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 9d97b2f5b15..2df59f56b26 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -368,20 +368,20 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) // Overwriting surface and zone level environmental data with EMS override value if (state.dataGlobal->AnyEnergyManagementSystemInModel) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (Surface(SurfNum).OutDryBulbTempEMSOverrideOn) { - Surface(SurfNum).OutDryBulbTemp = Surface(SurfNum).OutDryBulbTempEMSOverrideValue; + if (state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum)) { + Surface(SurfNum).OutDryBulbTemp = state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum); } - if (Surface(SurfNum).OutWetBulbTempEMSOverrideOn) { - Surface(SurfNum).OutWetBulbTemp = Surface(SurfNum).OutWetBulbTempEMSOverrideValue; + if (state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum)) { + Surface(SurfNum).OutWetBulbTemp = state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum); } - if (Surface(SurfNum).WindSpeedEMSOverrideOn) { - Surface(SurfNum).WindSpeed = Surface(SurfNum).WindSpeedEMSOverrideValue; + if (state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum)) { + Surface(SurfNum).WindSpeed = state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum); } - if (Surface(SurfNum).WindDirEMSOverrideOn) { - Surface(SurfNum).WindDir = Surface(SurfNum).WindDirEMSOverrideValue; + if (state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum)) { + Surface(SurfNum).WindDir = state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum); } - if (Surface(SurfNum).ViewFactorGroundEMSOverrideOn) { - Surface(SurfNum).ViewFactorGround = Surface(SurfNum).ViewFactorGroundEMSOverrideValue; + if (state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum)) { + Surface(SurfNum).ViewFactorGround = state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum); } } } @@ -1303,6 +1303,17 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); + state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvCoeff.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtConvCoeff.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfLowTempErrCount(SurfNum) = 0; + state.dataSurface->SurfHighTempErrCount(SurfNum) = 0; + state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; + } + // Use the total number of surfaces to allocate variables to avoid a surface number limit state.dataHeatBalSurf->CTFConstInPart.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->CTFConstOutPart.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -4524,39 +4535,42 @@ void InitEMSControlledConstructions(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); - if (std::any_of(Surface.begin(), Surface.end(), [](DataSurfaces::SurfaceData const &e) { return e.EMSConstructionOverrideON; })) - SurfConstructOverridesPresent = true; - + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + if (state.dataSurface->SurfEMSConstructionOverrideON(SurfNum)) { + SurfConstructOverridesPresent = true; + break; + } + } if (!SurfConstructOverridesPresent) return; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (Surface(SurfNum).EMSConstructionOverrideON && (Surface(SurfNum).EMSConstructionOverrideValue > 0)) { + if (state.dataSurface->SurfEMSConstructionOverrideON(SurfNum) && (state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum) > 0)) { - if (state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).TypeIsWindow) { // okay, allways allow windows - state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; + if (state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TypeIsWindow) { // okay, allways allow windows + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; } - if ((state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum)) && - (state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum))) { + if ((state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) && + (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum))) { - Surface(SurfNum).Construction = Surface(SurfNum).EMSConstructionOverrideValue; + Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); state.dataConstruction->Construct(Surface(SurfNum).Construction).IsUsed = true; state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->Surface(SurfNum).Construction; } else { // have not checked yet or is not okay, so see if we need to warn about incompatible - if (!state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum)) { + if (!state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { // check if constructions appear compatible if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CTF || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { // compare old construction to new construction and see if terms match // set as okay and turn false if find a big problem - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; if (state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories != - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumHistories) { + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumHistories) { // thow warning, but allow ShowWarningError(state, "InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, incompatible " @@ -4567,14 +4581,14 @@ void InitEMSControlledConstructions(EnergyPlusData &state) state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories)); ShowContinueError(state, format("While construction named = {} has CTF timesteps = {}", - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumHistories)); + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumHistories)); ShowContinueError(state, "Transient heat transfer modeling may not be valid for surface name = " + Surface(SurfNum).Name + ", and the simulation continues"); } if (state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms != - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumCTFTerms) { + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumCTFTerms) { // thow warning, but allow ShowWarningError(state, "InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, incompatible " @@ -4585,8 +4599,8 @@ void InitEMSControlledConstructions(EnergyPlusData &state) state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms)); ShowContinueError(state, format("While construction named = {} has number of CTF terms = {}", - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).NumCTFTerms)); + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumCTFTerms)); ShowContinueError( state, "The actuator is allowed but the transient heat transfer modeling may not be valid for surface name = " + @@ -4594,7 +4608,7 @@ void InitEMSControlledConstructions(EnergyPlusData &state) } if (state.dataConstruction->Construct(Surface(SurfNum).Construction).SourceSinkPresent) { - if (!state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).SourceSinkPresent) { + if (!state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).SourceSinkPresent) { // thow warning, and do not allow ShowSevereError(state, "InitEMSControlledConstructions: EMS Construction State Actuator not valid."); ShowContinueError(state, @@ -4602,25 +4616,25 @@ void InitEMSControlledConstructions(EnergyPlusData &state) " has internal source/sink"); ShowContinueError(state, "While construction named = " + - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name + + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + " is not an internal source/sink construction"); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; } } - if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum)) { - Surface(SurfNum).Construction = Surface(SurfNum).EMSConstructionOverrideValue; + if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { + Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); } } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; if (state.dataHeatBalFiniteDiffMgr->ConstructFD(Surface(SurfNum).Construction).TotNodes != - state.dataHeatBalFiniteDiffMgr->ConstructFD(Surface(SurfNum).EMSConstructionOverrideValue).TotNodes) { + state.dataHeatBalFiniteDiffMgr->ConstructFD(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TotNodes) { // thow warning, and do not allow ShowSevereError(state, "InitEMSControlledConstructions: EMS Construction State Actuator not valid."); ShowContinueError(state, @@ -4630,17 +4644,17 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError( state, format("While construction named = {}has number of finite difference nodes ={}", - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name, - state.dataHeatBalFiniteDiffMgr->ConstructFD(Surface(SurfNum).EMSConstructionOverrideValue).TotNodes)); + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, + state.dataHeatBalFiniteDiffMgr->ConstructFD(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TotNodes)); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; } if (state.dataConstruction->Construct(Surface(SurfNum).Construction).SourceSinkPresent) { - if (!state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).SourceSinkPresent) { + if (!state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).SourceSinkPresent) { // thow warning, and do not allow ShowSevereError(state, "InitEMSControlledConstructions: EMS Construction State Actuator not valid."); ShowContinueError(state, @@ -4648,18 +4662,18 @@ void InitEMSControlledConstructions(EnergyPlusData &state) " has internal source/sink"); ShowContinueError(state, "While construction named = " + - state.dataConstruction->Construct(Surface(SurfNum).EMSConstructionOverrideValue).Name + + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + " is not an internal source/sink construction"); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; } } - if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum)) { - Surface(SurfNum).Construction = Surface(SurfNum).EMSConstructionOverrideValue; + if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { + Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); } } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { // don't allow @@ -4669,8 +4683,8 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::Kiva) { // don't allow ShowSevereError(state, @@ -4679,8 +4693,8 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorChecked(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorIsOkay(Surface(SurfNum).EMSConstructionOverrideValue, SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; } } else { @@ -6162,7 +6176,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside surface gets wet - if (Surface(SurfNum).ExtConvCoeff <= 0) { // Reset HcExtSurf because of wetness + if (state.dataSurface->SurfExtConvCoeff(SurfNum) <= 0) { // Reset HcExtSurf because of wetness state.dataHeatBalSurf->HcExtSurf(SurfNum) = 1000.0; } else { // User set state.dataHeatBalSurf->HcExtSurf(SurfNum) = SetExtConvectionCoeff(state, SurfNum); @@ -7141,7 +7155,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, EmisOut = WindowEquivalentLayer::EQLWindowOutsideEffectiveEmiss(state, ConstrNum); } // Set Exterior Convection Coefficient... - if (surface.ExtConvCoeff > 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); @@ -7180,7 +7194,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, } } else { // Interior Surface - if (surface.ExtConvCoeff > 0) { + if (state.dataSurface->SurfExtConvCoeff(SurfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of @@ -7201,7 +7215,6 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, for (int SurfNum : HTSurfs) { int const ZoneNum = Surface(SurfNum).Zone; - auto &surface(Surface(SurfNum)); auto &zone(state.dataHeatBal->Zone(ZoneNum)); Real64 &TH11(state.dataHeatBalSurf->TH(1, 1, SurfNum)); Real64 &TH12(state.dataHeatBalSurf->TH(2, 1, SurfNum)); @@ -7228,7 +7241,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, } if ((TH12 > state.dataHeatBalSurf->MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { - TestSurfTempCalcHeatBalanceInsideSurf(state, TH12, surface, zone, state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount); + TestSurfTempCalcHeatBalanceInsideSurf(state, TH12, SurfNum, zone, state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount); } } // ...end of main loops over all surfaces for inside heat balances @@ -7903,7 +7916,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, EmisOut = WindowEquivalentLayer::EQLWindowOutsideEffectiveEmiss(state, ConstrNum); } // Set Exterior Convection Coefficient... - if (surface.ExtConvCoeff > 0) { + if (state.dataSurface->SurfExtConvCoeff(surfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); @@ -7942,7 +7955,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, } } else { // Interior Surface - if (surface.ExtConvCoeff > 0) { + if (state.dataSurface->SurfExtConvCoeff(surfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of @@ -7990,7 +8003,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, } if ((TH12 > state.dataHeatBalSurf->MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { - TestSurfTempCalcHeatBalanceInsideSurf(state, TH12, surface, zone, state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount); + TestSurfTempCalcHeatBalanceInsideSurf(state, TH12, surfNum, zone, state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount); } } } // ...end of main loops over all surfaces for inside heat balances @@ -8121,16 +8134,17 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, CalculateZoneMRT(state, ZoneToResimulate); // Update here so that the proper value of MRT is available to radiant systems } -void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, SurfaceData &surface, ZoneData &zone, int WarmupSurfTemp) +void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, int const SurfNum, ZoneData &zone, int WarmupSurfTemp) { + std::string surfName = state.dataSurface->Surface(SurfNum).Name; if ((TH12 > state.dataHeatBalSurf->MaxSurfaceTempLimit) || (TH12 < MinSurfaceTempLimit)) { if (state.dataGlobal->WarmupFlag) ++WarmupSurfTemp; if (!state.dataGlobal->WarmupFlag || WarmupSurfTemp > 10 || state.dataGlobal->DisplayExtraWarnings) { if (TH12 < MinSurfaceTempLimit) { - if (surface.LowTempErrCount == 0) { + if (state.dataSurface->SurfLowTempErrCount(SurfNum) == 0) { ShowSevereMessage( - state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); + state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8153,8 +8167,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S zone.TempOutOfBoundsReported = true; } ShowRecurringSevereErrorAtEnd(state, - "Temperature (low) out of bounds for zone=" + zone.Name + " for surface=" + surface.Name, - surface.LowTempErrCount, + "Temperature (low) out of bounds for zone=" + zone.Name + " for surface=" + surfName, + state.dataSurface->SurfLowTempErrCount(SurfNum), TH12, TH12, _, @@ -8162,8 +8176,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S "C"); } else { ShowRecurringSevereErrorAtEnd(state, - "Temperature (low) out of bounds for zone=" + zone.Name + " for surface=" + surface.Name, - surface.LowTempErrCount, + "Temperature (low) out of bounds for zone=" + zone.Name + " for surface=" + surfName, + state.dataSurface->SurfLowTempErrCount(SurfNum), TH12, TH12, _, @@ -8171,10 +8185,10 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S "C"); } } else { - if (surface.HighTempErrCount == 0) { + if (state.dataSurface->SurfHighTempErrCount(SurfNum) == 0) { ShowSevereMessage( state, - format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); + format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8197,8 +8211,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S zone.TempOutOfBoundsReported = true; } ShowRecurringSevereErrorAtEnd(state, - "Temperature (high) out of bounds for zone=" + zone.Name + " for surface=" + surface.Name, - surface.HighTempErrCount, + "Temperature (high) out of bounds for zone=" + zone.Name + " for surface=" + surfName, + state.dataSurface->SurfHighTempErrCount(SurfNum), TH12, TH12, _, @@ -8206,8 +8220,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S "C"); } else { ShowRecurringSevereErrorAtEnd(state, - "Temperature (high) out of bounds for zone=" + zone.Name + " for surface=" + surface.Name, - surface.HighTempErrCount, + "Temperature (high) out of bounds for zone=" + zone.Name + " for surface=" + surfName, + state.dataSurface->SurfHighTempErrCount(SurfNum), TH12, TH12, _, @@ -8230,7 +8244,7 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S if (!state.dataGlobal->WarmupFlag) { if (TH12 < MinSurfaceTempLimitBeforeFatal) { ShowSevereError( - state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); + state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8255,7 +8269,7 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S ShowFatalError(state, "Program terminates due to preceding condition."); } else { ShowSevereError( - state, format("Temperature (high) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); + state, format("Temperature (high) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8284,7 +8298,7 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, S ShowSevereError( state, format( - "CalcHeatBalanceInsideSurf: The temperature of {:.2R} C for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surface.Name)); + "CalcHeatBalanceInsideSurf: The temperature of {:.2R} C for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueError(state, "..is very far out of bounds during warmup. This may be an indication of a malformed zone."); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.hh b/src/EnergyPlus/HeatBalanceSurfaceManager.hh index 1b32fde223d..ce8d25a37b1 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.hh +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.hh @@ -170,7 +170,7 @@ namespace HeatBalanceSurfaceManager { Optional_int_const ZoneToResimulate = _); void TestSurfTempCalcHeatBalanceInsideSurf( - EnergyPlusData &state, Real64 TH12, DataSurfaces::SurfaceData &surface, DataHeatBalance::ZoneData &zone, int WarmupSurfTemp); + EnergyPlusData &state, Real64 TH12, int const SurfNum, DataHeatBalance::ZoneData &zone, int WarmupSurfTemp); void CalcOutsideSurfTemp(EnergyPlusData &state, int SurfNum, // Surface number DO loop counter diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index 0b26a94acf7..7653d7a4f8c 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -1552,10 +1552,10 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices << format("{:.2R}", state.dataSurface->Surface(surf).Width) << "," << format("{:.2R}", state.dataSurface->Surface(surf).Height) << "," << format("{:.2R}", state.dataSurface->Surface(surf).Reveal) << ","; - if (state.dataSurface->Surface(surf).IntConvCoeff > 0) { + if (state.dataSurface->SurfIntConvCoeff(surf) > 0) { { auto const SELECT_CASE_var( - state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->Surface(surf).IntConvCoeff).OverrideType); + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(surf)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { IntConvCoeffCalc = "User Supplied Value"; } else if (SELECT_CASE_var == ConvCoefSchedule) { @@ -1566,13 +1566,13 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices ExtConvCoeffCalc = "User Specified Model"; } } - } else if (state.dataSurface->Surface(surf).IntConvCoeff < 0) { // not in use yet. - IntConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->Surface(surf).IntConvCoeff)); + } else if (state.dataSurface->SurfIntConvCoeff(surf) < 0) { // not in use yet. + IntConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfIntConvCoeff(surf))); } - if (state.dataSurface->Surface(surf).ExtConvCoeff > 0) { + if (state.dataSurface->SurfExtConvCoeff(surf) > 0) { { auto const SELECT_CASE_var( - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->Surface(surf).ExtConvCoeff).OverrideType); + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(surf)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { ExtConvCoeffCalc = "User Supplied Value"; } else if (SELECT_CASE_var == ConvCoefSchedule) { @@ -1583,8 +1583,8 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices ExtConvCoeffCalc = "User Specified Model"; } } - } else if (state.dataSurface->Surface(surf).ExtConvCoeff < 0) { - ExtConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->Surface(surf).ExtConvCoeff)); + } else if (state.dataSurface->SurfExtConvCoeff(surf) < 0) { + ExtConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfExtConvCoeff(surf))); } if (state.dataSurface->Surface(surf).ExtBoundCond == ExternalEnvironment) { *eiostream << "ExternalEnvironment" diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index add6fbe5b8b..7787ba7d22c 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -236,12 +236,12 @@ namespace SolarReflectionManager { // Shading surfaces are always not exposed to solar (ExtSolar = False) RecSurfNum = 0; for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->Surface(SurfNum).ShadowSurfRecSurfNum = 0; + state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; if (state.dataSurface->Surface(SurfNum).ExtSolar) { ++RecSurfNum; state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).SurfNum = SurfNum; state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).SurfName = state.dataSurface->Surface(SurfNum).Name; - state.dataSurface->Surface(SurfNum).ShadowSurfRecSurfNum = RecSurfNum; + state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = RecSurfNum; // Warning if any receiving surface vertex is below ground level, taken to be at Z = 0 in absolute coords for (loop = 1; loop <= state.dataSurface->Surface(SurfNum).Sides; ++loop) { @@ -991,8 +991,7 @@ namespace SolarReflectionManager { if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window) { // Reflecting surface is a window // Receiving surface number for this window int const ReflSurfRecNum = - state.dataSurface->Surface(ReflSurfNum) - .ShadowSurfRecSurfNum; // Receiving surface number corresponding to a reflecting surface number + state.dataSurface->SurfShadowSurfRecSurfNum(ReflSurfNum); // Receiving surface number corresponding to a reflecting surface number if (ReflSurfRecNum > 0) { // Loop over possible obstructions for this window for (int loop2 = 1, @@ -1012,7 +1011,7 @@ namespace SolarReflectionManager { } } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->Surface(ObsSurfNum).ShadowSurfPossibleObstruction) continue; + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; if (ObsSurfNum == ReflSurfNum) continue; // TH2 CR8959 -- Skip mirrored surfaces @@ -1231,7 +1230,7 @@ namespace SolarReflectionManager { for (state.dataSolarReflectionManager->iObsSurfNum = 1; state.dataSolarReflectionManager->iObsSurfNum <= state.dataSurface->TotSurfaces; ++state.dataSolarReflectionManager->iObsSurfNum) { - if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).ShadowSurfPossibleObstruction) + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 50d7e132830..9421424a905 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1452,7 +1452,14 @@ namespace SurfaceGeometry { // After reordering, MovedSurfs should equal TotSurfaces MovedSurfs = 0; + // todo - move allocation to property functions state.dataSurface->Surface.allocate(state.dataSurface->TotSurfaces); // Allocate the Surface derived type appropriately + state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowSurfRecSurfNum.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; + state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; + } Array1D SurfaceTmpClassMoved; // Tmp class is moved SurfaceTmpClassMoved.dimension(state.dataSurface->TotSurfaces, false); @@ -2425,7 +2432,7 @@ namespace SurfaceGeometry { // Set flag that determines whether a surface can be an exterior obstruction // Also set associated surfaces for Kiva foundations and build heat transfer surface lists for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->Surface(SurfNum).ShadowSurfPossibleObstruction = false; + state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; if (state.dataSurface->Surface(SurfNum).HeatTransSurf) { state.dataSurface->AllHTSurfaceList.push_back(SurfNum); int const zoneNum(state.dataSurface->Surface(SurfNum).Zone); @@ -2478,7 +2485,7 @@ namespace SurfaceGeometry { // Exclude air boundary surfaces if (state.dataSurface->Surface(SurfNum).IsAirBoundarySurf) continue; - state.dataSurface->Surface(SurfNum).ShadowSurfPossibleObstruction = true; + state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = true; } // Check for IRT surfaces in invalid places. diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 50c28be9e5a..e64317f572a 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2459,7 +2459,7 @@ namespace WindowManager { // Reset hcin if necessary since too small a value sometimes causes non-convergence // of window layer heat balance solution. - if (surface.IntConvCoeff == 0) { + if (state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) { if (state.dataWindowManager->hcin <= state.dataHeatBal->LowHConvLimit) { // may be redundent now, check is also in HeatBalanceConvectionCoeffs.cc // hcin = 3.076d0 !BG this is rather high value and abrupt change. changed to set to lower limit @@ -3319,8 +3319,8 @@ namespace WindowManager { } // call for new interior film coeff (since it is temperature dependent) if using Detailed inside coef model - if (((state.dataSurface->Surface(SurfNum).IntConvCoeff == 0) && (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == ASHRAETARP)) || - (state.dataSurface->Surface(SurfNum).IntConvCoeff == -2)) { + if (((state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) && (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == ASHRAETARP)) || + (state.dataSurface->SurfIntConvCoeff(SurfNum) == -2)) { // coef model is "detailed" and not prescribed by user // need to find inside face index, varies with shade/blind etc. if (ANY_INTERIOR_SHADE_BLIND(ShadeFlag)) { diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 840c406b0b9..1b5043c469b 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -728,7 +728,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) // Test 2/3: CalcDetailedHcInForDVModel calculation for Hn state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(SurfNum).IntConvCoeff = 0.0; + state->dataSurface->state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; @@ -739,7 +739,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(SurfNum).IntConvCoeff = 0.0; + state->dataSurface->state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 61af675ce44..9fc9c4c4070 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -2152,8 +2152,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_EMSConstructionSwitchTest) SimulationManager::ManageSimulation(*state); int surfNum = UtilityRoutines::FindItemInList("FENESTRATIONSURFACE", state->dataSurface->Surface); - EXPECT_EQ(state->dataSurface->Surface(surfNum).Construction, state->dataSurface->Surface(surfNum).EMSConstructionOverrideValue); - EXPECT_TRUE(state->dataSurface->Surface(surfNum).EMSConstructionOverrideON); + EXPECT_EQ(state->dataSurface->Surface(surfNum).Construction, state->dataSurface->SurfEMSConstructionOverrideValue(surfNum)); + EXPECT_TRUE(state->dataSurface->SurfEMSConstructionOverrideON(surfNum)); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index c108fed9cf4..b845c6e90d6 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -167,10 +167,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI { Real64 surfTemp; - DataSurfaces::SurfaceData testSurface; + state->dataSurface->Surface.allocate(1); + state->dataSurface->SurfLowTempErrCount.allocate(1); + state->dataSurface->SurfHighTempErrCount.allocate(1); DataHeatBalance::ZoneData testZone; int cntWarmupSurfTemp = 0; - testSurface.Name = "TestSurface"; + Surface(1).Name = "TestSurface"; testZone.Name = "TestZone"; testZone.InternalHeatGains = 2.5; testZone.NominalInfilVent = 0.5; @@ -179,23 +181,23 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI // no error surfTemp = 26; state->dataGlobal->WarmupFlag = true; - testSurface.LowTempErrCount = 0; - testSurface.HighTempErrCount = 0; + state->dataSurface->SurfLowTempErrCount(1) = 0; + state->dataSurface->SurfHighTempErrCount(1) = 0; testZone.TempOutOfBoundsReported = true; testZone.FloorArea = 1000; testZone.IsControlled = true; - TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, testSurface, testZone, cntWarmupSurfTemp); + TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, 1, testZone, cntWarmupSurfTemp); EXPECT_TRUE(compare_err_stream("", true)); // to hot - first time surfTemp = 201; state->dataGlobal->WarmupFlag = false; - testSurface.LowTempErrCount = 0; - testSurface.HighTempErrCount = 0; + state->dataSurface->SurfLowTempErrCount(1) = 0; + state->dataSurface->SurfHighTempErrCount(1) = 0; testZone.TempOutOfBoundsReported = false; testZone.FloorArea = 1000; testZone.IsControlled = true; - TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, testSurface, testZone, cntWarmupSurfTemp); + TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, 1, testZone, cntWarmupSurfTemp); std::string const error_string01 = delimited_string({" ** Severe ** Temperature (high) out of bounds (201.00] for zone=\"TestZone\", for surface=\"TestSurface\"", " ** ~~~ ** Environment=, at Simulation time= 00:00 - 00:00", @@ -210,12 +212,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI // to hot - subsequent times surfTemp = 201; state->dataGlobal->WarmupFlag = false; - testSurface.LowTempErrCount = 0; - testSurface.HighTempErrCount = 0; + state->dataSurface->SurfLowTempErrCount(1) = 0; + state->dataSurface->SurfHighTempErrCount(1) = 0; testZone.TempOutOfBoundsReported = true; testZone.FloorArea = 1000; testZone.IsControlled = true; - TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, testSurface, testZone, cntWarmupSurfTemp); + TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, 1, testZone, cntWarmupSurfTemp); std::string const error_string02 = delimited_string({ " ** Severe ** Temperature (high) out of bounds (201.00] for zone=\"TestZone\", for surface=\"TestSurface\"", " ** ~~~ ** Environment=, at Simulation time= 00:00 - 00:00", @@ -226,12 +228,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI // to cold - first time surfTemp = -101; state->dataGlobal->WarmupFlag = false; - testSurface.LowTempErrCount = 0; - testSurface.HighTempErrCount = 0; + state->dataSurface->SurfLowTempErrCount(1) = 0; + state->dataSurface->SurfHighTempErrCount(1) = 0; testZone.TempOutOfBoundsReported = false; testZone.FloorArea = 1000; testZone.IsControlled = true; - TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, testSurface, testZone, cntWarmupSurfTemp); + TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, 1, testZone, cntWarmupSurfTemp); std::string const error_string03 = delimited_string({" ** Severe ** Temperature (low) out of bounds [-101.00] for zone=\"TestZone\", for surface=\"TestSurface\"", " ** ~~~ ** Environment=, at Simulation time= 00:00 - 00:00", @@ -246,12 +248,12 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI // to cold - subsequent times surfTemp = -101; state->dataGlobal->WarmupFlag = false; - testSurface.LowTempErrCount = 0; - testSurface.HighTempErrCount = 0; + state->dataSurface->SurfLowTempErrCount(1) = 0; + state->dataSurface->SurfHighTempErrCount(1) = 0; testZone.TempOutOfBoundsReported = true; testZone.FloorArea = 1000; testZone.IsControlled = true; - TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, testSurface, testZone, cntWarmupSurfTemp); + TestSurfTempCalcHeatBalanceInsideSurf(*state, surfTemp, 1, testZone, cntWarmupSurfTemp); std::string const error_string04 = delimited_string({" ** Severe ** Temperature (low) out of bounds [-101.00] for zone=\"TestZone\", for surface=\"TestSurface\"", " ** ~~~ ** Environment=, at Simulation time= 00:00 - 00:00"}); @@ -1346,7 +1348,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) // Test if local value used in surface hc calculation // Surface(1) - local; Surface(2) - global; for (int SurfNum = 1; SurfNum <= 6; SurfNum++) { - state->dataSurface->Surface(SurfNum).ExtConvCoeff = -1; + state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -1; } CalcHeatBalanceOutsideSurf(*state); Real64 HExt_Expect_Surf1 = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(5, 1.5); @@ -1900,7 +1902,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) for (SurfNum = 1; SurfNum <= 6; SurfNum++) { state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp state->dataSurface->Surface(SurfNum).OutDryBulbTemp = 22; // Air temp - state->dataSurface->Surface(SurfNum).ExtConvCoeff = -6; + state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -6; state->dataSurface->AirSkyRadSplit(SurfNum) = 1.0; } CalcHeatBalanceOutsideSurf(*state); @@ -2464,7 +2466,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA SolarShading::DetermineShadowingCombinations(*state); InitSurfaceHeatBalance(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { - state->dataSurface->Surface(SurfNum).ExtConvCoeff = -1; + state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -1; } // Test Additional Heat Source Calculation CalcHeatBalanceOutsideSurf(*state); diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index e9009db2f72..e6430dc1116 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -104,7 +104,7 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataSurface->Surface(SurfNum).BaseSurf = SurfNum; state->dataSurface->Surface(SurfNum).Zone = ZoneNum; state->dataSurface->Surface(SurfNum).IsICS = true; - state->dataSurface->Surface(SurfNum).ExtConvCoeff = 0; + state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = 0; state->dataSurface->Surface(SurfNum).ExtWind = false; // allocate construction variable data state->dataConstruction->Construct.allocate(ConstrNum); From cced5d30c53b07228a3e64f002009d41eb420042 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 20 Apr 2021 22:17:23 -0700 Subject: [PATCH 02/25] unit test bug --- src/EnergyPlus/DaylightingManager.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 1 - .../unit/ConvectionCoefficients.unit.cc | 5 ++-- .../unit/DisplacementVentMgr.unit.cc | 3 ++ .../unit/HeatBalanceSurfaceManager.unit.cc | 30 ++++++++++++++++--- tst/EnergyPlus/unit/ICSCollector.unit.cc | 5 +++- tst/EnergyPlus/unit/OutputReports.unit.cc | 5 ++++ tst/EnergyPlus/unit/WindowManager.unit.cc | 8 +++++ 8 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index eb36b064b2e..2f3fe1188b8 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -5907,7 +5907,7 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); - if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces + if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 2df59f56b26..d4d183ffbc2 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -7977,7 +7977,6 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, int const firstSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrWinSurfaceFirst; int const lastSurf = state.dataHeatBal->Zone(zoneNum).OpaqOrWinSurfaceLast; for (int surfNum = firstSurf; surfNum <= lastSurf; ++surfNum) { - auto &surface(Surface(surfNum)); auto &zone(state.dataHeatBal->Zone(zoneNum)); Real64 &TH11(state.dataHeatBalSurf->TH(1, 1, surfNum)); Real64 &TH12(state.dataHeatBalSurf->TH(2, 1, surfNum)); diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 1b5043c469b..3ac6efed3de 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -717,6 +717,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) SurfTemp.allocate(1); HcIn.allocate(1); Vhc.allocate(1); + state->dataSurface->SurfIntConvCoeff.allocate(SurfNum); // Test 1: CalcWaltonUnstableHorizontalOrTilt calculation for Hn DeltaTemp = 1.0; @@ -728,7 +729,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) // Test 2/3: CalcDetailedHcInForDVModel calculation for Hn state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; @@ -739,7 +740,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 220e2ef7382..f3b2f2482c0 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -159,6 +159,9 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->Surface(3).Vertex(4).y = -1.48693002; state->dataSurface->Surface(3).Vertex(4).z = 8.5343999852; + state->dataSurface->SurfIntConvCoeff.allocate(TotSurfaces); + state->dataSurface->SurfIntConvCoeff = 0.0; + state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index b845c6e90d6..b99d87f79a4 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -172,7 +172,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataSurface->SurfHighTempErrCount.allocate(1); DataHeatBalance::ZoneData testZone; int cntWarmupSurfTemp = 0; - Surface(1).Name = "TestSurface"; + state->dataSurface->Surface(1).Name = "TestSurface"; testZone.Name = "TestZone"; testZone.InternalHeatGains = 2.5; testZone.NominalInfilVent = 0.5; @@ -737,6 +737,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideIntConvCoef = false; + state->dataSurface->SurfEMSOverrideExtConvCoef = false; + state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1273,6 +1278,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideIntConvCoef = false; + state->dataSurface->SurfEMSOverrideExtConvCoef = false; + state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1348,7 +1358,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) // Test if local value used in surface hc calculation // Surface(1) - local; Surface(2) - global; for (int SurfNum = 1; SurfNum <= 6; SurfNum++) { - state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -1; + state->dataSurface->SurfExtConvCoeff(SurfNum) = -1; } CalcHeatBalanceOutsideSurf(*state); Real64 HExt_Expect_Surf1 = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(5, 1.5); @@ -1848,6 +1858,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideIntConvCoef = false; + state->dataSurface->SurfEMSOverrideExtConvCoef = false; + state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1902,7 +1917,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) for (SurfNum = 1; SurfNum <= 6; SurfNum++) { state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp state->dataSurface->Surface(SurfNum).OutDryBulbTemp = 22; // Air temp - state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -6; + state->dataSurface->SurfExtConvCoeff(SurfNum) = -6; state->dataSurface->AirSkyRadSplit(SurfNum) = 1.0; } CalcHeatBalanceOutsideSurf(*state); @@ -2414,6 +2429,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideIntConvCoef = false; + state->dataSurface->SurfEMSOverrideExtConvCoef = false; + state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -2466,7 +2486,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA SolarShading::DetermineShadowingCombinations(*state); InitSurfaceHeatBalance(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { - state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = -1; + state->dataSurface->SurfExtConvCoeff(SurfNum) = -1; } // Test Additional Heat Source Calculation CalcHeatBalanceOutsideSurf(*state); @@ -3096,6 +3116,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) createFacilityElectricPowerServiceObject(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfEMSOverrideIntConvCoef = false; InitSurfaceHeatBalance(*state); diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index e6430dc1116..8219b74ba1e 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -104,7 +104,8 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataSurface->Surface(SurfNum).BaseSurf = SurfNum; state->dataSurface->Surface(SurfNum).Zone = ZoneNum; state->dataSurface->Surface(SurfNum).IsICS = true; - state->dataSurface->state.dataSurface->SurfExtConvCoeff(SurfNum) = 0; + state->dataSurface->SurfExtConvCoeff.allocate(NumOfSurf); + state->dataSurface->SurfExtConvCoeff(SurfNum) = 0; state->dataSurface->Surface(SurfNum).ExtWind = false; // allocate construction variable data state->dataConstruction->Construct.allocate(ConstrNum); @@ -127,6 +128,8 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataHeatBal->SurfQRadSWOutIncident(1) = 0.0; // set user defined conv. coeff. calculation to false state->dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false; + state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(NumOfSurf); + state->dataSurface->SurfEMSOverrideExtConvCoef(1) = false; // SurfPtr( 1 ); // Array of indexes pointing to Surface structure in DataSurfaces Real64 const VentArea(0.1); // Area available for venting the gap [m2] diff --git a/tst/EnergyPlus/unit/OutputReports.unit.cc b/tst/EnergyPlus/unit/OutputReports.unit.cc index 2d7545ee29a..4a6fcf253e5 100644 --- a/tst/EnergyPlus/unit/OutputReports.unit.cc +++ b/tst/EnergyPlus/unit/OutputReports.unit.cc @@ -147,6 +147,11 @@ TEST_F(EnergyPlusFixture, OutputReports_SurfaceDetailsReport) SurfaceGeometry::GetSurfaceData(*state, foundErrors); // setup zone geometry and get zone data EXPECT_FALSE(foundErrors); // expect no errors + state->dataSurface->SurfExtConvCoeff.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIntConvCoeff.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfExtConvCoeff = 0.0; + state->dataSurface->SurfIntConvCoeff = 0.0; + // reset eio stream has_eio_output(true); diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index f5ba0f146dd..46d2e33591b 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -575,6 +575,8 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); + state->dataSurface->SurfIntConvCoeff.allocate(3); state->dataHeatBalSurf->QdotConvOutRep.allocate(3); state->dataHeatBalSurf->QdotConvOutRepPerArea.allocate(3); @@ -596,6 +598,8 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; + state->dataSurface->SurfIntConvCoeff = 0.0; + state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; Real64 outSurfTemp; @@ -2803,6 +2807,8 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); + state->dataSurface->SurfIntConvCoeff.allocate(3); state->dataHeatBalSurf->QdotConvOutRep.allocate(3); state->dataHeatBalSurf->QdotConvOutRepPerArea.allocate(3); @@ -2824,6 +2830,8 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; + state->dataSurface->SurfIntConvCoeff = 0.0; + state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; Real64 outSurfTemp; From 3ff0b214474871a5f6b2abe159ed175a8d3c7fa5 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 22 Apr 2021 11:24:41 -0700 Subject: [PATCH 03/25] more variables --- .../AirflowNetworkBalanceManager.cc | 4 +- src/EnergyPlus/ConvectionCoefficients.cc | 76 +++++++++---------- src/EnergyPlus/CrossVentMgr.cc | 12 +-- src/EnergyPlus/DataSurfaces.cc | 2 +- src/EnergyPlus/DataSurfaces.hh | 46 +++++++---- src/EnergyPlus/DaylightingDevices.cc | 4 +- src/EnergyPlus/DaylightingManager.cc | 16 ++-- src/EnergyPlus/DisplacementVentMgr.cc | 12 +-- src/EnergyPlus/HeatBalanceManager.cc | 7 ++ src/EnergyPlus/HeatBalanceSurfaceManager.cc | 36 ++++----- src/EnergyPlus/MundtSimMgr.cc | 6 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 6 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 +- src/EnergyPlus/SolarReflectionManager.cc | 6 +- src/EnergyPlus/SolarShading.cc | 45 ++++++----- src/EnergyPlus/SurfaceGeometry.cc | 54 ++++++++----- src/EnergyPlus/SurfaceGeometry.hh | 2 +- src/EnergyPlus/UFADManager.cc | 12 +-- src/EnergyPlus/WindowComplexManager.cc | 8 +- src/EnergyPlus/WindowEquivalentLayer.cc | 8 +- src/EnergyPlus/WindowManager.cc | 12 +-- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 8 +- .../unit/ConvectionCoefficients.unit.cc | 21 ++--- .../unit/DaylightingManager.unit.cc | 7 ++ .../unit/DisplacementVentMgr.unit.cc | 2 + .../unit/HeatBalanceSurfaceManager.unit.cc | 31 +++++--- tst/EnergyPlus/unit/ICSCollector.unit.cc | 6 +- .../unit/RoomAirflowNetwork.unit.cc | 4 + tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 2 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 17 +++-- .../unit/ZoneTempPredictorCorrector.unit.cc | 8 +- 31 files changed, 275 insertions(+), 207 deletions(-) diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index ba254f33c37..f6e196040eb 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -9147,7 +9147,7 @@ namespace AirflowNetworkBalanceManager { ZN2 = state.dataAirflowNetwork->AirflowNetworkNodeData(M).EPlusZoneNum; // Find a linkage from a zone to outdoors if (ZN1 > 0 && ZN2 == 0) { - if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { + if (state.dataSurface->SurfHasLinkedOutAirNode(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum)) { Tamb = state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; CpAir = PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb( state, @@ -9232,7 +9232,7 @@ namespace AirflowNetworkBalanceManager { } } if (ZN1 == 0 && ZN2 > 0) { - if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { + if (state.dataSurface->SurfHasLinkedOutAirNode(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum)) { Tamb = state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; CpAir = PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb( state, diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index c364e775ff8..aacdc20731f 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -394,8 +394,8 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, TSky = state.dataEnvrn->SkyTempKelvin; TGround = TAir; - if (Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum != 0) { TSky = GetCurrentScheduleValue(state, state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum) + DataGlobalConstants::KelvinConv; @@ -2664,7 +2664,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, // UCSD { - auto const SELECT_CASE_var(Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == AdjacentAirTemp) { TAirConv = state.dataHeatBal->TempEffBulkAir(SurfNum); } else { @@ -2988,7 +2988,7 @@ void CalcCeilingDiffuserInletCorr(EnergyPlusData &state, state.dataHeatBal->HConvIn(SurfNum) = 0.19 * std::pow(ACH, 0.8); // Wall correlation } // set flag for reference air temperature - Surface(SurfNum).TAirRef = ZoneSupplyAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) @@ -4437,7 +4437,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcASHRAEVerticalWall((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_WaltonUnstableHorizontalOrTilt) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double { @@ -4446,7 +4446,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcWaltonUnstableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_WaltonStableHorizontalOrTilt) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double { @@ -4455,7 +4455,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcWaltonStableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserFloor) { Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum); Real64 AirHumRat = state.dataHeatBalFanSys->ZoneAirHumRatAvg(ZoneNum); @@ -4474,7 +4474,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, Surface(SurfNum).Height, state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserCeiling) { Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum); Real64 AirHumRat = state.dataHeatBalFanSys->ZoneAirHumRatAvg(ZoneNum); @@ -4493,7 +4493,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, Surface(SurfNum).Height, state.dataConstruction->Construct(Surface(SurfNum).Construction).TypeIsWindow); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserWalls) { Real64 AirChangeRate = CalcCeilingDiffuserACH(state, ZoneNum); Real64 AirHumRat = state.dataHeatBalFanSys->ZoneAirHumRatAvg(ZoneNum); @@ -4515,7 +4515,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondStableHorizontal) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { @@ -4524,7 +4524,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, SurfNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { @@ -4533,7 +4533,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcAlamdariHammondVerticalWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, SurfNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondUnstableHorizontal) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { @@ -4542,42 +4542,42 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, SurfNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq3WallAwayFromHeat) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq3WallAwayFromHeat(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq3WallAwayFromHeat((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq4CeilingAwayFromHeat) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq4CeilingAwayFromHeat(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq4CeilingAwayFromHeat((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq5WallNearHeat) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq5WallsNearHeat(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq5WallsNearHeat((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq6NonHeatedWalls) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq6NonHeatedWalls(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq6NonHeatedWalls((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq7Ceiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq7Ceiling(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq7Ceiling((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AwbiHattonHeatedFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { @@ -4586,7 +4586,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcAwbiHattonHeatedFloor((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AwbiHattonHeatedWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { @@ -4595,7 +4595,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcAwbiHattonHeatedWall((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedAssistingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4608,7 +4608,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedOppossingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4621,7 +4621,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4635,7 +4635,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, tmpHc = CalcBeausoleilMorrisonMixedStableCeiling(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4649,7 +4649,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, tmpHc = CalcBeausoleilMorrisonMixedUnstableCeiling( state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4663,7 +4663,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, tmpHc = CalcBeausoleilMorrisonMixedStableFloor(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { @@ -4677,7 +4677,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, tmpHc = CalcBeausoleilMorrisonMixedUnstableFloor(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FohannoPolidoriVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { Real64 QdotConvection = -state.dataHeatBalSurf->QdotConvInRepPerArea(SurfNum); @@ -4696,18 +4696,18 @@ void EvaluateIntHcModels(EnergyPlusData &state, -state.dataHeatBalSurf->QdotConvInRepPerArea(SurfNum), SurfNum); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KaradagChilledCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKaradagChilledCeiling(Tsurf - Tamb); }; } else { tmpHc = CalcKaradagChilledCeiling((Tsurface - Tzone)); } - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_ISO15099Windows) { CalcISO15099WindowIntConvCoeff(state, SurfNum, Tsurface, Tzone); tmpHc = state.dataHeatBal->HConvIn(SurfNum); - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWindow) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow( Surface(SurfNum).IntConvZonePerimLength, Surface(SurfNum).IntConvWindowWallRatio, Surface(SurfNum).IntConvWindowLocation, ZoneNum); @@ -4716,9 +4716,9 @@ void EvaluateIntHcModels(EnergyPlusData &state, } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { - Surface(SurfNum).TAirRef = ZoneSupplyAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } else { - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWalls) { tmpHc = @@ -4728,9 +4728,9 @@ void EvaluateIntHcModels(EnergyPlusData &state, } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { - Surface(SurfNum).TAirRef = ZoneSupplyAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } else { - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserFloor) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(Surface(SurfNum).IntConvZonePerimLength, ZoneNum); @@ -4739,9 +4739,9 @@ void EvaluateIntHcModels(EnergyPlusData &state, } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { - Surface(SurfNum).TAirRef = ZoneSupplyAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } else { - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } } } @@ -6339,13 +6339,13 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int if (SELECT_CASE_var == RefTempMeanAirTemp) { tmpAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); - Surface(SurfNum).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == RefTempAdjacentAirTemp) { tmpAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); - Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; } else if (SELECT_CASE_var == RefTempSupplyAirTemp) { tmpAirTemp = SupplyAirTemp; - Surface(SurfNum).TAirRef = ZoneSupplyAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = ZoneSupplyAirTemp; } } diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 80aaeb42e90..5834916ea68 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -189,7 +189,7 @@ namespace CrossVentMgr { // WALL Hc, HA and HAT calculation for (Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( @@ -203,7 +203,7 @@ namespace CrossVentMgr { for (Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Window(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); @@ -266,7 +266,7 @@ namespace CrossVentMgr { for (Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); ++Ctd) { // DOOR SurfNum = state.dataUCSDShared->APos_Door(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( @@ -280,7 +280,7 @@ namespace CrossVentMgr { for (Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( @@ -295,7 +295,7 @@ namespace CrossVentMgr { for (Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( @@ -323,7 +323,7 @@ namespace CrossVentMgr { for (Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index dc68520d3a9..f01cf8504e1 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -298,7 +298,7 @@ Real64 SurfaceData::getInsideAirTemperature(EnergyPlusData &state, const int t_S // determine reference air temperature for this surface { - const auto SELECT_CASE_var(TAirRef); + const auto SELECT_CASE_var(state.dataSurface->SurfTAirRef(t_SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(Zone); } else if (SELECT_CASE_var == AdjacentAirTemp) { diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index f02540f1111..ace81d56278 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -667,8 +667,8 @@ namespace DataSurfaces { Real64 Multiplier; // Multiplies glazed area, frame area and divider area (windows only) // Daylighting pointers - int Shelf; // Pointer to daylighting shelf - int TAirRef; // Flag for reference air temperature +// int Shelf; // Pointer to daylighting shelf +// int TAirRef; // Flag for reference air temperature // ZoneMeanAirTemp = 1 = mean air temperature or MAT => for mixing air model with all convection algos // except inlet-dependent algo // AdjacentAirTemp = 2 = adjacent air temperature or TempEffBulkAir => for nodal or zonal air model @@ -680,14 +680,14 @@ namespace DataSurfaces { Real64 OutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) Real64 WindSpeed; // Surface outside wind speed, for surface heat balance (m/s) Real64 WindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) - bool SchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported - int ExternalShadingSchInd; // Schedule for a the external shading - bool HasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface - int SurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces) - bool HasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface - int LinkedOutAirNode; // Index of the an OutdoorAir:Node - - int PenumbraID; // Surface ID in penumbra +// bool SchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported +// int ExternalShadingSchInd; // Schedule for a the external shading +// bool HasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface +// int SurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces) +// bool HasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface +// int LinkedOutAirNode; // Index of the an OutdoorAir:Node +// +// int PenumbraID; // Surface ID in penumbra std::string UNomWOFilm; // Nominal U Value without films stored as string std::string UNomFilm; // Nominal U Value with films stored as string @@ -746,14 +746,10 @@ namespace DataSurfaces { Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), - activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), Shelf(0), - TAirRef(ZoneMeanAirTemp), OutDryBulbTemp(0.0), + activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), + OutDryBulbTemp(0.0), OutWetBulbTemp(0.0),WindSpeed(0.0), WindDir(0.0), - - SchedExternalShadingFrac(false), ExternalShadingSchInd(0), HasSurroundingSurfProperties(false), SurroundingSurfacesNum(0), - HasLinkedOutAirNode(false), LinkedOutAirNode(0), PenumbraID(-1), - UNomWOFilm("- "), UNomFilm("- "), ExtEcoRoof(false), ExtCavityPresent(false), ExtCavNum(0), IsPV(false), IsICS(false), IsPool(false), ICSPtr(0), MirroredSurf(false), IntConvClassification(0), IntConvHcModelEq(0), IntConvHcUserCurveIndex(0), OutConvClassification(0), OutConvHfModelEq(0), OutConvHfUserCurveIndex(0), OutConvHnModelEq(0), OutConvHnUserCurveIndex(0), @@ -1368,6 +1364,15 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfHighTempErrCount; Array1D SurfIntConvCoeff; // Interior Convection Coefficient pointer (different data structure) when being overridden Array1D SurfExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfDaylightingShelfInd; // Pointer to daylighting shelf + Array1D SurfTAirRef; // Flag for reference air temperature + Array1D SurfSchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported + Array1D SurfExternalShadingSchInd; // Schedule for a the external shading + Array1D SurfHasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface + Array1D SurfSurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces) + Array1D SurfHasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface + Array1D SurfLinkedOutAirNode; // Index of the an OutdoorAir:Node + Array1D SurfPenumbraID; // Surface Shadow Properties Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction @@ -1695,6 +1700,15 @@ struct SurfacesData : BaseGlobalStruct this->SurfExtConvCoeff.deallocate(); this->SurfShadowSurfPossibleObstruction.deallocate(); this->SurfShadowSurfRecSurfNum.deallocate(); + this->SurfDaylightingShelfInd.deallocate(); + this->SurfTAirRef.deallocate(); + this->SurfSchedExternalShadingFrac.deallocate(); + this->SurfExternalShadingSchInd.deallocate(); + this->SurfHasSurroundingSurfProperties.deallocate(); + this->SurfSurroundingSurfacesNum.deallocate(); + this->SurfHasLinkedOutAirNode.deallocate(); + this->SurfLinkedOutAirNode.deallocate(); + this->SurfPenumbraID.deallocate(); this->SurfWinTransSolar.deallocate(); this->SurfWinBmSolar.deallocate(); diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index b5bca2def80..09d144069f4 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -842,7 +842,7 @@ namespace DaylightingDevices { state.dataDaylightingDevices->GetShelfInputErrorsFound = true; } - if (state.dataSurface->Surface(SurfNum).Shelf > 0) { + if (state.dataSurface->SurfDaylightingShelfInd(SurfNum) > 0) { ShowSevereError(state, cCurrentModuleObject + " = " + state.dataIPShortCut->cAlphaArgs(1) + ": Window " + state.dataIPShortCut->cAlphaArgs(2) + " is referenced by more than one shelf."); @@ -877,7 +877,7 @@ namespace DaylightingDevices { } state.dataDaylightingDevicesData->Shelf(ShelfNum).Window = SurfNum; - state.dataSurface->Surface(SurfNum).Shelf = ShelfNum; + state.dataSurface->SurfDaylightingShelfInd(SurfNum) = ShelfNum; } // Get inside shelf heat transfer surface (optional) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 2f3fe1188b8..124f76f7852 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -319,8 +319,8 @@ void DayltgAveInteriorReflectance(EnergyPlusData &state, int &ZoneNum) // Zone n state.dataSurface->SurfWinFractionUpgoing(IWin) = state.dataSurface->Surface(IWin).Tilt / 180.0; // Daylighting shelf simplification: All light goes up to the ceiling regardless of orientation of shelf - if (state.dataSurface->Surface(IWin).Shelf > 0) { - if (state.dataDaylightingDevicesData->Shelf(state.dataSurface->Surface(IWin).Shelf).InSurf > 0) + if (state.dataSurface->SurfDaylightingShelfInd(IWin) > 0) { + if (state.dataDaylightingDevicesData->Shelf(state.dataSurface->SurfDaylightingShelfInd(IWin)).InSurf > 0) state.dataSurface->SurfWinFractionUpgoing(IWin) = 1.0; } } @@ -1756,10 +1756,10 @@ void FigureDayltgCoeffsAtPointsSetupForWindow( BlNum = state.dataSurface->SurfWinBlindNumber(IWin); // ScNum = SurfaceWindow( IWin ).ScreenNumber; //Unused Set but never used - ShelfNum = state.dataSurface->Surface(IWin).Shelf; + ShelfNum = state.dataSurface->SurfDaylightingShelfInd(IWin); if (ShelfNum > 0) { InShelfSurf = - state.dataDaylightingDevicesData->Shelf(state.dataSurface->Surface(IWin).Shelf).InSurf; // Inside daylighting shelf present if > 0 + state.dataDaylightingDevicesData->Shelf(state.dataSurface->SurfDaylightingShelfInd(IWin)).InSurf; // Inside daylighting shelf present if > 0 } else { InShelfSurf = 0; } @@ -3392,7 +3392,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } } else { // Shadowing surface is nearest hit - if (state.dataSurface->Surface(NearestHitSurfNum).Shelf > 0) { + if (state.dataSurface->SurfDaylightingShelfInd(NearestHitSurfNum) > 0) { // This is a daylighting shelf, for which reflection is separately calculated ObsVisRefl = 0.0; } else { @@ -7732,7 +7732,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, PipeNum = state.dataSurface->SurfWinTDDPipeNum(IWin); } - ShelfNum = state.dataSurface->Surface(IWin).Shelf; + ShelfNum = state.dataSurface->SurfDaylightingShelfInd(IWin); if (ShelfNum > 0) { InShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 OutShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 @@ -7892,7 +7892,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, } } else { // Shadowing surface is nearest hit - if (state.dataSurface->Surface(NearestHitSurfNum).Shelf > 0) { + if (state.dataSurface->SurfDaylightingShelfInd(NearestHitSurfNum) > 0) { // Skip daylighting shelves, whose reflection is separately calculated ObsVisRefl = 0.0; } else { @@ -9328,7 +9328,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, LumAtReflHitPtFrSun = 0.0; // Skip daylighting shelves since reflection from these is separately calculated - if (state.dataSurface->Surface(ReflSurfNum).Shelf > 0) return; + if (state.dataSurface->SurfDaylightingShelfInd(ReflSurfNum) > 0) return; // Normal to reflecting surface in hemisphere containing window element DayltgSurfaceLumFromSunReflNorm = state.dataSurface->Surface(ReflSurfNum).OutNormVec; if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf) { diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index de25e8a3c6a..6e4a1af41b3 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -209,7 +209,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // WALL Hc, HA and HAT calculation for (Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -261,7 +261,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // WINDOW Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Window(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -331,7 +331,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); ++Ctd) { // DOOR SurfNum = state.dataUCSDShared->APos_Door(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Door Wall Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -404,7 +404,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; ZSupSurf = state.dataDispVentMgr->HeightIntMass; ZInfSurf = 0.0; @@ -444,7 +444,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); @@ -457,7 +457,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // FLOOR Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 924aa2dd164..b4ab6cebe7f 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5775,6 +5775,13 @@ namespace HeatBalanceManager { // Use the total number of zones or surfaces to allocate variables to avoid a limit // Allocate real Variables // Following used for Calculations + // Allocate solar shading variables + state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfPenumbraID(SurfNum) = 0; + state.dataSurface->SurfDaylightingShelfInd(SurfNum) = 0; + } // Allocate variables in DataHeatBalSys state.dataHeatBalFanSys->SumConvHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBalFanSys->SumLatentHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index d4d183ffbc2..23a97065f62 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -318,15 +318,15 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) // END DO if (state.dataGlobal->AnyLocalEnvironmentsInModel) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (Surface(SurfNum).HasLinkedOutAirNode) { - Surface(SurfNum).OutDryBulbTemp = state.dataLoopNodes->Node(Surface(SurfNum).LinkedOutAirNode).OutAirDryBulb; - Surface(SurfNum).OutWetBulbTemp = state.dataLoopNodes->Node(Surface(SurfNum).LinkedOutAirNode).OutAirWetBulb; - Surface(SurfNum).WindSpeed = state.dataLoopNodes->Node(Surface(SurfNum).LinkedOutAirNode).OutAirWindSpeed; - Surface(SurfNum).WindDir = state.dataLoopNodes->Node(Surface(SurfNum).LinkedOutAirNode).OutAirWindDir; + if (state.dataSurface->SurfHasLinkedOutAirNode(SurfNum)) { + Surface(SurfNum).OutDryBulbTemp = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirDryBulb; + Surface(SurfNum).OutWetBulbTemp = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWetBulb; + Surface(SurfNum).WindSpeed = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindSpeed; + Surface(SurfNum).WindDir = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindDir; } - if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime && Surface(SurfNum).HasSurroundingSurfProperties) { - Real64 SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime && state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + Real64 SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); Real64 SrdSurfsViewFactor = 0; if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor >= 0) { SrdSurfsViewFactor += state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; @@ -1307,11 +1307,13 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIntConvCoeff.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfExtConvCoeff.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfTAirRef.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfLowTempErrCount(SurfNum) = 0; state.dataSurface->SurfHighTempErrCount(SurfNum) = 0; state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; + state.dataSurface->SurfTAirRef(SurfNum) = 0; } // Use the total number of surfaces to allocate variables to avoid a surface number limit @@ -2017,7 +2019,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Inside Face Convection Reference Air Index", OutputProcessor::Unit::None, - Surface(loop).TAirRef, + state.dataSurface->SurfTAirRef(loop), "Zone", "Average", Surface(loop).Name); @@ -2887,7 +2889,7 @@ void InitSolarHeatGains(EnergyPlusData &state) int SurfSolIncPtr = SurfaceScheduledSolarInc(state, SurfNum, ConstrNum); if (SurfSolIncPtr == 0) { if (state.dataConstruction->Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - int ShelfNum = Surface(SurfNum).Shelf; // Daylighting shelf object number + int ShelfNum = state.dataSurface->SurfDaylightingShelfInd(SurfNum); // Daylighting shelf object number int InShelfSurf = 0; // Inside daylighting shelf surface number if (ShelfNum > 0) { InShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 @@ -6303,8 +6305,8 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, } } // Calculate LWR from surrounding surfaces if defined for an exterior surface - if (Surface(SurfNum).HasSurroundingSurfProperties) { - int SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + int SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); // Absolute temperature of the outside surface of an exterior surface Real64 TSurf = state.dataHeatBalSurf->TH(1, 1, SurfNum) + DataGlobalConstants::KelvinConv; for (int SrdSurfNum = 1; SrdSurfNum <= state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; @@ -6601,7 +6603,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, if (Surface(SurfNum).Class == SurfaceClass::TDD_Dome) continue; // Skip TDD:DOME objects. Inside temp is handled by TDD:DIFFUSER. { - auto const SELECT_CASE_var(Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); // for reporting surf adjacent air temp @@ -7536,7 +7538,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, state.dataHeatBalSurf->IsNotPoolSurf(surfNum) = 1; } } - auto const SELECT_CASE_var(Surface(surfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(surfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); state.dataHeatBal->TempEffBulkAir(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); // for reporting surf adjacent air temp @@ -8374,8 +8376,8 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, Real64 TSky = state.dataEnvrn->SkyTemp; Real64 TGround = state.dataEnvrn->OutDryBulbTemp; - if (Surface(SurfNum).HasSurroundingSurfProperties) { - int SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + int SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum != 0) { TSky = GetCurrentScheduleValue(state, state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyTempSchNum); } @@ -8566,8 +8568,8 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, QRadLWOutSrdSurfsRep = 0; // Report LWR from surrounding surfaces for current exterior surf temp // Current exterior surf temp would be used for the next step LWR calculation. - if (Surface(SurfNum).HasSurroundingSurfProperties) { - int SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + int SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); for (int SrdSurfNum = 1; SrdSurfNum <= state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { Real64 SrdSurfViewFac = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; Real64 SrdSurfTempAbs = diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 193843607b4..79910676f3e 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -781,7 +781,7 @@ namespace MundtSimMgr { state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataMundtSimMgr->MundtAirSurf(SurfNum, state.dataMundtSimMgr->MundtZoneNum).TMeanAir; // set flag for reference air temperature - state.dataSurface->Surface(SurfFirst + SurfNum - 1).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = AdjacentAirTemp; } // b) Average zone air temperature -> ZT(ZoneNum) // For Mundt model, average room air is the weighted value of floor and ceiling air temps @@ -803,7 +803,7 @@ namespace MundtSimMgr { state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataHeatBalFanSys->TempZoneThermostatSetPoint(ZoneNum) + DeltaTemp; // set flag for reference air temperature - state.dataSurface->Surface(SurfFirst + SurfNum - 1).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = AdjacentAirTemp; } // b) Average zone air temperature -> ZT(ZoneNum) // For Mundt model, average room air is the weighted value of floor and ceiling air temps @@ -826,7 +826,7 @@ namespace MundtSimMgr { for (SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataHeatBalFanSys->MAT(ZoneNum); // set flag for reference air temperature - state.dataSurface->Surface(SurfFirst + SurfNum - 1).TAirRef = ZoneMeanAirTemp; + state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = ZoneMeanAirTemp; } // set flag to indicate that Mundt model is NOT used for this zone at the present time state.dataRoomAirMod->AirModel(ZoneNum).SimAirModel = false; diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 9969e4a3b20..0eee15b5bb8 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -1083,14 +1083,14 @@ namespace RoomAirModelAirflowNetwork { HA = HA + state.dataHeatBal->HConvIn(SurfNum) * Area; SumHATsurf += state.dataHeatBal->HConvIn(SurfNum) * Area * state.dataHeatBalSurf->TempSurfInTmp(SurfNum); - if (state.dataSurface->Surface(SurfNum).TAirRef == ZoneMeanAirTemp) { + if (state.dataSurface->SurfTAirRef(SurfNum) == ZoneMeanAirTemp) { // The zone air is the reference temperature(which is to be solved for in CorrectZoneAirTemp). RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); SumHA += HA; - } else if (state.dataSurface->Surface(SurfNum).TAirRef == AdjacentAirTemp) { + } else if (state.dataSurface->SurfTAirRef(SurfNum) == AdjacentAirTemp) { RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); SumHATref += HA * RefAirTemp; - } else if (state.dataSurface->Surface(SurfNum).TAirRef == ZoneSupplyAirTemp) { + } else if (state.dataSurface->SurfTAirRef(SurfNum) == ZoneSupplyAirTemp) { // check whether this zone is a controlled zone or not if (!ControlledZoneAirFlag) { ShowFatalError(state, diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index e182a072c0b..9ff75bd8637 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -955,7 +955,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // set flag for reference air temperature mode for (int i = SurfFirst; i <= SurfLast; ++i) { - state.dataSurface->Surface(i).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(i) = AdjacentAirTemp; } } diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 7787ba7d22c..5e7301e7585 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -654,7 +654,7 @@ namespace SolarReflectionManager { if (state.dataSolarReflectionManager->HitPtSurfNum > 0) { // Skip rays that hit a daylighting shelf, from which solar reflection is calculated separately. - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum).Shelf > 0) continue; + if (state.dataSurface->SurfDaylightingShelfInd(state.dataSolarReflectionManager->HitPtSurfNum) > 0) continue; // Skip rays that hit a window // If hit point's surface is a window or glass door go to next ray since it is assumed for now @@ -1167,7 +1167,7 @@ namespace SolarReflectionManager { if (state.dataSolarReflectionManager->HitPntSurfNum > 0) { // Ray hits an obstruction // Skip hit points on daylighting shelves, from which solar reflection is separately calculated - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).Shelf > 0) continue; + if (state.dataSurface->SurfDaylightingShelfInd(state.dataSolarReflectionManager->HitPntSurfNum) > 0) continue; // Reflected radiance at hit point divided by unobstructed sky diffuse horizontal irradiance state.dataSolarReflectionManager->HitPtSurfNumX = state.dataSolarReflectionManager->HitPntSurfNum; // Each shading surface has a "mirror" duplicate surface facing in the opposite direction. @@ -1179,7 +1179,7 @@ namespace SolarReflectionManager { state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).OutNormVec) > 0.0) { if (state.dataSolarReflectionManager->HitPntSurfNum + 1 < state.dataSurface->TotSurfaces) state.dataSolarReflectionManager->HitPtSurfNumX = state.dataSolarReflectionManager->HitPntSurfNum + 1; - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNumX).Shelf > 0) continue; + if (state.dataSurface->SurfDaylightingShelfInd(state.dataSolarReflectionManager->HitPtSurfNumX) > 0) continue; } } diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index b5a82165c1e..edc5a859dc8 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -574,8 +574,8 @@ void GetShadowingInput(EnergyPlusData &state) for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { ExtShadingSchedNum = ScheduleManager::GetScheduleIndex(state, state.dataSurface->Surface(SurfNum).Name + "_shading"); if (ExtShadingSchedNum) { - state.dataSurface->Surface(SurfNum).SchedExternalShadingFrac = true; - state.dataSurface->Surface(SurfNum).ExternalShadingSchInd = ExtShadingSchedNum; + state.dataSurface->SurfSchedExternalShadingFrac(SurfNum) = true; + state.dataSurface->SurfExternalShadingSchInd(SurfNum) = ExtShadingSchedNum; } else { ShowWarningError(state, cCurrentModuleObject + ": sunlit fraction schedule not found for " + state.dataSurface->Surface(SurfNum).Name + @@ -745,7 +745,7 @@ void AllocateModuleArrays(EnergyPlusData &state) int SurfLoop; int I; int NumOfLayers; - + // TODO - check allocation here state.dataSolarShading->CTHETA.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSolarShading->SAREA.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -930,6 +930,11 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataSurface->SurfWinBmSolAbsdInsRevealReport(SurfNum) = 0.0; } + state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfPenumbraID(SurfNum) = 0; + } + DisplayString(state, "Initializing Zone and Enclosure Report Variables"); for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { auto &thisEnclosureName = state.dataViewFactor->ZoneSolarInfo(enclosureNum).Name; @@ -4906,9 +4911,9 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const if ((state.dataSysVars->shadingMethod == ShadingMethod::Scheduled || state.dataSysVars->shadingMethod == ShadingMethod::Imported) && !state.dataGlobal->DoingSizing && state.dataGlobal->KindOfSim == DataGlobalConstants::KindOfSim::RunPeriodWeather) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (state.dataSurface->Surface(SurfNum).SchedExternalShadingFrac) { + if (state.dataSurface->SurfSchedExternalShadingFrac(SurfNum)) { state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = - LookUpScheduleValue(state, state.dataSurface->Surface(SurfNum).ExternalShadingSchInd, iHour, iTimeStep); + LookUpScheduleValue(state, state.dataSurface->SurfExternalShadingSchInd(SurfNum), iHour, iTimeStep); } else { state.dataHeatBal->SunlitFrac(iTimeStep, iHour, SurfNum) = 1.0; } @@ -5128,9 +5133,9 @@ void DetermineShadowingCombinations(EnergyPlusData &state) // Skip interior surfaces if the other side has already been added to penumbra if (state.dataSurface->Surface(GRSNR).ExtBoundCond > 0) { - if (state.dataSurface->Surface(state.dataSurface->Surface(GRSNR).ExtBoundCond).PenumbraID >= 0) { - state.dataSurface->Surface(GRSNR).PenumbraID = - state.dataSurface->Surface(state.dataSurface->Surface(GRSNR).ExtBoundCond).PenumbraID; + if (state.dataSurface->SurfPenumbraID(state.dataSurface->Surface(GRSNR).ExtBoundCond) >= 0) { + state.dataSurface->SurfPenumbraID(GRSNR) = + state.dataSurface->SurfPenumbraID(state.dataSurface->Surface(GRSNR).ExtBoundCond); skipSurface = true; } } @@ -5211,8 +5216,8 @@ void DetermineShadowingCombinations(EnergyPlusData &state) pSurf.addHole(subPoly); } } - state.dataSurface->Surface(GRSNR).PenumbraID = state.dataSolarShading->penumbra->addSurface(pSurf); - state.dataSolarShading->penumbraIDs.push_back(state.dataSurface->Surface(GRSNR).PenumbraID); + state.dataSurface->SurfPenumbraID(GRSNR) = state.dataSolarShading->penumbra->addSurface(pSurf); + state.dataSolarShading->penumbraIDs.push_back(state.dataSurface->SurfPenumbraID(GRSNR)); } } #endif @@ -5580,14 +5585,14 @@ void SHADOW(EnergyPlusData &state, } else { // Surface in sun and either shading surfaces or subsurfaces present (or both) #ifndef EP_NO_OPENGL - auto id = state.dataSurface->Surface(HTS).PenumbraID; + auto id = state.dataSurface->SurfPenumbraID(HTS); if (state.dataSolarShading->penumbra && id >= 0) { // SAREA(HTS) = buildingPSSF.at(id) / CTHETA(HTS); state.dataSolarShading->SAREA(HTS) = state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->CTHETA(HTS); // SAREA(HTS) = penumbra->fetchPSSA(Surface(HTS).PenumbraID)/CTHETA(HTS); for (int SS = 1; SS <= NSBS; ++SS) { auto HTSS = state.dataShadowComb->ShadowComb(HTS).SubSurf(SS); - id = state.dataSurface->Surface(HTSS).PenumbraID; + id = state.dataSurface->SurfPenumbraID(HTSS); if (id >= 0) { // SAREA(HTSS) = buildingPSSF.at(id) / CTHETA(HTSS); state.dataSolarShading->SAREA(HTSS) = state.dataSolarShading->penumbra->fetchPSSA(id) / state.dataSolarShading->CTHETA(HTSS); @@ -6148,20 +6153,20 @@ void CalcInteriorSolarOverlaps(EnergyPlusData &state, for (auto bkSurfNum : state.dataShadowComb->ShadowComb(GRSNR).BackSurf) { if (bkSurfNum == 0) continue; if (state.dataSolarShading->CTHETA(bkSurfNum) < DataEnvironment::SunIsUpValue) { - pbBackSurfaces.push_back(state.dataSurface->Surface(bkSurfNum).PenumbraID); + pbBackSurfaces.push_back(state.dataSurface->SurfPenumbraID(bkSurfNum)); } } pssas = - state.dataSolarShading->penumbra->calculateInteriorPSSAs({(unsigned)state.dataSurface->Surface(HTSS).PenumbraID}, pbBackSurfaces); + state.dataSolarShading->penumbra->calculateInteriorPSSAs({(unsigned)state.dataSurface->SurfPenumbraID(HTSS)}, pbBackSurfaces); // penumbra->renderInteriorScene({(unsigned)Surface(HTSS).PenumbraID}, pbBackSurfaces); JBKS = 0; for (auto bkSurfNum : state.dataShadowComb->ShadowComb(GRSNR).BackSurf) { if (bkSurfNum == 0) continue; - if (pssas[state.dataSurface->Surface(bkSurfNum).PenumbraID] > 0) { + if (pssas[state.dataSurface->SurfPenumbraID(bkSurfNum)] > 0) { ++JBKS; state.dataHeatBal->BackSurfaces(TS, iHour, JBKS, HTSS) = bkSurfNum; - Real64 OverlapArea = pssas[state.dataSurface->Surface(bkSurfNum).PenumbraID] / state.dataSolarShading->CTHETA(HTSS); + Real64 OverlapArea = pssas[state.dataSurface->SurfPenumbraID(bkSurfNum)] / state.dataSolarShading->CTHETA(HTSS); state.dataHeatBal->OverlapAreas(TS, iHour, JBKS, HTSS) = OverlapArea * state.dataSurface->SurfWinGlazedFrac(HTSS); } } @@ -7328,7 +7333,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Real64 InOutProjSLFracMult = state.dataSurface->SurfaceWindow(SurfNum).InOutProjSLFracMult(state.dataGlobal->HourOfDay); int InShelfSurf = 0; // Inside daylighting shelf surface number - int ShelfNum = state.dataSurface->Surface(SurfNum).Shelf; + int ShelfNum = state.dataSurface->SurfDaylightingShelfInd(SurfNum); if (ShelfNum > 0) { // Daylighting shelf InShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).InSurf; } @@ -8379,7 +8384,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) (state.dataSurface->Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt)) { WinShadingType ShadeFlag = state.dataSurface->SurfWinShadingFlag(SurfNum); - int ShelfNum = state.dataSurface->Surface(SurfNum).Shelf; + int ShelfNum = state.dataSurface->SurfDaylightingShelfInd(SurfNum); int OutShelfSurf = 0; if (ShelfNum > 0) { // Outside daylighting shelf OutShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).OutSurf; @@ -10441,8 +10446,8 @@ void SkyDifSolarShading(EnergyPlusData &state) } state.dataSurface->Surface(SurfNum).ViewFactorGroundIR = 1.0 - state.dataSurface->Surface(SurfNum).ViewFactorSkyIR; - if (state.dataSurface->Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor != -1) { state.dataSurface->Surface(SurfNum).ViewFactorSkyIR *= state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; } diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 9421424a905..9770b4eaddd 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -359,8 +359,6 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->CosZoneRelNorth.deallocate(); state.dataSurfaceGeometry->SinZoneRelNorth.deallocate(); - AllocateModuleArrays(state); // This needs to be moved to the main manager routine of SSG at a later date - state.dataSurface->AirSkyRadSplit.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->CalcWindowRevealReflection = false; // Set to True in ProcessSurfaceVertices if beam solar reflection from window reveals @@ -840,7 +838,7 @@ namespace SurfaceGeometry { CheckZoneOutBulbTempAt(state); } - void AllocateModuleArrays(EnergyPlusData &state) + void AllocateSurfaceArrays(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -882,6 +880,7 @@ namespace SurfaceGeometry { state.dataSurface->Y0.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->Z0.dimension(state.dataSurface->TotSurfaces, 0.0); + // TODO: move the following to (surface) heat balance state.dataSurface->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataSurface->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->QSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); @@ -894,6 +893,26 @@ namespace SurfaceGeometry { state.dataSurface->SurfWinA.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); state.dataSurface->SurfWinADiffFront.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); state.dataSurface->SurfWinACFOverlap.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); + + // Following are surface property arrays used in SurfaceGeometry + state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowSurfRecSurfNum.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfSchedExternalShadingFrac.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExternalShadingSchInd.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfHasSurroundingSurfProperties.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfSurroundingSurfacesNum.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfHasLinkedOutAirNode.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfLinkedOutAirNode.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; + state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; + state.dataSurface->SurfSchedExternalShadingFrac(SurfNum) = false; + state.dataSurface->SurfExternalShadingSchInd(SurfNum) = 0; + state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = false; + state.dataSurface->SurfSurroundingSurfacesNum(SurfNum) = 0; + state.dataSurface->SurfHasLinkedOutAirNode(SurfNum) = false; + state.dataSurface->SurfLinkedOutAirNode(SurfNum) = 0; + } } void GetSurfaceData(EnergyPlusData &state, bool &ErrorsFound) // If errors found in input @@ -1235,16 +1254,17 @@ namespace SurfaceGeometry { ShowFatalError(state, RoutineName + "Errors discovered, program terminates."); } + state.dataSurface->Surface.allocate(state.dataSurface->TotSurfaces); // Allocate the Surface derived type appropriately + state.dataSurface->SurfaceWindow.allocate(state.dataSurface->TotSurfaces); + AllocateSurfaceArrays(state); + AllocateSurfaceWindows(state, state.dataSurface->TotSurfaces); + // Have to make room for added surfaces, if needed FirstTotalSurfaces = NumSurfs + AddedSubSurfaces; if (NeedToAddSurfaces + NeedToAddSubSurfaces > 0) { state.dataSurfaceGeometry->SurfaceTmp.redimension(state.dataSurface->TotSurfaces); } - state.dataSurface->SurfaceWindow.allocate(state.dataSurface->TotSurfaces); - - AllocateSurfaceWindows(state, state.dataSurface->TotSurfaces); - // add the "need to add" surfaces // Debug write(outputfiledebug,*) ' need to add ',NeedtoAddSurfaces+NeedToAddSubSurfaces if (NeedToAddSurfaces + NeedToAddSubSurfaces > 0) CurNewSurf = FirstTotalSurfaces; @@ -1452,14 +1472,6 @@ namespace SurfaceGeometry { // After reordering, MovedSurfs should equal TotSurfaces MovedSurfs = 0; - // todo - move allocation to property functions - state.dataSurface->Surface.allocate(state.dataSurface->TotSurfaces); // Allocate the Surface derived type appropriately - state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfShadowSurfRecSurfNum.allocate(state.dataSurface->TotSurfaces); - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; - state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; - } Array1D SurfaceTmpClassMoved; // Tmp class is moved SurfaceTmpClassMoved.dimension(state.dataSurface->TotSurfaces, false); @@ -7638,16 +7650,16 @@ namespace SurfaceGeometry { for (Loop = 1; Loop <= state.dataSurface->TotSurfLocalEnv; ++Loop) { if (state.dataSurface->SurfLocalEnvironment(Loop).SurfPtr == SurfLoop) { if (state.dataSurface->SurfLocalEnvironment(Loop).OutdoorAirNodePtr != 0) { - state.dataSurface->Surface(SurfLoop).HasLinkedOutAirNode = true; - state.dataSurface->Surface(SurfLoop).LinkedOutAirNode = state.dataSurface->SurfLocalEnvironment(Loop).OutdoorAirNodePtr; + state.dataSurface->SurfHasLinkedOutAirNode(SurfLoop) = true; + state.dataSurface->SurfLinkedOutAirNode(SurfLoop) = state.dataSurface->SurfLocalEnvironment(Loop).OutdoorAirNodePtr; } if (state.dataSurface->SurfLocalEnvironment(Loop).ExtShadingSchedPtr != 0) { - state.dataSurface->Surface(SurfLoop).SchedExternalShadingFrac = true; - state.dataSurface->Surface(SurfLoop).ExternalShadingSchInd = state.dataSurface->SurfLocalEnvironment(Loop).ExtShadingSchedPtr; + state.dataSurface->SurfSchedExternalShadingFrac(SurfLoop) = true; + state.dataSurface->SurfExternalShadingSchInd(SurfLoop) = state.dataSurface->SurfLocalEnvironment(Loop).ExtShadingSchedPtr; } if (state.dataSurface->SurfLocalEnvironment(Loop).SurroundingSurfsPtr != 0) { - state.dataSurface->Surface(SurfLoop).HasSurroundingSurfProperties = true; - state.dataSurface->Surface(SurfLoop).SurroundingSurfacesNum = + state.dataSurface->SurfHasSurroundingSurfProperties(SurfLoop) = true; + state.dataSurface->SurfSurroundingSurfacesNum(SurfLoop) = state.dataSurface->SurfLocalEnvironment(Loop).SurroundingSurfsPtr; } } diff --git a/src/EnergyPlus/SurfaceGeometry.hh b/src/EnergyPlus/SurfaceGeometry.hh index 80488ce37d3..f63143d0060 100644 --- a/src/EnergyPlus/SurfaceGeometry.hh +++ b/src/EnergyPlus/SurfaceGeometry.hh @@ -82,7 +82,7 @@ namespace SurfaceGeometry { void SetupZoneGeometry(EnergyPlusData &state, bool &ErrorsFound); - void AllocateModuleArrays(EnergyPlusData &state); + void AllocateSurfaceArrays(EnergyPlusData &state); void AllocateSurfaceWindows(EnergyPlusData &state, int NumSurfaces); diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 90ef9f0f4f0..ac68d49f5a8 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -701,7 +701,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // WALL Hc, HA and HAT calculation for (Ctd = state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Wall((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -765,7 +765,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // WINDOW Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Window((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Window(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -849,7 +849,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Door((ZoneNum - 1) * 2 + 2); ++Ctd) { // DOOR SurfNum = state.dataUCSDShared->APos_Door(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; Z1 = minval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); Z2 = maxval(state.dataSurface->Surface(SurfNum).Vertex({1, state.dataSurface->Surface(SurfNum).Sides}), &Vector::z); @@ -904,7 +904,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Internal((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; ZSupSurf = state.dataUFADManager->HeightIntMass; ZInfSurf = 0.0; @@ -944,7 +944,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei for (Ctd = state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Ceiling((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); @@ -958,7 +958,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // FLOOR Hc, HA and HAT CALCULATION for (Ctd = state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 1); Ctd <= state.dataUCSDShared->PosZ_Floor((ZoneNum - 1) * 2 + 2); ++Ctd) { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); - state.dataSurface->Surface(SurfNum).TAirRef = AdjacentAirTemp; + state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 4413d50012b..b3f44562f00 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2768,7 +2768,7 @@ namespace WindowComplexManager { // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == AdjacentAirTemp) { @@ -2821,7 +2821,7 @@ namespace WindowComplexManager { // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNumAdj).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNumAdj)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); } else if (SELECT_CASE_var == AdjacentAirTemp) { @@ -2876,8 +2876,8 @@ namespace WindowComplexManager { // Calculate LWR from surrounding surfaces if defined for an exterior window OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { - if (state.dataSurface->Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor != -1) { state.dataSurface->Surface(SurfNum).ViewFactorSkyIR = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index faf93c2ad13..b05a4058c00 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -735,7 +735,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == AdjacentAirTemp) { @@ -779,7 +779,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNumAdj).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNumAdj)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); } else if (SELECT_CASE_var == AdjacentAirTemp) { @@ -829,8 +829,8 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // Calculate LWR from surrounding surfaces if defined for an exterior window OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { - if (state.dataSurface->Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor != -1) { state.dataSurface->Surface(SurfNum).ViewFactorSkyIR = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index e64317f572a..fc4f84eb9a4 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2407,7 +2407,7 @@ namespace WindowManager { // determine reference air temperature for this surface { - auto const SELECT_CASE_var(surface.TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); state.dataHeatBal->TempEffBulkAir(SurfNum) = RefAirTemp; @@ -2676,7 +2676,7 @@ namespace WindowManager { // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNumAdj).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNumAdj)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); state.dataHeatBal->TempEffBulkAir(SurfNumAdj) = RefAirTemp; @@ -2734,8 +2734,8 @@ namespace WindowManager { // Calculate LWR from surrounding surfaces if defined for an exterior window OutSrdIR = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { - if (state.dataSurface->Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); if (state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor != -1) { surface.ViewFactorSkyIR = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor; @@ -2912,8 +2912,8 @@ namespace WindowManager { Real64 rad_out_lw_srd_per_area = 0; if (state.dataGlobal->AnyLocalEnvironmentsInModel) { - if (state.dataSurface->Surface(SurfNum).HasSurroundingSurfProperties) { - SrdSurfsNum = state.dataSurface->Surface(SurfNum).SurroundingSurfacesNum; + if (state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { + SrdSurfsNum = state.dataSurface->SurfSurroundingSurfacesNum(SurfNum); for (SrdSurfNum = 1; SrdSurfNum <= state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).TotSurroundingSurface; SrdSurfNum++) { SrdSurfViewFac = state.dataSurface->SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor; SrdSurfTempAbs = GetCurrentScheduleValue( diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index ab30dfce9ff..0a9003a5956 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -2938,12 +2938,12 @@ void InitZoneAirSetPoints(EnergyPlusData &state) FirstSurfFlag = true; for (SurfNum = Zone(Loop).HTSurfaceFirst; SurfNum <= Zone(Loop).HTSurfaceLast; ++SurfNum) { if (FirstSurfFlag) { - TRefFlag = state.dataSurface->Surface(SurfNum).TAirRef; + TRefFlag = state.dataSurface->SurfTAirRef(SurfNum); FirstSurfFlag = false; } // for each particular zone, the reference air temperature(s) should be the same // (either mean air, bulk air, or supply air temp). - if (state.dataSurface->Surface(SurfNum).TAirRef != TRefFlag) { + if (state.dataSurface->SurfTAirRef(SurfNum) != TRefFlag) { ShowWarningError(state, "Different reference air temperatures for difference surfaces encountered in zone " + Zone(Loop).Name); } } @@ -6783,7 +6783,7 @@ void CalcZoneSums(EnergyPlusData &state, // determine reference air temperature for this surface { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { // The zone air is the reference temperature (which is to be solved for in CorrectZoneAirTemp). RefAirTemp = MAT(ZoneNum); @@ -7034,7 +7034,7 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, Area = state.dataSurface->Surface(SurfNum).Area; // For windows, this is the glazing area // determine reference air temperature for this surface's convective heat transfer model { - auto const SELECT_CASE_var(state.dataSurface->Surface(SurfNum).TAirRef); + auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { // The zone air is the reference temperature RefAirTemp = MAT(ZoneNum); diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 3ac6efed3de..3a5fa4a298c 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -600,7 +600,8 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) state->dataSurface->Surface(SurfNum).Zone = 1; state->dataSurface->Surface(SurfNum).Construction = 1; - state->dataSurface->Surface(SurfNum).TAirRef = 0; + state->dataSurface->SurfTAirRef.allocate(1); + state->dataSurface->SurfTAirRef(SurfNum) = 0; state->dataConstruction->Construct(1).TypeIsWindow = false; state->dataHeatBal->Zone(1).SystemZoneNodeNumber = 1; state->dataHeatBal->Zone(1).Multiplier = 1.0; @@ -631,7 +632,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) CalcASHRAETARPNatural(state->dataHeatBalSurf->TH(2, 1, 1), state->dataHeatBalFanSys->MAT(1), -state->dataSurface->Surface(SurfNum).CosTilt); EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); // Test 2: Ceiling Diffuser Model @@ -643,7 +644,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) CalcASHRAETARPNatural(state->dataHeatBalSurf->TH(2, 1, 1), state->dataHeatBalFanSys->MAT(1), -state->dataSurface->Surface(SurfNum).CosTilt); EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); // Test 3: Ceiling Diffuser Model @@ -655,7 +656,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) CalcASHRAETARPNatural(state->dataHeatBalSurf->TH(2, 1, 1), state->dataHeatBalFanSys->MAT(1), -state->dataSurface->Surface(SurfNum).CosTilt); EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); // Case 2 - High ACH @@ -671,7 +672,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) HcExpectedValue = 4.122; EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); // Test 2: Ceiling Diffuser Model @@ -682,7 +683,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) HcExpectedValue = 9.476; EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); // Test 3: Ceiling Diffuser Model @@ -693,7 +694,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) HcExpectedValue = 3.212; EvaluateIntHcModels(*state, SurfNum, ConvModelEquationNum, Hc); - EXPECT_EQ(state->dataSurface->Surface(SurfNum).TAirRef, DataSurfaces::ZoneMeanAirTemp); + EXPECT_EQ(state->dataSurface->SurfTAirRef(SurfNum), DataSurfaces::ZoneMeanAirTemp); EXPECT_NEAR(Hc, HcExpectedValue, 0.1); } @@ -718,7 +719,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) HcIn.allocate(1); Vhc.allocate(1); state->dataSurface->SurfIntConvCoeff.allocate(SurfNum); - + state->dataSurface->SurfTAirRef.allocate(SurfNum); // Test 1: CalcWaltonUnstableHorizontalOrTilt calculation for Hn DeltaTemp = 1.0; CosineTilt = 1.0; @@ -728,7 +729,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) // Test 2/3: CalcDetailedHcInForDVModel calculation for Hn state->dataSurface->Surface(SurfNum).HeatTransSurf = true; - state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::AdjacentAirTemp; state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; @@ -739,7 +740,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) EXPECT_NEAR(Hn, 1.520, 0.001); state->dataSurface->Surface(SurfNum).HeatTransSurf = true; - state->dataSurface->Surface(SurfNum).TAirRef = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::AdjacentAirTemp; state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 4f64fa91311..08c15623460 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -837,6 +837,8 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) SurfaceGeometry::SetupZoneGeometry(*state, foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); + state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfDaylightingShelfInd = 0; state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized @@ -2110,6 +2112,9 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); + state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfDaylightingShelfInd = 0; + state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized ScheduleManager::ProcessScheduleInput(*state); @@ -2859,6 +2864,8 @@ TEST_F(EnergyPlusFixture, DaylightingManager_TDD_NoDaylightingControls) SurfaceGeometry::SetupZoneGeometry(*state, foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); + state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfDaylightingShelfInd = 0; state->dataConstruction->Construct(state->dataSurface->Surface(7).Construction).TransDiff = 0.001; // required for GetTDDInput function to work. DaylightingDevices::GetTDDInput(*state); diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index f3b2f2482c0..786d395c554 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -160,7 +160,9 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->Surface(3).Vertex(4).z = 8.5343999852; state->dataSurface->SurfIntConvCoeff.allocate(TotSurfaces); + state->dataSurface->SurfTAirRef.allocate(TotSurfaces); state->dataSurface->SurfIntConvCoeff = 0.0; + state->dataSurface->SurfTAirRef = 0; state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->AirModel(1).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index b99d87f79a4..d997868a41c 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -131,6 +131,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs(SurfNum) = 1.0; state->dataHeatBalSurf->SurfQAdditionalHeatSourceOutside.allocate(SurfNum); state->dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) = 0.0; + state->dataSurface->SurfHasSurroundingSurfProperties.allocate(SurfNum); + state->dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = 0; state->dataHeatBalSurf->TH.allocate(2, 2, 1); state->dataSurface->Surface.allocate(SurfNum); @@ -733,9 +735,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.001; state->dataLoopNodes->Node.allocate(4); - state->dataSurface->Surface(1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); @@ -785,6 +784,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); + + state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(2) = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(3) = DataSurfaces::ZoneSupplyAirTemp; + // with supply air CalcHeatBalanceInsideSurf(*state); EXPECT_EQ(24.0, state->dataHeatBal->TempEffBulkAir(1)); @@ -1274,9 +1278,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.001; state->dataLoopNodes->Node.allocate(4); - state->dataSurface->Surface(1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); @@ -1336,6 +1337,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataScheduleMgr->Schedule(2).CurrentValue = 20.0; state->dataScheduleMgr->Schedule(3).CurrentValue = 1.5; state->dataScheduleMgr->Schedule(4).CurrentValue = 90.0; + state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(2) = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(3) = DataSurfaces::ZoneSupplyAirTemp; OutAirNodeManager::InitOutAirNodes(*state); @@ -1854,9 +1858,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.001; state->dataLoopNodes->Node.allocate(4); - state->dataSurface->Surface(1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); @@ -1906,6 +1907,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); + state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(2) = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(3) = DataSurfaces::ZoneSupplyAirTemp; + InitSurfaceHeatBalance(*state); state->dataSurface->AirSkyRadSplit.allocate(6); @@ -2425,9 +2430,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataHeatBalFanSys->ZoneAirHumRat(1) = 0.001; state->dataLoopNodes->Node.allocate(4); - state->dataSurface->Surface(1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(2).TAirRef = DataSurfaces::AdjacentAirTemp; - state->dataSurface->Surface(3).TAirRef = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); @@ -2484,10 +2486,15 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA createFacilityElectricPowerServiceObject(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); + state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(2) = DataSurfaces::AdjacentAirTemp; + state->dataSurface->SurfTAirRef(3) = DataSurfaces::ZoneSupplyAirTemp; + InitSurfaceHeatBalance(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { state->dataSurface->SurfExtConvCoeff(SurfNum) = -1; } + // Test Additional Heat Source Calculation CalcHeatBalanceOutsideSurf(*state); EXPECT_EQ(-0.1, state->dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(1)); diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 8219b74ba1e..77e1a939f35 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -104,8 +104,6 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataSurface->Surface(SurfNum).BaseSurf = SurfNum; state->dataSurface->Surface(SurfNum).Zone = ZoneNum; state->dataSurface->Surface(SurfNum).IsICS = true; - state->dataSurface->SurfExtConvCoeff.allocate(NumOfSurf); - state->dataSurface->SurfExtConvCoeff(SurfNum) = 0; state->dataSurface->Surface(SurfNum).ExtWind = false; // allocate construction variable data state->dataConstruction->Construct.allocate(ConstrNum); @@ -128,6 +126,10 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataHeatBal->SurfQRadSWOutIncident(1) = 0.0; // set user defined conv. coeff. calculation to false state->dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false; + state->dataSurface->SurfExtConvCoeff.allocate(NumOfSurf); + state->dataSurface->SurfExtConvCoeff(SurfNum) = 0; + state->dataSurface->SurfHasSurroundingSurfProperties.allocate(NumOfSurf); + state->dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = false; state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(NumOfSurf); state->dataSurface->SurfEMSOverrideExtConvCoef(1) = false; diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 197de235a5d..29872d4ee07 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -106,6 +106,7 @@ class RoomAirflowNetworkTest : public EnergyPlusFixture state->dataLoopNodes->NodeID.allocate(state->dataLoopNodes->NumOfNodes); state->dataLoopNodes->Node.allocate(state->dataLoopNodes->NumOfNodes); state->dataSurface->Surface.allocate(NumOfSurfaces); + state->dataSurface->SurfTAirRef.allocate(NumOfSurfaces); state->dataHeatBal->HConvIn.allocate(NumOfSurfaces); state->dataHeatBalSurf->TempSurfInTmp.allocate(NumOfSurfaces); state->dataMstBalEMPD->RVSurface.allocate(NumOfSurfaces); @@ -264,6 +265,9 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) state->dataSurface->Surface(1).HeatTransferAlgorithm = iHeatTransferModel::EMPD; state->dataSurface->Surface(2).HeatTransferAlgorithm = iHeatTransferModel::EMPD; + + state->dataSurface->SurfTAirRef = 0; + state->dataMstBalEMPD->RVSurface(1) = 0.0011; state->dataMstBalEMPD->RVSurface(2) = 0.0012; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index c7f0442447b..93fb170f775 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -492,7 +492,7 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SurfaceShape) // compare_err_stream( "" ); // just for debugging - SurfaceGeometry::AllocateModuleArrays(*state); + SurfaceGeometry::AllocateSurfaceArrays(*state); // Adding additional surfaces will change the index of the following based on where the surfaces are added in the array. // If adding new tests, break here and look at EnergyPlus::state->dataSurface->Surface to see the order. diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 46d2e33591b..393bee4e21c 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -515,9 +515,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->Surface(surfNum1).Area = 10.0; state->dataSurface->Surface(surfNum2).Area = 10.0; state->dataSurface->Surface(surfNum3).Area = 10.0; - state->dataSurface->Surface(surfNum1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(surfNum2).TAirRef = DataSurfaces::ZoneSupplyAirTemp; - state->dataSurface->Surface(surfNum3).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(surfNum1).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum2).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum3).SolarEnclIndex = 1; @@ -575,8 +572,13 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); + state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); state->dataSurface->SurfIntConvCoeff.allocate(3); + state->dataSurface->SurfTAirRef.allocate(3); + state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; state->dataHeatBalSurf->QdotConvOutRep.allocate(3); state->dataHeatBalSurf->QdotConvOutRepPerArea.allocate(3); @@ -624,7 +626,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataLoopNodes->Node(2).MassFlowRate = 0.0; state->dataSurface->Surface(1).ExtBoundCond = 2; state->dataSurface->Surface(2).ExtBoundCond = 1; - state->dataSurface->Surface(1).TAirRef = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneSupplyAirTemp; WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); EXPECT_NEAR(25.0, state->dataHeatBal->TempEffBulkAir(surfNum2), 0.0001); } @@ -2747,9 +2749,6 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->Surface(surfNum1).Area = 10.0; state->dataSurface->Surface(surfNum2).Area = 10.0; state->dataSurface->Surface(surfNum3).Area = 10.0; - state->dataSurface->Surface(surfNum1).TAirRef = DataSurfaces::ZoneMeanAirTemp; - state->dataSurface->Surface(surfNum2).TAirRef = DataSurfaces::ZoneSupplyAirTemp; - state->dataSurface->Surface(surfNum3).TAirRef = DataSurfaces::AdjacentAirTemp; state->dataSurface->Surface(surfNum1).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum2).SolarEnclIndex = 1; state->dataSurface->Surface(surfNum3).SolarEnclIndex = 1; @@ -2809,6 +2808,10 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->InsideDividerCondensationFlag.allocate(3); state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); state->dataSurface->SurfIntConvCoeff.allocate(3); + state->dataSurface->SurfTAirRef.allocate(3); + state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; + state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; state->dataHeatBalSurf->QdotConvOutRep.allocate(3); state->dataHeatBalSurf->QdotConvOutRepPerArea.allocate(3); diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index a107f556e6a..d103981ef00 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -1076,15 +1076,17 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataHeatBal->TempEffBulkAir.allocate(3); state->dataHeatBalSurf->TempSurfInTmp.allocate(3); + state->dataSurface->SurfTAirRef.allocate(3); + state->dataSurface->SurfTAirRef(1) = ZoneMeanAirTemp; + state->dataSurface->SurfTAirRef(2) = AdjacentAirTemp; + state->dataSurface->SurfTAirRef(3) = ZoneSupplyAirTemp; + state->dataSurface->Surface(1).HeatTransSurf = true; state->dataSurface->Surface(2).HeatTransSurf = true; state->dataSurface->Surface(3).HeatTransSurf = true; state->dataSurface->Surface(1).Area = 10.0; state->dataSurface->Surface(2).Area = 10.0; state->dataSurface->Surface(3).Area = 10.0; - state->dataSurface->Surface(1).TAirRef = ZoneMeanAirTemp; - state->dataSurface->Surface(2).TAirRef = AdjacentAirTemp; - state->dataSurface->Surface(3).TAirRef = ZoneSupplyAirTemp; state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; From a0cab54aa80858740d0dec766a81c204a0d1f401 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 29 Apr 2021 10:23:24 -0700 Subject: [PATCH 04/25] surface properties --- src/EnergyPlus/DataSurfaces.hh | 54 +++++++++------------ src/EnergyPlus/GeneralRoutines.cc | 4 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 27 ++++++----- src/EnergyPlus/OutputReports.cc | 18 +++---- src/EnergyPlus/Photovoltaics.cc | 2 +- src/EnergyPlus/SurfaceGeometry.cc | 41 ++++++++++------ src/EnergyPlus/SwimmingPool.cc | 2 +- tst/EnergyPlus/unit/ICSCollector.unit.cc | 5 +- tst/EnergyPlus/unit/SwimmingPool.unit.cc | 5 +- 9 files changed, 84 insertions(+), 74 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index ace81d56278..1f40ea91abd 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -666,38 +666,18 @@ namespace DataSurfaces { int FrameDivider; // Pointer to frame and divider information (windows only) Real64 Multiplier; // Multiplies glazed area, frame area and divider area (windows only) - // Daylighting pointers -// int Shelf; // Pointer to daylighting shelf -// int TAirRef; // Flag for reference air temperature - // ZoneMeanAirTemp = 1 = mean air temperature or MAT => for mixing air model with all convection algos - // except inlet-dependent algo - // AdjacentAirTemp = 2 = adjacent air temperature or TempEffBulkAir => for nodal or zonal air model - // with all convection algos except inlet-dependent algo - // ZoneSupplyAirTemp = 3 = supply air temperature => for mixing air model with inlet-dependent algo - // Default value is 'ZoneMeanAirTemp' and value for each particular surface will be changed only if - // the inlet-dependent convection algorithm and/or nodal and zonal air models are used. Real64 OutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C) Real64 OutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) Real64 WindSpeed; // Surface outside wind speed, for surface heat balance (m/s) Real64 WindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) -// bool SchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported -// int ExternalShadingSchInd; // Schedule for a the external shading -// bool HasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface -// int SurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces) -// bool HasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface -// int LinkedOutAirNode; // Index of the an OutdoorAir:Node -// -// int PenumbraID; // Surface ID in penumbra - - std::string UNomWOFilm; // Nominal U Value without films stored as string - std::string UNomFilm; // Nominal U Value with films stored as string - bool ExtEcoRoof; // True if the top outside construction material is of type Eco Roof - bool ExtCavityPresent; // true if there is an exterior vented cavity on surface - int ExtCavNum; // index for this surface in ExtVentedCavity structure (if any) - bool IsPV; // true if this is a photovoltaic surface (dxf output) - bool IsICS; // true if this is an ICS collector - bool IsPool; // true if this is a pool - int ICSPtr; // Index to ICS collector + +// bool ExtEcoRoof; // True if the top outside construction material is of type Eco Roof +// bool ExtCavityPresent; // true if there is an exterior vented cavity on surface +// int ExtCavNum; // index for this surface in ExtVentedCavity structure (if any) +// bool IsPV; // true if this is a photovoltaic surface (dxf output) +// bool IsICS; // true if this is an ICS collector +// bool IsPool; // true if this is a pool +// int ICSPtr; // Index to ICS collector // TH added 3/26/2010 bool MirroredSurf; // True if it is a mirrored surface @@ -750,8 +730,7 @@ namespace DataSurfaces { OutDryBulbTemp(0.0), OutWetBulbTemp(0.0),WindSpeed(0.0), WindDir(0.0), - UNomWOFilm("- "), UNomFilm("- "), ExtEcoRoof(false), ExtCavityPresent(false), ExtCavNum(0), IsPV(false), - IsICS(false), IsPool(false), ICSPtr(0), MirroredSurf(false), IntConvClassification(0), IntConvHcModelEq(0), IntConvHcUserCurveIndex(0), + MirroredSurf(false), IntConvClassification(0), IntConvHcModelEq(0), IntConvHcUserCurveIndex(0), OutConvClassification(0), OutConvHfModelEq(0), OutConvHfUserCurveIndex(0), OutConvHnModelEq(0), OutConvHnUserCurveIndex(0), OutConvFaceArea(0.0), OutConvFacePerimeter(0.0), OutConvFaceHeight(0.0), IntConvZoneWallHeight(0.0), IntConvZonePerimLength(0.0), IntConvZoneHorizHydrDiam(0.0), IntConvWindowWallRatio(0.0), IntConvWindowLocation(InConvWinLoc_NotSet), @@ -1373,6 +1352,13 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfHasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface Array1D SurfLinkedOutAirNode; // Index of the an OutdoorAir:Node Array1D SurfPenumbraID; + Array1D SurfExtEcoRoof; // True if the top outside construction material is of type Eco Roof + Array1D SurfExtCavityPresent; // true if there is an exterior vented cavity on surface + Array1D SurfExtCavNum; // index for this surface in ExtVentedCavity structure (if any) + Array1D SurfIsPV; // true if this is a photovoltaic surface (dxf output) + Array1D SurfIsICS; // true if this is an ICS collector + Array1D SurfIsPool; // true if this is a pool + Array1D SurfICSPtr; // Index to ICS collector // Surface Shadow Properties Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction @@ -1709,7 +1695,13 @@ struct SurfacesData : BaseGlobalStruct this->SurfHasLinkedOutAirNode.deallocate(); this->SurfLinkedOutAirNode.deallocate(); this->SurfPenumbraID.deallocate(); - + this->SurfExtEcoRoof.deallocate(); + this->SurfExtCavityPresent.deallocate(); + this->SurfExtCavNum.deallocate(); + this->SurfIsPV.deallocate(); + this->SurfIsICS.deallocate(); + this->SurfIsPool.deallocate(); + this->SurfICSPtr.deallocate(); this->SurfWinTransSolar.deallocate(); this->SurfWinBmSolar.deallocate(); this->SurfWinBmBmSolar.deallocate(); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 98a0c020ea6..43c01500a61 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -995,9 +995,9 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, HPlenARR(ThisSurf) = Sigma * AbsExt * AbsThermSurf * (pow_4(TsBaffK) - pow_4(TsoK)) / (TsBaffK - TsoK); } // Added for ICS collector OSCM - if (state.dataSurface->Surface(SurfPtr).IsICS) { + if (state.dataSurface->SurfIsICS(SurfPtr)) { ICSCollectorIsOn = true; - CollectorNum = state.dataSurface->Surface(SurfPtr).ICSPtr; + CollectorNum = state.dataSurface->SurfICSPtr(SurfPtr); } } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 23a97065f62..a78e3e45de9 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -1314,6 +1314,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; state.dataSurface->SurfTAirRef(SurfNum) = 0; + } // Use the total number of surfaces to allocate variables to avoid a surface number limit @@ -2271,9 +2272,9 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) state.dataEnvrn->GroundTempFC; } - if (Surface(SurfNum).ExtCavityPresent) { - state.dataSurface->ExtVentedCavity(Surface(SurfNum).ExtCavNum).TbaffleLast = 20.0; - state.dataSurface->ExtVentedCavity(Surface(SurfNum).ExtCavNum).TairLast = 20.0; + if (state.dataSurface->SurfExtCavityPresent(SurfNum)) { + state.dataSurface->ExtVentedCavity(state.dataSurface->SurfExtCavNum(SurfNum)).TbaffleLast = 20.0; + state.dataSurface->ExtVentedCavity(state.dataSurface->SurfExtCavNum(SurfNum)).TairLast = 20.0; } // Initialize Kiva convection algorithms @@ -6122,7 +6123,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CTF || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { - if (Surface(SurfNum).ExtCavityPresent) { + if (state.dataSurface->SurfExtCavityPresent(SurfNum)) { CalcExteriorVentedCavity(state, SurfNum); } @@ -6131,7 +6132,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { - if (Surface(SurfNum).ExtCavityPresent) { + if (state.dataSurface->SurfExtCavityPresent(SurfNum)) { CalcExteriorVentedCavity(state, SurfNum); } } @@ -6144,7 +6145,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, Real64 TempExt; - if (Surface(SurfNum).ExtEcoRoof) { + if (state.dataSurface->SurfExtEcoRoof(SurfNum)) { CalcEcoRoof(state, SurfNum, zoneNum, ConstrNum, TempExt); continue; } @@ -6796,8 +6797,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (state.dataHeatBalFanSys->QRadSurfAFNDuct(SurfNum) / state.dataGlobal->TimeStepZoneSec)); Real64 const TempDiv(1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature - if ((!surface.IsPool) || - ((surface.IsPool) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && + if ((!state.dataSurface->SurfIsPool(SurfNum)) || + ((state.dataSurface->SurfIsPool(SurfNum)) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = @@ -6909,8 +6910,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (state.dataHeatBalFanSys->QRadSurfAFNDuct(SurfNum) / state.dataGlobal->TimeStepZoneSec)); Real64 const TempDiv(1.0 / (construct.CTFInside(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature - if ((!surface.IsPool) || - ((surface.IsPool) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && + if ((!state.dataSurface->SurfIsPool(SurfNum)) || + ((state.dataSurface->SurfIsPool(SurfNum)) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = @@ -7500,7 +7501,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, state.dataHeatBalSurf->IsSource(surfNum) = 0; state.dataHeatBalSurf->IsNotSource(surfNum) = 1; } - if (!Surface(surfNum).IsPool) { + if (!state.dataSurface->SurfIsPool(surfNum)) { state.dataHeatBalSurf->IsPoolSurf(surfNum) = 0; state.dataHeatBalSurf->IsNotPoolSurf(surfNum) = 1; } @@ -7528,7 +7529,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, } // The special heat balance terms for pools are used only when the pool is operating, so IsPool can change - if (Surface(surfNum).IsPool) { + if (state.dataSurface->SurfIsPool(surfNum)) { if ((std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(surfNum)) >= PoolIsOperatingLimit) || (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(surfNum)) >= PoolIsOperatingLimit)) { state.dataHeatBalSurf->IsPoolSurf(surfNum) = 1; @@ -8667,7 +8668,7 @@ void CalcExteriorVentedCavity(EnergyPlusData &state, int const SurfNum) // index Real64 OutHumRatExt; auto &Surface(state.dataSurface->Surface); - CavNum = Surface(SurfNum).ExtCavNum; + CavNum = state.dataSurface->SurfExtCavNum(SurfNum); TempExt = Surface(SurfNum).OutDryBulbTemp; diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index 7653d7a4f8c..1de371ec302 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -553,7 +553,7 @@ void DXFOut(EnergyPlusData &state, if (state.dataSurface->Surface(surf).Sides == 0) continue; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) colorindex = ColorNo_ShdDetFix; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_B) colorindex = ColorNo_ShdDetBldg; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) { ShadeType = "Fixed Shading"; print(dxffile, Format_710, "Fixed Shading:" + state.dataSurface->Surface(surf).Name); @@ -664,7 +664,7 @@ void DXFOut(EnergyPlusData &state, if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Dome) colorindex = ColorNo_TDDDome; if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Diffuser) colorindex = ColorNo_TDDDiffuser; } - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); if (state.dataSurface->Surface(surf).Sides <= 4) { @@ -758,7 +758,7 @@ void DXFOut(EnergyPlusData &state, if (state.dataSurface->Surface(surf).ZoneName != state.dataHeatBal->Zone(zones).Name) continue; if (state.dataSurface->Surface(surf).Sides == 0) continue; colorindex = ColorNo_ShdAtt; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); if (state.dataSurface->Surface(surf).Sides <= 4) { print(dxffile, Format_704_0, TempZoneName, DXFcolorno(colorindex)); @@ -944,7 +944,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->Surface(surf).Class == SurfaceClass::Shading) continue; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) colorindex = ColorNo_ShdDetFix; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_B) colorindex = ColorNo_ShdDetBldg; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) { ShadeType = "Fixed Shading"; print(dxffile, Format_710, "Fixed Shading:" + state.dataSurface->Surface(surf).Name); @@ -996,7 +996,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Dome) colorindex = ColorNo_TDDDome; if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Diffuser) colorindex = ColorNo_TDDDiffuser; } - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; ++surfcount; ++surfcount; @@ -1039,7 +1039,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->Surface(surf).Class != SurfaceClass::Shading) continue; if (state.dataSurface->Surface(surf).ZoneName != state.dataHeatBal->Zone(zones).Name) continue; colorindex = ColorNo_ShdAtt; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; ++surfcount; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); @@ -1133,7 +1133,7 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->Surface(surf).Class == SurfaceClass::Shading) continue; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) colorindex = ColorNo_ShdDetFix; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_B) colorindex = ColorNo_ShdDetBldg; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; if (state.dataSurface->Surface(surf).Class == SurfaceClass::Detached_F) { ShadeType = "Fixed Shading"; print(dxffile, Format_710, "Fixed Shading:" + state.dataSurface->Surface(surf).Name); @@ -1178,7 +1178,7 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Dome) colorindex = ColorNo_TDDDome; if (state.dataSurface->SurfWinOriginalClass(surf) == SurfaceClass::TDD_Diffuser) colorindex = ColorNo_TDDDiffuser; } - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; ++surfcount; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); @@ -1206,7 +1206,7 @@ void DXFOutWireFrame(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->Surface(surf).Class != SurfaceClass::Shading) continue; if (state.dataSurface->Surface(surf).ZoneName != state.dataHeatBal->Zone(zones).Name) continue; colorindex = ColorNo_ShdAtt; - if (state.dataSurface->Surface(surf).IsPV) colorindex = ColorNo_PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo_PV; ++surfcount; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index b6a4b34ae72..2cf0e67ab36 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -323,7 +323,7 @@ namespace Photovoltaics { } else { // Found one -- make sure has right parameters for PV SurfNum = state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr; - state.dataSurface->Surface(SurfNum).IsPV = true; + state.dataSurface->SurfIsPV(SurfNum) = true; if (!state.dataSurface->Surface(SurfNum).ExtSolar) { ShowWarningError(state, "Invalid " + state.dataIPShortCut->cAlphaFieldNames(2) + " = " + state.dataIPShortCut->cAlphaArgs(2)); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 9770b4eaddd..71bfa7eb1ed 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -689,9 +689,6 @@ namespace SurfaceGeometry { cNominalU = "**"; } - // save the U-value nominal for use later in tabular report - state.dataSurface->Surface(SurfNum).UNomWOFilm = cNominalU; - state.dataSurface->Surface(SurfNum).UNomFilm = cNominalUwithConvCoeffs; // populate the predefined report related to u-values with films // only exterior surfaces including underground auto const SurfaceClass(state.dataSurface->Surface(SurfNum).Class); @@ -903,6 +900,13 @@ namespace SurfaceGeometry { state.dataSurface->SurfSurroundingSurfacesNum.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHasLinkedOutAirNode.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfLinkedOutAirNode.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtEcoRoof.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtCavityPresent.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtCavNum.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIsPV.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIsICS.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIsPool.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfICSPtr.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; @@ -912,6 +916,13 @@ namespace SurfaceGeometry { state.dataSurface->SurfSurroundingSurfacesNum(SurfNum) = 0; state.dataSurface->SurfHasLinkedOutAirNode(SurfNum) = false; state.dataSurface->SurfLinkedOutAirNode(SurfNum) = 0; + state.dataSurface->SurfExtEcoRoof(SurfNum) = false; + state.dataSurface->SurfExtCavityPresent(SurfNum) = false; + state.dataSurface->SurfExtCavNum(SurfNum) = 0; + state.dataSurface->SurfIsPV(SurfNum) = false; + state.dataSurface->SurfIsICS(SurfNum) = false; + state.dataSurface->SurfIsPool(SurfNum) = false; + state.dataSurface->SurfICSPtr(SurfNum) = 0; } } @@ -2422,7 +2433,9 @@ namespace SurfaceGeometry { LayNumOutside = 0; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Check for EcoRoof and only 1 allowed to be used. - if (!state.dataSurface->Surface(SurfNum).ExtEcoRoof) continue; + if (state.dataSurface->Surface(SurfNum).Construction > 0) + state.dataSurface->SurfExtEcoRoof(SurfNum) = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).TypeIsEcoRoof; + if (!state.dataSurface->SurfExtEcoRoof(SurfNum)) continue; if (LayNumOutside == 0) { LayNumOutside = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).LayerPoint(1); continue; @@ -3805,9 +3818,9 @@ namespace SurfaceGeometry { } // Set the logical flag for the EcoRoof presented, this is only based on the flag in the construction type - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; +// if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) +// state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = +// state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ViewFactorGround = state.dataIPShortCut->rNumericArgs(1); if (state.dataIPShortCut->lNumericFieldBlanks(1)) @@ -4171,9 +4184,9 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtWind = true; // Set the logical flag for the EcoRoof presented, this is only based on the flag in the construction type - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; +// if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) +// state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = +// state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; } else if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == state.dataSurfaceGeometry->UnreconciledZoneSurface) { if (GettingIZSurfaces) { @@ -7208,8 +7221,8 @@ namespace SurfaceGeometry { state.dataSurface->ExtVentedCavity(Item).SurfPtrs(ThisSurf) = Found; // now set info in Surface structure - state.dataSurface->Surface(Found).ExtCavNum = Item; - state.dataSurface->Surface(Found).ExtCavityPresent = true; + state.dataSurface->SurfExtCavNum(Found) = Item; + state.dataSurface->SurfExtCavityPresent(Found) = true; } if (ErrorsFound) continue; // previous inner do loop may have detected problems that need to be cycle'd again to avoid crash @@ -14303,8 +14316,8 @@ namespace SurfaceGeometry { for (CollectorNum = 1; CollectorNum <= NumOfCollectors; ++CollectorNum) { if (UtilityRoutines::SameString(state.dataSurface->Surface(SurfNum).Name, TmpCandidateICSSurfaceNames(CollectorNum)) && UtilityRoutines::SameString(TmpCandidateICSBCTypeNames(CollectorNum), "OTHERSIDECONDITIONSMODEL")) { - state.dataSurface->Surface(SurfNum).IsICS = true; - state.dataSurface->Surface(SurfNum).ICSPtr = CollectorNum; + state.dataSurface->SurfIsICS(SurfNum) = true; + state.dataSurface->SurfICSPtr(SurfNum) = CollectorNum; } } } diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 872c76ec126..69164743a7e 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -436,7 +436,7 @@ void SwimmingPoolData::ErrorCheckSetupPoolSurface( ErrorsFound = true; } else { // ( Pool( Item ).SurfacePtr > 0 ) state.dataSurface->Surface(this->SurfacePtr).IsRadSurfOrVentSlabOrPool = true; - state.dataSurface->Surface(this->SurfacePtr).IsPool = true; + state.dataSurface->SurfIsPool(this->SurfacePtr) = true; this->ZonePtr = state.dataSurface->Surface(this->SurfacePtr).Zone; // Check to make sure pool surface is a floor if (state.dataSurface->Surface(this->SurfacePtr).Class != DataSurfaces::SurfaceClass::Floor) { diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 77e1a939f35..30043f2d945 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -103,8 +103,11 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataSurface->Surface(SurfNum).Construction = ConstrNum; state->dataSurface->Surface(SurfNum).BaseSurf = SurfNum; state->dataSurface->Surface(SurfNum).Zone = ZoneNum; - state->dataSurface->Surface(SurfNum).IsICS = true; state->dataSurface->Surface(SurfNum).ExtWind = false; + state->dataSurface->SurfIsICS.allocate(NumOfSurf); + state->dataSurface->SurfICSPtr.allocate(NumOfSurf); + state->dataSurface->SurfIsICS(SurfNum) = true; + // allocate construction variable data state->dataConstruction->Construct.allocate(ConstrNum); state->dataConstruction->Construct(ConstrNum).LayerPoint.allocate(MatNum); diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index c2e06a0fcb5..a5f59301a2b 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -245,6 +245,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); state->dataSurface->Surface.allocate(1); state->dataConstruction->Construct.allocate(1); + state->dataSurface->SurfIsPool.allocate(1); // testing variables static std::string const Alpha1("FirstString"); @@ -341,13 +342,13 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataConstruction->Construct(state->dataSurface->Surface(poolReference.SurfacePtr).Construction).SourceSinkPresent = false; state->dataSurface->Surface(poolReference.SurfacePtr).Zone = 7; state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; - state->dataSurface->Surface(poolReference.SurfacePtr).IsPool = false; + state->dataSurface->SurfIsPool(poolReference.SurfacePtr) = false; poolReference.ZonePtr = 0; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); EXPECT_FALSE(ErrFnd); EXPECT_TRUE(state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool); - EXPECT_TRUE(state->dataSurface->Surface(poolReference.SurfacePtr).IsPool); + EXPECT_TRUE(state->dataSurface->SurfIsPool(poolReference.SurfacePtr)); EXPECT_EQ(state->dataSurface->Surface(poolReference.SurfacePtr).Zone, poolReference.ZonePtr); } From 15d62288e2115673c5b3a54054b98aaf1943fe34 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 30 Apr 2021 18:07:22 -0700 Subject: [PATCH 05/25] more vars --- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 2 +- src/EnergyPlus/ConvectionCoefficients.cc | 856 +++++++++--------- src/EnergyPlus/DataSurfaces.hh | 85 +- src/EnergyPlus/ElectricBaseboardRadiator.cc | 2 +- src/EnergyPlus/HWBaseboardRadiator.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 131 +-- src/EnergyPlus/HighTempRadiantSystem.cc | 2 +- src/EnergyPlus/LowTempRadiantSystem.cc | 10 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 3 +- src/EnergyPlus/SurfaceGeometry.cc | 68 +- src/EnergyPlus/VentilatedSlab.cc | 4 +- .../unit/ConvectionCoefficients.unit.cc | 60 +- .../unit/HighTempRadiantSystem.unit.cc | 2 + .../unit/LowTempRadiantSystem.unit.cc | 4 + tst/EnergyPlus/unit/OutputReports.unit.cc | 5 - tst/EnergyPlus/unit/WindowManager.unit.cc | 6 - 16 files changed, 648 insertions(+), 594 deletions(-) diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index c8d1c8900d2..0e98db7a32f 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -612,7 +612,7 @@ void GetCoolingPanelInput(EnergyPlusData &state) ThisCP.TotSurfToDistrib = MinFraction; } if (ThisCP.SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(ThisCP.SurfacePtr(SurfNum)).IntConvSurfGetsRadiantHeat = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(ThisCP.SurfacePtr(SurfNum)) = true; } AllFracsSummed += ThisCP.FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index aacdc20731f..0baa3648afa 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -3268,8 +3268,8 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); } - Surface(SurfNum).OutConvHfModelEq = HcExt_UserValue; // reporting - Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserValue; // reporting + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { HExt = GetCurrentScheduleValue(state, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity @@ -3277,14 +3277,14 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); } - Surface(SurfNum).OutConvHfModelEq = HcExt_UserSchedule; // reporting - Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserSchedule; // reporting + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedOutsideHcModel( state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).UserCurveIndex, HExt); // Kiva convection handled in function above - Surface(SurfNum).OutConvHfModelEq = HcExt_UserCurve; // reporting - Surface(SurfNum).OutConvHnModelEq = HcExt_None; // reporting + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserCurve; // reporting + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { EvaluateExtHcModels(state, SurfNum, @@ -3292,8 +3292,8 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, HExt); // Kiva convection handled in function above - Surface(SurfNum).OutConvHfModelEq = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting - Surface(SurfNum).OutConvHnModelEq = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting } else { assert(false); } @@ -3337,23 +3337,23 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } - Surface(SurfNum).IntConvHcModelEq = HcInt_UserValue; // reporting + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { HInt = GetCurrentScheduleValue(state, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } - Surface(SurfNum).IntConvHcModelEq = HcInt_UserSchedule; // reporting + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserSchedule; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedInsideHcModel( state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).UserCurveIndex, HInt); // Kiva convection handled in function above - Surface(SurfNum).IntConvHcModelEq = HcInt_UserCurve; // reporting + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserCurve; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { EvaluateIntHcModels(state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq, HInt); // Kiva convection handled in function above - Surface(SurfNum).IntConvHcModelEq = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; } else { assert(false); } @@ -3621,10 +3621,10 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) // second pass thru zone surfs to fill data for (int SurfLoop = Zone(ZoneLoop).HTSurfaceFirst; SurfLoop <= Zone(ZoneLoop).HTSurfaceLast; ++SurfLoop) { // now fill values - Surface(SurfLoop).IntConvZoneWallHeight = Zone(ZoneLoop).CeilingHeight; - Surface(SurfLoop).IntConvZonePerimLength = PerimExtLengthSum; - Surface(SurfLoop).IntConvZoneHorizHydrDiam = thisZoneHorizHydralicDiameter; - Surface(SurfLoop).IntConvWindowWallRatio = thisWWR; + state.dataSurface->SurfIntConvZoneWallHeight(SurfLoop) = Zone(ZoneLoop).CeilingHeight; + state.dataSurface->SurfIntConvZonePerimLength(SurfLoop) = PerimExtLengthSum; + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfLoop) = thisZoneHorizHydralicDiameter; + state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop) = thisWWR; } // 2nd pass over surfaces. // third pass for window locations @@ -3632,30 +3632,30 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) for (int SurfLoop = Zone(ZoneLoop).HTSurfaceFirst; SurfLoop <= Zone(ZoneLoop).HTSurfaceLast; ++SurfLoop) { if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) && ((Surface(SurfLoop).Class == SurfaceClass::Window) || (Surface(SurfLoop).Class == SurfaceClass::GlassDoor))) { - if (Surface(SurfLoop).IntConvWindowWallRatio < 0.5) { + if (state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop) < 0.5) { if (Surface(SurfLoop).Centroid.z < Zone(ZoneLoop).Centroid.z) { - Surface(SurfLoop).IntConvWindowLocation = InConvWinLoc_LowerPartOfExteriorWall; + state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = InConvWinLoc_LowerPartOfExteriorWall; } else { - Surface(SurfLoop).IntConvWindowLocation = InConvWinLoc_UpperPartOfExteriorWall; + state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = InConvWinLoc_UpperPartOfExteriorWall; } } else { - Surface(SurfLoop).IntConvWindowLocation = InConvWinLoc_LargePartOfExteriorWall; + state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = InConvWinLoc_LargePartOfExteriorWall; } if ((Surface(Surface(SurfLoop).BaseSurf).ExtBoundCond == ExternalEnvironment) && (Surface(Surface(SurfLoop).BaseSurf).Class == SurfaceClass::Wall)) { if (Surface(Surface(SurfLoop).BaseSurf).Centroid.z < Surface(SurfLoop).Centroid.z) { - Surface(Surface(SurfLoop).BaseSurf).IntConvWindowLocation = InConvWinLoc_WindowAboveThis; + state.dataSurface->SurfIntConvWindowLocation(Surface(SurfLoop).BaseSurf) = InConvWinLoc_WindowAboveThis; } else { - Surface(Surface(SurfLoop).BaseSurf).IntConvWindowLocation = InConvWinLoc_WindowBelowThis; + state.dataSurface->SurfIntConvWindowLocation(Surface(SurfLoop).BaseSurf) = InConvWinLoc_WindowBelowThis; } } } if ((Surface(SurfLoop).ExtBoundCond == ExternalEnvironment) && (Surface(SurfLoop).Class == SurfaceClass::Wall) && - (Surface(SurfLoop).IntConvWindowLocation == InConvWinLoc_NotSet)) { + (state.dataSurface->SurfIntConvWindowLocation(SurfLoop) == InConvWinLoc_NotSet)) { if (Surface(SurfLoop).Centroid.z < Zone(ZoneLoop).Centroid.z) { - Surface(SurfLoop).IntConvWindowLocation = InConvWinLoc_WindowAboveThis; + state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = InConvWinLoc_WindowAboveThis; } else { - Surface(SurfLoop).IntConvWindowLocation = InConvWinLoc_WindowBelowThis; + state.dataSurface->SurfIntConvWindowLocation(SurfLoop) = InConvWinLoc_WindowBelowThis; } } } // third pass over surfaces @@ -4014,46 +4014,46 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) if ((Surface(SurfLoop).Tilt >= 45.0) && (Surface(SurfLoop).Tilt < 135.0)) { // treat as vertical wall if ((thisAzimuth >= NorthFacade.AzimuthRangeLow) || (thisAzimuth < NorthFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(NorthFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(NorthFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(NorthFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthFacade.Height, z_del); } else if ((thisAzimuth >= NorthEastFacade.AzimuthRangeLow) && (thisAzimuth < NorthEastFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(NorthEastFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(NorthEastFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(NorthEastFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthEastFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthEastFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthEastFacade.Height, z_del); } else if ((thisAzimuth >= EastFacade.AzimuthRangeLow) && (thisAzimuth < EastFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(EastFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(EastFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(EastFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(EastFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(EastFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(EastFacade.Height, z_del); } else if ((thisAzimuth >= SouthEastFacade.AzimuthRangeLow) && (thisAzimuth < SouthEastFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(SouthEastFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(SouthEastFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(SouthEastFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthEastFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthEastFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthEastFacade.Height, z_del); } else if ((thisAzimuth >= SouthFacade.AzimuthRangeLow) && (thisAzimuth < SouthFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(SouthFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(SouthFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(SouthFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthFacade.Height, z_del); } else if ((thisAzimuth >= SouthWestFacade.AzimuthRangeLow) && (thisAzimuth < SouthWestFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(SouthWestFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(SouthWestFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(SouthWestFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(SouthWestFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(SouthWestFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(SouthWestFacade.Height, z_del); } else if ((thisAzimuth >= WestFacade.AzimuthRangeLow) && (thisAzimuth < WestFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(WestFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(WestFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(WestFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(WestFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(WestFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(WestFacade.Height, z_del); } else if ((thisAzimuth >= NorthWestFacade.AzimuthRangeLow) && (thisAzimuth < NorthWestFacade.AzimuthRangeHi)) { - Surface(SurfLoop).OutConvFaceArea = max(NorthWestFacade.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(NorthWestFacade.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(NorthWestFacade.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(NorthWestFacade.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(NorthWestFacade.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(NorthWestFacade.Height, z_del); } } else if (Surface(SurfLoop).Tilt < 45.0) { // assume part of roof - Surface(SurfLoop).OutConvFaceArea = max(state.dataConvectionCoefficient->RoofGeo.Area, Surface(SurfLoop).GrossArea); - Surface(SurfLoop).OutConvFacePerimeter = max(state.dataConvectionCoefficient->RoofGeo.Perimeter, Surface(SurfLoop).Perimeter); - Surface(SurfLoop).OutConvFaceHeight = max(state.dataConvectionCoefficient->RoofGeo.Height, z_del); + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Area, Surface(SurfLoop).GrossArea); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Height, z_del); } else if (Surface(SurfLoop).Tilt >= 135.0) { // assume floor over exterior, just use surface's geometry - Surface(SurfLoop).OutConvFaceArea = Surface(SurfLoop).GrossArea; - Surface(SurfLoop).OutConvFacePerimeter = Surface(SurfLoop).Perimeter; - Surface(SurfLoop).OutConvFaceHeight = z_del; + state.dataSurface->SurfOutConvFaceArea(SurfLoop) = Surface(SurfLoop).GrossArea; + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = Surface(SurfLoop).Perimeter; + state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = z_del; } } // second pass thru surfs for outside face convection params. @@ -4067,12 +4067,12 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) print(state.files.eio, Format_900); // header for (int SurfLoop : state.dataSurface->AllSurfaceListReportOrder) { if (!Surface(SurfLoop).HeatTransSurf) continue; - if (Surface(SurfLoop).IntConvSurfGetsRadiantHeat) { + if (state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfLoop)) { YesNo1 = "Yes"; } else { YesNo1 = "No"; } - if (Surface(SurfLoop).IntConvSurfHasActiveInIt) { + if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) { YesNo2 = "Yes"; } else { YesNo2 = "No"; @@ -4082,15 +4082,15 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) Format_901, Surface(SurfLoop).Name, state.dataSurface->SurfExtConvCoeff(SurfLoop), - Surface(SurfLoop).OutConvFaceArea, - Surface(SurfLoop).OutConvFacePerimeter, - Surface(SurfLoop).OutConvFaceHeight, + state.dataSurface->SurfOutConvFaceArea(SurfLoop), + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop), + state.dataSurface->SurfOutConvFaceHeight(SurfLoop), state.dataSurface->SurfIntConvCoeff(SurfLoop), - Surface(SurfLoop).IntConvZoneWallHeight, - Surface(SurfLoop).IntConvZonePerimLength, - Surface(SurfLoop).IntConvZoneHorizHydrDiam, - Surface(SurfLoop).IntConvWindowWallRatio, - Surface(SurfLoop).IntConvWindowLocation, + state.dataSurface->SurfIntConvZoneWallHeight(SurfLoop), + state.dataSurface->SurfIntConvZonePerimLength(SurfLoop), + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfLoop), + state.dataSurface->SurfIntConvWindowWallRatio(SurfLoop), + state.dataSurface->SurfIntConvWindowLocation(SurfLoop), YesNo1, YesNo2); @@ -4304,7 +4304,7 @@ void SetupAdaptiveConvectionRadiantSurfaceData(EnergyPlusData &state) state.dataConvectionCoefficient->ActiveFloorArea = 0.0; for (SurfLoop = Zone(ZoneLoop).HTSurfaceFirst; SurfLoop <= Zone(ZoneLoop).HTSurfaceLast; ++SurfLoop) { - if (!Surface(SurfLoop).IntConvSurfHasActiveInIt) continue; + if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue; if (Surface(SurfLoop).Class == SurfaceClass::Wall || Surface(SurfLoop).Class == SurfaceClass::Door) { ++state.dataConvectionCoefficient->ActiveWallCount; state.dataConvectionCoefficient->ActiveWallArea += Surface(SurfLoop).Area; @@ -4356,7 +4356,7 @@ void ManageInsideAdaptiveConvectionAlgo(EnergyPlusData &state, int const SurfNum // simple worker routine takes surface classification and fills in model to use (IntConvHcModelEq) for that surface MapIntConvClassificationToHcModels(state, SurfNum); - EvaluateIntHcModels(state, SurfNum, state.dataSurface->Surface(SurfNum).IntConvHcModelEq, state.dataHeatBal->HConvIn(SurfNum)); + EvaluateIntHcModels(state, SurfNum, state.dataSurface->SurfIntConvHcModelEq(SurfNum), state.dataHeatBal->HConvIn(SurfNum)); // if ( std::isnan( HConvIn( SurfNum ) ) ) { // Use IEEE_IS_NAN when GFortran supports it //// throw Error // ShowSevereError(state, "Inside convection coefficient is out of bound = " + Surface( SurfNum ).Name ); @@ -4383,13 +4383,11 @@ void ManageOutsideAdaptiveConvectionAlgo(EnergyPlusData &state, // This routine implements an adaptive structure and classification system for outdoor // It calls a series of separable worker routines - auto &Surface(state.dataSurface->Surface); - DynamicExtConvSurfaceClassification(state, SurfNum); MapExtConvClassificationToHcModels(state, SurfNum); - EvaluateExtHcModels(state, SurfNum, Surface(SurfNum).OutConvHnModelEq, Surface(SurfNum).OutConvHfModelEq, Hc); + EvaluateExtHcModels(state, SurfNum, state.dataSurface->SurfOutConvHnModelEq(SurfNum), state.dataSurface->SurfOutConvHfModelEq(SurfNum), Hc); } void EvaluateIntHcModels(EnergyPlusData &state, @@ -4430,7 +4428,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, auto const SELECT_CASE_var(ConvModelEquationNum); if (SELECT_CASE_var == HcInt_UserCurve) { - CalcUserDefinedInsideHcModel(state, SurfNum, Surface(SurfNum).IntConvHcUserCurveIndex, tmpHc); + CalcUserDefinedInsideHcModel(state, SurfNum, state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum), tmpHc); } else if (SELECT_CASE_var == HcInt_ASHRAEVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); }; @@ -4518,29 +4516,32 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondStableHorizontal) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, Surface(SurfNum).IntConvZoneHorizHydrDiam); + return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, SurfNum); + tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + Real64 WallHeight = state.dataSurface->SurfIntConvZoneWallHeight(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, Surface(SurfNum).IntConvZoneWallHeight); + return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, WallHeight); }; } else { - tmpHc = CalcAlamdariHammondVerticalWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, SurfNum); + tmpHc = CalcAlamdariHammondVerticalWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), SurfNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondUnstableHorizontal) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, Surface(SurfNum).IntConvZoneHorizHydrDiam); + return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, SurfNum); + tmpHc = CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq3WallAwayFromHeat) { @@ -4580,110 +4581,113 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AwbiHattonHeatedFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAwbiHattonHeatedFloor(Tsurf - Tamb, Surface(SurfNum).IntConvZoneHorizHydrDiam); + return CalcAwbiHattonHeatedFloor(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAwbiHattonHeatedFloor((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam); + tmpHc = CalcAwbiHattonHeatedFloor((Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum)); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AwbiHattonHeatedWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + Real64 HorizHydrDiam = state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAwbiHattonHeatedWall(Tsurf - Tamb, Surface(SurfNum).IntConvZoneHorizHydrDiam); + return CalcAwbiHattonHeatedWall(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAwbiHattonHeatedWall((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam); + tmpHc = CalcAwbiHattonHeatedWall((Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum)); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedAssistingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedAssistedWall(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneWallHeight, + state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedOppossingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedOpposingWall(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneWallHeight, + state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedStableCeiling(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { tmpHc = - CalcBeausoleilMorrisonMixedStableCeiling(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); + CalcBeausoleilMorrisonMixedStableCeiling(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedUnstableCeiling(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { tmpHc = CalcBeausoleilMorrisonMixedUnstableCeiling( - state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedStableFloor(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { tmpHc = - CalcBeausoleilMorrisonMixedStableFloor(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); + CalcBeausoleilMorrisonMixedStableFloor(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableFloor) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedUnstableFloor(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurf, CalcZoneSupplyAirTemp(state, ZoneNum), CalcZoneSystemACH(state, ZoneNum)); }; } else { tmpHc = - CalcBeausoleilMorrisonMixedUnstableFloor(state, (Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); + CalcBeausoleilMorrisonMixedUnstableFloor(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FohannoPolidoriVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { Real64 QdotConvection = -state.dataHeatBalSurf->QdotConvInRepPerArea(SurfNum); + Real64 WallHeight = state.dataSurface->SurfIntConvZoneWallHeight(SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcFohannoPolidoriVerticalWall(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneWallHeight, + WallHeight, Tsurf - DataGlobalConstants::KelvinConv, // Kiva already uses Kelvin, but algorithm expects C QdotConvection); @@ -4691,7 +4695,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } else { tmpHc = CallCalcFohannoPolidoriVerticalWall(state, (Tsurface - Tzone), - Surface(SurfNum).IntConvZoneWallHeight, + state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, -state.dataHeatBalSurf->QdotConvInRepPerArea(SurfNum), SurfNum); @@ -4710,7 +4714,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWindow) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow( - Surface(SurfNum).IntConvZonePerimLength, Surface(SurfNum).IntConvWindowWallRatio, Surface(SurfNum).IntConvWindowLocation, ZoneNum); + state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowWallRatio(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } @@ -4722,7 +4726,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWalls) { tmpHc = - CalcGoldsteinNovoselacCeilingDiffuserWall(Surface(SurfNum).IntConvZonePerimLength, Surface(SurfNum).IntConvWindowLocation, ZoneNum); + CalcGoldsteinNovoselacCeilingDiffuserWall(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } @@ -4733,7 +4737,7 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserFloor) { - tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(Surface(SurfNum).IntConvZonePerimLength, ZoneNum); + tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } @@ -4790,7 +4794,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat Hn = 0.0; HnFn = KIVA_CONST_CONV(0.0); } else if (SELECT_CASE_var == HcExt_UserCurve) { - CalcUserDefinedOutsideHcModel(state, SurfNum, Surface(SurfNum).OutConvHnUserCurveIndex, Hn); + CalcUserDefinedOutsideHcModel(state, SurfNum, state.dataSurface->SurfOutConvHnUserCurveIndex(SurfNum), Hn); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=, &state](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double { // Remove Hfterm since this is only used for the natural convection portion @@ -4813,11 +4817,11 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat return CalcWaltonStableHorizontalOrTilt(Tsurf - Tamb, cosTilt); }; } else if (SELECT_CASE_var == HcExt_AlamdariHammondVerticalWall) { - + Real64 FaceHeight = state.dataSurface->SurfOutConvFaceHeight(SurfNum); Hn = CalcAlamdariHammondVerticalWall( - state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), Surface(SurfNum).OutConvFaceHeight, SurfNum); + state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), FaceHeight, SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, Surface(SurfNum).OutConvFaceHeight); + return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, FaceHeight); }; } else if (SELECT_CASE_var == HcExt_FohannoPolidoriVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { @@ -4826,22 +4830,22 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } Hn = CallCalcFohannoPolidoriVerticalWall(state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), - Surface(SurfNum).OutConvFaceHeight, + state.dataSurface->SurfOutConvFaceHeight(SurfNum), TH(1, 1, SurfNum), -QdotConvOutRepPerArea(SurfNum), SurfNum); } else if (SELECT_CASE_var == HcExt_AlamdariHammondStableHorizontal) { - if (Surface(SurfNum).OutConvFacePerimeter > 0.0) { - HydraulicDiameter = 4.0 * Surface(SurfNum).OutConvFaceArea / Surface(SurfNum).OutConvFacePerimeter; + if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) { + HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum); } else { - HydraulicDiameter = std::sqrt(Surface(SurfNum).OutConvFaceArea); + HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } Hn = CalcAlamdariHammondStableHorizontal(state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), HydraulicDiameter, SurfNum); } else if (SELECT_CASE_var == HcExt_AlamdariHammondUnstableHorizontal) { - if (Surface(SurfNum).OutConvFacePerimeter > 0.0) { - HydraulicDiameter = 4.0 * Surface(SurfNum).OutConvFaceArea / Surface(SurfNum).OutConvFacePerimeter; + if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) { + HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum); } else { - HydraulicDiameter = std::sqrt(Surface(SurfNum).OutConvFaceArea); + HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } Hn = CalcAlamdariHammondUnstableHorizontal(state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), HydraulicDiameter, SurfNum); } @@ -4866,14 +4870,14 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat HfTermFn = KIVA_HF_DEF; HfFn = KIVA_CONST_CONV(0.0); } else if (SELECT_CASE_var == HcExt_UserCurve) { - CalcUserDefinedOutsideHcModel(state, SurfNum, Surface(SurfNum).OutConvHfUserCurveIndex, Hf); + CalcUserDefinedOutsideHcModel(state, SurfNum, state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum), Hf); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HfTermFn = state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f; HnFn = state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out; } } else if (SELECT_CASE_var == HcExt_SparrowWindward) { Hf = CalcSparrowWindward( - state, Roughness, Surface(SurfNum).OutConvFacePerimeter, Surface(SurfNum).OutConvFaceArea, SurfWindSpeed, SurfNum); + state, Roughness, state.dataSurface->SurfOutConvFacePerimeter(SurfNum), state.dataSurface->SurfOutConvFaceArea(SurfNum), SurfWindSpeed, SurfNum); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). @@ -4898,7 +4902,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_SparrowLeeward) { Hf = - CalcSparrowLeeward(state, Roughness, Surface(SurfNum).OutConvFacePerimeter, Surface(SurfNum).OutConvFaceArea, SurfWindSpeed, SurfNum); + CalcSparrowLeeward(state, Roughness, state.dataSurface->SurfOutConvFacePerimeter(SurfNum), state.dataSurface->SurfOutConvFaceArea(SurfNum), SurfWindSpeed, SurfNum); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). const double area = 9999999.; @@ -4996,8 +5000,8 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat Surface(SurfNum).OutDryBulbTemp, SurfWindSpeed, SurfWindDir, - Surface(SurfNum).OutConvFaceArea, - Surface(SurfNum).OutConvFacePerimeter); + state.dataSurface->SurfOutConvFaceArea(SurfNum), + state.dataSurface->SurfOutConvFacePerimeter(SurfNum)); HfTermFn = [=](double, double, double, double windSpeed) -> double { return windSpeed; }; if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). @@ -5086,17 +5090,17 @@ void DynamicExtConvSurfaceClassification(EnergyPlusData &state, int const SurfNu } if (DeltaTemp < 0.0) { - Surface(SurfNum).OutConvClassification = OutConvClass_RoofStable; + state.dataSurface->SurfOutConvClassification(SurfNum) = OutConvClass_RoofStable; } else { - Surface(SurfNum).OutConvClassification = OutConvClass_RoofUnstable; + state.dataSurface->SurfOutConvClassification(SurfNum) = OutConvClass_RoofUnstable; } } else { if (Windward(Surface(SurfNum).CosTilt, Surface(SurfNum).Azimuth, surfWindDir)) { - Surface(SurfNum).OutConvClassification = OutConvClass_WindwardVertWall; + state.dataSurface->SurfOutConvClassification(SurfNum) = OutConvClass_WindwardVertWall; } else { - Surface(SurfNum).OutConvClassification = OutConvClass_LeewardVertWall; + state.dataSurface->SurfOutConvClassification(SurfNum) = OutConvClass_LeewardVertWall; } } } @@ -5109,61 +5113,58 @@ void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum // DATE WRITTEN Aug 2010 // MODIFIED na // RE-ENGINEERED na - - auto &Surface(state.dataSurface->Surface); - { - auto const SELECT_CASE_var(Surface(SurfNum).OutConvClassification); + auto const SELECT_CASE_var(state.dataSurface->SurfOutConvClassification(SurfNum)); if (SELECT_CASE_var == OutConvClass_WindwardVertWall) { - Surface(SurfNum).OutConvHfModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum; - if (Surface(SurfNum).OutConvHfModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum; + if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardUserCurveNum; } - Surface(SurfNum).OutConvHnModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum; - if (Surface(SurfNum).OutConvHnModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHnUserCurveIndex = + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum; + if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHnUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallUserCurveNum; } } else if (SELECT_CASE_var == OutConvClass_LeewardVertWall) { - Surface(SurfNum).OutConvHfModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum; - if (Surface(SurfNum).OutConvHfModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum; + if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardUserCurveNum; } - Surface(SurfNum).OutConvHnModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum; - if (Surface(SurfNum).OutConvHnModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallEqNum; + if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallUserCurveNum; } } else if (SELECT_CASE_var == OutConvClass_RoofStable) { - Surface(SurfNum).OutConvHfModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum; - if (Surface(SurfNum).OutConvHfModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum; + if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum; } - Surface(SurfNum).OutConvHnModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum; - if (Surface(SurfNum).OutConvHnModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum; + if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizUserCurveNum; } } else if (SELECT_CASE_var == OutConvClass_RoofUnstable) { - Surface(SurfNum).OutConvHfModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum; - if (Surface(SurfNum).OutConvHfModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofEqNum; + if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum; } - Surface(SurfNum).OutConvHnModelEq = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; - if (Surface(SurfNum).OutConvHnModelEq == HcExt_UserCurve) { - Surface(SurfNum).OutConvHfUserCurveIndex = + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; + if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUstableHorizUserCurveNum; } } else { ShowSevereError(state, format("MapExtConvClassificationToHcModels: caught unknown outdoor surfce classification:{}", - Surface(SurfNum).OutConvClassification)); + state.dataSurface->SurfOutConvClassification(SurfNum))); } } } @@ -5340,7 +5341,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InFloorActiveElement) { for (SurfLoop = Zone(ZoneNum).HTSurfaceFirst; SurfLoop <= Zone(ZoneNum).HTSurfaceLast; ++SurfLoop) { - if (!Surface(SurfLoop).IntConvSurfHasActiveInIt) continue; + if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue; if (Surface(SurfLoop).Class == SurfaceClass::Floor) { DeltaTemp = TH(2, 1, SurfLoop) - state.dataHeatBalFanSys->MAT(ZoneNum); if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with floor @@ -5361,7 +5362,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InCeilingActiveElement) { for (SurfLoop = Zone(ZoneNum).HTSurfaceFirst; SurfLoop <= Zone(ZoneNum).HTSurfaceLast; ++SurfLoop) { - if (!Surface(SurfLoop).IntConvSurfHasActiveInIt) continue; + if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue; if (Surface(SurfLoop).Class == SurfaceClass::Roof) { DeltaTemp = TH(2, 1, SurfLoop) - state.dataHeatBalFanSys->MAT(ZoneNum); if (DeltaTemp < ActiveDelTempThreshold) { // assume cooling with ceiling @@ -5382,7 +5383,7 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).InWallActiveElement) { for (SurfLoop = Zone(ZoneNum).HTSurfaceFirst; SurfLoop <= Zone(ZoneNum).HTSurfaceLast; ++SurfLoop) { - if (!Surface(SurfLoop).IntConvSurfHasActiveInIt) continue; + if (!state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfLoop)) continue; if (Surface(SurfLoop).Class == SurfaceClass::Wall || Surface(SurfLoop).Class == SurfaceClass::Door) { DeltaTemp = TH(2, 1, SurfLoop) - state.dataHeatBalFanSys->MAT(ZoneNum); if (DeltaTemp > ActiveDelTempThreshold) { // assume heating with wall panel @@ -5484,75 +5485,75 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (Surface(SurfNum).Class == SurfaceClass::Wall || Surface(SurfNum).Class == SurfaceClass::Door) { if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A1_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_VertWalls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableTilted; } } else if (Surface(SurfNum).Tilt <= 85.0) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { - if (Surface(SurfNum).IntConvSurfHasActiveInIt) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_ChilledCeil; + if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) { + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_ChilledCeil; } else if (Surface(SurfNum).Tilt < 5.0) { if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableHoriz; } } else if ((Surface(SurfNum).Tilt >= 5.0) && ((Surface(SurfNum).Tilt < 95.0))) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableTilted; } } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A1_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_VertWalls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { - if (Surface(SurfNum).IntConvSurfHasActiveInIt) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_HeatedFloor; + if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) { + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_HeatedFloor; } else if (Surface(SurfNum).Tilt > 175.0) { // floor if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableHoriz; } } else if ((Surface(SurfNum).Tilt <= 175.0) && (Surface(SurfNum).Tilt >= 95.0)) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableTilted; } } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { // assume horizontal upwards. if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A1_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A1_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A1_StableHoriz; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for A1 surface named" + Surface(SurfNum).Name); } @@ -5561,74 +5562,74 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu DeltaTemp = TH(2, 1, SurfNum) - state.dataHeatBalFanSys->MAT(ZoneNum); if (Surface(SurfNum).Class == SurfaceClass::Wall || Surface(SurfNum).Class == SurfaceClass::Door) { - if (Surface(SurfNum).IntConvSurfHasActiveInIt) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_HeatedVerticalWall; + if (state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum)) { + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_HeatedVerticalWall; } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A2_VertWallsNonHeated; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_VertWallsNonHeated; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableTilted; } } else if (Surface(SurfNum).Tilt <= 85.0) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { if (Surface(SurfNum).Tilt < 5.0) { if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableHoriz; } } else if ((Surface(SurfNum).Tilt >= 5.0) && ((Surface(SurfNum).Tilt < 95.0))) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableTilted; } } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A2_VertWallsNonHeated; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_VertWallsNonHeated; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { if (Surface(SurfNum).Tilt > 175.0) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableHoriz; } } else if ((Surface(SurfNum).Tilt <= 175.0) && (Surface(SurfNum).Tilt >= 95.0)) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableTilted; } } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { // assume horizontal upwards. if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A2_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A2_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A2_StableHoriz; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for A2 surface named" + Surface(SurfNum).Name); } @@ -5637,71 +5638,71 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (Surface(SurfNum).Class == SurfaceClass::Wall || Surface(SurfNum).Class == SurfaceClass::Door) { if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A3_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_VertWalls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableTilted; } } else if (Surface(SurfNum).Tilt <= 85.0) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { if (Surface(SurfNum).Tilt < 5.0) { if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableHoriz; } } else if ((Surface(SurfNum).Tilt > 5.0) && ((Surface(SurfNum).Tilt < 85.0))) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableTilted; } } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_A3_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_VertWalls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { if (Surface(SurfNum).Tilt > 175.0) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableHoriz; } } else if ((Surface(SurfNum).Tilt <= 175.0) && (Surface(SurfNum).Tilt >= 95.0)) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableTilted; } } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { // assume horizontal upwards. if (DeltaTemp >= 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_A3_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_A3_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_A3_StableHoriz; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for A3 surface named" + Surface(SurfNum).Name); } @@ -5710,96 +5711,96 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (Surface(SurfNum).Class == SurfaceClass::Wall || Surface(SurfNum).Class == SurfaceClass::Door) { if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - if (Surface(SurfNum).IntConvSurfGetsRadiantHeat) { - Surface(SurfNum).IntConvClassification = InConvClass_B_VertWallsNearHeat; + if (state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfNum)) { + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_VertWallsNearHeat; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_VertWalls; } } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableTilted; } } else if (Surface(SurfNum).Tilt <= 85.0) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { if (Surface(SurfNum).Tilt < 5.0) { if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableHoriz; } } else if ((Surface(SurfNum).Tilt >= 5.0) && ((Surface(SurfNum).Tilt < 85.0))) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableTilted; } } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - if (Surface(SurfNum).IntConvSurfGetsRadiantHeat) { - Surface(SurfNum).IntConvClassification = InConvClass_B_VertWallsNearHeat; + if (state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfNum)) { + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_VertWallsNearHeat; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_VertWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_VertWalls; } } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { if (Surface(SurfNum).Tilt > 175.0) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableHoriz; } } else if ((Surface(SurfNum).Tilt <= 175.0) && (Surface(SurfNum).Tilt >= 95.0)) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableTilted; } } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_B_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { // assume horizontal upwards. if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_B_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_B_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_B_StableHoriz; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for B surface named" + Surface(SurfNum).Name); } } else if (SELECT_CASE_var == InConvFlowRegime_C) { if (Surface(SurfNum).Class == SurfaceClass::Wall || Surface(SurfNum).Class == SurfaceClass::Door) { - Surface(SurfNum).IntConvClassification = InConvClass_C_Walls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_C_Walls; } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { - Surface(SurfNum).IntConvClassification = InConvClass_C_Ceiling; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_C_Ceiling; } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { - Surface(SurfNum).IntConvClassification = InConvClass_C_Floor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_C_Floor; } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_C_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_C_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { - Surface(SurfNum).IntConvClassification = InConvClass_C_Floor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_C_Floor; } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for C surface named" + Surface(SurfNum).Name); } @@ -5810,74 +5811,74 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_D_Walls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_Walls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableTilted; } } else if (Surface(SurfNum).Tilt <= 85.0) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { if (Surface(SurfNum).Tilt < 5.0) { if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableHoriz; } } else if ((Surface(SurfNum).Tilt >= 5.0) && ((Surface(SurfNum).Tilt <= 85.0))) { // tilted downwards if (DeltaTemp < 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableTilted; } } else if ((Surface(SurfNum).Tilt > 85.0) && (Surface(SurfNum).Tilt < 95.0)) { // vertical wall - Surface(SurfNum).IntConvClassification = InConvClass_D_Walls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_Walls; } else if (Surface(SurfNum).Tilt >= 95.0) { // tilted upwards if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableTilted; } } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { if (Surface(SurfNum).Tilt > 175.0) { // floor if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableHoriz; } } else if ((Surface(SurfNum).Tilt <= 175.0) && (Surface(SurfNum).Tilt >= 95.0)) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableTilted; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableTilted; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableTilted; } } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_D_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { // assume horizontal upwards. if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_D_UnstableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_UnstableHoriz; } else { - Surface(SurfNum).IntConvClassification = InConvClass_D_StableHoriz; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_D_StableHoriz; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for D surface named" + Surface(SurfNum).Name); } @@ -5893,43 +5894,43 @@ void DynamicIntConvSurfaceClassification(EnergyPlusData &state, int const SurfNu if (SELECT_CASE_var1 == InConvFlowRegime_C) { // assume forced flow is down along wall (ceiling diffuser) if (DeltaTemp > 0.0) { // surface is hotter so plume upwards and forces oppose - Surface(SurfNum).IntConvClassification = InConvClass_E_OpposFlowWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_OpposFlowWalls; } else { // surface is cooler so plume down and forces assist - Surface(SurfNum).IntConvClassification = InConvClass_E_AssistFlowWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_AssistFlowWalls; } } else if (SELECT_CASE_var1 == InConvFlowRegime_D) { // assume forced flow is upward along wall (perimeter zone HVAC with fan) if (DeltaTemp > 0.0) { // surface is hotter so plume up and forces assist - Surface(SurfNum).IntConvClassification = InConvClass_E_AssistFlowWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_AssistFlowWalls; } else { // surface is cooler so plume downward and forces oppose - Surface(SurfNum).IntConvClassification = InConvClass_E_OpposFlowWalls; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_OpposFlowWalls; } } } } else if (Surface(SurfNum).Class == SurfaceClass::Roof) { if (DeltaTemp > 0.0) { // surface is hotter so stable - Surface(SurfNum).IntConvClassification = InConvClass_E_StableCeiling; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_StableCeiling; } else { - Surface(SurfNum).IntConvClassification = InConvClass_E_UnstableCieling; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_UnstableCieling; } } else if (Surface(SurfNum).Class == SurfaceClass::Floor) { if (DeltaTemp > 0.0) { // surface is hotter so unstable - Surface(SurfNum).IntConvClassification = InConvClass_E_UnstableFloor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_UnstableFloor; } else { - Surface(SurfNum).IntConvClassification = InConvClass_E_StableFloor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_StableFloor; } } else if ((Surface(SurfNum).Class == SurfaceClass::Window) || (Surface(SurfNum).Class == SurfaceClass::GlassDoor) || (Surface(SurfNum).Class == SurfaceClass::TDD_Diffuser)) { - Surface(SurfNum).IntConvClassification = InConvClass_E_Windows; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_Windows; } else if (Surface(SurfNum).Class == SurfaceClass::IntMass) { if (DeltaTemp > 0.0) { - Surface(SurfNum).IntConvClassification = InConvClass_E_UnstableFloor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_UnstableFloor; } else { - Surface(SurfNum).IntConvClassification = InConvClass_E_StableFloor; + state.dataSurface->SurfIntConvClassification(SurfNum) = InConvClass_E_StableFloor; } } - if (Surface(SurfNum).IntConvClassification == 0) { + if (state.dataSurface->SurfIntConvClassification(SurfNum) == 0) { ShowSevereError(state, "DynamicIntConvSurfaceClassification: failed to resolve Hc model for D surface named " + Surface(SurfNum).Name); } @@ -5956,308 +5957,305 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum // Long case statement depends on surface classification determined in DynamicIntConvSurfaceClassification // then simply map data stored in InsideFaceAdaptiveConvectionAlgo into the surface's structure // if model type is user-defined, also store the index to the user curve to be used. - - auto &Surface(state.dataSurface->Surface); - { - auto const SELECT_CASE_var(Surface(SurfNum).IntConvClassification); + auto const SELECT_CASE_var(state.dataSurface->SurfIntConvClassification(SurfNum)); if (SELECT_CASE_var == InConvClass_A1_VertWalls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_StableHoriz) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_UnstableHoriz) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_HeatedFloor) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolHeatedFloorEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolHeatedFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_ChilledCeil) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolChilledCeilingEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolChilledCeilingUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_StableTilted) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_UnstableTilted) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_VertWallsNonHeated) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_HeatedVerticalWall) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_StableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_UnstableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_StableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_UnstableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_VertWalls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_StableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_UnstableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_StableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_UnstableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_VertWalls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_VertWallsNearHeat) { - Surface(SurfNum).IntConvHcModelEq = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_StableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_UnstableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_StableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_UnstableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_C_Walls) { - if ((Surface(SurfNum).IntConvZonePerimLength == 0.0) && + if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) && (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum == HcInt_GoldsteinNovoselacCeilingDiffuserWalls)) { // no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model - Surface(SurfNum).IntConvHcModelEq = HcInt_FisherPedersenCeilDiffuserWalls; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_FisherPedersenCeilDiffuserWalls; } else { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum; } - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_C_Ceiling) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_C_Floor) { - if ((Surface(SurfNum).IntConvZonePerimLength == 0.0) && + if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) && (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum == HcInt_GoldsteinNovoselacCeilingDiffuserFloor)) { // no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model - Surface(SurfNum).IntConvHcModelEq = HcInt_FisherPedersenCeilDiffuserFloor; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_FisherPedersenCeilDiffuserFloor; } else { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum; } - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_C_Windows) { - if ((Surface(SurfNum).IntConvZonePerimLength == 0.0) && + if ((state.dataSurface->SurfIntConvZonePerimLength(SurfNum) == 0.0) && (state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum == HcInt_GoldsteinNovoselacCeilingDiffuserWindow)) { // no perimeter, Goldstein Novolselac model not good so revert to ISO15099 - Surface(SurfNum).IntConvHcModelEq = HcInt_ISO15099Windows; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_ISO15099Windows; } else { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum; } - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_Walls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_StableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_UnstableHoriz) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_StableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_UnstableTilted) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_AssistFlowWalls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_OpposFlowWalls) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_StableFloor) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_UnstableFloor) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_StableCeiling) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_UnstableCieling) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_Windows) { - Surface(SurfNum).IntConvHcModelEq = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsEqNum; - if (Surface(SurfNum).IntConvHcModelEq == HcInt_UserCurve) { - Surface(SurfNum).IntConvHcUserCurveIndex = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsUserCurveNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsEqNum; + if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsUserCurveNum; } } } @@ -6362,9 +6360,9 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int HcFnTempDiffDivHeight = CurveValue(state, UserCurve.HcFnTempDiffDivHeightCurveNum, - (std::abs(state.dataHeatBalSurf->TH(2, 1, SurfNum) - tmpAirTemp) / Surface(SurfNum).IntConvZoneWallHeight)); + (std::abs(state.dataHeatBalSurf->TH(2, 1, SurfNum) - tmpAirTemp) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum))); HcFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { - return CurveValue(state, UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / Surface(SurfNum).IntConvZoneWallHeight); + return CurveValue(state, UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum)); }; } @@ -6373,7 +6371,7 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int } if (UserCurve.HcFnACHDivPerimLengthCurveNum > 0) { - HcFnACHDivPerimLength = CurveValue(state, UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / Surface(SurfNum).IntConvZonePerimLength)); + HcFnACHDivPerimLength = CurveValue(state, UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / state.dataSurface->SurfIntConvZonePerimLength(SurfNum))); } if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { @@ -6455,13 +6453,13 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int } if (UserCurve.HnFnTempDiffDivHeightCurveNum > 0) { - if (Surface(SurfNum).OutConvFaceHeight > 0.0) { + if (state.dataSurface->SurfOutConvFaceHeight(SurfNum) > 0.0) { HnFnTempDiffDivHeight = CurveValue( state, UserCurve.HnFnTempDiffDivHeightCurveNum, - ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)) / Surface(SurfNum).OutConvFaceHeight)); + ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); HnFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { - return CurveValue(state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / Surface(SurfNum).OutConvFaceHeight)); + return CurveValue(state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); }; } } diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 1f40ea91abd..7f985da73bf 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -670,36 +670,9 @@ namespace DataSurfaces { Real64 OutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) Real64 WindSpeed; // Surface outside wind speed, for surface heat balance (m/s) Real64 WindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) - -// bool ExtEcoRoof; // True if the top outside construction material is of type Eco Roof -// bool ExtCavityPresent; // true if there is an exterior vented cavity on surface -// int ExtCavNum; // index for this surface in ExtVentedCavity structure (if any) -// bool IsPV; // true if this is a photovoltaic surface (dxf output) -// bool IsICS; // true if this is an ICS collector -// bool IsPool; // true if this is a pool -// int ICSPtr; // Index to ICS collector // TH added 3/26/2010 bool MirroredSurf; // True if it is a mirrored surface - // additional attributes for convection correlations - int IntConvClassification; // current classification for inside face air flow regime and surface orientation - int IntConvHcModelEq; // current convection model for inside face - int IntConvHcUserCurveIndex; // current index to user convection model if used - int OutConvClassification; // current classification for outside face wind regime and convection orientation - int OutConvHfModelEq; // current convection model for forced convection at outside face - int OutConvHfUserCurveIndex; // current index to user forced convection model if used - int OutConvHnModelEq; // current Convection model for natural convection at outside face - int OutConvHnUserCurveIndex; // current index to user natural convection model if used - Real64 OutConvFaceArea; // area of larger building envelope facade that surface is a part of - Real64 OutConvFacePerimeter; // perimeter of larger building envelope facade that surface is a part of - Real64 OutConvFaceHeight; // height of larger building envelope facade that surface is a part of - Real64 IntConvZoneWallHeight; // [m] height of larger inside building wall element that surface is a part of - Real64 IntConvZonePerimLength; // [m] length of perimeter zone's exterior wall - Real64 IntConvZoneHorizHydrDiam; // [m] hydraulic diameter, usually 4 times the zone floor area div by perimeter - Real64 IntConvWindowWallRatio; // [-] area of windows over area of exterior wall for zone - int IntConvWindowLocation; // relative location of window in zone for interior Hc models - bool IntConvSurfGetsRadiantHeat; - bool IntConvSurfHasActiveInIt; bool IsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group // LG added 1/6/12 Real64 GenericContam; // [ppm] Surface generic contaminant as a storage term for @@ -730,11 +703,7 @@ namespace DataSurfaces { OutDryBulbTemp(0.0), OutWetBulbTemp(0.0),WindSpeed(0.0), WindDir(0.0), - MirroredSurf(false), IntConvClassification(0), IntConvHcModelEq(0), IntConvHcUserCurveIndex(0), - OutConvClassification(0), OutConvHfModelEq(0), OutConvHfUserCurveIndex(0), OutConvHnModelEq(0), OutConvHnUserCurveIndex(0), - OutConvFaceArea(0.0), OutConvFacePerimeter(0.0), OutConvFaceHeight(0.0), IntConvZoneWallHeight(0.0), IntConvZonePerimLength(0.0), - IntConvZoneHorizHydrDiam(0.0), IntConvWindowWallRatio(0.0), IntConvWindowLocation(InConvWinLoc_NotSet), - IntConvSurfGetsRadiantHeat(false), IntConvSurfHasActiveInIt(false), IsRadSurfOrVentSlabOrPool(false), GenericContam(0.0), + MirroredSurf(false), IsRadSurfOrVentSlabOrPool(false), GenericContam(0.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { } @@ -1341,10 +1310,7 @@ struct SurfacesData : BaseGlobalStruct // Surface Properties Array1D SurfLowTempErrCount; Array1D SurfHighTempErrCount; - Array1D SurfIntConvCoeff; // Interior Convection Coefficient pointer (different data structure) when being overridden - Array1D SurfExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) when being overridden Array1D SurfDaylightingShelfInd; // Pointer to daylighting shelf - Array1D SurfTAirRef; // Flag for reference air temperature Array1D SurfSchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported Array1D SurfExternalShadingSchInd; // Schedule for a the external shading Array1D SurfHasSurroundingSurfProperties; // true if surrounding surfaces properties are listed for an external surface @@ -1360,6 +1326,29 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIsPool; // true if this is a pool Array1D SurfICSPtr; // Index to ICS collector + // Surface ConvCoeff Properties + Array1D SurfTAirRef; // Flag for reference air temperature + Array1D SurfIntConvCoeff; // Interior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfIntConvClassification; // current classification for inside face air flow regime and surface orientation + Array1D SurfIntConvHcModelEq; // current convection model for inside face + Array1D SurfIntConvHcUserCurveIndex; // current index to user convection model if used + Array1D SurfOutConvClassification; // current classification for outside face wind regime and convection orientation + Array1D SurfOutConvHfModelEq; // current convection model for forced convection at outside face + Array1D SurfOutConvHfUserCurveIndex; // current index to user forced convection model if used + Array1D SurfOutConvHnModelEq; // current Convection model for natural convection at outside face + Array1D SurfOutConvHnUserCurveIndex; // current index to user natural convection model if used + Array1D SurfOutConvFaceArea; // area of larger building envelope facade that surface is a part of + Array1D SurfOutConvFacePerimeter; // perimeter of larger building envelope facade that surface is a part of + Array1D SurfOutConvFaceHeight; // height of larger building envelope facade that surface is a part of + Array1D SurfIntConvZoneWallHeight; // [m] height of larger inside building wall element that surface is a part of + Array1D SurfIntConvZonePerimLength; // [m] length of perimeter zone's exterior wall + Array1D SurfIntConvZoneHorizHydrDiam; // [m] hydraulic diameter, usually 4 times the zone floor area div by perimeter + Array1D SurfIntConvWindowWallRatio; // [-] area of windows over area of exterior wall for zone + Array1D SurfIntConvWindowLocation; // relative location of window in zone for interior Hc models + Array1D SurfIntConvSurfGetsRadiantHeat; + Array1D SurfIntConvSurfHasActiveInIt; + // Surface Shadow Properties Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction Array1D SurfShadowSurfRecSurfNum; // Receiving surface number @@ -1682,12 +1671,10 @@ struct SurfacesData : BaseGlobalStruct this->SurfLowTempErrCount.deallocate(); this->SurfHighTempErrCount.deallocate(); - this->SurfIntConvCoeff.deallocate(); - this->SurfExtConvCoeff.deallocate(); + this->SurfShadowSurfPossibleObstruction.deallocate(); this->SurfShadowSurfRecSurfNum.deallocate(); this->SurfDaylightingShelfInd.deallocate(); - this->SurfTAirRef.deallocate(); this->SurfSchedExternalShadingFrac.deallocate(); this->SurfExternalShadingSchInd.deallocate(); this->SurfHasSurroundingSurfProperties.deallocate(); @@ -1702,6 +1689,28 @@ struct SurfacesData : BaseGlobalStruct this->SurfIsICS.deallocate(); this->SurfIsPool.deallocate(); this->SurfICSPtr.deallocate(); + this->SurfIntConvCoeff.deallocate(); + this->SurfExtConvCoeff.deallocate(); + this->SurfTAirRef.deallocate(); + this->SurfIntConvClassification.deallocate(); + this->SurfIntConvHcModelEq.deallocate(); + this->SurfIntConvHcUserCurveIndex.deallocate(); + this->SurfOutConvClassification.deallocate(); + this->SurfOutConvHfModelEq.deallocate(); + this->SurfOutConvHfUserCurveIndex.deallocate(); + this->SurfOutConvHnModelEq.deallocate(); + this->SurfOutConvHnUserCurveIndex.deallocate(); + this->SurfOutConvFaceArea.deallocate(); + this->SurfOutConvFacePerimeter.deallocate(); + this->SurfOutConvFaceHeight.deallocate(); + this->SurfIntConvZoneWallHeight.deallocate(); + this->SurfIntConvZonePerimLength.deallocate(); + this->SurfIntConvZoneHorizHydrDiam.deallocate(); + this->SurfIntConvWindowWallRatio.deallocate(); + this->SurfIntConvWindowLocation.deallocate(); + this->SurfIntConvSurfGetsRadiantHeat.deallocate(); + this->SurfIntConvSurfHasActiveInIt.deallocate(); + this->SurfWinTransSolar.deallocate(); this->SurfWinBmSolar.deallocate(); this->SurfWinBmBmSolar.deallocate(); diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 73c7f3a53ac..6d9ca7c1dbf 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -460,7 +460,7 @@ namespace ElectricBaseboardRadiator { ElecBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (ElecBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(ElecBaseboard(BaseboardNum).SurfacePtr(SurfNum)).IntConvSurfGetsRadiantHeat = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(ElecBaseboard(BaseboardNum).SurfacePtr(SurfNum)) = true; } AllFracsSummed += ElecBaseboard(BaseboardNum).FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index fd57260e86c..433bab1a3f7 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -697,7 +697,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (HWBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(HWBaseboard(BaseboardNum).SurfacePtr(SurfNum)).IntConvSurfGetsRadiantHeat = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(HWBaseboard(BaseboardNum).SurfacePtr(SurfNum)) = true; } AllFracsSummed += HWBaseboard(BaseboardNum).FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index a78e3e45de9..734154a874a 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -1303,20 +1303,6 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); - state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfIntConvCoeff.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfExtConvCoeff.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfTAirRef.allocate(state.dataSurface->TotSurfaces); - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfLowTempErrCount(SurfNum) = 0; - state.dataSurface->SurfHighTempErrCount(SurfNum) = 0; - state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; - state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; - state.dataSurface->SurfTAirRef(SurfNum) = 0; - - } - // Use the total number of surfaces to allocate variables to avoid a surface number limit state.dataHeatBalSurf->CTFConstInPart.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->CTFConstOutPart.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -2006,14 +1992,14 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Inside Face Convection Classification Index", OutputProcessor::Unit::None, - Surface(loop).IntConvClassification, + state.dataSurface->SurfIntConvClassification(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable(state, "Surface Inside Face Convection Model Equation Index", OutputProcessor::Unit::None, - Surface(loop).IntConvHcModelEq, + state.dataSurface->SurfIntConvHcModelEq(loop), "Zone", "Average", Surface(loop).Name); @@ -2028,21 +2014,21 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Convection Classification Index", OutputProcessor::Unit::None, - Surface(loop).OutConvClassification, + state.dataSurface->SurfOutConvClassification(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Forced Convection Model Equation Index", OutputProcessor::Unit::None, - Surface(loop).OutConvHfModelEq, + state.dataSurface->SurfOutConvHfModelEq(loop), "Zone", "Average", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Natural Convection Model Equation Index", OutputProcessor::Unit::None, - Surface(loop).OutConvHnModelEq, + state.dataSurface->SurfOutConvHnModelEq(loop), "Zone", "Average", Surface(loop).Name); @@ -2889,9 +2875,9 @@ void InitSolarHeatGains(EnergyPlusData &state) if (ConstrNum > 0) { int SurfSolIncPtr = SurfaceScheduledSolarInc(state, SurfNum, ConstrNum); if (SurfSolIncPtr == 0) { - if (state.dataConstruction->Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface - int ShelfNum = state.dataSurface->SurfDaylightingShelfInd(SurfNum); // Daylighting shelf object number - int InShelfSurf = 0; // Inside daylighting shelf surface number + if (state.dataConstruction->Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface + int ShelfNum = state.dataSurface->SurfDaylightingShelfInd(SurfNum); // Daylighting shelf object number + int InShelfSurf = 0; // Inside daylighting shelf surface number if (ShelfNum > 0) { InShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).InSurf; // Inside daylighting shelf present if > 0 } @@ -4550,7 +4536,8 @@ void InitEMSControlledConstructions(EnergyPlusData &state) if (state.dataSurface->SurfEMSConstructionOverrideON(SurfNum) && (state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum) > 0)) { - if (state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TypeIsWindow) { // okay, allways allow windows + if (state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)) + .TypeIsWindow) { // okay, allways allow windows state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; } @@ -4570,8 +4557,10 @@ void InitEMSControlledConstructions(EnergyPlusData &state) Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::EMPD) { // compare old construction to new construction and see if terms match // set as okay and turn false if find a big problem - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; if (state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories != state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumHistories) { // thow warning, but allow @@ -4582,10 +4571,11 @@ void InitEMSControlledConstructions(EnergyPlusData &state) format("Construction named = {} has CTF timesteps = {}", state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, state.dataConstruction->Construct(Surface(SurfNum).Construction).NumHistories)); - ShowContinueError(state, - format("While construction named = {} has CTF timesteps = {}", - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumHistories)); + ShowContinueError( + state, + format("While construction named = {} has CTF timesteps = {}", + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumHistories)); ShowContinueError(state, "Transient heat transfer modeling may not be valid for surface name = " + Surface(SurfNum).Name + ", and the simulation continues"); @@ -4600,10 +4590,11 @@ void InitEMSControlledConstructions(EnergyPlusData &state) format("Construction named = {} has number of CTF terms = {}", state.dataConstruction->Construct(Surface(SurfNum).Construction).Name, state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms)); - ShowContinueError(state, - format("While construction named = {} has number of CTF terms = {}", - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumCTFTerms)); + ShowContinueError( + state, + format("While construction named = {} has number of CTF terms = {}", + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).NumCTFTerms)); ShowContinueError( state, "The actuator is allowed but the transient heat transfer modeling may not be valid for surface name = " + @@ -4617,25 +4608,30 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "Construction named = " + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + " has internal source/sink"); - ShowContinueError(state, - "While construction named = " + - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + - " is not an internal source/sink construction"); + ShowContinueError( + state, + "While construction named = " + + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + + " is not an internal source/sink construction"); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), + SurfNum) = false; } } - if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { + if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), + SurfNum)) { Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); } } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD) { - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; if (state.dataHeatBalFiniteDiffMgr->ConstructFD(Surface(SurfNum).Construction).TotNodes != state.dataHeatBalFiniteDiffMgr->ConstructFD(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TotNodes) { // thow warning, and do not allow @@ -4648,12 +4644,14 @@ void InitEMSControlledConstructions(EnergyPlusData &state) state, format("While construction named = {}has number of finite difference nodes ={}", state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name, - state.dataHeatBalFiniteDiffMgr->ConstructFD(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).TotNodes)); + state.dataHeatBalFiniteDiffMgr->ConstructFD(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)) + .TotNodes)); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + false; } if (state.dataConstruction->Construct(Surface(SurfNum).Construction).SourceSinkPresent) { @@ -4663,19 +4661,22 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "Construction named = " + state.dataConstruction->Construct(Surface(SurfNum).Construction).Name + " has internal source/sink"); - ShowContinueError(state, - "While construction named = " + - state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + - " is not an internal source/sink construction"); + ShowContinueError( + state, + "While construction named = " + + state.dataConstruction->Construct(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum)).Name + + " is not an internal source/sink construction"); ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), + SurfNum) = false; } } - if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { + if (state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), + SurfNum)) { Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); } @@ -4686,8 +4687,10 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + false; } else if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::Kiva) { // don't allow ShowSevereError(state, @@ -4696,8 +4699,10 @@ void InitEMSControlledConstructions(EnergyPlusData &state) ShowContinueError(state, "This actuator is not allowed for surface name = " + Surface(SurfNum).Name + ", and the simulation continues without the override"); - state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = true; - state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = false; + state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + true; + state.dataRuntimeLang->EMSConstructActuatorIsOkay(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum) = + false; } } else { @@ -6798,7 +6803,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, Real64 const TempDiv(1.0 / (construct.CTFInside(0) - construct.CTFCross(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature if ((!state.dataSurface->SurfIsPool(SurfNum)) || - ((state.dataSurface->SurfIsPool(SurfNum)) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && + ((state.dataSurface->SurfIsPool(SurfNum)) && + (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = @@ -6911,7 +6917,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, Real64 const TempDiv(1.0 / (construct.CTFInside(0) + HConvIn_surf + IterDampConst)); // Calculate the current inside surface temperature if ((!state.dataSurface->SurfIsPool(SurfNum)) || - ((state.dataSurface->SurfIsPool(SurfNum)) && (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && + ((state.dataSurface->SurfIsPool(SurfNum)) && + (std::abs(state.dataHeatBalFanSys->QPoolSurfNumerator(SurfNum)) < PoolIsOperatingLimit) && (std::abs(state.dataHeatBalFanSys->PoolHeatTransCoefs(SurfNum)) < PoolIsOperatingLimit))) { if (construct.SourceSinkPresent) { state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = @@ -8189,8 +8196,7 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, i } else { if (state.dataSurface->SurfHighTempErrCount(SurfNum) == 0) { ShowSevereMessage( - state, - format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); + state, format("Temperature (high) out of bounds ({:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8245,8 +8251,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, i if ((TH12 > state.dataHeatBalSurf->MaxSurfaceTempLimitBeforeFatal) || (TH12 < MinSurfaceTempLimitBeforeFatal)) { if (!state.dataGlobal->WarmupFlag) { if (TH12 < MinSurfaceTempLimitBeforeFatal) { - ShowSevereError( - state, format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); + ShowSevereError(state, + format("Temperature (low) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8270,8 +8276,8 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, i } ShowFatalError(state, "Program terminates due to preceding condition."); } else { - ShowSevereError( - state, format("Temperature (high) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); + ShowSevereError(state, + format("Temperature (high) out of bounds [{:.2R}] for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueErrorTimeStamp(state, ""); if (!zone.TempOutOfBoundsReported) { ShowContinueError(state, "Zone=\"" + zone.Name + "\", Diagnostic Details:"); @@ -8299,8 +8305,7 @@ void TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, i if (TH12 < -10000. || TH12 > 10000.) { ShowSevereError( state, - format( - "CalcHeatBalanceInsideSurf: The temperature of {:.2R} C for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); + format("CalcHeatBalanceInsideSurf: The temperature of {:.2R} C for zone=\"{}\", for surface=\"{}\"", TH12, zone.Name, surfName)); ShowContinueError(state, "..is very far out of bounds during warmup. This may be an indication of a malformed zone."); ShowContinueErrorTimeStamp(state, ""); ShowFatalError(state, "Program terminates due to preceding condition."); diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index 5c865025586..231492796f8 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -584,7 +584,7 @@ namespace HighTempRadiantSystem { } if (state.dataHighTempRadSys->HighTempRadSys(Item).SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(state.dataHighTempRadSys->HighTempRadSys(Item).SurfacePtr(SurfNum)).IntConvSurfGetsRadiantHeat = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(state.dataHighTempRadSys->HighTempRadSys(Item).SurfacePtr(SurfNum)) = true; } AllFracsSummed += state.dataHighTempRadSys->HighTempRadSys(Item).FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index 6afda29817a..afb553cce77 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -673,7 +673,7 @@ namespace LowTempRadiantSystem { thisRadSys.SurfaceName(SurfNum) = state.dataSurfLists->SurfList(SurfListNum).SurfName(SurfNum); thisRadSys.SurfaceFrac(SurfNum) = state.dataSurfLists->SurfList(SurfListNum).SurfFlowFrac(SurfNum); if (thisRadSys.SurfacePtr(SurfNum) > 0) { - Surface(thisRadSys.SurfacePtr(SurfNum)).IntConvSurfHasActiveInIt = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(thisRadSys.SurfacePtr(SurfNum)) = true; } } } else { // User entered a single surface name rather than a surface list @@ -697,8 +697,8 @@ namespace LowTempRadiantSystem { ErrorsFound = true; } if (thisRadSys.SurfacePtr(1) != 0) { - Surface(thisRadSys.SurfacePtr(1)).IntConvSurfHasActiveInIt = true; - Surface(thisRadSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(thisRadSys.SurfacePtr(1)) = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(thisRadSys.SurfacePtr(1)) = true; } } @@ -973,7 +973,7 @@ namespace LowTempRadiantSystem { thisCFloSys.SurfaceFrac(SurfNum) = state.dataSurfLists->SurfList(SurfListNum).SurfFlowFrac(SurfNum); thisCFloSys.NumCircuits(SurfNum) = 0.0; if (thisCFloSys.SurfacePtr(SurfNum) != 0) { - Surface(thisCFloSys.SurfacePtr(SurfNum)).IntConvSurfHasActiveInIt = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(thisCFloSys.SurfacePtr(SurfNum)) = true; } } } else { // User entered a single surface name rather than a surface list @@ -998,7 +998,7 @@ namespace LowTempRadiantSystem { ErrorsFound = true; } if (thisCFloSys.SurfacePtr(1) != 0) { - Surface(thisCFloSys.SurfacePtr(1)).IntConvSurfHasActiveInIt = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(thisCFloSys.SurfacePtr(1)) = true; Surface(thisCFloSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; } } diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index af276204f54..f0e4c06f336 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -718,8 +718,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum)) - .IntConvSurfGetsRadiantHeat = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum)) = true; } AllFracsSummed += state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 71bfa7eb1ed..a193eb28c91 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -924,6 +924,54 @@ namespace SurfaceGeometry { state.dataSurface->SurfIsPool(SurfNum) = false; state.dataSurface->SurfICSPtr(SurfNum) = 0; } + state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvCoeff.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtConvCoeff.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfTAirRef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvClassification.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvHcModelEq.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvHcUserCurveIndex.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvClassification.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvHfModelEq.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvHfUserCurveIndex.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvHnModelEq.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvHnUserCurveIndex.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvFaceArea.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvFacePerimeter.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutConvFaceHeight.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvZoneWallHeight.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvZonePerimLength.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvZoneHorizHydrDiam.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvWindowWallRatio.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvWindowLocation.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvSurfGetsRadiantHeat.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvSurfHasActiveInIt.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfLowTempErrCount(SurfNum) = 0; + state.dataSurface->SurfHighTempErrCount(SurfNum) = 0; + state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; + state.dataSurface->SurfTAirRef(SurfNum) = 0; + state.dataSurface->SurfIntConvClassification(SurfNum) = 0; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = 0; + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = 0; + state.dataSurface->SurfOutConvClassification(SurfNum) = 0; + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = 0; + state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = 0; + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = 0; + state.dataSurface->SurfOutConvHnUserCurveIndex(SurfNum) = 0; + state.dataSurface->SurfOutConvFaceArea(SurfNum) = 0; + state.dataSurface->SurfOutConvFacePerimeter(SurfNum) = 0; + state.dataSurface->SurfOutConvFaceHeight(SurfNum) = 0; + state.dataSurface->SurfIntConvZoneWallHeight(SurfNum) = 0; + state.dataSurface->SurfIntConvZonePerimLength(SurfNum) = 0; + state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum) = 0; + state.dataSurface->SurfIntConvWindowWallRatio(SurfNum) = 0; + state.dataSurface->SurfIntConvWindowLocation(SurfNum) = 0; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat(SurfNum) = false; + state.dataSurface->SurfIntConvSurfHasActiveInIt(SurfNum) = false; + } } void GetSurfaceData(EnergyPlusData &state, bool &ErrorsFound) // If errors found in input @@ -1483,7 +1531,7 @@ namespace SurfaceGeometry { // After reordering, MovedSurfs should equal TotSurfaces MovedSurfs = 0; - Array1D SurfaceTmpClassMoved; // Tmp class is moved + Array1D SurfaceTmpClassMoved; // Tmp class is moved SurfaceTmpClassMoved.dimension(state.dataSurface->TotSurfaces, false); // Move all shading Surfaces to Front @@ -2434,7 +2482,8 @@ namespace SurfaceGeometry { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Check for EcoRoof and only 1 allowed to be used. if (state.dataSurface->Surface(SurfNum).Construction > 0) - state.dataSurface->SurfExtEcoRoof(SurfNum) = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).TypeIsEcoRoof; + state.dataSurface->SurfExtEcoRoof(SurfNum) = + state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).TypeIsEcoRoof; if (!state.dataSurface->SurfExtEcoRoof(SurfNum)) continue; if (LayNumOutside == 0) { LayNumOutside = state.dataConstruction->Construct(state.dataSurface->Surface(SurfNum).Construction).LayerPoint(1); @@ -3818,9 +3867,9 @@ namespace SurfaceGeometry { } // Set the logical flag for the EcoRoof presented, this is only based on the flag in the construction type -// if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) -// state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = -// state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; + // if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) + // state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = + // state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ViewFactorGround = state.dataIPShortCut->rNumericArgs(1); if (state.dataIPShortCut->lNumericFieldBlanks(1)) @@ -4184,9 +4233,9 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtWind = true; // Set the logical flag for the EcoRoof presented, this is only based on the flag in the construction type -// if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) -// state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = -// state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; + // if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction > 0) + // state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtEcoRoof = + // state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Construction).TypeIsEcoRoof; } else if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ExtBoundCond == state.dataSurfaceGeometry->UnreconciledZoneSurface) { if (GettingIZSurfaces) { @@ -7672,8 +7721,7 @@ namespace SurfaceGeometry { } if (state.dataSurface->SurfLocalEnvironment(Loop).SurroundingSurfsPtr != 0) { state.dataSurface->SurfHasSurroundingSurfProperties(SurfLoop) = true; - state.dataSurface->SurfSurroundingSurfacesNum(SurfLoop) = - state.dataSurface->SurfLocalEnvironment(Loop).SurroundingSurfsPtr; + state.dataSurface->SurfSurroundingSurfacesNum(SurfLoop) = state.dataSurface->SurfLocalEnvironment(Loop).SurroundingSurfsPtr; } } } diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 4db15e9d0bc..997b8075ea9 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -371,7 +371,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlab(Item).SlabIn(SurfNum) = state.dataSurfLists->SlabList(SurfListNum).SlabInNodeName(SurfNum); state.dataVentilatedSlab->VentSlab(Item).SlabOut(SurfNum) = state.dataSurfLists->SlabList(SurfListNum).SlabOutNodeName(SurfNum); if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum) != 0) { - state.dataSurface->Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)).IntConvSurfHasActiveInIt = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(SurfNum)) = true; } } @@ -400,7 +400,7 @@ namespace VentilatedSlab { ErrorsFound = true; } if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1) != 0) { - state.dataSurface->Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IntConvSurfHasActiveInIt = true; + state.dataSurface->SurfIntConvSurfHasActiveInIt(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)) = true; state.dataSurface->Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; } } diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 3a5fa4a298c..df4f6657521 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -486,99 +486,99 @@ TEST_F(ConvectionCoefficientsFixture, DynamicIntConvSurfaceClassification) state->dataHeatBalFanSys->MAT(1) = 30.0; DynamicIntConvSurfaceClassification(*state, 1); - EXPECT_EQ(state->dataSurface->Surface(1).IntConvClassification, DataSurfaces::InConvClass_A3_VertWalls); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(1), DataSurfaces::InConvClass_A3_VertWalls); DynamicIntConvSurfaceClassification(*state, 2); - EXPECT_EQ(state->dataSurface->Surface(2).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(2), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 3); - EXPECT_EQ(state->dataSurface->Surface(3).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(3), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 4); - EXPECT_EQ(state->dataSurface->Surface(4).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(4), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 5); - EXPECT_EQ(state->dataSurface->Surface(5).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(5), DataSurfaces::InConvClass_A3_StableTilted); // vertical floor is currently not a valid case, so returns zero with a severe error DynamicIntConvSurfaceClassification(*state, 6); - EXPECT_EQ(state->dataSurface->Surface(6).IntConvClassification, 0); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(6), 0); DynamicIntConvSurfaceClassification(*state, 7); - EXPECT_EQ(state->dataSurface->Surface(7).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(7), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 8); - EXPECT_EQ(state->dataSurface->Surface(8).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(8), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 9); - EXPECT_EQ(state->dataSurface->Surface(9).IntConvClassification, DataSurfaces::InConvClass_A3_StableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(9), DataSurfaces::InConvClass_A3_StableHoriz); DynamicIntConvSurfaceClassification(*state, 10); - EXPECT_EQ(state->dataSurface->Surface(10).IntConvClassification, DataSurfaces::InConvClass_A3_StableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(10), DataSurfaces::InConvClass_A3_StableHoriz); DynamicIntConvSurfaceClassification(*state, 11); - EXPECT_EQ(state->dataSurface->Surface(11).IntConvClassification, DataSurfaces::InConvClass_A3_VertWalls); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(11), DataSurfaces::InConvClass_A3_VertWalls); DynamicIntConvSurfaceClassification(*state, 12); - EXPECT_EQ(state->dataSurface->Surface(12).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(12), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 13); - EXPECT_EQ(state->dataSurface->Surface(13).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(13), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 14); - EXPECT_EQ(state->dataSurface->Surface(14).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(14), DataSurfaces::InConvClass_A3_UnstableHoriz); DynamicIntConvSurfaceClassification(*state, 15); - EXPECT_EQ(state->dataSurface->Surface(15).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(15), DataSurfaces::InConvClass_A3_UnstableHoriz); // Case 2 - Zone air colder than surfaces state->dataHeatBalFanSys->MAT(1) = 10.0; DynamicIntConvSurfaceClassification(*state, 1); - EXPECT_EQ(state->dataSurface->Surface(1).IntConvClassification, DataSurfaces::InConvClass_A3_VertWalls); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(1), DataSurfaces::InConvClass_A3_VertWalls); DynamicIntConvSurfaceClassification(*state, 2); - EXPECT_EQ(state->dataSurface->Surface(2).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(2), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 3); - EXPECT_EQ(state->dataSurface->Surface(3).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(3), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 4); - EXPECT_EQ(state->dataSurface->Surface(4).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(4), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 5); - EXPECT_EQ(state->dataSurface->Surface(5).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(5), DataSurfaces::InConvClass_A3_UnstableTilted); // vertical floor is currently not a valid case, so returns zero with a severe error DynamicIntConvSurfaceClassification(*state, 6); - EXPECT_EQ(state->dataSurface->Surface(6).IntConvClassification, 0); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(6), 0); DynamicIntConvSurfaceClassification(*state, 7); - EXPECT_EQ(state->dataSurface->Surface(7).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(7), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 8); - EXPECT_EQ(state->dataSurface->Surface(8).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(8), DataSurfaces::InConvClass_A3_UnstableTilted); DynamicIntConvSurfaceClassification(*state, 9); - EXPECT_EQ(state->dataSurface->Surface(9).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(9), DataSurfaces::InConvClass_A3_UnstableHoriz); DynamicIntConvSurfaceClassification(*state, 10); - EXPECT_EQ(state->dataSurface->Surface(10).IntConvClassification, DataSurfaces::InConvClass_A3_UnstableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(10), DataSurfaces::InConvClass_A3_UnstableHoriz); DynamicIntConvSurfaceClassification(*state, 11); - EXPECT_EQ(state->dataSurface->Surface(11).IntConvClassification, DataSurfaces::InConvClass_A3_VertWalls); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(11), DataSurfaces::InConvClass_A3_VertWalls); DynamicIntConvSurfaceClassification(*state, 12); - EXPECT_EQ(state->dataSurface->Surface(12).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(12), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 13); - EXPECT_EQ(state->dataSurface->Surface(13).IntConvClassification, DataSurfaces::InConvClass_A3_StableTilted); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(13), DataSurfaces::InConvClass_A3_StableTilted); DynamicIntConvSurfaceClassification(*state, 14); - EXPECT_EQ(state->dataSurface->Surface(14).IntConvClassification, DataSurfaces::InConvClass_A3_StableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(14), DataSurfaces::InConvClass_A3_StableHoriz); DynamicIntConvSurfaceClassification(*state, 15); - EXPECT_EQ(state->dataSurface->Surface(15).IntConvClassification, DataSurfaces::InConvClass_A3_StableHoriz); + EXPECT_EQ(state->dataSurface->SurfIntConvClassification(15), DataSurfaces::InConvClass_A3_StableHoriz); } TEST_F(ConvectionCoefficientsFixture, EvaluateIntHcModelsFisherPedersen) diff --git a/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc index a9ceda23336..b103dd2b505 100644 --- a/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc @@ -103,6 +103,8 @@ TEST_F(EnergyPlusFixture, HighTempRadiantSystemTest_GetHighTempRadiantSystem) state->dataSurface->Surface.allocate(1); state->dataSurface->Surface(1).Name = "WALL1"; state->dataSurface->Surface(1).Zone = 1; + state->dataSurface->SurfIntConvSurfGetsRadiantHeat.allocate(1); + state->dataSurface->SurfIntConvSurfGetsRadiantHeat = 0.0; ErrorsFound = false; diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 21c0ceee2e2..4b3285c51e0 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -2356,6 +2356,8 @@ TEST_F(LowTempRadiantSystemTest, LowTempElecRadSurfaceGroupTest) state->dataSurface->Surface(4).Construction = 1; state->dataConstruction->Construct.allocate(1); state->dataConstruction->Construct(1).SourceSinkPresent = true; + state->dataSurface->SurfIntConvSurfHasActiveInIt.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIntConvSurfHasActiveInIt = false; GetLowTempRadiantSystem(*state); EXPECT_EQ(2, state->dataLowTempRadSys->NumOfElecLowTempRadSys); @@ -3836,6 +3838,8 @@ TEST_F(LowTempRadiantSystemTest, GetLowTempRadiantSystem_MultipleTypes) state->dataSurface->Surface(6).Construction = 1; state->dataConstruction->Construct.allocate(1); state->dataConstruction->Construct(1).SourceSinkPresent = true; + state->dataSurface->SurfIntConvSurfHasActiveInIt.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIntConvSurfHasActiveInIt = false; GetLowTempRadiantSystem(*state); diff --git a/tst/EnergyPlus/unit/OutputReports.unit.cc b/tst/EnergyPlus/unit/OutputReports.unit.cc index 4a6fcf253e5..2d7545ee29a 100644 --- a/tst/EnergyPlus/unit/OutputReports.unit.cc +++ b/tst/EnergyPlus/unit/OutputReports.unit.cc @@ -147,11 +147,6 @@ TEST_F(EnergyPlusFixture, OutputReports_SurfaceDetailsReport) SurfaceGeometry::GetSurfaceData(*state, foundErrors); // setup zone geometry and get zone data EXPECT_FALSE(foundErrors); // expect no errors - state->dataSurface->SurfExtConvCoeff.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfIntConvCoeff.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfExtConvCoeff = 0.0; - state->dataSurface->SurfIntConvCoeff = 0.0; - // reset eio stream has_eio_output(true); diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 393bee4e21c..d9c9155e6ba 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -574,8 +574,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->InsideDividerCondensationFlag.allocate(3); state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); - state->dataSurface->SurfIntConvCoeff.allocate(3); - state->dataSurface->SurfTAirRef.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; @@ -600,7 +598,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; - state->dataSurface->SurfIntConvCoeff = 0.0; state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; @@ -2807,8 +2804,6 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); - state->dataSurface->SurfIntConvCoeff.allocate(3); - state->dataSurface->SurfTAirRef.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; @@ -2833,7 +2828,6 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; - state->dataSurface->SurfIntConvCoeff = 0.0; state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; From fb54ea7c7ae243371f4984e48d762e1a1ef11d26 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 1 May 2021 18:49:21 -0700 Subject: [PATCH 06/25] more vars --- .../AirflowNetworkBalanceManager.cc | 10 +-- src/EnergyPlus/ConvectionCoefficients.cc | 52 ++++++------ src/EnergyPlus/CrossVentMgr.cc | 52 ++++++------ src/EnergyPlus/DataSurfaceLists.cc | 4 +- src/EnergyPlus/DataSurfaces.cc | 36 ++++----- src/EnergyPlus/DataSurfaces.hh | 47 ++++++----- src/EnergyPlus/GeneralRoutines.cc | 24 +++--- src/EnergyPlus/HeatBalanceManager.cc | 44 +---------- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 53 ++++++------- src/EnergyPlus/LowTempRadiantSystem.cc | 10 +-- .../PhotovoltaicThermalCollectors.cc | 4 +- src/EnergyPlus/Photovoltaics.cc | 10 +-- src/EnergyPlus/SolarCollectors.cc | 24 +++--- src/EnergyPlus/SolarShading.cc | 21 ++--- src/EnergyPlus/SurfaceGeometry.cc | 57 ++++++++++++- src/EnergyPlus/SwimmingPool.cc | 4 +- src/EnergyPlus/TranspiredCollector.cc | 79 ++++++++++--------- src/EnergyPlus/VentilatedSlab.cc | 4 +- src/EnergyPlus/WindowComplexManager.cc | 8 +- src/EnergyPlus/WindowEquivalentLayer.cc | 6 +- src/EnergyPlus/WindowManager.cc | 18 ++--- .../WindowManagerExteriorThermal.cc | 2 +- .../ZoneContaminantPredictorCorrector.cc | 8 +- .../unit/ConvectionCoefficients.unit.cc | 6 +- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 4 + tst/EnergyPlus/unit/DataSurfaces.unit.cc | 5 +- .../unit/DaylightingManager.unit.cc | 7 -- .../unit/HeatBalanceSurfaceManager.unit.cc | 43 +++------- tst/EnergyPlus/unit/ICSCollector.unit.cc | 10 ++- tst/EnergyPlus/unit/SolarShading.unit.cc | 4 +- tst/EnergyPlus/unit/SwimmingPool.unit.cc | 18 ++--- tst/EnergyPlus/unit/WindowManager.unit.cc | 6 +- 32 files changed, 332 insertions(+), 348 deletions(-) diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 13ab9b00104..6ea42260181 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -9182,11 +9182,11 @@ namespace AirflowNetworkBalanceManager { // Find a linkage from a zone to outdoors if (ZN1 > 0 && ZN2 == 0) { if (state.dataSurface->SurfHasLinkedOutAirNode(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum)) { - Tamb = state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; + Tamb = state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum); CpAir = PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb( state, Tamb, - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, + state.dataSurface->SurfOutWetBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum), state.dataEnvrn->OutBaroPress)); } else { Tamb = Zone(ZN1).OutDryBulbTemp; @@ -9267,11 +9267,11 @@ namespace AirflowNetworkBalanceManager { } if (ZN1 == 0 && ZN2 > 0) { if (state.dataSurface->SurfHasLinkedOutAirNode(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum)) { - Tamb = state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; + Tamb = state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum); CpAir = PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb( state, Tamb, - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, + state.dataSurface->SurfOutWetBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(i).SurfNum), state.dataEnvrn->OutBaroPress)); } else { Tamb = Zone(ZN2).OutDryBulbTemp; @@ -10876,7 +10876,7 @@ namespace AirflowNetworkBalanceManager { // Venting based on inside-outside air temperature difference if ((VentCtrlNum == VentControlType::Temp || VentCtrlNum == VentControlType::AdjTemp) && VentingAllowed) { - Tamb = state.dataSurface->Surface(SurfNum).OutDryBulbTemp; + Tamb = state.dataSurface->SurfOutDryBulbTemp(SurfNum); // Check whether this surface is an interior wall or not. If Yes, use adjacent zone conditions if (VentCtrlNum == VentControlType::AdjTemp && state.dataAirflowNetwork->MultizoneSurfaceData(i).IndVentControl) { Tamb = state.dataAirflowNetwork->ANZT( diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 0baa3648afa..096a7cd41b9 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -389,7 +389,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, state.dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false; } - TAir = Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + TAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; TSurf = TempExt + DataGlobalConstants::KelvinConv; TSky = state.dataEnvrn->SkyTempKelvin; TGround = TAir; @@ -408,14 +408,14 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, BaseSurf = Surface(SurfNum).BaseSurf; // If this is a base surface, BaseSurf = SurfNum - SurfWindDir = Surface(SurfNum).WindDir; + SurfWindDir = state.dataSurface->SurfOutWindDir(SurfNum); if (!Surface(SurfNum).ExtWind) { SurfWindSpeed = 0.0; // No wind exposure } else if (Surface(SurfNum).Class == SurfaceClass::Window && state.dataSurface->SurfWinShadingFlag(SurfNum) == WinShadingType::ExtShade) { SurfWindSpeed = 0.0; // Assume zero wind speed at outside glass surface of window with exterior shade } else { - SurfWindSpeed = Surface(SurfNum).WindSpeed; + SurfWindSpeed = state.dataSurface->SurfOutWindSpeed(SurfNum); } // Check if exterior is to be set by user @@ -4802,16 +4802,16 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat }; } } else if (SELECT_CASE_var == HcExt_NaturalASHRAEVerticalWall) { - Hn = CalcASHRAEVerticalWall((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)); + Hn = CalcASHRAEVerticalWall((TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); }; } else if (SELECT_CASE_var == HcExt_NaturalWaltonUnstableHorizontalOrTilt) { - Hn = CalcWaltonUnstableHorizontalOrTilt((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), + Hn = CalcWaltonUnstableHorizontalOrTilt((TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out HnFn = [=](double Tsurf, double Tamb, double, double, double cosTilt) -> double { return CalcWaltonUnstableHorizontalOrTilt(Tsurf - Tamb, cosTilt); }; } else if (SELECT_CASE_var == HcExt_NaturalWaltonStableHorizontalOrTilt) { - Hn = CalcWaltonStableHorizontalOrTilt((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), + Hn = CalcWaltonStableHorizontalOrTilt((TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out HnFn = [=](double Tsurf, double Tamb, double, double, double cosTilt) -> double { return CalcWaltonStableHorizontalOrTilt(Tsurf - Tamb, cosTilt); @@ -4819,7 +4819,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } else if (SELECT_CASE_var == HcExt_AlamdariHammondVerticalWall) { Real64 FaceHeight = state.dataSurface->SurfOutConvFaceHeight(SurfNum); Hn = CalcAlamdariHammondVerticalWall( - state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), FaceHeight, SurfNum); + state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), FaceHeight, SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, FaceHeight); }; @@ -4829,7 +4829,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat ShowFatalError(state, "Fohanno Polidori convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } Hn = CallCalcFohannoPolidoriVerticalWall(state, - (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), + (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), state.dataSurface->SurfOutConvFaceHeight(SurfNum), TH(1, 1, SurfNum), -QdotConvOutRepPerArea(SurfNum), @@ -4840,14 +4840,14 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } else { HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } - Hn = CalcAlamdariHammondStableHorizontal(state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), HydraulicDiameter, SurfNum); + Hn = CalcAlamdariHammondStableHorizontal(state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); } else if (SELECT_CASE_var == HcExt_AlamdariHammondUnstableHorizontal) { if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) { HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum); } else { HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } - Hn = CalcAlamdariHammondUnstableHorizontal(state, (TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), HydraulicDiameter, SurfNum); + Hn = CalcAlamdariHammondUnstableHorizontal(state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); } } @@ -4858,7 +4858,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } else if (Surface(SurfNum).Class == SurfaceClass::Window && state.dataSurface->SurfWinShadingFlag(SurfNum) == WinShadingType::ExtShade) { SurfWindSpeed = 0.0; // Assume zero wind speed at outside glass surface of window with exterior shade } else { - SurfWindSpeed = Surface(SurfNum).WindSpeed; + SurfWindSpeed = state.dataSurface->SurfOutWindSpeed(SurfNum); } int Roughness = state.dataMaterial->Material(state.dataConstruction->Construct(Surface(SurfNum).Construction).LayerPoint(1)).Roughness; @@ -4925,7 +4925,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_MoWiTTWindward) { - Hf = CalcMoWITTWindward(TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp, SurfWindSpeed); + Hf = CalcMoWITTWindward(TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum), SurfWindSpeed); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { @@ -4938,7 +4938,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_MoWiTTLeeward) { - Hf = CalcMoWITTLeeward((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), SurfWindSpeed); + Hf = CalcMoWITTLeeward((TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), SurfWindSpeed); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedLeeward(windSpeed); }; } else { @@ -4951,7 +4951,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Windward) { - Hf = CalcDOE2Windward(TH(1, 1, SurfNum), Surface(SurfNum).OutDryBulbTemp, Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); + Hf = CalcDOE2Windward(TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { @@ -4964,7 +4964,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Leeward) { - Hf = CalcDOE2Leeward(TH(1, 1, SurfNum), Surface(SurfNum).OutDryBulbTemp, Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); + Hf = CalcDOE2Leeward(TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { @@ -4993,11 +4993,11 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat }; HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_ClearRoof) { - SurfWindDir = Surface(SurfNum).WindDir; + SurfWindDir = state.dataSurface->SurfOutWindDir(SurfNum); Hf = CalcClearRoof(state, SurfNum, TH(1, 1, SurfNum), - Surface(SurfNum).OutDryBulbTemp, + state.dataSurface->SurfOutDryBulbTemp(SurfNum), SurfWindSpeed, SurfWindDir, state.dataSurface->SurfOutConvFaceArea(SurfNum), @@ -5078,15 +5078,15 @@ void DynamicExtConvSurfaceClassification(EnergyPlusData &state, int const SurfNu auto &Surface(state.dataSurface->Surface); - surfWindDir = Surface(SurfNum).WindDir; + surfWindDir = state.dataSurface->SurfOutWindDir(SurfNum); if (Surface(SurfNum).Class == SurfaceClass::Roof || (Surface(SurfNum).Class == SurfaceClass::Floor && Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) // Applies to exterior grade ) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - DeltaTemp = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - Surface(SurfNum).OutDryBulbTemp; + DeltaTemp = state.dataSurfaceGeometry->kivaManager.surfaceMap[SurfNum].results.Tconv - state.dataSurface->SurfOutDryBulbTemp(SurfNum); } else { - DeltaTemp = state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp; + DeltaTemp = state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum); } if (DeltaTemp < 0.0) { @@ -6419,7 +6419,7 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int if (SELECT_CASE_var == RefWindWeatherFile) { windVel = state.dataEnvrn->WindSpeed; } else if (SELECT_CASE_var == RefWindAtZ) { - windVel = Surface(SurfNum).WindSpeed; + windVel = state.dataSurface->SurfOutWindSpeed(SurfNum); } else if (SELECT_CASE_var == RefWindParallComp) { // WindSpeed , WindDir, surface Azimuth Theta = state.dataEnvrn->WindDir - Surface(SurfNum).Azimuth - 90.0; // TODO double check theta @@ -6427,9 +6427,9 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int windVel = std::cos(ThetaRad) * state.dataEnvrn->WindSpeed; } else if (SELECT_CASE_var == RefWindParallCompAtZ) { // Surface WindSpeed , Surface WindDir, surface Azimuth - Theta = Surface(SurfNum).WindDir - Surface(SurfNum).Azimuth - 90.0; // TODO double check theta + Theta = state.dataSurface->SurfOutWindDir(SurfNum) - Surface(SurfNum).Azimuth - 90.0; // TODO double check theta ThetaRad = Theta * DataGlobalConstants::DegToRadians; - windVel = std::cos(ThetaRad) * Surface(SurfNum).WindSpeed; + windVel = std::cos(ThetaRad) * state.dataSurface->SurfOutWindSpeed(SurfNum); } } @@ -6446,7 +6446,7 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int if (UserCurve.HnFnTempDiffCurveNum > 0) { HnFnTempDiff = - CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)); + CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))); HnFnTempDiffFn = [&](double Tsurf, double Tamb, double, double, double) -> double { return CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(Tsurf - Tamb)); }; @@ -6457,7 +6457,7 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int HnFnTempDiffDivHeight = CurveValue( state, UserCurve.HnFnTempDiffDivHeightCurveNum, - ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); + ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); HnFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { return CurveValue(state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); }; @@ -8541,7 +8541,7 @@ Real64 CalcASTMC1340ConvCoeff(EnergyPlusData &state, int const SurfNum, Real64 c } if (Surface(SurfNum).ExtBoundCond == 0) { - v = Surface(SurfNum).WindSpeed; + v = state.dataSurface->SurfOutWindSpeed(SurfNum); } else { v = Vair; } diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 5834916ea68..15c12edd59b 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -454,10 +454,10 @@ namespace CrossVentMgr { } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == ExternalEnvironment) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == Ground) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == @@ -466,16 +466,16 @@ namespace CrossVentMgr { state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp + + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) + state.dataSurface->OSC(OPtr).ConstTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + state.dataSurface->OSC(OPtr).WindSpeedCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).WindSpeed * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp); + state.dataSurface->SurfOutWindSpeed(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) * + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum)); state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->OSC(OPtr).OSCTempCalc; } else { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } return; } @@ -608,10 +608,10 @@ namespace CrossVentMgr { } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == ExternalEnvironment) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == Ground) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == @@ -620,16 +620,16 @@ namespace CrossVentMgr { state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp + + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) + state.dataSurface->OSC(OPtr).ConstTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + state.dataSurface->OSC(OPtr).WindSpeedCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).WindSpeed * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp); + state.dataSurface->SurfOutWindSpeed(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) * + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum)); state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->OSC(OPtr).OSCTempCalc; } else { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } state.dataRoomAirMod->Urec(ZoneNum) = 0.0; state.dataRoomAirMod->Ujet(ZoneNum) = 0.0; @@ -671,10 +671,10 @@ namespace CrossVentMgr { } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == ExternalEnvironment) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == Ground) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == @@ -683,17 +683,17 @@ namespace CrossVentMgr { state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp + + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) + state.dataSurface->OSC(OPtr).ConstTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + state.dataSurface->OSC(OPtr).WindSpeedCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).WindSpeed * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp); + state.dataSurface->SurfOutWindSpeed(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) * + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum)); state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->OSC(OPtr).OSCTempCalc; } else { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } return; } @@ -771,10 +771,10 @@ namespace CrossVentMgr { if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond <= 0) { if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == ExternalEnvironment) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == Ground) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == OtherSideCoefNoCalcExt || state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).ExtBoundCond == @@ -783,16 +783,16 @@ namespace CrossVentMgr { state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp + + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) + state.dataSurface->OSC(OPtr).ConstTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + state.dataSurface->OSC(OPtr).WindSpeedCoef * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).WindSpeed * - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp); + state.dataSurface->SurfOutWindSpeed(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum) * + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum)); state.dataRoomAirMod->Tin(ZoneNum) = state.dataSurface->OSC(OPtr).OSCTempCalc; } else { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } } else { // adiabatic surface @@ -803,7 +803,7 @@ namespace CrossVentMgr { if (state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).Zone == ZoneNum) { if (state.dataAirflowNetwork->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataRoomAirMod->AirModel(state.dataAirflowNetwork->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = @@ -817,7 +817,7 @@ namespace CrossVentMgr { if (state.dataAirflowNetwork->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) { state.dataRoomAirMod->Tin(ZoneNum) = - state.dataSurface->Surface(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(state.dataAirflowNetwork->MultizoneSurfaceData(MaxSurf).SurfNum); } else if (state.dataRoomAirMod->AirModel(state.dataAirflowNetwork->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModelType == DataRoomAirModel::RoomAirModel::UCSDCV) { state.dataRoomAirMod->Tin(ZoneNum) = diff --git a/src/EnergyPlus/DataSurfaceLists.cc b/src/EnergyPlus/DataSurfaceLists.cc index 24e179b312e..749dcca53a1 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -185,7 +185,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) " statement not found = " + SurfList(Item).SurfName(SurfNum)); ErrorsFound = true; } else { // Make sure that all of the surfaces are located in the same zone - state.dataSurface->Surface(SurfList(Item).SurfPtr(SurfNum)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(SurfList(Item).SurfPtr(SurfNum)) = true; if (SurfNum == 1) { ZoneForSurface = state.dataSurface->Surface(SurfList(Item).SurfPtr(SurfNum)).Zone; } @@ -316,7 +316,7 @@ void GetSurfaceListsInputs(EnergyPlusData &state) ErrorsFound = true; } } - state.dataSurface->Surface(SlabList(Item).SurfPtr(SurfNum)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(SlabList(Item).SurfPtr(SurfNum)) = true; SlabList(Item).CoreDiameter(SurfNum) = Numbers(NumArray); SlabList(Item).CoreLength(SurfNum) = Numbers(NumArray + 1); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index f01cf8504e1..2cb8138a69d 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -216,8 +216,8 @@ void SurfaceData::SetOutBulbTempAt(EnergyPlusData &state) // Routine provides facility for doing bulk Set Temperature at Height. if (state.dataEnvrn->SiteTempGradient == 0.0) { - OutDryBulbTemp = state.dataEnvrn->OutDryBulbTemp; - OutWetBulbTemp = state.dataEnvrn->OutWetBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(Index) = state.dataEnvrn->OutDryBulbTemp; + state.dataSurface->SurfOutWetBulbTemp(Index) = state.dataEnvrn->OutWetBulbTemp; } else { // Base temperatures at Z = 0 (C) Real64 const BaseDryTemp(state.dataEnvrn->OutDryBulbTemp + state.dataEnvrn->WeatherFileTempModCoeff); @@ -225,11 +225,11 @@ void SurfaceData::SetOutBulbTempAt(EnergyPlusData &state) Real64 const Z(Centroid.z); // Centroid value if (Z <= 0.0) { - OutDryBulbTemp = BaseDryTemp; - OutWetBulbTemp = BaseWetTemp; + state.dataSurface->SurfOutDryBulbTemp(Index) = BaseDryTemp; + state.dataSurface->SurfOutWetBulbTemp(Index) = BaseWetTemp; } else { - OutDryBulbTemp = BaseDryTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); - OutWetBulbTemp = BaseWetTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); + state.dataSurface->SurfOutDryBulbTemp(Index) = BaseDryTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); + state.dataSurface->SurfOutWetBulbTemp(Index) = BaseWetTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); } } } @@ -246,21 +246,21 @@ void SurfaceData::SetWindSpeedAt(EnergyPlusData &state, Real64 const fac) // Routine provides facility for doing bulk Set Windspeed at Height. if (state.dataEnvrn->SiteWindExp == 0.0) { - WindSpeed = state.dataEnvrn->WindSpeed; + state.dataSurface->SurfOutWindSpeed(Index) = state.dataEnvrn->WindSpeed; } else { Real64 const Z(Centroid.z); // Centroid value if (Z <= 0.0) { - WindSpeed = 0.0; + state.dataSurface->SurfOutWindSpeed(Index) = 0.0; } else { // [Met] - at meterological Station, Height of measurement is usually 10m above ground // LocalWindSpeed = Windspeed [Met] * (Wind Boundary LayerThickness [Met]/Height [Met])**Wind Exponent[Met] & // * (Height above ground / Site Wind Boundary Layer Thickness) ** Site Wind Exponent - WindSpeed = fac * std::pow(Z, state.dataEnvrn->SiteWindExp); + state.dataSurface->SurfOutWindSpeed(Index) = fac * std::pow(Z, state.dataEnvrn->SiteWindExp); } } } -void SurfaceData::SetWindDirAt(Real64 const fac) +void SurfaceData::SetWindDirAt(EnergyPlusData &state, Real64 const fac) { // SUBROUTINE INFORMATION: // AUTHOR X Luo @@ -272,7 +272,7 @@ void SurfaceData::SetWindDirAt(Real64 const fac) // Routine provides facility for doing bulk Set Windspeed locally. // Using/Aliasing - WindDir = fac; + state.dataSurface->SurfOutWindDir(Index) = fac; } Real64 SurfaceData::getInsideAirTemperature(EnergyPlusData &state, const int t_SurfNum) const @@ -368,14 +368,14 @@ Real64 SurfaceData::getOutsideAirTemperature(EnergyPlusData &state, const int t_ // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - temperature = OutWetBulbTemp; + temperature = state.dataSurface->SurfOutWetBulbTemp(t_SurfNum); } else { // Dry - temperature = OutDryBulbTemp; + temperature = state.dataSurface->SurfOutDryBulbTemp(t_SurfNum); } } else { // Window not exposed to wind - temperature = OutDryBulbTemp; + temperature = state.dataSurface->SurfOutDryBulbTemp(t_SurfNum); } } @@ -638,9 +638,9 @@ void CheckSurfaceOutBulbTempAt(EnergyPlusData &state) using DataEnvironment::SetOutBulbTempAt_error; Real64 minBulb = 0.0; - for (auto &surface : state.dataSurface->Surface) { - minBulb = min(minBulb, surface.OutDryBulbTemp, surface.OutWetBulbTemp); - if (minBulb < -100.0) SetOutBulbTempAt_error(state, "Surface", surface.Centroid.z, surface.Name); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { + minBulb = min(minBulb, state.dataSurface->SurfOutDryBulbTemp(SurfNum), state.dataSurface->SurfOutWetBulbTemp(SurfNum)); + if (minBulb < -100.0) SetOutBulbTempAt_error(state, "Surface", state.dataSurface->Surface(SurfNum).Centroid.z, state.dataSurface->Surface(SurfNum).Name); } } @@ -657,7 +657,7 @@ void SetSurfaceWindDirAt(EnergyPlusData &state) { // Using/Aliasing for (auto &surface : state.dataSurface->Surface) { - surface.SetWindDirAt(state.dataEnvrn->WindDir); + surface.SetWindDirAt(state, state.dataEnvrn->WindDir); } } diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index c31a9717c7d..baba61c427d 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -551,6 +551,7 @@ namespace DataSurfaces { using Plane = Vector4; // Members + int Index; std::string Name; // User supplied name of the surface (must be unique) int Construction; // Pointer to the construction in the Construct derived type int ConstructionStoredInputValue; // holds the original value for Construction per surface input @@ -605,6 +606,7 @@ namespace DataSurfaces { Real64 ViewFactorSkyIR; // View factor to the sky from the exterior of the surface for IR radiation Special/optional other side coefficients (OSC) int OSCPtr; // Pointer to OSC data structure int OSCMPtr; // "Pointer" to OSCM data structure (other side conditions from a model) + bool MirroredSurf; // True if it is a mirrored surface // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.) int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface @@ -664,44 +666,25 @@ namespace DataSurfaces { int FrameDivider; // Pointer to frame and divider information (windows only) Real64 Multiplier; // Multiplies glazed area, frame area and divider area (windows only) - Real64 OutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C) - Real64 OutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) - Real64 WindSpeed; // Surface outside wind speed, for surface heat balance (m/s) - Real64 WindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) - // TH added 3/26/2010 - bool MirroredSurf; // True if it is a mirrored surface - // additional attributes for convection correlations - bool IsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group - // LG added 1/6/12 - Real64 GenericContam; // [ppm] Surface generic contaminant as a storage term for // Air boundaries int SolarEnclIndex; // Pointer to solar enclosure this surface belongs to int SolarEnclSurfIndex; // Pointer to solar enclosure surface data, ZoneSolarInfo(n).SurfacePtr(RadEnclSurfIndex) points to this surface - bool IsAirBoundarySurf; // True if surface is an air boundary surface (Construction:AirBoundary), - - std::vector DisabledShadowingZoneList; // Array of all disabled shadowing zone number to the current surface - // the surface diffusion model - + bool IsAirBoundarySurf; // True if surface is an air boundary surface (Construction:AirBoundary) // Default Constructor SurfaceData() - : Construction(0), ConstructionStoredInputValue(0), + : Index(0), Construction(0), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None), Sides(0), Area(0.0), GrossArea(0.0), NetAreaShadowCalc(0.0), Perimeter(0.0), Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0), Width(0.0), HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), - ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), + ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), MirroredSurf(false), SchedShadowSurfIndex(0), ShadowSurfSchedVaries(false), ShadowingSurf(false), IsTransparent(false), SchedMinValue(0.0), ShadowSurfDiffuseSolRefl(0.0), ShadowSurfDiffuseVisRefl(0.0), ShadowSurfGlazingFrac(0.0), ShadowSurfGlazingConstruct(0), - MaterialMovInsulExt(0), - MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), MovInsulIntPresent(false), MovInsulIntPresentPrevTS(false), + MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), MovInsulIntPresent(false), MovInsulIntPresentPrevTS(false), Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), - OutDryBulbTemp(0.0), - OutWetBulbTemp(0.0),WindSpeed(0.0), - WindDir(0.0), - MirroredSurf(false), IsRadSurfOrVentSlabOrPool(false), GenericContam(0.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { } @@ -712,7 +695,7 @@ namespace DataSurfaces { void SetOutBulbTempAt(EnergyPlusData &state); - void SetWindDirAt(Real64 const fac); + void SetWindDirAt(EnergyPlusData &state, Real64 const fac); void SetWindSpeedAt(EnergyPlusData &state, Real64 const fac); @@ -1287,6 +1270,12 @@ struct SurfacesData : BaseGlobalStruct std::vector AllHTWindowSurfaceList; // List of all window surfaces std::vector AllSurfaceListReportOrder; // List of all surfaces - output reporting order + // Surface HB arrays + Array1D SurfOutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C) + Array1D SurfOutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) + Array1D SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s) + Array1D SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) + // Surface EMS Array1D SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value Array1D SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden @@ -1323,6 +1312,8 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIsICS; // true if this is an ICS collector Array1D SurfIsPool; // true if this is a pool Array1D SurfICSPtr; // Index to ICS collector + Array1D SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group + Array1D SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature @@ -1350,6 +1341,7 @@ struct SurfacesData : BaseGlobalStruct // Surface Shadow Properties Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction Array1D SurfShadowSurfRecSurfNum; // Receiving surface number + Array1D> SurfDisabledShadowingZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model // Surface Window Heat Balance Array1D SurfWinTransSolar; // Exterior beam plus diffuse solar transmitted through window, or window plus shade/blind, into zone (W) @@ -1650,6 +1642,10 @@ struct SurfacesData : BaseGlobalStruct this->AllHTNonWindowSurfaceList.clear(); this->AllHTWindowSurfaceList.clear(); this->AllSurfaceListReportOrder.clear(); + this->SurfOutDryBulbTemp.deallocate(); + this->SurfOutWetBulbTemp.deallocate(); + this->SurfOutWindSpeed.deallocate(); + this->SurfOutWindDir.deallocate(); this->SurfEMSConstructionOverrideON.deallocate(); this->SurfEMSConstructionOverrideValue.deallocate(); this->SurfEMSOverrideIntConvCoef.deallocate(); @@ -1672,6 +1668,7 @@ struct SurfacesData : BaseGlobalStruct this->SurfShadowSurfPossibleObstruction.deallocate(); this->SurfShadowSurfRecSurfNum.deallocate(); + this->SurfDisabledShadowingZoneList.deallocate(); this->SurfDaylightingShelfInd.deallocate(); this->SurfSchedExternalShadingFrac.deallocate(); this->SurfExternalShadingSchInd.deallocate(); @@ -1687,6 +1684,8 @@ struct SurfacesData : BaseGlobalStruct this->SurfIsICS.deallocate(); this->SurfIsPool.deallocate(); this->SurfICSPtr.deallocate(); + this->SurfIsRadSurfOrVentSlabOrPool.deallocate(); + this->SurfGenericContam.deallocate(); this->SurfIntConvCoeff.deallocate(); this->SurfExtConvCoeff.deallocate(); this->SurfTAirRef.deallocate(); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 43c01500a61..96fc30d2fd2 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -943,18 +943,18 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, int CollectorNum; // current solar collector index Real64 ICSWaterTemp; // ICS solar collector water temp Real64 ICSULossbottom; // ICS solar collector bottom loss Conductance - - Real64 const surfaceArea(sum_sub(state.dataSurface->Surface, &SurfaceData::Area, SurfPtrARR)); - + Real64 sum_area = 0.0; + Real64 sum_produc_area_drybulb = 0.0; + Real64 sum_produc_area_wetbulb = 0.0; + for (int SurfNum: SurfPtrARR) { + sum_area += state.dataSurface->Surface(SurfNum).Area; + sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); + sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); + } // LocalOutDryBulbTemp = sum( Surface( SurfPtrARR ).Area * Surface( SurfPtrARR ).OutDryBulbTemp ) / sum( Surface( SurfPtrARR ).Area ); - ////Autodesk:F2C++ Array subscript usage: Replaced by below - LocalOutDryBulbTemp = sum_product_sub(state.dataSurface->Surface, &SurfaceData::Area, &SurfaceData::OutDryBulbTemp, SurfPtrARR) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage - + LocalOutDryBulbTemp = sum_produc_area_drybulb / sum_area; // Autodesk:F2C++ Functions handle array subscript usage // LocalWetBulbTemp = sum( Surface( SurfPtrARR ).Area * Surface( SurfPtrARR ).OutWetBulbTemp ) / sum( Surface( SurfPtrARR ).Area ); - ////Autodesk:F2C++ Array subscript usage: Replaced by below - LocalWetBulbTemp = sum_product_sub(state.dataSurface->Surface, &SurfaceData::Area, &SurfaceData::OutWetBulbTemp, SurfPtrARR) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage + LocalWetBulbTemp = sum_produc_area_wetbulb / sum_area; LocalOutHumRat = PsyWFnTdbTwbPb(state, LocalOutDryBulbTemp, LocalWetBulbTemp, state.dataEnvrn->OutBaroPress, RoutineName); @@ -966,7 +966,7 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, Tamb = LocalWetBulbTemp; } // A = sum( Surface( SurfPtrARR ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below - A = surfaceArea; + A = sum_area; TmpTsBaf = TsBaffle; // loop through underlying surfaces and collect needed data @@ -982,7 +982,7 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, SurfPtr = SurfPtrARR(ThisSurf); // Initializations for this surface HMovInsul = 0.0; - LocalWindArr(ThisSurf) = state.dataSurface->Surface(SurfPtr).WindSpeed; + LocalWindArr(ThisSurf) = state.dataSurface->SurfOutWindSpeed(SurfPtr); InitExteriorConvectionCoeff( state, SurfPtr, HMovInsul, Roughness, AbsExt, TmpTsBaf, HExtARR(ThisSurf), HSkyARR(ThisSurf), HGroundARR(ThisSurf), HAirARR(ThisSurf)); ConstrNum = state.dataSurface->Surface(SurfPtr).Construction; diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 9feb9b5360f..e635b3e38da 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -216,42 +216,7 @@ namespace HeatBalanceManager { } bool anyRan; - if (state.dataGlobal->BeginSimFlag) { - state.dataSurface->SurfEMSConstructionOverrideON.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfEMSConstructionOverrideValue.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfEMSOverrideIntConvCoef.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfEMSValueForIntConvCoef.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfEMSOverrideExtConvCoef.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfEMSValueForExtConvCoef.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfOutDryBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfOutDryBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfOutWetBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfOutWetBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfWindSpeedEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfWindSpeedEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfViewFactorGroundEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfViewFactorGroundEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfWindDirEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfWindDirEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfEMSConstructionOverrideON(SurfNum) = false; - state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum) = 0.0; - state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum) = false; - state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum) = 0.0; - state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum) = false; - state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum) = 0.0; - state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum) = false; - state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum) = 0.0; - state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum) = false; - state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum) = 0.0; - state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum) = false; - state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum) = 0.0; - state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum) = false; - state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum) = 0.0; - state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum) = false; - state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum) = 0.0; - } - } + ManageEMS(state, EMSManager::EMSCallFrom::BeginZoneTimestepBeforeInitHeatBalance, anyRan, @@ -5774,13 +5739,6 @@ namespace HeatBalanceManager { // Use the total number of zones or surfaces to allocate variables to avoid a limit // Allocate real Variables // Following used for Calculations - // Allocate solar shading variables - state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfPenumbraID(SurfNum) = 0; - state.dataSurface->SurfDaylightingShelfInd(SurfNum) = 0; - } // Allocate variables in DataHeatBalSys state.dataHeatBalFanSys->SumConvHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBalFanSys->SumLatentHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 734154a874a..4c3ab322b64 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -319,10 +319,10 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) if (state.dataGlobal->AnyLocalEnvironmentsInModel) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (state.dataSurface->SurfHasLinkedOutAirNode(SurfNum)) { - Surface(SurfNum).OutDryBulbTemp = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirDryBulb; - Surface(SurfNum).OutWetBulbTemp = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWetBulb; - Surface(SurfNum).WindSpeed = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindSpeed; - Surface(SurfNum).WindDir = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindDir; + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirDryBulb; + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWetBulb; + state.dataSurface->SurfOutWindSpeed(SurfNum) = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindSpeed; + state.dataSurface->SurfOutWindDir(SurfNum) = state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindDir; } if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime && state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { @@ -369,16 +369,16 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) if (state.dataGlobal->AnyEnergyManagementSystemInModel) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum)) { - Surface(SurfNum).OutDryBulbTemp = state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum); + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum); } if (state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum)) { - Surface(SurfNum).OutWetBulbTemp = state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum); + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum); } if (state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum)) { - Surface(SurfNum).WindSpeed = state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum); + state.dataSurface->SurfOutWindSpeed(SurfNum) = state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum); } if (state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum)) { - Surface(SurfNum).WindDir = state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum); + state.dataSurface->SurfOutWindDir(SurfNum) = state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum); } if (state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum)) { Surface(SurfNum).ViewFactorGround = state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum); @@ -1654,28 +1654,28 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Outside Face Outdoor Air Drybulb Temperature", OutputProcessor::Unit::C, - Surface(loop).OutDryBulbTemp, + state.dataSurface->SurfOutDryBulbTemp(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Outdoor Air Wetbulb Temperature", OutputProcessor::Unit::C, - Surface(loop).OutWetBulbTemp, + state.dataSurface->SurfOutWetBulbTemp(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Outdoor Air Wind Speed", OutputProcessor::Unit::m_s, - Surface(loop).WindSpeed, + state.dataSurface->SurfOutWindSpeed(loop), "Zone", "State", Surface(loop).Name); SetupOutputVariable(state, "Surface Outside Face Outdoor Air Wind Direction", OutputProcessor::Unit::deg, - Surface(loop).WindDir, + state.dataSurface->SurfOutWindDir(loop), "Zone", "State", Surface(loop).Name); @@ -2239,9 +2239,9 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) if ((Surface(SurfNum).ExtBoundCond == ExternalEnvironment) || (Surface(SurfNum).ExtBoundCond == OtherSideCondModeledExt)) { state.dataHeatBalSurf->THM(1, {1, state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms + 1}, SurfNum) = - Surface(SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(SurfNum); state.dataHeatBalSurf->TH(1, {1, state.dataConstruction->Construct(Surface(SurfNum).Construction).NumCTFTerms + 1}, SurfNum) = - Surface(SurfNum).OutDryBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(SurfNum); } else if (Surface(SurfNum).ExtBoundCond == Ground) { @@ -5963,10 +5963,10 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(zoneNum) + - state.dataSurface->OSC(OPtr).ExtDryBulbCoef * Surface(SurfNum).OutDryBulbTemp + + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(SurfNum) + ConstantTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + - state.dataSurface->OSC(OPtr).WindSpeedCoef * Surface(SurfNum).WindSpeed * Surface(SurfNum).OutDryBulbTemp + + state.dataSurface->OSC(OPtr).WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(SurfNum) * state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataSurface->OSC(OPtr).TPreviousCoef * state.dataSurface->OSC(OPtr).TOutsideSurfPast); // Enforce max/min limits if applicable @@ -6026,10 +6026,10 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataSurface->OSC(OPtr).OSCTempCalc = (state.dataSurface->OSC(OPtr).ZoneAirTempCoef * state.dataHeatBalFanSys->MAT(zoneNum) + - state.dataSurface->OSC(OPtr).ExtDryBulbCoef * Surface(SurfNum).OutDryBulbTemp + + state.dataSurface->OSC(OPtr).ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataSurface->OSC(OPtr).ConstTempCoef * state.dataSurface->OSC(OPtr).ConstTemp + state.dataSurface->OSC(OPtr).GroundTempCoef * state.dataEnvrn->GroundTemp + - state.dataSurface->OSC(OPtr).WindSpeedCoef * Surface(SurfNum).WindSpeed * Surface(SurfNum).OutDryBulbTemp + + state.dataSurface->OSC(OPtr).WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(SurfNum) * state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataSurface->OSC(OPtr).TPreviousCoef * state.dataSurface->OSC(OPtr).TOutsideSurfPast); // Enforce max/min limits if applicable @@ -6190,7 +6190,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataHeatBalSurf->HcExtSurf(SurfNum) = SetExtConvectionCoeff(state, SurfNum); } - TempExt = Surface(SurfNum).OutWetBulbTemp; + TempExt = state.dataSurface->SurfOutWetBulbTemp(SurfNum); // start HAMT if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { @@ -6240,7 +6240,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, } else { // Surface is dry, use the normal correlation - TempExt = Surface(SurfNum).OutDryBulbTemp; + TempExt = state.dataSurface->SurfOutDryBulbTemp(SurfNum); if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { @@ -6285,7 +6285,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, state.dataHeatBalSurf->HGrdExtSurf(SurfNum), state.dataHeatBalSurf->HAirExtSurf(SurfNum)); - TempExt = Surface(SurfNum).OutDryBulbTemp; + TempExt = state.dataSurface->SurfOutDryBulbTemp(SurfNum); if (Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::CondFD || Surface(SurfNum).HeatTransferAlgorithm == DataSurfaces::iHeatTransferModel::HAMT) { @@ -6436,9 +6436,9 @@ Real64 GetQdotConvOutRepPerArea(EnergyPlusData &state, int const SurfNum) return -state.dataSurface->OSCM(OPtr).HConv * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->OSCM(OPtr).TConv); } else { if (state.dataEnvrn->IsRain) { - return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutWetBulbTemp); + return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutWetBulbTemp(SurfNum)); } else { - return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp); + return -state.dataHeatBalSurf->HcExtSurf(SurfNum) * (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); } } } @@ -8593,7 +8593,7 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, // Calculate surface heat emission to the air, positive values indicates heat transfer from surface to the outside state.dataHeatBalSurf->QAirExtReport(SurfNum) = Surface(SurfNum).Area * state.dataHeatBalSurf->HAirExtSurf(SurfNum) * - (state.dataHeatBalSurf->TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp); + (state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); // Set the radiant system heat balance coefficients if this surface is also a radiant system if (construct.SourceSinkPresent) { @@ -8671,13 +8671,12 @@ void CalcExteriorVentedCavity(EnergyPlusData &state, int const SurfNum) // index int thisOSCM; Real64 TempExt; Real64 OutHumRatExt; - auto &Surface(state.dataSurface->Surface); CavNum = state.dataSurface->SurfExtCavNum(SurfNum); - TempExt = Surface(SurfNum).OutDryBulbTemp; + TempExt = state.dataSurface->SurfOutDryBulbTemp(SurfNum); - OutHumRatExt = PsyWFnTdbTwbPb(state, Surface(SurfNum).OutDryBulbTemp, Surface(SurfNum).OutWetBulbTemp, state.dataEnvrn->OutBaroPress); + OutHumRatExt = PsyWFnTdbTwbPb(state, state.dataSurface->SurfOutDryBulbTemp(SurfNum), state.dataSurface->SurfOutWetBulbTemp(SurfNum), state.dataEnvrn->OutBaroPress); RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, TempExt, OutHumRatExt); diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index afb553cce77..448a06895fa 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -691,7 +691,7 @@ namespace LowTempRadiantSystem { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(5), Alphas(5))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + Alphas(1)); ErrorsFound = true; - } else if (Surface(thisRadSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { + } else if (state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(thisRadSys.SurfacePtr(1))) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Invalid Surface"); ShowContinueError(state, cAlphaFields(5) + "=\"" + Alphas(5) + "\" has been used in another radiant system or ventilated slab."); ErrorsFound = true; @@ -992,14 +992,14 @@ namespace LowTempRadiantSystem { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(4), Alphas(4))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + Alphas(1)); ErrorsFound = true; - } else if (Surface(thisCFloSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { + } else if (state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(thisCFloSys.SurfacePtr(1))) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Invalid Surface"); ShowContinueError(state, cAlphaFields(5) + "=\"" + Alphas(5) + "\" has been used in another radiant system or ventilated slab."); ErrorsFound = true; } if (thisCFloSys.SurfacePtr(1) != 0) { state.dataSurface->SurfIntConvSurfHasActiveInIt(thisCFloSys.SurfacePtr(1)) = true; - Surface(thisCFloSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(thisCFloSys.SurfacePtr(1)) = true; } } @@ -1227,13 +1227,13 @@ namespace LowTempRadiantSystem { ShowSevereError(state, format("{}Invalid {} = {}", RoutineName, cAlphaFields(4), Alphas(4))); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + Alphas(1)); ErrorsFound = true; - } else if (Surface(thisElecSys.SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { + } else if (state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(thisElecSys.SurfacePtr(1))) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + "\", Invalid Surface"); ShowContinueError(state, cAlphaFields(4) + "=\"" + Alphas(4) + "\" has been used in another radiant system or ventilated slab."); ErrorsFound = true; } if (thisElecSys.SurfacePtr(1) != 0) { - Surface(state.dataLowTempRadSys->ElecRadSys(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(state.dataLowTempRadSys->ElecRadSys(Item).SurfacePtr(1)) = true; } } diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 0862f6fb9fd..f968b3e1e04 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -1034,8 +1034,8 @@ namespace PhotovoltaicThermalCollectors { Real64 Tcollector = (2.0 * mdot * CpInlet * Tinlet + this->AreaCol * (HrGround * state.dataEnvrn->OutDryBulbTemp + HrSky * state.dataEnvrn->SkyTemp + - HrAir * state.dataSurface->Surface(this->SurfNum).OutDryBulbTemp + - HcExt * state.dataSurface->Surface(this->SurfNum).OutDryBulbTemp)) / + HrAir * state.dataSurface->SurfOutDryBulbTemp(this->SurfNum) + + HcExt * state.dataSurface->SurfOutDryBulbTemp(this->SurfNum))) / (2.0 * mdot * CpInlet + this->AreaCol * (HrGround + HrSky + HrAir + HcExt)); PotentialOutletTemp = 2.0 * Tcollector - Tinlet; diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index 2cf0e67ab36..ecbf38db33e 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -943,8 +943,8 @@ namespace Photovoltaics { std::acos(state.dataHeatBal->SurfCosIncidenceAngle(ThisSurf)) / DataGlobalConstants::DegToRadians; // (deg) from dataHeatBalance state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.ZenithAngle = std::acos(state.dataEnvrn->SOLCOS(3)) / DataGlobalConstants::DegToRadians; //(degrees), - state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Tamb = state.dataSurface->Surface(ThisSurf).OutDryBulbTemp; //(deg. C) - state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.WindSpeed = state.dataSurface->Surface(ThisSurf).WindSpeed; // (m/s) + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Tamb = state.dataSurface->SurfOutDryBulbTemp(ThisSurf); //(deg. C) + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.WindSpeed = state.dataSurface->SurfOutWindSpeed(ThisSurf); // (m/s) state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Altitude = state.dataEnvrn->Elevation; // from DataEnvironment via USE if (((state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.IcBeam + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.IcDiffuse) > @@ -1187,9 +1187,9 @@ namespace Photovoltaics { // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && state.dataPhotovoltaicState->MyEnvrnFlag(PVnum)) { state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVcalc.CellTempK = - state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + DataGlobalConstants::KelvinConv; state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVcalc.LastCellTempK = - state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + DataGlobalConstants::KelvinConv; state.dataPhotovoltaicState->MyEnvrnFlag(PVnum) = false; } @@ -1281,7 +1281,7 @@ namespace Photovoltaics { state.dataPhotovoltaic->ShuntResistance = state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVModule.ShuntResistance; // convert ambient temperature from C to K - Tambient = state.dataSurface->Surface(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + Tambient = state.dataSurface->SurfOutDryBulbTemp(state.dataPhotovoltaic->PVarray(PVnum).SurfacePtr) + DataGlobalConstants::KelvinConv; if ((state.dataPhotovoltaic->PVarray(PVnum).TRNSYSPVcalc.Insolation > MinInsolation) && (RunFlag)) { diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index be8446af17a..24e1a55e305 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -1139,19 +1139,19 @@ namespace SolarCollectors { if (SELECT_CASE_var == TestTypeEnum::INLET) { FRULpTest = state.dataSolarCollectors->Parameters(ParamNum).eff1 + - state.dataSolarCollectors->Parameters(ParamNum).eff2 * (inletTemp - state.dataSurface->Surface(SurfNum).OutDryBulbTemp); + state.dataSolarCollectors->Parameters(ParamNum).eff2 * (inletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); TestTypeMod = 1.0; } else if (SELECT_CASE_var == TestTypeEnum::AVERAGE) { FRULpTest = state.dataSolarCollectors->Parameters(ParamNum).eff1 + state.dataSolarCollectors->Parameters(ParamNum).eff2 * - ((inletTemp + outletTemp) * 0.5 - state.dataSurface->Surface(SurfNum).OutDryBulbTemp); + ((inletTemp + outletTemp) * 0.5 - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); TestTypeMod = 1.0 / (1.0 - FRULpTest / (2.0 * mCpATest)); } else if (SELECT_CASE_var == TestTypeEnum::OUTLET) { FRULpTest = state.dataSolarCollectors->Parameters(ParamNum).eff1 + - state.dataSolarCollectors->Parameters(ParamNum).eff2 * (outletTemp - state.dataSurface->Surface(SurfNum).OutDryBulbTemp); + state.dataSolarCollectors->Parameters(ParamNum).eff2 * (outletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); TestTypeMod = 1.0 / (1.0 - FRULpTest / mCpATest); } } @@ -1194,7 +1194,7 @@ namespace SolarCollectors { // Calculate fluid heat gain (or loss) // Heat loss is possible if there is no incident radiation and fluid is still flowing. Q = (FRTAN * incidentAngleModifier * state.dataHeatBal->SurfQRadSWOutIncident(SurfNum) + - FRULpTest * (inletTemp - state.dataSurface->Surface(SurfNum).OutDryBulbTemp)) * + FRULpTest * (inletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum))) * area * FlowMod; outletTemp = inletTemp + Q / (massFlowRate * Cp); @@ -1223,9 +1223,9 @@ namespace SolarCollectors { // Calculate temperature of stagnant fluid in collector Real64 A = -FRULT; - Real64 B = -FRUL + 2.0 * FRULT * state.dataSurface->Surface(SurfNum).OutDryBulbTemp; - Real64 C = -FRULT * pow_2(state.dataSurface->Surface(SurfNum).OutDryBulbTemp) + - FRUL * state.dataSurface->Surface(SurfNum).OutDryBulbTemp - + Real64 B = -FRUL + 2.0 * FRULT * state.dataSurface->SurfOutDryBulbTemp(SurfNum); + Real64 C = -FRULT * pow_2(state.dataSurface->SurfOutDryBulbTemp(SurfNum)) + + FRUL * state.dataSurface->SurfOutDryBulbTemp(SurfNum) - FRTAN * incidentAngleModifier * state.dataHeatBal->SurfQRadSWOutIncident(SurfNum); Real64 qEquation = (pow_2(B) - 4.0 * A * C); if (qEquation < 0.0) { @@ -1245,7 +1245,7 @@ namespace SolarCollectors { qEquation); } if (FRULT == 0.0 || qEquation < 0.0) { // Linear, 1st order solution - outletTemp = state.dataSurface->Surface(SurfNum).OutDryBulbTemp - + outletTemp = state.dataSurface->SurfOutDryBulbTemp(SurfNum) - FRTAN * incidentAngleModifier * state.dataHeatBal->SurfQRadSWOutIncident(SurfNum) / FRUL; } else { // Quadratic, 2nd order solution outletTemp = (-B + std::sqrt(qEquation)) / (2.0 * A); @@ -1363,7 +1363,7 @@ namespace SolarCollectors { Real64 SecInTimeStep = state.dataHVACGlobal->TimeStepSys * DataGlobalConstants::SecInHour; Real64 TempWater = this->SavedTempOfWater; Real64 TempAbsPlate = this->SavedTempOfAbsPlate; - Real64 TempOutdoorAir = state.dataSurface->Surface(SurfNum).OutDryBulbTemp; + Real64 TempOutdoorAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum); Real64 TempOSCM; // Otherside condition model temperature [C] if (this->OSCM_ON) { @@ -1769,7 +1769,7 @@ namespace SolarCollectors { Real64 TempAbsPlate = this->SavedTempOfAbsPlate; // absorber plate average temperature [C] Real64 TempInnerCover = this->SavedTempOfInnerCover; // inner cover average temperature [C] Real64 TempOuterCover = this->SavedTempOfOuterCover; // outer cover average temperature [C] - Real64 TempOutdoorAir = state.dataSurface->Surface(SurfNum).OutDryBulbTemp; // outdoor air temperature [C] + Real64 TempOutdoorAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum); // outdoor air temperature [C] Real64 EmissOfAbsPlate = state.dataSolarCollectors->Parameters(ParamNum).EmissOfAbsPlate; // emissivity of absorber plate Real64 EmissOfOuterCover = state.dataSolarCollectors->Parameters(ParamNum).EmissOfCover(1); // emissivity of outer cover @@ -1818,7 +1818,7 @@ namespace SolarCollectors { } // Calc collector outside surface convection heat transfer coefficient: - hConvCoefC2O = 2.8 + 3.0 * state.dataSurface->Surface(SurfNum).WindSpeed; + hConvCoefC2O = 2.8 + 3.0 * state.dataSurface->SurfOutWindSpeed(SurfNum); // Calc linearized radiation coefficient between outer cover and the surrounding: tempnom = state.dataSurface->Surface(SurfNum).ViewFactorSky * EmissOfOuterCover * DataGlobalConstants::StefanBoltzmann * @@ -1862,7 +1862,7 @@ namespace SolarCollectors { // calculate the side loss coefficient. Adds the insulation resistance and the combined // convection-radiation coefficients in series. - Real64 hRadConvOut = 5.7 + 3.8 * state.dataSurface->Surface(SurfNum).WindSpeed; + Real64 hRadConvOut = 5.7 + 3.8 * state.dataSurface->SurfOutWindSpeed(SurfNum); this->UsLoss = 1.0 / (1.0 / (state.dataSolarCollectors->Parameters(ParamNum).ULossSide * this->AreaRatio) + 1.0 / (hRadConvOut * this->AreaRatio)); diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index edc5a859dc8..69629f92fab 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -662,12 +662,12 @@ void GetShadowingInput(EnergyPlusData &state) if (SurfZoneGroup == CurZoneGroup && DisableSelfShadingWithinGroup) { for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { // Loop through all zones in the zone list - state.dataSurface->Surface(SurfNum).DisabledShadowingZoneList.push_back( + state.dataSurface->SurfDisabledShadowingZoneList(SurfNum).push_back( state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); } } else if (SurfZoneGroup != CurZoneGroup && DisableSelfShadingBetweenGroup) { for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { - state.dataSurface->Surface(SurfNum).DisabledShadowingZoneList.push_back( + state.dataSurface->SurfDisabledShadowingZoneList(SurfNum).push_back( state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); } } @@ -930,11 +930,6 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataSurface->SurfWinBmSolAbsdInsRevealReport(SurfNum) = 0.0; } - state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); - for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfPenumbraID(SurfNum) = 0; - } - DisplayString(state, "Initializing Zone and Enclosure Report Variables"); for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { auto &thisEnclosureName = state.dataViewFactor->ZoneSolarInfo(enclosureNum).Name; @@ -5884,7 +5879,7 @@ void SHDGSS(EnergyPlusData &state, continue; // Disable all shadowing surfaces in all zones. Attached shading surfaces are not part of a zone, zone value is 0. } } else if (state.dataSysVars->DisableGroupSelfShading) { - std::vector DisabledZones = state.dataSurface->Surface(CurSurf).DisabledShadowingZoneList; + std::vector DisabledZones = state.dataSurface->SurfDisabledShadowingZoneList(CurSurf); bool isDisabledShadowSurf = false; for (int i : DisabledZones) { if (surface.Zone == i) { @@ -9703,7 +9698,7 @@ void WindowShadingManager(EnergyPlusData &state) break; case WindowShadingControlType::HiOutAirTemp: // 'OnIfHighOutdoorAirTemperature' - if (state.dataSurface->Surface(ISurf).OutDryBulbTemp > SetPoint && SchedAllowsControl) { + if (state.dataSurface->SurfOutDryBulbTemp(ISurf) > SetPoint && SchedAllowsControl) { shadingOn = true; } else if (GlareControlIsActive) { shadingOffButGlareControlOn = true; @@ -9721,7 +9716,7 @@ void WindowShadingManager(EnergyPlusData &state) case WindowShadingControlType::OnHiOutTemp_HiSolarWindow: // 'OnIfHighOutdoorAirTempAndHighSolarOnWindow' ! Outside air temp and solar on // window if (state.dataEnvrn->SunIsUp) { - if (state.dataSurface->Surface(ISurf).OutDryBulbTemp > SetPoint && SolarOnWindow > SetPoint2 && SchedAllowsControl) { + if (state.dataSurface->SurfOutDryBulbTemp(ISurf) > SetPoint && SolarOnWindow > SetPoint2 && SchedAllowsControl) { shadingOn = true; } else if (GlareControlIsActive) { shadingOffButGlareControlOn = true; @@ -9732,7 +9727,7 @@ void WindowShadingManager(EnergyPlusData &state) case WindowShadingControlType::OnHiOutTemp_HiHorzSolar: // 'OnIfHighOutdoorAirTempAndHighHorizontalSolar' ! Outside air temp and // horizontal solar if (state.dataEnvrn->SunIsUp) { - if (state.dataSurface->Surface(ISurf).OutDryBulbTemp > SetPoint && HorizSolar > SetPoint2 && SchedAllowsControl) { + if (state.dataSurface->SurfOutDryBulbTemp(ISurf) > SetPoint && HorizSolar > SetPoint2 && SchedAllowsControl) { shadingOn = true; } else if (GlareControlIsActive) { shadingOffButGlareControlOn = true; @@ -9793,7 +9788,7 @@ void WindowShadingManager(EnergyPlusData &state) break; case WindowShadingControlType::OnNightLoOutTemp_OffDay: // 'OnNightIfLowOutdoorTempAndOffDay' - if (!state.dataEnvrn->SunIsUp && state.dataSurface->Surface(ISurf).OutDryBulbTemp < SetPoint && SchedAllowsControl) { + if (!state.dataEnvrn->SunIsUp && state.dataSurface->SurfOutDryBulbTemp(ISurf) < SetPoint && SchedAllowsControl) { shadingOn = true; } else if (GlareControlIsActive) { shadingOffButGlareControlOn = true; @@ -9821,7 +9816,7 @@ void WindowShadingManager(EnergyPlusData &state) case WindowShadingControlType::OnNightLoOutTemp_OnDayCooling: // 'OnNightIfLowOutdoorTempAndOnDayIfCooling' if (!state.dataGlobal->BeginSimFlag) { if (!state.dataEnvrn->SunIsUp) { // Night - if (state.dataSurface->Surface(ISurf).OutDryBulbTemp < SetPoint && SchedAllowsControl) shadingOn = true; + if (state.dataSurface->SurfOutDryBulbTemp(ISurf) < SetPoint && SchedAllowsControl) shadingOn = true; } else { // Day if (state.dataHeatBal->SNLoadCoolRate(IZone) > 0.0 && SchedAllowsControl) { shadingOn = true; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index a193eb28c91..a717dd8b080 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -868,7 +868,6 @@ namespace SurfaceGeometry { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // na - state.dataSurface->ShadeV.allocate(state.dataSurface->TotSurfaces); for (auto &e : state.dataSurface->ShadeV) e.NVert = 0; @@ -891,9 +890,60 @@ namespace SurfaceGeometry { state.dataSurface->SurfWinADiffFront.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); state.dataSurface->SurfWinACFOverlap.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); + // Surface EMS arrays + state.dataSurface->SurfEMSConstructionOverrideON.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSConstructionOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSOverrideIntConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSValueForIntConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSOverrideExtConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfEMSValueForExtConvCoef.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutDryBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutDryBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWetBulbTempEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWetBulbTempEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindSpeedEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindSpeedEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfViewFactorGroundEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfViewFactorGroundEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindDirEMSOverrideOn.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfWindDirEMSOverrideValue.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfEMSConstructionOverrideON(SurfNum) = false; + state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum) = false; + state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum) = 0.0; + state.dataSurface->SurfEMSOverrideExtConvCoef(SurfNum) = false; + state.dataSurface->SurfEMSValueForExtConvCoef(SurfNum) = 0.0; + state.dataSurface->SurfOutDryBulbTempEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfOutDryBulbTempEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfOutWetBulbTempEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfOutWetBulbTempEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfWindSpeedEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfWindSpeedEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfViewFactorGroundEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfViewFactorGroundEMSOverrideValue(SurfNum) = 0.0; + state.dataSurface->SurfWindDirEMSOverrideOn(SurfNum) = false; + state.dataSurface->SurfWindDirEMSOverrideValue(SurfNum) = 0.0; + } + // Following are surface hb arrays + state.dataSurface->SurfOutDryBulbTemp.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWetBulbTemp.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWindSpeed.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfOutWindDir.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfGenericContam.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = 0.0; + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = 0.0; + state.dataSurface->SurfOutWindSpeed(SurfNum) = 0.0; + state.dataSurface->SurfOutWindDir(SurfNum) = 0.0; + state.dataSurface->SurfGenericContam(SurfNum) = 0.0; + state.dataSurface->SurfPenumbraID(SurfNum) = 0; + } // Following are surface property arrays used in SurfaceGeometry state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowSurfRecSurfNum.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfDisabledShadowingZoneList.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfSchedExternalShadingFrac.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfExternalShadingSchInd.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHasSurroundingSurfProperties.allocate(state.dataSurface->TotSurfaces); @@ -907,6 +957,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfIsICS.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIsPool.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfICSPtr.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; @@ -923,6 +975,8 @@ namespace SurfaceGeometry { state.dataSurface->SurfIsICS(SurfNum) = false; state.dataSurface->SurfIsPool(SurfNum) = false; state.dataSurface->SurfICSPtr(SurfNum) = 0; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(SurfNum) = false; + state.dataSurface->SurfDaylightingShelfInd(SurfNum) = 0; } state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); @@ -2673,6 +2727,7 @@ namespace SurfaceGeometry { // Initialize run time surface arrays for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->Surface(SurfNum).Construction; + state.dataSurface->Surface(SurfNum).Index = SurfNum; } } diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 69164743a7e..ee4b8915898 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -404,7 +404,7 @@ void SwimmingPoolData::ErrorCheckSetupPoolSurface( ShowSevereError(state, RoutineName + "Invalid " + cAlphaField2 + " = " + Alpha2); ShowContinueError(state, "Occurs in " + CurrentModuleObject + " = " + Alpha1); ErrorsFound = true; - } else if (state.dataSurface->Surface(this->SurfacePtr).IsRadSurfOrVentSlabOrPool) { + } else if (state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(this->SurfacePtr)) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alpha1 + "\", Invalid Surface"); ShowContinueError(state, cAlphaField2 + "=\"" + Alpha2 + "\" has been used in another radiant system, ventilated slab, or pool."); ShowContinueError(state, @@ -435,7 +435,7 @@ void SwimmingPoolData::ErrorCheckSetupPoolSurface( " is a pool and uses a construction with a source/sink. This is not allowed. Use a standard construction for this surface."); ErrorsFound = true; } else { // ( Pool( Item ).SurfacePtr > 0 ) - state.dataSurface->Surface(this->SurfacePtr).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(this->SurfacePtr) = true; state.dataSurface->SurfIsPool(this->SurfacePtr) = true; this->ZonePtr = state.dataSurface->Surface(this->SurfacePtr).Zone; // Check to make sure pool surface is a floor diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 25d3a844e1c..259c662a158 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -911,19 +911,22 @@ namespace TranspiredCollector { } // determine average ambient temperature - Real64 const surfaceArea(sum_sub(state.dataSurface->Surface, &SurfaceData::Area, state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs)); + Real64 sum_area = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_area += state.dataSurface->Surface(SurfNum).Area; + } if (!state.dataEnvrn->IsRain) { - Tamb = sum_product_sub(state.dataSurface->Surface, - &SurfaceData::OutDryBulbTemp, - &SurfaceData::Area, - state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; + Real64 sum_produc_area_drybulb = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); + } + Tamb = sum_produc_area_drybulb / sum_area; } else { // when raining we use wet bulb not drybulb - Tamb = sum_product_sub(state.dataSurface->Surface, - &SurfaceData::OutWetBulbTemp, - &SurfaceData::Area, - state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; + Real64 sum_produc_area_wetbulb = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); + } + Tamb = sum_produc_area_wetbulb / sum_area; } // inits for each iteration @@ -1031,24 +1034,22 @@ namespace TranspiredCollector { // Active UTSC calculation // first do common things for both correlations - Real64 const surfaceArea(sum_sub(state.dataSurface->Surface, &SurfaceData::Area, state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs)); + Real64 sum_area = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_area += state.dataSurface->Surface(SurfNum).Area; + } if (!state.dataEnvrn->IsRain) { - // Tamb = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).OutDryBulbTemp * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / sum( - // Surface( UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below - Tamb = sum_product_sub(state.dataSurface->Surface, - &SurfaceData::OutDryBulbTemp, - &SurfaceData::Area, - state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage - + Real64 sum_produc_area_drybulb = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); + } + Tamb = sum_produc_area_drybulb / sum_area; } else { // when raining we use wet bulb not drybulb - // Tamb = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).OutWetBulbTemp * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / sum( - // Surface( UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below - Tamb = sum_product_sub(state.dataSurface->Surface, - &SurfaceData::OutWetBulbTemp, - &SurfaceData::Area, - state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage + Real64 sum_produc_area_wetbulb = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); + } + Tamb = sum_produc_area_wetbulb / sum_area; } RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, Tamb, state.dataEnvrn->OutHumRat); @@ -1126,7 +1127,7 @@ namespace TranspiredCollector { // Initializations for this surface HMovInsul = 0.0; HExt = 0.0; - LocalWindArr(ThisSurf) = state.dataSurface->Surface(SurfPtr).WindSpeed; + LocalWindArr(ThisSurf) = state.dataSurface->SurfOutWindSpeed(SurfPtr); InitExteriorConvectionCoeff( state, SurfPtr, HMovInsul, Roughness, AbsExt, TempExt, HExt, HSkyARR(ThisSurf), HGroundARR(ThisSurf), HAirARR(ThisSurf)); ConstrNum = state.dataSurface->Surface(SurfPtr).Construction; @@ -1316,19 +1317,19 @@ namespace TranspiredCollector { Real64 Twbamb; Real64 OutHumRatAmb; - Real64 const surfaceArea(sum_sub(state.dataSurface->Surface, &SurfaceData::Area, state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs)); // Tamb = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).OutDryBulbTemp * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / sum( Surface( // UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below - Tamb = - sum_product_sub( - state.dataSurface->Surface, &SurfaceData::OutDryBulbTemp, &SurfaceData::Area, state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage - // Twbamb = sum( Surface( UTSC( UTSCNum ).SurfPtrs ).OutWetBulbTemp * Surface( UTSC( UTSCNum ).SurfPtrs ).Area ) / sum( Surface( - // UTSC( UTSCNum ).SurfPtrs ).Area ); //Autodesk:F2C++ Array subscript usage: Replaced by below - Twbamb = - sum_product_sub( - state.dataSurface->Surface, &SurfaceData::OutWetBulbTemp, &SurfaceData::Area, state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) / - surfaceArea; // Autodesk:F2C++ Functions handle array subscript usage + Real64 sum_area = 0.0; + Real64 sum_produc_area_drybulb = 0.0; + Real64 sum_produc_area_wetbulb = 0.0; + for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + sum_area += state.dataSurface->Surface(SurfNum).Area; + sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); + sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); + } + Tamb = sum_produc_area_drybulb / sum_area; + Twbamb = sum_produc_area_wetbulb / sum_area; + OutHumRatAmb = PsyWFnTdbTwbPb(state, Tamb, Twbamb, state.dataEnvrn->OutBaroPress); RhoAir = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, Tamb, OutHumRatAmb); diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 997b8075ea9..b93fbe5a45a 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -392,7 +392,7 @@ namespace VentilatedSlab { CurrentModuleObject + "=\"" + state.dataIPShortCut->cAlphaArgs(1) + "\" invalid " + cAlphaFields(4) + "=\"" + state.dataIPShortCut->cAlphaArgs(4) + "\" not found."); ErrorsFound = true; - } else if (state.dataSurface->Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool) { + } else if (state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1))) { ShowSevereError(state, CurrentModuleObject + "=\"" + state.dataIPShortCut->cAlphaArgs(1) + "\", invalid Surface"); ShowContinueError(state, cAlphaFields(4) + "=\"" + state.dataIPShortCut->cAlphaArgs(4) + @@ -401,7 +401,7 @@ namespace VentilatedSlab { } if (state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1) != 0) { state.dataSurface->SurfIntConvSurfHasActiveInIt(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)) = true; - state.dataSurface->Surface(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)).IsRadSurfOrVentSlabOrPool = true; + state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(state.dataVentilatedSlab->VentSlab(Item).SurfacePtr(1)) = true; } } diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 25bad522836..81189a28345 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2899,12 +2899,12 @@ namespace WindowComplexManager { } if (state.dataSurface->Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - tout = state.dataSurface->Surface(SurfNum).OutWetBulbTemp + DataGlobalConstants::KelvinConv; + tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } else { // Dry - tout = state.dataSurface->Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } } else { // Window not exposed to wind - tout = state.dataSurface->Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } // tsky = SkyTemp + TKelvin tsky = state.dataEnvrn->SkyTempKelvin; @@ -2940,7 +2940,7 @@ namespace WindowComplexManager { // WinShadingType::ExtShade) THEN // wso = 0.0 ! Assume zero wind speed at outside glass surface of window with exterior shade } else { - wso = state.dataSurface->Surface(SurfNum).WindSpeed; + wso = state.dataSurface->SurfOutWindSpeed(SurfNum); } // indoor wind speed diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index b05a4058c00..2209b3cbceb 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -850,12 +850,12 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, } if (state.dataSurface->Surface(SurfNum).ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - Tout = state.dataSurface->Surface(SurfNum).OutWetBulbTemp + DataGlobalConstants::KelvinConv; + Tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } else { // Dry - Tout = state.dataSurface->Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } } else { // Window not exposed to wind - Tout = state.dataSurface->Surface(SurfNum).OutDryBulbTemp + DataGlobalConstants::KelvinConv; + Tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + DataGlobalConstants::KelvinConv; } tsky = state.dataEnvrn->SkyTempKelvin; Ebout = DataGlobalConstants::StefanBoltzmann * pow_4(Tout); diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index fc4f84eb9a4..342b69b0ed5 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2324,12 +2324,12 @@ namespace WindowManager { // how to solve this in more elegant way :( if (surface.ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - state.dataWindowManager->tout = surface.OutWetBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } else { // Dry - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } } else { // Window not exposed to wind - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } state.dataWindowManager->Ebout = state.dataWindowManager->sigma * pow_4(state.dataWindowManager->tout); @@ -2347,12 +2347,12 @@ namespace WindowManager { // Required for report variables calculations. if (surface.ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - state.dataWindowManager->tout = surface.OutWetBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } else { // Dry - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } } else { // Window not exposed to wind - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } } else { // regular window, not BSDF, not EQL Window @@ -2756,12 +2756,12 @@ namespace WindowManager { } if (surface.ExtWind) { // Window is exposed to wind (and possibly rain) if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside window surface gets wet - state.dataWindowManager->tout = surface.OutWetBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutWetBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } else { // Dry - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } } else { // Window not exposed to wind - state.dataWindowManager->tout = surface.OutDryBulbTemp + state.dataWindowManager->TKelvin; + state.dataWindowManager->tout = state.dataSurface->SurfOutDryBulbTemp(SurfNum) + state.dataWindowManager->TKelvin; } state.dataWindowManager->Ebout = state.dataWindowManager->sigma * pow_4(state.dataWindowManager->tout); state.dataWindowManager->Outir = diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index 586242a5de4..f89496a773e 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -647,7 +647,7 @@ namespace WindowManager { double tSky = state.dataEnvrn->SkyTempKelvin; double airSpeed = 0.0; if (m_Surface.ExtWind) { - airSpeed = m_Surface.WindSpeed; + airSpeed = state.dataSurface->SurfOutWindSpeed(m_SurfNum); } double fclr = 1 - state.dataEnvrn->CloudFraction; AirHorizontalDirection airDirection = AirHorizontalDirection::Windward; diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index 28553d2ed41..e5f763535cd 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -862,7 +862,7 @@ void GetZoneContaminanInputs(EnergyPlusData &state) SetupOutputVariable(state, "Generic Air Contaminant Boundary Layer Diffusion Inside Face Concentration", OutputProcessor::Unit::ppm, - state.dataSurface->Surface(state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum).GenericContam, + state.dataSurface->SurfGenericContam(state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum), "Zone", "Average", state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfName); @@ -1569,7 +1569,7 @@ void InitZoneContSetPoints(EnergyPlusData &state) state.dataContaminantBalance->ZoneGCMX = state.dataContaminantBalance->OutdoorGC; state.dataContaminantBalance->ZoneGCM2 = state.dataContaminantBalance->OutdoorGC; for (Loop = 1; Loop <= state.dataZoneContaminantPredictorCorrector->TotGCBLDiff; ++Loop) { - state.dataSurface->Surface(state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum).GenericContam = + state.dataSurface->SurfGenericContam(state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum) = state.dataContaminantBalance->OutdoorGC; } if (state.dataZoneContaminantPredictorCorrector->TotGCGenDecay > 0) @@ -1723,7 +1723,7 @@ void InitZoneContSetPoints(EnergyPlusData &state) for (Loop = 1; Loop <= state.dataZoneContaminantPredictorCorrector->TotGCBLDiff; ++Loop) { SurfNum = state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).SurfNum; ZoneNum = state.dataSurface->Surface(SurfNum).Zone; - Cs = state.dataSurface->Surface(SurfNum).GenericContam; + Cs = state.dataSurface->SurfGenericContam(SurfNum); Sch = GetCurrentScheduleValue(state, state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).GCTranCoefSchedPtr); GCGain = state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).GCTranCoef * Sch * state.dataSurface->Surface(SurfNum).Area * @@ -1732,7 +1732,7 @@ void InitZoneContSetPoints(EnergyPlusData &state) 1.0e-6; state.dataContaminantBalance->ZoneContamGenericBLDiff(Loop).GCGenRate = GCGain; // Surface concentration level based on steady-state assumption - state.dataSurface->Surface(SurfNum).GenericContam = + state.dataSurface->SurfGenericContam(SurfNum) = Cs - GCGain * 1.0e6 / state.dataSurface->Surface(SurfNum).Multiplier / state.dataSurface->Surface(SurfNum).Area; } diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index df4f6657521..cae2a2d67fb 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -1951,7 +1951,7 @@ TEST_F(ConvectionCoefficientsFixture, TestASTMC1340) state->dataSurface->Surface.allocate(3); state->dataHeatBal->Zone.allocate(3); - + state->dataSurface->SurfOutWindSpeed.allocate(3); // Horizontal Roof, heat flow down state->dataSurface->Surface(1).Zone = 1; state->dataHeatBal->Zone(1).Volume = 1000; @@ -1959,7 +1959,7 @@ TEST_F(ConvectionCoefficientsFixture, TestASTMC1340) state->dataSurface->Surface(1).Tilt = 0; state->dataSurface->Surface(1).Area = 100; state->dataSurface->Surface(1).ExtBoundCond = 0; - state->dataSurface->Surface(1).WindSpeed = 1; + state->dataSurface->SurfOutWindSpeed(1) = 1; Tsurf = 18.0; Tair = 15.0; @@ -1977,8 +1977,8 @@ TEST_F(ConvectionCoefficientsFixture, TestASTMC1340) state->dataSurface->Surface(2).Tilt = 20; state->dataSurface->Surface(2).Area = 100; state->dataSurface->Surface(2).ExtBoundCond = 0; - state->dataSurface->Surface(2).WindSpeed = 1; state->dataSurface->Surface(2).Height = 8; + state->dataSurface->SurfOutWindSpeed(2) = 1; Tsurf = 15.0; Tair = 18.0; diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index f080da9454b..6c2a9b6ac27 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -109,6 +109,10 @@ TEST_F(EnergyPlusFixture, CrossVentMgr_EvolveParaUCSDCV_Test) state->dataSurface->Surface(10).Centroid.x = 1.0314909999999999; state->dataSurface->Surface(10).Centroid.y = 7.1687189999999994; state->dataSurface->Surface(10).Centroid.z = 1.6763999999999999; + state->dataSurface->SurfOutDryBulbTemp.allocate(10); + state->dataSurface->SurfOutWindSpeed.allocate(10); + state->dataSurface->SurfOutDryBulbTemp = 0.0; + state->dataSurface->SurfOutWindSpeed = 0.0; state->dataHeatBal->Zone.allocate(1); state->dataHeatBal->Zone(1).Volume = 996.75300003839993; diff --git a/tst/EnergyPlus/unit/DataSurfaces.unit.cc b/tst/EnergyPlus/unit/DataSurfaces.unit.cc index 0028c70f024..8eea07865e5 100644 --- a/tst/EnergyPlus/unit/DataSurfaces.unit.cc +++ b/tst/EnergyPlus/unit/DataSurfaces.unit.cc @@ -185,12 +185,11 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SetSurfaceOutBulbTempAtTest) ErrorsFound = false; GetSurfaceData(*state, ErrorsFound); // setup zone geometry and get zone data EXPECT_FALSE(ErrorsFound); // expect no errors - SetSurfaceOutBulbTempAt(*state); EXPECT_EQ("T3-RF1 - FLOOR:N", state->dataSurface->Surface(1).Name); EXPECT_GT(state->dataSurface->Surface(1).Centroid.z, 20000.0); // this condition is fatal - EXPECT_LT(state->dataSurface->Surface(1).OutDryBulbTemp, -100.0); // this condition is fatal - EXPECT_LT(state->dataSurface->Surface(1).OutWetBulbTemp, -100.0); // this condition is fatal + EXPECT_LT(state->dataSurface->SurfOutDryBulbTemp(1), -100.0); // this condition is fatal + EXPECT_LT(state->dataSurface->SurfOutWetBulbTemp(1), -100.0); // this condition is fatal } TEST_F(EnergyPlusFixture, SurfaceTest_Plane) diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 08c15623460..4f64fa91311 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -837,8 +837,6 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) SurfaceGeometry::SetupZoneGeometry(*state, foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); - state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfDaylightingShelfInd = 0; state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized @@ -2112,9 +2110,6 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); - state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfDaylightingShelfInd = 0; - state->dataGlobal->NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 60; // must initialize this to get schedules initialized ScheduleManager::ProcessScheduleInput(*state); @@ -2864,8 +2859,6 @@ TEST_F(EnergyPlusFixture, DaylightingManager_TDD_NoDaylightingControls) SurfaceGeometry::SetupZoneGeometry(*state, foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors HeatBalanceIntRadExchange::InitSolarViewFactors(*state); - state->dataSurface->SurfDaylightingShelfInd.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfDaylightingShelfInd = 0; state->dataConstruction->Construct(state->dataSurface->Surface(7).Construction).TransDiff = 0.001; // required for GetTDDInput function to work. DaylightingDevices::GetTDDInput(*state); diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index d997868a41c..865ed8f9463 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -139,7 +139,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) state->dataSurface->Surface(SurfNum).Class = DataSurfaces::SurfaceClass::Wall; state->dataSurface->Surface(SurfNum).Area = 10.0; state->dataSurface->Surface(SurfNum).MaterialMovInsulExt = 1; - + state->dataSurface->SurfOutDryBulbTemp.allocate(SurfNum); + state->dataSurface->SurfOutDryBulbTemp = 0; state->dataEnvrn->SkyTemp = 23.0; state->dataEnvrn->OutDryBulbTemp = 23.0; @@ -161,7 +162,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) EXPECT_TRUE(ErrorFlag); EXPECT_TRUE(compare_err_stream(error_string, true)); - EXPECT_EQ(10.0 * 1.0 * (state->dataHeatBalSurf->TH(1, 1, SurfNum) - state->dataSurface->Surface(SurfNum).OutDryBulbTemp), + EXPECT_EQ(10.0 * 1.0 * (state->dataHeatBalSurf->TH(1, 1, SurfNum) - state->dataSurface->SurfOutDryBulbTemp(SurfNum)), state->dataHeatBalSurf->QAirExtReport(SurfNum)); } @@ -736,11 +737,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataLoopNodes->Node.allocate(4); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideIntConvCoef = false; - state->dataSurface->SurfEMSOverrideExtConvCoef = false; - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1279,11 +1275,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataLoopNodes->Node.allocate(4); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideIntConvCoef = false; - state->dataSurface->SurfEMSOverrideExtConvCoef = false; - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1354,10 +1345,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) InitSurfaceHeatBalance(*state); // Test if local value correctly overwritten - EXPECT_EQ(25.0, state->dataSurface->Surface(1).OutDryBulbTemp); - EXPECT_EQ(20.0, state->dataSurface->Surface(1).OutWetBulbTemp); - EXPECT_EQ(1.5, state->dataSurface->Surface(1).WindSpeed); - EXPECT_EQ(90.0, state->dataSurface->Surface(1).WindDir); + EXPECT_EQ(25.0, state->dataSurface->SurfOutDryBulbTemp(1)); + EXPECT_EQ(20.0, state->dataSurface->SurfOutWetBulbTemp(1)); + EXPECT_EQ(1.5, state->dataSurface->SurfOutWindSpeed(1)); + EXPECT_EQ(90.0, state->dataSurface->SurfOutWindDir(1)); // Test if local value used in surface hc calculation // Surface(1) - local; Surface(2) - global; @@ -1859,11 +1850,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataLoopNodes->Node.allocate(4); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideIntConvCoef = false; - state->dataSurface->SurfEMSOverrideExtConvCoef = false; - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -1921,7 +1907,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) int SurfNum; for (SurfNum = 1; SurfNum <= 6; SurfNum++) { state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp - state->dataSurface->Surface(SurfNum).OutDryBulbTemp = 22; // Air temp + state->dataSurface->SurfOutDryBulbTemp(SurfNum) = 22; // Air temp state->dataSurface->SurfExtConvCoeff(SurfNum) = -6; state->dataSurface->AirSkyRadSplit(SurfNum) = 1.0; } @@ -2431,11 +2417,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataLoopNodes->Node.allocate(4); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideIntConvCoef = false; - state->dataSurface->SurfEMSOverrideExtConvCoef = false; - state->dataHeatBalSurf->TempSurfInTmp.allocate(6); state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; @@ -2567,14 +2548,16 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestReportIntMovInsInsideSur TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_OutsideSurfHeatBalanceWhenRainFlag) { state->dataSurface->Surface.allocate(1); + state->dataSurface->SurfOutWetBulbTemp.allocate(1); + state->dataSurface->SurfOutDryBulbTemp.allocate(1); state->dataHeatBalSurf->HcExtSurf.allocate(1); state->dataHeatBalSurf->TH.allocate(1, 1, 1); state->dataSurface->Surface(1).Area = 58.197; state->dataHeatBalSurf->HcExtSurf(1) = 1000; state->dataHeatBalSurf->TH(1, 1, 1) = 6.71793958923051; - state->dataSurface->Surface(1).OutWetBulbTemp = 6.66143784594778; - state->dataSurface->Surface(1).OutDryBulbTemp = 7.2; + state->dataSurface->SurfOutWetBulbTemp(1) = 6.66143784594778; + state->dataSurface->SurfOutDryBulbTemp(1) = 7.2; // If Rain Flag = on, GetQdotConvOutRep uses Outdoor Air Wet Bulb Temp. state->dataEnvrn->IsRain = true; @@ -3123,8 +3106,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) createFacilityElectricPowerServiceObject(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfEMSOverrideIntConvCoef = false; InitSurfaceHeatBalance(*state); diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 30043f2d945..eb8a3207dc9 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -96,10 +96,14 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest ConstrNum = 1; // allocate surface variable data state->dataSurface->Surface.allocate(NumOfSurf); + state->dataSurface->SurfOutDryBulbTemp.allocate(NumOfSurf); + state->dataSurface->SurfOutWetBulbTemp.allocate(NumOfSurf); + state->dataSurface->SurfOutWindSpeed.allocate(NumOfSurf); + state->dataSurface->SurfOutWindDir.allocate(NumOfSurf); state->dataSurface->Surface(SurfNum).Area = 10.0; - state->dataSurface->Surface(SurfNum).OutDryBulbTemp = 20.0; - state->dataSurface->Surface(SurfNum).OutWetBulbTemp = 15.0; - state->dataSurface->Surface(SurfNum).WindSpeed = 3.0; + state->dataSurface->SurfOutDryBulbTemp(SurfNum) = 20.0; + state->dataSurface->SurfOutWetBulbTemp(SurfNum) = 15.0; + state->dataSurface->SurfOutWindSpeed(SurfNum) = 3.0; state->dataSurface->Surface(SurfNum).Construction = ConstrNum; state->dataSurface->Surface(SurfNum).BaseSurf = SurfNum; state->dataSurface->Surface(SurfNum).Zone = ZoneNum; diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 06ac4a12c1a..73ea1fe1f72 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1456,9 +1456,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { if (state->dataSurface->Surface(SurfNum).ExtBoundCond == 0 && state->dataSurface->Surface(SurfNum).Zone != 0) { - int ZoneSize = state->dataSurface->Surface(SurfNum).DisabledShadowingZoneList.size(); + int ZoneSize = state->dataSurface->SurfDisabledShadowingZoneList(SurfNum).size(); EXPECT_EQ(1, ZoneSize); - std::vector DisabledZones = state->dataSurface->Surface(SurfNum).DisabledShadowingZoneList; + std::vector DisabledZones = state->dataSurface->SurfDisabledShadowingZoneList(SurfNum); for (int i : DisabledZones) { EXPECT_EQ(1, i); } diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index a5f59301a2b..1f954e8ef25 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -246,6 +246,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSurface->Surface.allocate(1); state->dataConstruction->Construct.allocate(1); state->dataSurface->SurfIsPool.allocate(1); + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(1); // testing variables static std::string const Alpha1("FirstString"); @@ -266,7 +267,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 2: The surface is already pointing to a radiant system, ventilated slab, or other pool--this is not allowed and should produce an error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = true; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = true; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); @@ -275,7 +276,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 3: The heat transfer method has to be CTFs to simulate the pool, otherwise it should produce and error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CondFD; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); @@ -285,7 +286,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 4: The pool surface is defined as a window--this is not allowed and should produce an error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Window; @@ -296,7 +297,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 5: The pool is defined with movable insulation--this is not allowed and should produce an error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; @@ -308,7 +309,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 6: The pool is defined with a source/sink (usually associated with radiant systems)--this is not allowed and should produce an error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; @@ -322,7 +323,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 7: The pool is not defined as a floor--this is not allowed and should produce an error ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Wall; state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; @@ -335,20 +336,19 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) // Test 8: Everything about the surface that is being used by the "legal"--no error is produced ErrFnd = false; poolReference.SurfacePtr = 1; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 0; state->dataConstruction->Construct(state->dataSurface->Surface(poolReference.SurfacePtr).Construction).SourceSinkPresent = false; state->dataSurface->Surface(poolReference.SurfacePtr).Zone = 7; - state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool = false; state->dataSurface->SurfIsPool(poolReference.SurfacePtr) = false; poolReference.ZonePtr = 0; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); EXPECT_FALSE(ErrFnd); - EXPECT_TRUE(state->dataSurface->Surface(poolReference.SurfacePtr).IsRadSurfOrVentSlabOrPool); + EXPECT_TRUE(state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr)); EXPECT_TRUE(state->dataSurface->SurfIsPool(poolReference.SurfacePtr)); EXPECT_EQ(state->dataSurface->Surface(poolReference.SurfacePtr).Zone, poolReference.ZonePtr); } diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 30609144abb..ef81365453c 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -243,7 +243,7 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) state->dataHeatBal->SunlitFrac.dimension(1, 1, 3, 1.0); state->dataHeatBal->SunlitFracWithoutReveal.dimension(1, 1, 3, 1.0); - state->dataSurface->Surface(winNum).OutDryBulbTemp = T_out; + state->dataSurface->SurfOutDryBulbTemp(winNum) = T_out; state->dataHeatBal->TempEffBulkAir(winNum) = T_in; state->dataSurface->SurfWinIRfromParentZone(winNum) = DataGlobalConstants::StefanBoltzmann * std::pow(T_in + DataGlobalConstants::KelvinConv, 4); state->dataHeatBalFanSys->ZoneAirHumRatAvg.dimension(1, 0.01); @@ -573,7 +573,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; @@ -598,7 +597,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; - state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; Real64 outSurfTemp; @@ -2803,7 +2801,6 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); state->dataSurface->InsideFrameCondensationFlag.allocate(3); state->dataSurface->InsideDividerCondensationFlag.allocate(3); - state->dataSurface->SurfEMSOverrideIntConvCoef.allocate(3); state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::AdjacentAirTemp; @@ -2828,7 +2825,6 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; state->dataHeatBal->QS = 0.0; - state->dataSurface->SurfEMSOverrideIntConvCoef = false; Real64 inSurfTemp; Real64 outSurfTemp; From 036ba68bf6bf9d7316938deeff52859e2679291b Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sun, 2 May 2021 16:14:29 -0700 Subject: [PATCH 07/25] data surface --- .../Interzone Air Wall NFP and Design.md | 2 +- ...ffuse-reflection-of-beam-solar-and-sky.tex | 22 +- src/EnergyPlus/ConvectionCoefficients.cc | 4 +- src/EnergyPlus/DataHeatBalSurface.hh | 2 +- src/EnergyPlus/DataHeatBalance.hh | 4 +- src/EnergyPlus/DataSurfaces.cc | 4 +- src/EnergyPlus/DataSurfaces.hh | 207 +++++++++--------- src/EnergyPlus/DaylightingManager.cc | 40 ++-- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 1 + src/EnergyPlus/HeatBalanceManager.cc | 5 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 48 ++-- src/EnergyPlus/SolarReflectionManager.cc | 80 +++---- src/EnergyPlus/SolarShading.cc | 20 +- src/EnergyPlus/SurfaceGeometry.cc | 24 +- src/EnergyPlus/WindowComplexManager.cc | 4 +- src/EnergyPlus/WindowEquivalentLayer.cc | 4 +- src/EnergyPlus/WindowManager.cc | 12 +- .../unit/DaylightingManager.unit.cc | 4 + .../unit/HeatBalanceSurfaceManager.unit.cc | 4 +- .../unit/LowTempRadiantSystem.unit.cc | 4 + tst/EnergyPlus/unit/SolarShading.unit.cc | 1 + .../unit/UnitaryHybridAirConditioner.unit.cc | 4 +- 22 files changed, 259 insertions(+), 241 deletions(-) diff --git a/design/FY2019/Interzone Air Wall NFP and Design.md b/design/FY2019/Interzone Air Wall NFP and Design.md index e4a87c6e4e0..25bfc455b94 100644 --- a/design/FY2019/Interzone Air Wall NFP and Design.md +++ b/design/FY2019/Interzone Air Wall NFP and Design.md @@ -398,7 +398,7 @@ Pertinent variables (*inferring units from usage - not documented - grrr*): `DataHeatBalance::QL` [W?] - Total thermal radiation added to a zone `DataHeatBalance::QS` [W?] - Zone short-wave flux density `DataHeatBalance::QSLights` [W?] - Like QS, but Lights short-wave only. - `DataHeatBalance::QSDifSol` [W?] - Like QS, but diffuse solar short-wave only. + `DataHeatBalance::EnclSolQSDifSol` [W?] - Like QS, but diffuse solar short-wave only. Pertinent functions: diff --git a/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex b/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex index bdda779e63f..bd054db629a 100644 --- a/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex +++ b/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex @@ -59,7 +59,7 @@ \subsection{Sky Solar Radiation Diffusely Reflected from Obstructions}\label{sky The factor for reflection of sky radiation from obstructions onto a receiving surface is calculated in subroutine CalcSkySolDiffuseReflFactors. It is given by: \begin{equation} -\begin{array}{l}{\rm{ReflFacSkySolObs(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}ViewFacSk{y_{obs,i}}DifShdgRatioIsoSk{y_{obs,i}}{\rho_{obs,i}}\cos {\alpha_i}/\pi } } \end{array} +\begin{array}{l}{\rm{SurfReflFacSkySolObs(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}ViewFacSk{y_{obs,i}}DifShdgRatioIsoSk{y_{obs,i}}{\rho_{obs,i}}\cos {\alpha_i}/\pi } } \end{array} \end{equation} where @@ -83,7 +83,7 @@ \subsection{Sky Solar Radiation Diffusely Reflected from Obstructions}\label{sky The above reflection factor is used in the timestep calculation to find the irradiance on a receiving surface due to sky radiation reflected from obstructions: \begin{equation} -QRadSWOutIncSkyDiffReflObs(RecSurfNum) = DifSolarRad * ReflFacSkySolObs(RecSurfNum) (W/m^{2}) +QRadSWOutIncSkyDiffReflObs(RecSurfNum) = DifSolarRad * SurfReflFacSkySolObs(RecSurfNum) (W/m^{2}) \end{equation} where \emph{DifSolarRad} is the horizontal sky irradiance on an unobstructed horizontal plane (W/m\(^{2}\)). @@ -102,7 +102,7 @@ \subsection{Sky Solar Radiation Diffusely Reflected from the Ground}\label{sky-s \begin{equation} \begin{array}{l} -{\rm{ReflFacSkySolGnd(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {\left[ {(Hi{t_{gnd,i}}d{\Omega_i}\cos {\alpha_i}/\pi )\sum\limits_{j(i)}^{{N_{ray}}} {Hi{t_{sky,j(i)}}\cos {\alpha_{j(i)}}d{\Omega_{j(i)}}/\pi } } \right]} } +{\rm{SurfReflFacSkySolGnd(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {\left[ {(Hi{t_{gnd,i}}d{\Omega_i}\cos {\alpha_i}/\pi )\sum\limits_{j(i)}^{{N_{ray}}} {Hi{t_{sky,j(i)}}\cos {\alpha_{j(i)}}d{\Omega_{j(i)}}/\pi } } \right]} } \end{array} \end{equation} @@ -119,7 +119,7 @@ \subsection{Sky Solar Radiation Diffusely Reflected from the Ground}\label{sky-s This factor is used in the timestep calculation to find the irradiance on a receiving surface due to sky radiation reflected from the ground: \begin{equation} -QRadSWOutIncSkyDiffReflGnd(RecSurfNum) = DifSolarRad * {\rho_{gnd}} * ReflFacSkySolGnd(RecSurfNum)~ (W/m^{2}) +QRadSWOutIncSkyDiffReflGnd(RecSurfNum) = DifSolarRad * {\rho_{gnd}} * SurfReflFacSkySolGnd(RecSurfNum)~ (W/m^{2}) \end{equation} where \({\rho_{gnd}}\) is the solar reflectance of the ground, which is assumed to be uniform over the ground plane but may vary monthly (because of snow cover, for example). @@ -134,7 +134,7 @@ \subsection{Beam Solar Radiation Diffusely Reflected from Obstructions}\label{be {\scriptsize \begin{equation} -{\rm{ReflFacBmToDiffSolObs(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}Hi{t_{obs,i,sun}}d{\Omega_i}\cos {\alpha_i}{\rho_{obs,i}}\cos {\alpha_{sun,obs,i}}} } +{\rm{SurfReflFacBmToDiffSolObs(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}Hi{t_{obs,i,sun}}d{\Omega_i}\cos {\alpha_i}{\rho_{obs,i}}\cos {\alpha_{sun,obs,i}}} } \end{equation}} where @@ -152,8 +152,8 @@ \subsection{Beam Solar Radiation Diffusely Reflected from Obstructions}\label{be \begin{equation} \begin{split} QRadSWOutIncBmToDiffReflObs(RecSurfNum) = BeamSolarRad \\ -* (WeightNow * ReflFacBmToDiffSolObs(RecSurfNum,HourOfDay) \\ -+ WeightPreviousHour * ReflFacBmToDiffSolObs(RecSurfNum,PreviousHour)) +* (WeightNow * SurfReflFacBmToDiffSolObs(RecSurfNum,HourOfDay) \\ ++ WeightPreviousHour * SurfReflFacBmToDiffSolObs(RecSurfNum,PreviousHour)) \end{split} \end{equation} @@ -165,7 +165,7 @@ \subsection{Beam Solar Radiation Diffusely Reflected from the Ground}\label{beam {\scriptsize \begin{equation} -{\rm{ReflFacBmToDiffSolGnd(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{gnd,i}}Hi{t_{gnd,i,sun}}d{\Omega_i}\cos {\alpha_{gnd,i}}\cos {\alpha_{sun,gnd}}} } +{\rm{SurfReflFacBmToDiffSolGnd(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{gnd,i}}Hi{t_{gnd,i,sun}}d{\Omega_i}\cos {\alpha_{gnd,i}}\cos {\alpha_{sun,gnd}}} } \end{equation}} where @@ -179,7 +179,7 @@ \subsection{Beam Solar Radiation Diffusely Reflected from the Ground}\label{beam This factor is used in the timestep calculation to find the diffuse irradiance on a receiving surface due to beam solar diffusely reflected from the ground: \begin{equation} -QRadSWOutIncBmToDiffReflGnd(RecSurfNum) = BeamSolarRad * {\rho_{gnd}} * (WeightNow * ReflFacBmToDiffSolGnd(RecSurfNum,HourOfDay) + WeightPreviousHour * ReflFacBmToDiffSolGnd(RecSurfNum,PreviousHour)) +QRadSWOutIncBmToDiffReflGnd(RecSurfNum) = BeamSolarRad * {\rho_{gnd}} * (WeightNow * SurfReflFacBmToDiffSolGnd(RecSurfNum,HourOfDay) + WeightPreviousHour * SurfReflFacBmToDiffSolGnd(RecSurfNum,PreviousHour)) \end{equation} \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{beam-solar-radiation-specularly-reflected-from-obstructions} @@ -223,7 +223,7 @@ \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{b The factor for specular reflection of beam solar from obstruction onto a receiving surface is calculated in subroutine CalcBeamSolSpecularReflFactors. It is given by: \begin{equation} -{\rm{ReflFacBmToBmSolObs(RecSurfNum,IHr) }} = \sum\limits_{\scriptstyle \substack{specularly \, reflecting \, surfaces}} \left[ {\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {{f_{C,glazed}}{\rho_{spec}}({\alpha_C})\cos {\alpha_D}} } \right] +{\rm{SurfReflFacBmToBmSolObs(RecSurfNum,IHr) }} = \sum\limits_{\scriptstyle \substack{specularly \, reflecting \, surfaces}} \left[ {\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {{f_{C,glazed}}{\rho_{spec}}({\alpha_C})\cos {\alpha_D}} } \right] \end{equation} The program assumes that specular reflection from a surface is due to glazing. If the reflecting surface is a window belonging to the building itself (as in Figure~\ref{fig:solar-reflection-from-building-surfaces-onto}), then \({f_{C,glazed}}\) is the fraction of the window that is glazed (which is 1.0 unless the window has dividers). @@ -243,5 +243,5 @@ \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{b The above specular reflection factor is used in the timestep calculation to find the beam irradiance on a receiving surface due to beam-beam reflection from obstructions: \begin{equation} -QRadSWOutIncBmToBmReflObsRecSurfNum) = BeamSolarRad * (WeightNow * ReflFacBmToBmSolObs(RecSurfNum,HourOfDay) + WeightPreviousHour * ReflFacBmToBmSolObs(RecSurfNum,PreviousHour)) +QRadSWOutIncBmToBmReflObsRecSurfNum) = BeamSolarRad * (WeightNow * SurfReflFacBmToBmSolObs(RecSurfNum,HourOfDay) + WeightPreviousHour * SurfReflFacBmToBmSolObs(RecSurfNum,PreviousHour)) \end{equation} diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 096a7cd41b9..d61fd4e471f 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -611,7 +611,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, HSky = 0.0; } else { // Compute sky radiation coefficient - HSky = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * state.dataSurface->AirSkyRadSplit(SurfNum) * + HSky = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * state.dataSurface->SurfAirSkyRadSplit(SurfNum) * (pow_4(TSurf) - pow_4(TSky)) / (TSurf - TSky); } @@ -624,7 +624,7 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorGroundIR * (pow_4(TSurf) - pow_4(TGround)) / (TSurf - TGround); // Compute air radiation coefficient - HAir = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * + HAir = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * (pow_4(TSurf) - pow_4(TAir)) / (TSurf - TAir); } } diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index a56ae4de201..1b5a2313a22 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -225,7 +225,7 @@ struct HeatBalSurfData : BaseGlobalStruct // through exterior windows, beam from exterior windows reflecting // from interior surfaces, and beam entering through interior windows // (considered diffuse) - // Originally QD, now used only for QSDifSol calc for daylighting + // Originally QD, now used only for EnclSolQSDifSol calc for daylighting Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces Array1D ZoneMRT; // Zone Mean Radiant Temperature diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 562440e1b10..c09b124f8ff 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -2150,7 +2150,7 @@ struct HeatBalanceData : BaseGlobalStruct Array1D MultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening Array1D QS; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure Array1D QSLights; // Like QS, but Lights short-wave only. - Array1D QSDifSol; // Like QS, but diffuse solar short-wave only. + Array1D EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only. Array1D ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA) Array1D TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF' Array1D QL; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) @@ -2426,7 +2426,7 @@ struct HeatBalanceData : BaseGlobalStruct this->MultHorizonZenith.deallocate(); this->QS.deallocate(); this->QSLights.deallocate(); - this->QSDifSol.deallocate(); + this->EnclSolQSDifSol.deallocate(); this->ITABSF.deallocate(); this->TMULT.deallocate(); this->QL.deallocate(); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 2cb8138a69d..59f83e7b6ae 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -401,8 +401,8 @@ Real64 SurfaceData::getOutsideIR(EnergyPlusData &state, const int t_SurfNum) con Real64 tout = getOutsideAirTemperature(state, t_SurfNum) + DataGlobalConstants::KelvinConv; value = state.dataWindowManager->sigma * pow_4(tout); value = - ViewFactorSkyIR * (state.dataSurface->AirSkyRadSplit(t_SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + - (1.0 - state.dataSurface->AirSkyRadSplit(t_SurfNum)) * value) + + ViewFactorSkyIR * (state.dataSurface->SurfAirSkyRadSplit(t_SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + + (1.0 - state.dataSurface->SurfAirSkyRadSplit(t_SurfNum)) * value) + ViewFactorGroundIR * value; } return value; diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index baba61c427d..70ba41b3d7c 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -576,6 +576,31 @@ namespace DataSurfaces { Real64 Tilt; // Angle (deg) between the ground outward normal and the surface outward normal Real64 Width; // Width of the surface (m) + // Precomputed parameters for PierceSurface performance + ShapeCat shapeCat; // Shape category + Plane plane; // Plane + Surface2D surface2d; // 2D projected surface for efficient intersection testing + + // Vertices + Array1D NewVertex; + Vertices Vertex; // Surface Vertices are represented by Number of Sides and Vector (type) + Vector Centroid; // computed centroid (also known as center of mass or surface balance point) + Vector lcsx; + Vector lcsy; + Vector lcsz; + Vector NewellAreaVector; + Vector NewellSurfaceNormalVector; // same as OutNormVec in vector notation + Array1D OutNormVec; // Direction cosines (outward normal vector) for surface + Real64 SinAzim; // Sine of surface azimuth angle + Real64 CosAzim; // Cosine of surface azimuth angle + Real64 SinTilt; // Sine of surface tilt angle + Real64 CosTilt; // Cosine of surface tilt angle + bool IsConvex; // true if the surface is convex. + bool IsDegenerate; // true if the surface is degenerate. + bool VerticesProcessed; // true if vertices have been processed (only used for base surfaces) + Real64 XShift; // relative coordinate shift data - used by child subsurfaces + Real64 YShift; // relative coordinate shift data - used by child subsurfaces + // Boundary conditions and interconnections bool HeatTransSurf; // True if surface is a heat transfer surface, int OutsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the outside surface @@ -629,31 +654,6 @@ namespace DataSurfaces { bool MovInsulIntPresent; // True when movable insulation is present bool MovInsulIntPresentPrevTS; // True when movable insulation was present during the previous time step - // Vertices - Array1D NewVertex; - Vertices Vertex; // Surface Vertices are represented by Number of Sides and Vector (type) - Vector Centroid; // computed centroid (also known as center of mass or surface balance point) - Vector lcsx; - Vector lcsy; - Vector lcsz; - Vector NewellAreaVector; - Vector NewellSurfaceNormalVector; // same as OutNormVec in vector notation - Array1D OutNormVec; // Direction cosines (outward normal vector) for surface - Real64 SinAzim; // Sine of surface azimuth angle - Real64 CosAzim; // Cosine of surface azimuth angle - Real64 SinTilt; // Sine of surface tilt angle - Real64 CosTilt; // Cosine of surface tilt angle - bool IsConvex; // true if the surface is convex. - bool IsDegenerate; // true if the surface is degenerate. - bool VerticesProcessed; // true if vertices have been processed (only used for base surfaces) - Real64 XShift; // relative coordinate shift data - used by child subsurfaces - Real64 YShift; // relative coordinate shift data - used by child subsurfaces - - // Precomputed parameters for PierceSurface performance - ShapeCat shapeCat; // Shape category - Plane plane; // Plane - Surface2D surface2d; // 2D projected surface for efficient intersection testing - // Window Parameters (when surface is Window) int activeWindowShadingControl; // Active window shading control (windows only) std::vector windowShadingControlList; // List of possible window shading controls @@ -674,16 +674,20 @@ namespace DataSurfaces { SurfaceData() : Index(0), Construction(0), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None), Sides(0), Area(0.0), GrossArea(0.0), NetAreaShadowCalc(0.0), Perimeter(0.0), - Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0), Width(0.0), HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), - InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), - ExtBoundCond(0), ExtSolar(false), ExtWind(false), + Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0), Width(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), + Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), + NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), + IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0), + + HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), + BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), MirroredSurf(false), + SchedShadowSurfIndex(0), ShadowSurfSchedVaries(false), ShadowingSurf(false), IsTransparent(false), SchedMinValue(0.0), ShadowSurfDiffuseSolRefl(0.0), ShadowSurfDiffuseVisRefl(0.0), ShadowSurfGlazingFrac(0.0), ShadowSurfGlazingConstruct(0), + MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), MovInsulIntPresent(false), MovInsulIntPresentPrevTS(false), - Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), - NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), - IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), + activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { @@ -1217,6 +1221,9 @@ struct SurfacesData : BaseGlobalStruct Real64 GroundLevelZ = 0.0; // Z value of ground level for solar refl calc (m) bool AirflowWindows = false; // TRUE if one or more airflow windows bool ShadingTransmittanceVaries = false; // overall, shading transmittance varies for the building + bool AnyHeatBalanceInsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm inside face used + bool AnyHeatBalanceOutsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm outside face used + Array1D_int InsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise Array1D_int InsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise Array1D_int InsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise @@ -1224,45 +1231,12 @@ struct SurfacesData : BaseGlobalStruct Array1D X0; // X-component of translation vector Array1D Y0; // Y-component of translation vector Array1D Z0; // Z-component of translation vector - Array1D EnclSolDB; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces - Array1D - EnclSolDBSSG; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces. Used only for scheduled surface gains - Array1D SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface - Array1D SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface - Array1D SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2) - Array1D SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2) - Array1D SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground - Array1D SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground - Array2D SurfWinA; // Time step value of factor for beam absorbed in window glass layers - - // Time step value of factor for diffuse absorbed in window layers - Array2D SurfWinADiffFront; - - Array2D SurfWinACFOverlap; // Time step value of factor for beam - // absorbed in window glass layers which comes from other windows - // It happens sometimes that beam enters one window and hits back of - // second window. It is used in complex fenestration only - - Array1D AirSkyRadSplit; // Fractional split between the air and - // the sky for radiation from the surface - // Fraction of sky IR coming from sky itself; 1-AirSkyRadSplit comes from the atmosphere. - - Array2D SUNCOSHR = Array2D( - 24, 3, 0.0); // Hourly values of SUNCOS (solar direction cosines), Autodesk: Init Zero-initialization added to avoid use uninitialized - Array2D ReflFacBmToDiffSolObs; - Array2D ReflFacBmToDiffSolGnd; - Array2D ReflFacBmToBmSolObs; - Array1D ReflFacSkySolObs; - Array1D ReflFacSkySolGnd; - Array2D CosIncAveBmToBmSolObs; - Array1D - EnclSolDBIntWin; // Value of factor for beam solar entering a zone through interior windows (considered to contribute to diffuse in zone) - Array1D SurfSunlitArea; // Sunlit area by surface number - Array1D SurfSunlitFrac; // Sunlit fraction by surface number - Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse and beam solar - // from exterior obstructions [W/m2] - Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, accounts for shadowing of ground by building and - // obstructions [W/m2] + + Array1D EnclSolDB; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces + Array1D EnclSolDBSSG; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces. + // Used only for scheduled surface gains + Array1D EnclSolDBIntWin; // Value of factor for beam solar entering a zone through interior windows + // (considered to contribute to diffuse in zone) std::vector AllHTSurfaceList; // List of all heat transfer surfaces std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces @@ -1273,8 +1247,36 @@ struct SurfacesData : BaseGlobalStruct // Surface HB arrays Array1D SurfOutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C) Array1D SurfOutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C) - Array1D SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s) - Array1D SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) + Array1D SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s) + Array1D SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) + Array1D SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for + + // Surface solar arrays + Array1D SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface + // Fraction of sky IR coming from sky itself; 1-SurfAirSkyRadSplit comes from the atmosphere. + Array2D SurfSunCosHourly; // Hourly values of SUNCOS (solar direction cosines) + // Autodesk: Init Zero-initialization added to avoid use uninitialized + Array1D SurfSunlitArea; // Sunlit area by surface number + Array1D SurfSunlitFrac; // Sunlit fraction by surface number + Array1D SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse + // and beam solar from exterior obstructions [W/m2] + Array1D SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true, + // accounts for shadowing of ground by building and obstructions [W/m2] + Array1D SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2) + Array1D SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2) + Array1D SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground + Array1D SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground + Array1D SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface + Array1D SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface + Array1D SurfPenumbraID; + + // Surface reflectance + Array2D SurfReflFacBmToDiffSolObs; + Array2D SurfReflFacBmToDiffSolGnd; + Array2D SurfReflFacBmToBmSolObs; + Array1D SurfReflFacSkySolObs; + Array1D SurfReflFacSkySolGnd; + Array2D SurfCosIncAveBmToBmSolObs; // Surface EMS Array1D SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value @@ -1304,7 +1306,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfSurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces) Array1D SurfHasLinkedOutAirNode; // true if an OutdoorAir::Node is linked to the surface Array1D SurfLinkedOutAirNode; // Index of the an OutdoorAir:Node - Array1D SurfPenumbraID; Array1D SurfExtEcoRoof; // True if the top outside construction material is of type Eco Roof Array1D SurfExtCavityPresent; // true if there is an exterior vented cavity on surface Array1D SurfExtCavNum; // index for this surface in ExtVentedCavity structure (if any) @@ -1313,7 +1314,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIsPool; // true if this is a pool Array1D SurfICSPtr; // Index to ICS collector Array1D SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group - Array1D SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature @@ -1344,14 +1344,19 @@ struct SurfacesData : BaseGlobalStruct Array1D> SurfDisabledShadowingZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model // Surface Window Heat Balance + Array2D SurfWinA; // Time step value of factor for beam absorbed in window glass layers + Array2D SurfWinADiffFront; // Time step value of factor for diffuse absorbed in window layers + Array2D SurfWinACFOverlap; // Time step value of factor for beam absorbed in window glass layers which comes from other windows + // It happens sometimes that beam enters one window and hits back of second window. + // It is used in complex fenestration only Array1D SurfWinTransSolar; // Exterior beam plus diffuse solar transmitted through window, or window plus shade/blind, into zone (W) Array1D SurfWinBmSolar; // Exterior beam solar transmitted through window, or window plus blind, into zone (W) Array1D SurfWinBmBmSolar; // Exterior beam-to-beam solar transmitted through window, or window plus blind, into zone (W) Array1D SurfWinBmDifSolar; // Exterior beam-to-diffuse solar transmitted through window, or window plus blind, into zone (W) Array1D SurfWinDifSolar; // Exterior diffuse solar transmitted through window, or window plus shade/blind, into zone (W) Array1D SurfWinHeatGain; // Total heat gain from window = WinTransSolar + (IR and convection from glazing, or, - // if interior shade, IR and convection from zone-side of shade plus gap air convection to zone) + - // (IR convection from frame) + (IR and convection from divider if no interior shade) (W) + // if interior shade, IR and convection from zone-side of shade plus gap air convection to zone) + + // (IR convection from frame) + (IR and convection from divider if no interior shade) (W) Array1D SurfWinHeatTransfer; // Total heat transfer through the window = WinTransSolar + conduction through glazing and frame Array1D SurfWinHeatGainRep; // Equals WinHeatGain when WinHeatGain >= 0.0 Array1D SurfWinHeatLossRep; // Equals -WinHeatGain when WinHeatGain < 0.0 @@ -1363,8 +1368,8 @@ struct SurfacesData : BaseGlobalStruct // and the shade (W) Array1D SurfWinGainConvShadeToZoneRep; // component of WinHeatGain convect to zone from front shade (W) Array1D SurfWinGainIRShadeToZoneRep; // component of WinHeatGain net IR to zone from front shade (W) - Array1D - SurfWinOtherConvGainInsideFaceToZoneRep; // net imbalance of convection heat gain from equivalent Layer window inside face to zone air + Array1D SurfWinOtherConvGainInsideFaceToZoneRep; // net imbalance of convection heat gain from equivalent Layer window + // inside face to zone air Array1D SurfWinGapConvHtFlowRep; // Convective heat flow from gap in airflow window (W) Array1D SurfWinShadingAbsorbedSolar; // Exterior beam plus diffuse solar absorbed by window shading device (W) Array1D SurfWinSysSolTransmittance; // Effective solar transmittance of window + shading device, if present @@ -1426,8 +1431,8 @@ struct SurfacesData : BaseGlobalStruct // incident on the outside of the frame per m2 of frame (-) Array1D SurfWinInsRevealDiffOntoFrame; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that is // incident on the outside of the frame per m2 of frame (-) for debugging CR 7596. TH 5/26/2009 - Array1D - SurfWinInsRevealDiffOntoGlazingReport; // Diffuse solar from beam reflection from inside reveal that is incident on the glazing (W) + Array1D SurfWinInsRevealDiffOntoGlazingReport; // Diffuse solar from beam reflection from inside reveal that is incident + // on the glazing (W) Array1D SurfWinInsRevealDiffIntoZoneReport; // Diffuse from beam reflection from inside reveal that goes into zone directly or reflected // from glazing (W) Array1D SurfWinInsRevealDiffOntoFrameReport; // Diffuse from beam reflection from inside reveal that is incident on the frame (W) @@ -1440,14 +1445,15 @@ struct SurfacesData : BaseGlobalStruct EPVector SurfWinShadingFlag; // -1: window has no shading device Array1D SurfWinShadingFlagEMSOn; // EMS control flag, true if EMS is controlling ShadingFlag with ShadingFlagEMSValue Array1D SurfWinShadingFlagEMSValue; // EMS control value for Shading Flag - Array1D - SurfWinStormWinFlag; // -1: Storm window not applicable; 0: Window has storm window but it is off 1: Window has storm window and it is on + Array1D SurfWinStormWinFlag; // -1: Storm window not applicable; + // 0: Window has storm window but it is off + // 1: Window has storm window and it is on Array1D SurfWinStormWinFlagPrevDay; // Previous time step value of StormWinFlag - Array1D - SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0 if no shading device or shading device is off = 1.0 if shading device is on; - // For time intervals longer than a time step, = fraction of time that shading device is on. - EPVector - SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step;0 otherwise + Array1D SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0 + // if no shading device or shading device is off = 1.0 if shading device is on; + // For time intervals longer than a time step, = fraction of time that shading device is on. + EPVector SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step; + // 0 otherwise Array1D SurfWinHasShadeOrBlindLayer; // mark as true if the window construction has a shade or a blind layer Array1D SurfWinSurfDayLightInit; // surface has been initialized for following 5 arrays Array1D SurfWinDaylFacPoint; // Pointer to daylight factors for the window @@ -1458,8 +1464,8 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfWinRhoCeilingWall; // Average interior reflectance seen by light moving up across horizontal plane thru center of window Array1D SurfWinRhoFloorWall; // Same as above, but for light moving down Array1D SurfWinFractionUpgoing; // Fraction light entering window that goes upward - Array1D - SurfWinVisTransRatio; // For windows with switchable glazing, ratio of normal transmittance in switched state to that in unswitched state + Array1D SurfWinVisTransRatio; // For windows with switchable glazing, + // ratio of normal transmittance in switched state to that in unswitched state Array1D SurfWinFrameArea; // Frame projected area (m2) Array1D SurfWinFrameConductance; // Frame conductance [no air films] (W/m2-K) Array1D SurfWinFrameSolAbsorp; // Frame solar absorptance (assumed same inside and outside) @@ -1496,8 +1502,8 @@ struct SurfacesData : BaseGlobalStruct // apportioned to the two faces Array1D SurfWinShadeAbsFacFace2; // Fraction of short-wave radiation incident that is absorbed by face 2 when total absorbed radiation is // apportioned to the two faces - Array1D - SurfWinConvCoeffWithShade; // Convection coefficient from glass or shade to gap air when interior or exterior shade is present (W/m2-K) + Array1D SurfWinConvCoeffWithShade; // Convection coefficient from glass or shade to gap air when interior + // or exterior shade is present (W/m2-K) Array1D SurfWinOtherConvHeatGain; // other convective = total conv - standard model prediction for EQL window model (W) Array1D SurfWinBlindNumber; // Blind number for a window with a blind Array1D SurfWinEffInsSurfTemp; // Effective inside surface temperature for window with interior blind or shade; combination of shade/blind @@ -1554,9 +1560,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfActiveConstruction; // The currently active construction with or without storm window Array1D SurfWinActiveShadedConstruction; // The currently active shaded construction with or without storm window (windows only) - bool AnyHeatBalanceInsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm inside face used - bool AnyHeatBalanceOutsideSourceTerm = false; // True if any SurfaceProperty:HeatBalanceSourceTerm outside face used - EPVector Surface; EPVector SurfaceWindow; Array1D FrameDivider; @@ -1624,14 +1627,14 @@ struct SurfacesData : BaseGlobalStruct this->SurfWinA.deallocate(); this->SurfWinADiffFront.deallocate(); this->SurfWinACFOverlap.deallocate(); - this->AirSkyRadSplit.deallocate(); - this->SUNCOSHR = Array2D(24, 3, 0.0); - this->ReflFacBmToDiffSolObs.deallocate(); - this->ReflFacBmToDiffSolGnd.deallocate(); - this->ReflFacBmToBmSolObs.deallocate(); - this->ReflFacSkySolObs.deallocate(); - this->ReflFacSkySolGnd.deallocate(); - this->CosIncAveBmToBmSolObs.deallocate(); + this->SurfAirSkyRadSplit.deallocate(); + this->SurfSunCosHourly.deallocate(); + this->SurfReflFacBmToDiffSolObs.deallocate(); + this->SurfReflFacBmToDiffSolGnd.deallocate(); + this->SurfReflFacBmToBmSolObs.deallocate(); + this->SurfReflFacSkySolObs.deallocate(); + this->SurfReflFacSkySolGnd.deallocate(); + this->SurfCosIncAveBmToBmSolObs.deallocate(); this->EnclSolDBIntWin.deallocate(); this->SurfSunlitArea.deallocate(); this->SurfSunlitFrac.deallocate(); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 124f76f7852..0f5d3cd7422 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -512,13 +512,13 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->GILSK = 0.0; state.dataDaylightingManager->GILSU = 0.0; for (IHR = 1; IHR <= 24; ++IHR) { - if (state.dataSurface->SUNCOSHR(IHR, 3) < DataEnvironment::SunIsUpValue) - continue; // Skip if sun is below horizon //Autodesk SUNCOSHR was uninitialized here - state.dataDaylightingManager->PHSUN = DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SUNCOSHR(IHR, 3)); + if (state.dataSurface->SurfSunCosHourly(IHR, 3) < DataEnvironment::SunIsUpValue) + continue; // Skip if sun is below horizon //Autodesk SurfSunCosHourly was uninitialized here + state.dataDaylightingManager->PHSUN = DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(IHR, 3)); state.dataDaylightingManager->PHSUNHR(IHR) = state.dataDaylightingManager->PHSUN; state.dataDaylightingManager->SPHSUNHR(IHR) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(IHR) = std::cos(state.dataDaylightingManager->PHSUN); - state.dataDaylightingManager->THSUNHR(IHR) = std::atan2(state.dataSurface->SUNCOSHR(IHR, 2), state.dataSurface->SUNCOSHR(IHR, 1)); + state.dataDaylightingManager->THSUNHR(IHR) = std::atan2(state.dataSurface->SurfSunCosHourly(IHR, 2), state.dataSurface->SurfSunCosHourly(IHR, 1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(IHR); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(IHR); @@ -538,14 +538,14 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay) = 0.0; state.dataDaylightingManager->GILSK(state.dataGlobal->HourOfDay, {1, 4}) = 0.0; state.dataDaylightingManager->GILSU(state.dataGlobal->HourOfDay) = 0.0; - if (!(state.dataSurface->SUNCOSHR(state.dataGlobal->HourOfDay, 3) < DataEnvironment::SunIsUpValue)) { // Skip if sun is below horizon + if (!(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 3) < DataEnvironment::SunIsUpValue)) { // Skip if sun is below horizon state.dataDaylightingManager->PHSUN = - DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SUNCOSHR(state.dataGlobal->HourOfDay, 3)); + DataGlobalConstants::PiOvr2 - std::acos(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 3)); state.dataDaylightingManager->PHSUNHR(state.dataGlobal->HourOfDay) = state.dataDaylightingManager->PHSUN; state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(state.dataGlobal->HourOfDay) = std::cos(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay) = - std::atan2(state.dataSurface->SUNCOSHR(state.dataGlobal->HourOfDay, 2), state.dataSurface->SUNCOSHR(state.dataGlobal->HourOfDay, 1)); + std::atan2(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 2), state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay); @@ -3146,7 +3146,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [&state, &GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { // todo - how to find index of object objArr - int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + int ObsSurfNum = surface.Index; if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { PierceSurface(surface, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface return hitObs; // Ray pierces surface @@ -3231,7 +3231,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // switch as need to serve both reference points and map points based on calledFrom using General::POLYF; - if (state.dataSurface->SUNCOSHR(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static Vector3 const RREF(0.0); // Location of a reference point in absolute coordinate system //Autodesk Was used uninitialized: @@ -3478,7 +3478,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( Real64 const TVISB_ObTrans(TVISB * ObTrans); Real64 const AVWLSU_add(TVISB_ObTrans * state.dataDaylightingManager->GILSU(iHour) * (state.dataEnvrn->GndReflectanceForDayltg / DataGlobalConstants::Pi)); - Vector3 const SUNCOS_iHour(state.dataSurface->SUNCOSHR(iHour, {1, 3})); + Vector3 const SUNCOS_iHour(state.dataSurface->SurfSunCosHourly(iHour, {1, 3})); assert(equal_dimensions(state.dataDaylightingManager->EDIRSK, state.dataDaylightingManager->AVWLSK)); auto l(state.dataDaylightingManager->EDIRSK.index(iHour, 1, 1)); for (ISky = 1; ISky <= 4; ++ISky, ++l) { // [ l ] == ( iHour, 1, ISky ) @@ -3947,7 +3947,7 @@ void FigureRefPointDayltgFactorsToAddIllums(EnergyPlusData &state, int JSH; // Shading index: J=1 is unshaded window, J=2 is shaded window Real64 VTR; // For switchable glazing, ratio of visible transmittance of fully-switched state to that of the unswitched state - if (state.dataSurface->SUNCOSHR(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; ++ISunPos; @@ -4086,7 +4086,7 @@ void FigureMapPointDayltgFactorsToAddIllums(EnergyPlusData &state, Real64 VTR; // For switchable glazing, ratio of visible transmittance of // fully-switched state to that of the unswitched state - if (state.dataSurface->SUNCOSHR(iHour, 3) < DataEnvironment::SunIsUpValue) return; + if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; // Altitude of sun (degrees) state.dataDaylightingManager->PHSUN = state.dataDaylightingManager->PHSUNHR(iHour); @@ -5906,7 +5906,7 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { - int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + int ObsSurfNum = surface.Index; if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { @@ -7752,7 +7752,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, DPH = (PHMAX - PHMIN) / double(NPHMAX); // Sky/ground element altitude integration - Vector3 const SUNCOS_IHR(state.dataSurface->SUNCOSHR(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); for (IPH = 1; IPH <= NPHMAX; ++IPH) { PH = PHMIN + (double(IPH) - 0.5) * DPH; @@ -8286,7 +8286,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // TH 7/7/2010 moved from inside the loop: DO JB = 1,MaxSlatAngs if (BlindOn) - ProfileAngle(state, IWin, state.dataSurface->SUNCOSHR(IHR, {1, 3}), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); + ProfileAngle(state, IWin, state.dataSurface->SurfSunCosHourly(IHR, {1, 3}), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); for (JB = 1; JB <= MaxSlatAngs; ++JB) { if (!state.dataSurface->SurfWinMovableSlats(IWin) && JB > 1) break; @@ -8386,7 +8386,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // specular reflection from exterior surfaces if (state.dataSurface->CalcSolRefl && state.dataSurface->SurfWinOriginalClass(IWin) != SurfaceClass::TDD_Dome) { - ZSU1refl = state.dataSurface->ReflFacBmToBmSolObs(IHR, IWin); + ZSU1refl = state.dataSurface->SurfReflFacBmToBmSolObs(IHR, IWin); if (ZSU1refl > 0.0) { // Contribution to window luminance and downgoing flux @@ -8598,7 +8598,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, } else { NGnd = state.dataBSDFWindow->ComplexWind(IWin).DaylghtGeom(CurCplxFenState).IlluminanceMap(iRefPoint, MapNum).NGnd(WinEl); } - Vector3 const SUNCOS_IHR(state.dataSurface->SUNCOSHR(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); for (iGndElem = 1; iGndElem <= NGnd; ++iGndElem) { // case for sky elements. Integration is done over upper ground hemisphere to determine how many obstructions // were hit in the process @@ -9257,7 +9257,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &state, &RecPt, &RayVec, &hit, &NearestHitDistance_sq, &nearestHitSurface, &NearestHitPt](SurfaceData const &surface) { - int ObsSurfNum = UtilityRoutines::FindItemInList(surface.Name, state.dataSurface->Surface); + int ObsSurfNum = surface.Index; if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(surface, RecPt, RayVec, state.dataDaylightingManager->HitPt, hit); // Check if ray pierces surface @@ -9337,7 +9337,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, } } // Cosine of angle of incidence of sun at HitPt if sun were to reach HitPt - Vector3 const SUNCOS_IHR(state.dataSurface->SUNCOSHR(IHR, {1, 3})); + Vector3 const SUNCOS_IHR(state.dataSurface->SurfSunCosHourly(IHR, {1, 3})); CosIncAngAtHitPt = dot(DayltgSurfaceLumFromSunReflNorm, SUNCOS_IHR); // Require that the sun be in front of this surface relative to window element if (CosIncAngAtHitPt <= 0.0) return; // Sun is in back of reflecting surface @@ -10654,7 +10654,7 @@ void DayltgInterReflIllFrIntWins(EnergyPlusData &state, int &ZoneNum) // Zone nu // This is an interior window in ZoneNum int const ConstrNum = state.dataSurface->Surface(IWin).Construction; int const adjEnclNum = state.dataSurface->Surface(state.dataSurface->Surface(IWin).ExtBoundCond).SolarEnclIndex; - QDifTrans = state.dataHeatBal->QSDifSol(adjEnclNum) * state.dataConstruction->Construct(ConstrNum).TransDiffVis * + QDifTrans = state.dataHeatBal->EnclSolQSDifSol(adjEnclNum) * state.dataConstruction->Construct(ConstrNum).TransDiffVis * state.dataSurface->Surface(IWin).Area * state.dataEnvrn->PDIFLW; QDifTransUp = QDifTrans * state.dataSurface->SurfWinFractionUpgoing(IWin); QDifTransDn = QDifTrans * (1.0 - state.dataSurface->SurfWinFractionUpgoing(IWin)); diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index f0540c74d68..4914442ec9f 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -2016,6 +2016,7 @@ namespace HeatBalanceIntRadExchange { { static std::string const routineName("GetRadiantSystemSurface: "); // include trailing blank space + // TODO - find by index? // For radiant zone equipment, find the referenced surface and check if it is in the same zone or radiant enclosure int const surfNum = UtilityRoutines::FindItemInList(SurfaceName, state.dataSurface->Surface); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index e635b3e38da..29af3ebea87 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5739,6 +5739,11 @@ namespace HeatBalanceManager { // Use the total number of zones or surfaces to allocate variables to avoid a limit // Allocate real Variables // Following used for Calculations + // Allocate zone / encl hb arrays + state.dataSurface->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataSurface->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolQSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); + // Allocate variables in DataHeatBalSys state.dataHeatBalFanSys->SumConvHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBalFanSys->SumLatentHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 4c3ab322b64..d0d11925ce6 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -1469,8 +1469,6 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalSurf->SurfNetLWRadToSurf.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->SurfOpaqQRadSWLightsInAbs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSkySolarInc.dimension(state.dataSurface->TotSurfaces, 0); - state.dataSurface->SurfGndSolarInc.dimension(state.dataSurface->TotSurfaces, 0); DisplayString(state, "Setting up Surface Reporting Variables"); @@ -2591,8 +2589,8 @@ void InitSolarHeatGains(EnergyPlusData &state) } if (currSolRadPositive) { // Sun is up, calculate solar quantities - assert(equal_dimensions(state.dataSurface->ReflFacBmToBmSolObs, state.dataSurface->ReflFacBmToDiffSolObs)); // For linear indexing - assert(equal_dimensions(state.dataSurface->ReflFacBmToBmSolObs, state.dataSurface->ReflFacBmToDiffSolGnd)); // For linear indexing + assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolObs)); // For linear indexing + assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolGnd)); // For linear indexing for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum); state.dataSurface->SurfGndSolarInc(SurfNum) = state.dataEnvrn->GndSolarRad * Surface(SurfNum).ViewFactorGround; @@ -2601,33 +2599,33 @@ void InitSolarHeatGains(EnergyPlusData &state) } if (state.dataSurface->CalcSolRefl) { // [ lSH ] == ( HourOfDay, SurfNum ) // [ lSP ] == ( PreviousHour, SurfNum ) - Array1D::size_type lSH = state.dataSurface->ReflFacBmToBmSolObs.index(state.dataGlobal->HourOfDay, 1) - 1; - Array1D::size_type lSP = state.dataSurface->ReflFacBmToBmSolObs.index(state.dataGlobal->PreviousHour, 1) - 1; + Array1D::size_type lSH = state.dataSurface->SurfReflFacBmToBmSolObs.index(state.dataGlobal->HourOfDay, 1) - 1; + Array1D::size_type lSP = state.dataSurface->SurfReflFacBmToBmSolObs.index(state.dataGlobal->PreviousHour, 1) - 1; // For Complex Fenestrations: for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfWinSkyGndSolarInc(SurfNum) = - state.dataEnvrn->DifSolarRad * state.dataEnvrn->GndReflectance * state.dataSurface->ReflFacSkySolGnd(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataEnvrn->GndReflectance * state.dataSurface->SurfReflFacSkySolGnd(SurfNum); state.dataSurface->SurfWinBmGndSolarInc(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS(3) * state.dataEnvrn->GndReflectance * state.dataSurface->SurfBmToDiffReflFacGnd(SurfNum); state.dataSurface->SurfBmToBmReflFacObs(SurfNum) = - state.dataGlobal->WeightNow * state.dataSurface->ReflFacBmToBmSolObs[lSH + SurfNum] + - state.dataGlobal->WeightPreviousHour * state.dataSurface->ReflFacBmToBmSolObs[lSP + SurfNum]; + state.dataGlobal->WeightNow * state.dataSurface->SurfReflFacBmToBmSolObs[lSH + SurfNum] + + state.dataGlobal->WeightPreviousHour * state.dataSurface->SurfReflFacBmToBmSolObs[lSP + SurfNum]; state.dataSurface->SurfBmToDiffReflFacObs(SurfNum) = - state.dataGlobal->WeightNow * state.dataSurface->ReflFacBmToDiffSolObs[lSH + SurfNum] + - state.dataGlobal->WeightPreviousHour * state.dataSurface->ReflFacBmToDiffSolObs[lSP + SurfNum]; + state.dataGlobal->WeightNow * state.dataSurface->SurfReflFacBmToDiffSolObs[lSH + SurfNum] + + state.dataGlobal->WeightPreviousHour * state.dataSurface->SurfReflFacBmToDiffSolObs[lSP + SurfNum]; state.dataSurface->SurfBmToDiffReflFacGnd(SurfNum) = - state.dataGlobal->WeightNow * state.dataSurface->ReflFacBmToDiffSolGnd[lSH + SurfNum] + - state.dataGlobal->WeightPreviousHour * state.dataSurface->ReflFacBmToDiffSolGnd[lSP + SurfNum]; + state.dataGlobal->WeightNow * state.dataSurface->SurfReflFacBmToDiffSolGnd[lSH + SurfNum] + + state.dataGlobal->WeightPreviousHour * state.dataSurface->SurfReflFacBmToDiffSolGnd[lSP + SurfNum]; // TH2 CR 9056 state.dataSurface->SurfSkySolarInc(SurfNum) += state.dataEnvrn->BeamSolarRad * (state.dataSurface->SurfBmToBmReflFacObs(SurfNum) + state.dataSurface->SurfBmToDiffReflFacObs(SurfNum)) + - state.dataEnvrn->DifSolarRad * state.dataSurface->ReflFacSkySolObs(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataSurface->SurfReflFacSkySolObs(SurfNum); state.dataSurface->SurfGndSolarInc(SurfNum) = state.dataEnvrn->BeamSolarRad * state.dataEnvrn->SOLCOS(3) * state.dataEnvrn->GndReflectance * state.dataSurface->SurfBmToDiffReflFacGnd(SurfNum) + - state.dataEnvrn->DifSolarRad * state.dataEnvrn->GndReflectance * state.dataSurface->ReflFacSkySolGnd(SurfNum); - state.dataSurface->SurfSkyDiffReflFacGnd(SurfNum) = state.dataSurface->ReflFacSkySolGnd(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataEnvrn->GndReflectance * state.dataSurface->SurfReflFacSkySolGnd(SurfNum); + state.dataSurface->SurfSkyDiffReflFacGnd(SurfNum) = state.dataSurface->SurfReflFacSkySolGnd(SurfNum); } } @@ -2650,7 +2648,7 @@ void InitSolarHeatGains(EnergyPlusData &state) // QDV(ZoneNum) = EnclSolDS(ZoneNum)*DifSolarRad & // +EnclSolDG(ZoneNum)*GndSolarRad - // Original QD calc used only for QSDifSol and daylighting calcs + // Original QD calc used only for EnclSolQSDifSol and daylighting calcs // QDforDaylight(ZoneNum) = EnclSolDB(ZoneNum)*BeamSolarRad & // +EnclSolDS(ZoneNum)*DifSolarRad & // +EnclSolDG(ZoneNum)*GndSolarRad @@ -2676,33 +2674,33 @@ void InitSolarHeatGains(EnergyPlusData &state) // Flux of diffuse solar in each zone - state.dataHeatBal->QSDifSol = 0.0; + state.dataHeatBal->EnclSolQSDifSol = 0.0; for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { - state.dataHeatBal->QSDifSol(enclNum) = state.dataHeatBalSurf->EnclSolQDforDaylight(enclNum); + state.dataHeatBal->EnclSolQSDifSol(enclNum) = state.dataHeatBalSurf->EnclSolQDforDaylight(enclNum); } if (state.dataHeatBalSurf->InterZoneWindow) { for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { if (state.dataHeatBalSurf->RecDifShortFromZ(enclNum)) { - Real64 QSDifSol_sum(0.0); // Accumulator + Real64 EnclSolQSDifSol_sum(0.0); // Accumulator auto lZone(state.dataHeatBalSurf->FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { if ((otherEnclNum != enclNum) && (state.dataHeatBalSurf->RecDifShortFromZ(otherEnclNum))) { - QSDifSol_sum += state.dataHeatBalSurf->FractDifShortZtoZ[lZone] * + EnclSolQSDifSol_sum += state.dataHeatBalSurf->FractDifShortZtoZ[lZone] * state.dataHeatBalSurf->EnclSolQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } - state.dataHeatBal->QSDifSol(enclNum) += QSDifSol_sum; + state.dataHeatBal->EnclSolQSDifSol(enclNum) += EnclSolQSDifSol_sum; } } } for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { if (state.dataHeatBalSurf->InterZoneWindow) - state.dataHeatBal->QSDifSol(enclNum) *= + state.dataHeatBal->EnclSolQSDifSol(enclNum) *= state.dataHeatBalSurf->FractDifShortZtoZ(enclNum, enclNum) * state.dataHeatBalSurf->EnclSolVMULT(enclNum); else - state.dataHeatBal->QSDifSol(enclNum) *= state.dataHeatBalSurf->EnclSolVMULT(enclNum); + state.dataHeatBal->EnclSolQSDifSol(enclNum) *= state.dataHeatBalSurf->EnclSolVMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -2790,7 +2788,7 @@ void InitSolarHeatGains(EnergyPlusData &state) state.dataSurface->SurfBmToDiffReflFacObs(SurfNum) * state.dataEnvrn->BeamSolarRad; // Incident diffuse solar from sky diffuse reflection from obstructions state.dataHeatBal->SurfQRadSWOutIncSkyDiffReflObs(SurfNum) = - state.dataEnvrn->DifSolarRad * state.dataSurface->ReflFacSkySolObs(SurfNum); + state.dataEnvrn->DifSolarRad * state.dataSurface->SurfReflFacSkySolObs(SurfNum); // TH2 CR 9056: Add reflections from obstructions to the total incident state.dataHeatBal->SurfQRadSWOutIncident(SurfNum) += state.dataHeatBal->SurfQRadSWOutIncBmToBmReflObs(SurfNum) + state.dataHeatBal->SurfQRadSWOutIncBmToDiffReflObs(SurfNum) + diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 5e7301e7585..e9a274f2a61 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -225,12 +225,12 @@ namespace SolarReflectionManager { state.dataSolarReflectionManager->SolReflRecSurf.allocate(state.dataSolarReflectionManager->TotSolReflRecSurf); - state.dataSurface->ReflFacBmToDiffSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->ReflFacBmToDiffSolGnd.dimension(24, state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->ReflFacBmToBmSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->ReflFacSkySolObs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->ReflFacSkySolGnd.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->CosIncAveBmToBmSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfReflFacBmToDiffSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfReflFacBmToDiffSolGnd.dimension(24, state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfReflFacBmToBmSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfReflFacSkySolObs.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfReflFacSkySolGnd.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfCosIncAveBmToBmSolObs.dimension(24, state.dataSurface->TotSurfaces, 0.0); // Only surfaces with sun exposure can receive solar reflection from ground or onstructions // Shading surfaces are always not exposed to solar (ExtSolar = False) @@ -581,14 +581,14 @@ namespace SolarReflectionManager { } else { DisplayString(state, "Updating Beam-to-Diffuse Exterior Solar Reflection Factors"); } - state.dataSurface->ReflFacBmToDiffSolObs = 0.0; - state.dataSurface->ReflFacBmToDiffSolGnd = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolObs = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolGnd = 0.0; for (state.dataSolarReflectionManager->IHr = 1; state.dataSolarReflectionManager->IHr <= 24; ++state.dataSolarReflectionManager->IHr) { FigureBeamSolDiffuseReflFactors(state, state.dataSolarReflectionManager->IHr); } // End of IHr loop } else { // timestep integrated solar, use current hour of day - state.dataSurface->ReflFacBmToDiffSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataSurface->ReflFacBmToDiffSolGnd(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolGnd(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; FigureBeamSolDiffuseReflFactors(state, state.dataGlobal->HourOfDay); } } @@ -617,7 +617,7 @@ namespace SolarReflectionManager { ReflBmToDiffSolGnd = 0.0; // Unit vector to sun - state.dataSolarReflectionManager->SunVec = state.dataSurface->SUNCOSHR(iHour, {1, 3}); + state.dataSolarReflectionManager->SunVec = state.dataSurface->SurfSunCosHourly(iHour, {1, 3}); // loop through each surface that can receive beam solar reflected as diffuse solar from other surfaces for (state.dataSolarReflectionManager->RecSurfNum = 1; @@ -788,7 +788,7 @@ namespace SolarReflectionManager { } else { // Ray hits ground (in this case we do not multiply by BmReflSolRadiance since // ground reflectance and cos of incidence angle of sun on - // ground is taken into account later when ReflFacBmToDiffSolGnd is used) + // ground is taken into account later when SurfReflFacBmToDiffSolGnd is used) state.dataSolarReflectionManager->dReflBeamToDiffSol = state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->RecSurfNum) .dOmegaRay(state.dataSolarReflectionManager->RayNum) * @@ -802,25 +802,25 @@ namespace SolarReflectionManager { } // End of loop over receiving points // Average over receiving points - state.dataSurface->ReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) = 0.0; - state.dataSurface->ReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) = 0.0; + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) = 0.0; state.dataSolarReflectionManager->NumRecPts = state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->RecSurfNum).NumRecPts; for (state.dataSolarReflectionManager->RecPtNum = 1; state.dataSolarReflectionManager->RecPtNum <= state.dataSolarReflectionManager->NumRecPts; ++state.dataSolarReflectionManager->RecPtNum) { - state.dataSurface->ReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) += + state.dataSurface->SurfReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) += ReflBmToDiffSolObs(state.dataSolarReflectionManager->RecPtNum); - state.dataSurface->ReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) += + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) += ReflBmToDiffSolGnd(state.dataSolarReflectionManager->RecPtNum); } - state.dataSurface->ReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; - state.dataSurface->ReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; + state.dataSurface->SurfReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; - // Do not allow ReflFacBmToDiffSolGnd to exceed the surface's unobstructed ground view factor - state.dataSurface->ReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) = + // Do not allow SurfReflFacBmToDiffSolGnd to exceed the surface's unobstructed ground view factor + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) = min(0.5 * (1.0 - state.dataSurface->Surface(state.dataSolarReflectionManager->SurfNum).CosTilt), - state.dataSurface->ReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum)); + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum)); // Note: the above factors are dimensionless; they are equal to // (W/m2 reflected solar incident on SurfNum)/(W/m2 beam normal solar) } // End of loop over receiving surfaces @@ -851,15 +851,15 @@ namespace SolarReflectionManager { } else { DisplayString(state, "Updating Beam-to-Beam Exterior Solar Reflection Factors"); } - state.dataSurface->ReflFacBmToBmSolObs = 0.0; - state.dataSurface->CosIncAveBmToBmSolObs = 0.0; + state.dataSurface->SurfReflFacBmToBmSolObs = 0.0; + state.dataSurface->SurfCosIncAveBmToBmSolObs = 0.0; for (state.dataSolarReflectionManager->NumHr = 1; state.dataSolarReflectionManager->NumHr <= 24; ++state.dataSolarReflectionManager->NumHr) { FigureBeamSolSpecularReflFactors(state, state.dataSolarReflectionManager->NumHr); } // End of NumHr loop } else { // timestep integrated solar, use current hour of day - state.dataSurface->ReflFacBmToBmSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; - state.dataSurface->CosIncAveBmToBmSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; + state.dataSurface->SurfReflFacBmToBmSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; + state.dataSurface->SurfCosIncAveBmToBmSolObs(state.dataGlobal->HourOfDay, {1, state.dataSurface->TotSurfaces}) = 0.0; FigureBeamSolSpecularReflFactors(state, state.dataGlobal->HourOfDay); } } @@ -910,10 +910,10 @@ namespace SolarReflectionManager { ReflBmToDiffSolObs = 0.0; ReflFacTimesCosIncSum = 0.0; - if (state.dataSurface->SUNCOSHR(iHour, 3) < DataEnvironment::SunIsUpValue) return; // Skip if sun is below horizon + if (state.dataSurface->SurfSunCosHourly(iHour, 3) < DataEnvironment::SunIsUpValue) return; // Skip if sun is below horizon // Unit vector to sun - state.dataSolarReflectionManager->SunVect = state.dataSurface->SUNCOSHR(iHour, {1, 3}); + state.dataSolarReflectionManager->SunVect = state.dataSurface->SurfSunCosHourly(iHour, {1, 3}); for (int RecSurfNum = 1; RecSurfNum <= state.dataSolarReflectionManager->TotSolReflRecSurf; ++RecSurfNum) { int const SurfNum = @@ -1073,11 +1073,11 @@ namespace SolarReflectionManager { } else { state.dataSolarReflectionManager->CosIncWeighted = 0.0; } - state.dataSurface->CosIncAveBmToBmSolObs(iHour, SurfNum) += state.dataSolarReflectionManager->CosIncWeighted; - state.dataSurface->ReflFacBmToBmSolObs(iHour, SurfNum) += ReflBmToBmSolObs(RecPtNum); + state.dataSurface->SurfCosIncAveBmToBmSolObs(iHour, SurfNum) += state.dataSolarReflectionManager->CosIncWeighted; + state.dataSurface->SurfReflFacBmToBmSolObs(iHour, SurfNum) += ReflBmToBmSolObs(RecPtNum); } - state.dataSurface->ReflFacBmToBmSolObs(iHour, SurfNum) /= double(NumRecPts); - state.dataSurface->CosIncAveBmToBmSolObs(iHour, SurfNum) /= double(NumRecPts); + state.dataSurface->SurfReflFacBmToBmSolObs(iHour, SurfNum) /= double(NumRecPts); + state.dataSurface->SurfCosIncAveBmToBmSolObs(iHour, SurfNum) /= double(NumRecPts); } // End of check if number of possible obstructions > 0 } // End of loop over receiving surfaces } @@ -1276,24 +1276,24 @@ namespace SolarReflectionManager { } // End of loop over receiving points // Average over receiving points - state.dataSurface->ReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) = 0.0; - state.dataSurface->ReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) = 0.0; + state.dataSurface->SurfReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) = 0.0; + state.dataSurface->SurfReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) = 0.0; state.dataSolarReflectionManager->iNumRecPts = state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->iRecSurfNum).NumRecPts; for (state.dataSolarReflectionManager->iRecPtNum = 1; state.dataSolarReflectionManager->iRecPtNum <= state.dataSolarReflectionManager->iNumRecPts; ++state.dataSolarReflectionManager->iRecPtNum) { - state.dataSurface->ReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) += + state.dataSurface->SurfReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) += ReflSkySolObs(state.dataSolarReflectionManager->iRecPtNum); - state.dataSurface->ReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) += + state.dataSurface->SurfReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) += ReflSkySolGnd(state.dataSolarReflectionManager->iRecPtNum); } - state.dataSurface->ReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) /= state.dataSolarReflectionManager->iNumRecPts; - state.dataSurface->ReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) /= state.dataSolarReflectionManager->iNumRecPts; - // Do not allow ReflFacBmToDiffSolGnd to exceed the surface's unobstructed ground view factor - state.dataSurface->ReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) = + state.dataSurface->SurfReflFacSkySolObs(state.dataSolarReflectionManager->iSurfNum) /= state.dataSolarReflectionManager->iNumRecPts; + state.dataSurface->SurfReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) /= state.dataSolarReflectionManager->iNumRecPts; + // Do not allow SurfReflFacBmToDiffSolGnd to exceed the surface's unobstructed ground view factor + state.dataSurface->SurfReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum) = min(0.5 * (1.0 - state.dataSurface->Surface(state.dataSolarReflectionManager->iSurfNum).CosTilt), - state.dataSurface->ReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum)); + state.dataSurface->SurfReflFacSkySolGnd(state.dataSolarReflectionManager->iSurfNum)); // Note: the above factors are dimensionless; they are equal to // (W/m2 reflected solar incident on SurfNum)/(W/m2 unobstructed horizontal sky diffuse irradiance) } // End of loop over receiving surfaces diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 69629f92fab..bbe81b1ae48 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -745,11 +745,22 @@ void AllocateModuleArrays(EnergyPlusData &state) int SurfLoop; int I; int NumOfLayers; + + state.dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); + state.dataSurface->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSunlitFrac.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSkySolarInc.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfGndSolarInc.dimension(state.dataSurface->TotSurfaces, 0); + state.dataSurface->SurfBmToBmReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfBmToDiffReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfBmToDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfSkyDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfOpaqAI.dimension(state.dataSurface->TotSurfaces, 0.0); + state.dataSurface->SurfOpaqAO.dimension(state.dataSurface->TotSurfaces, 0.0); + // TODO - check allocation here state.dataSolarShading->CTHETA.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSolarShading->SAREA.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSunlitArea.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSunlitFrac.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SunlitFracHR.dimension(24, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SunlitFrac.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SunlitFracWithoutReveal.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); @@ -4855,9 +4866,9 @@ void FigureSunCosines(EnergyPlusData &state, // Save hourly values for use in DaylightingManager if (!state.dataSysVars->DetailedSolarTimestepIntegration) { - if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) state.dataSurface->SUNCOSHR(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; + if (iTimeStep == state.dataGlobal->NumOfTimeStepInHour) state.dataSurface->SurfSunCosHourly(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; } else { - state.dataSurface->SUNCOSHR(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; + state.dataSurface->SurfSunCosHourly(iHour, {1, 3}) = state.dataSolarShading->SUNCOS; } // Save timestep values for use in WindowComplexManager state.dataBSDFWindow->SUNCOSTS(iTimeStep, iHour, {1, 3}) = state.dataSolarShading->SUNCOS; @@ -8593,6 +8604,7 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) state.dataSurface->EnclSolDBIntWin.allocate(state.dataGlobal->NumOfZones); } + // TODO - allocation state.dataSurface->EnclSolDB = 0.0; state.dataSurface->EnclSolDBIntWin = 0.0; state.dataSurface->SurfOpaqAI = 0.0; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index a717dd8b080..c1ac3af5a1f 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -112,6 +112,10 @@ namespace SurfaceGeometry { void AllocateSurfaceWindows(EnergyPlusData &state, int NumSurfaces) { + state.dataSurface->SurfWinA.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); + state.dataSurface->SurfWinADiffFront.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); + state.dataSurface->SurfWinACFOverlap.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); + state.dataSurface->SurfWinFrameQRadOutAbs.dimension(NumSurfaces, 0); state.dataSurface->SurfWinFrameQRadInAbs.dimension(NumSurfaces, 0); state.dataSurface->SurfWinDividerQRadOutAbs.dimension(NumSurfaces, 0); @@ -359,8 +363,6 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->CosZoneRelNorth.deallocate(); state.dataSurfaceGeometry->SinZoneRelNorth.deallocate(); - state.dataSurface->AirSkyRadSplit.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->CalcWindowRevealReflection = false; // Set to True in ProcessSurfaceVertices if beam solar reflection from window reveals // is requested for one or more exterior windows. state.dataSurface->BuildingShadingCount = 0; @@ -371,7 +373,7 @@ namespace SurfaceGeometry { for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Loop through all surfaces... - state.dataSurface->AirSkyRadSplit(SurfNum) = std::sqrt(0.5 * (1.0 + state.dataSurface->Surface(SurfNum).CosTilt)); + state.dataSurface->SurfAirSkyRadSplit(SurfNum) = std::sqrt(0.5 * (1.0 + state.dataSurface->Surface(SurfNum).CosTilt)); // Set flag that determines whether a surface is a shadowing surface state.dataSurface->Surface(SurfNum).ShadowingSurf = false; @@ -876,20 +878,6 @@ namespace SurfaceGeometry { state.dataSurface->Y0.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSurface->Z0.dimension(state.dataSurface->TotSurfaces, 0.0); - // TODO: move the following to (surface) heat balance - state.dataSurface->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataSurface->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->QSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataSurface->SurfOpaqAI.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfOpaqAO.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfBmToBmReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfBmToDiffReflFacObs.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfBmToDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfSkyDiffReflFacGnd.dimension(state.dataSurface->TotSurfaces, 0.0); - state.dataSurface->SurfWinA.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); - state.dataSurface->SurfWinADiffFront.dimension(state.dataSurface->TotSurfaces, CFSMAXNL + 1, 0.0); - state.dataSurface->SurfWinACFOverlap.dimension(state.dataSurface->TotSurfaces, state.dataHeatBal->MaxSolidWinLayers, 0.0); - // Surface EMS arrays state.dataSurface->SurfEMSConstructionOverrideON.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfEMSConstructionOverrideValue.allocate(state.dataSurface->TotSurfaces); @@ -932,6 +920,7 @@ namespace SurfaceGeometry { state.dataSurface->SurfOutWindDir.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfGenericContam.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfPenumbraID.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfAirSkyRadSplit.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfOutDryBulbTemp(SurfNum) = 0.0; state.dataSurface->SurfOutWetBulbTemp(SurfNum) = 0.0; @@ -939,6 +928,7 @@ namespace SurfaceGeometry { state.dataSurface->SurfOutWindDir(SurfNum) = 0.0; state.dataSurface->SurfGenericContam(SurfNum) = 0.0; state.dataSurface->SurfPenumbraID(SurfNum) = 0; + state.dataSurface->SurfAirSkyRadSplit(SurfNum) = 0.0; } // Following are surface property arrays used in SurfaceGeometry state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 81189a28345..dffb7cfb438 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2910,8 +2910,8 @@ namespace WindowComplexManager { tsky = state.dataEnvrn->SkyTempKelvin; Ebout = state.dataWindowComplexManager->sigma * pow_4(tout); outir = state.dataSurface->Surface(SurfNum).ViewFactorSkyIR * - (state.dataSurface->AirSkyRadSplit(SurfNum) * state.dataWindowComplexManager->sigma * pow_4(tsky) + - (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * Ebout) + + (state.dataSurface->SurfAirSkyRadSplit(SurfNum) * state.dataWindowComplexManager->sigma * pow_4(tsky) + + (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * Ebout) + state.dataSurface->Surface(SurfNum).ViewFactorGroundIR * Ebout + OutSrdIR; } diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 2209b3cbceb..53094f6f3de 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -861,8 +861,8 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, Ebout = DataGlobalConstants::StefanBoltzmann * pow_4(Tout); // ASHWAT model may be slightly different outir = state.dataSurface->Surface(SurfNum).ViewFactorSkyIR * - (state.dataSurface->AirSkyRadSplit(SurfNum) * DataGlobalConstants::StefanBoltzmann * pow_4(tsky) + - (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * Ebout) + + (state.dataSurface->SurfAirSkyRadSplit(SurfNum) * DataGlobalConstants::StefanBoltzmann * pow_4(tsky) + + (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * Ebout) + state.dataSurface->Surface(SurfNum).ViewFactorGroundIR * Ebout + OutSrdIR; } } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 342b69b0ed5..af52927fe18 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2335,8 +2335,8 @@ namespace WindowManager { state.dataWindowManager->Ebout = state.dataWindowManager->sigma * pow_4(state.dataWindowManager->tout); state.dataWindowManager->Outir = surface.ViewFactorSkyIR * - (state.dataSurface->AirSkyRadSplit(SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + - (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * state.dataWindowManager->Ebout) + + (state.dataSurface->SurfAirSkyRadSplit(SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + + (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * state.dataWindowManager->Ebout) + surface.ViewFactorGroundIR * state.dataWindowManager->Ebout; } else if (state.dataSurface->SurfWinWindowModelType(SurfNum) == WindowEQLModel) { @@ -2766,8 +2766,8 @@ namespace WindowManager { state.dataWindowManager->Ebout = state.dataWindowManager->sigma * pow_4(state.dataWindowManager->tout); state.dataWindowManager->Outir = surface.ViewFactorSkyIR * - (state.dataSurface->AirSkyRadSplit(SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + - (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * state.dataWindowManager->Ebout) + + (state.dataSurface->SurfAirSkyRadSplit(SurfNum) * state.dataWindowManager->sigma * pow_4(state.dataEnvrn->SkyTempKelvin) + + (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * state.dataWindowManager->Ebout) + surface.ViewFactorGroundIR * state.dataWindowManager->Ebout + OutSrdIR; } @@ -2925,9 +2925,9 @@ namespace WindowManager { } Real64 const rad_out_air_per_area = - -emiss_sigma_product * (1.0 - state.dataSurface->AirSkyRadSplit(SurfNum)) * surface.ViewFactorSkyIR * (Tsout_4 - Tout_4); + -emiss_sigma_product * (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * surface.ViewFactorSkyIR * (Tsout_4 - Tout_4); Real64 const rad_out_ground_per_area = -emiss_sigma_product * surface.ViewFactorGroundIR * (Tsout_4 - Tout_4); - Real64 const rad_out_sky_per_area = -emiss_sigma_product * state.dataSurface->AirSkyRadSplit(SurfNum) * surface.ViewFactorSkyIR * + Real64 const rad_out_sky_per_area = -emiss_sigma_product * state.dataSurface->SurfAirSkyRadSplit(SurfNum) * surface.ViewFactorSkyIR * (Tsout_4 - pow_4(state.dataEnvrn->SkyTempKelvin)); Real64 const rad_out_per_area = rad_out_air_per_area + rad_out_sky_per_area + rad_out_ground_per_area + rad_out_lw_srd_per_area; diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 4f64fa91311..b691140bf67 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -883,6 +883,8 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) state->dataGlobal->BeginSimFlag = true; state->dataGlobal->WeightNow = 1.0; state->dataGlobal->WeightPreviousHour = 0.0; + + state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); CalcDayltgCoefficients(*state); int zoneNum = 1; // test that tmp arrays are allocated to correct dimension @@ -2160,6 +2162,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_OutputFormats) state->dataGlobal->BeginSimFlag = true; state->dataGlobal->WeightNow = 1.0; state->dataGlobal->WeightPreviousHour = 0.0; + state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); CalcDayltgCoefficients(*state); int zoneNum = 1; // test that tmp arrays are allocated to correct dimension @@ -2852,6 +2855,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_TDD_NoDaylightingControls) state->dataSurfaceGeometry->SinZoneRelNorth(2) = std::sin(-state->dataHeatBal->Zone(2).RelNorth * DataGlobalConstants::DegToRadians); state->dataSurfaceGeometry->CosBldgRelNorth = 1.0; state->dataSurfaceGeometry->SinBldgRelNorth = 0.0; + state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); SurfaceGeometry::GetSurfaceData(*state, foundErrors); // setup zone geometry and get zone data EXPECT_FALSE(foundErrors); // expect no errors diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 865ed8f9463..571ed5a42c4 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -1899,7 +1899,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) InitSurfaceHeatBalance(*state); - state->dataSurface->AirSkyRadSplit.allocate(6); + state->dataSurface->SurfAirSkyRadSplit.allocate(6); state->dataScheduleMgr->Schedule(1).CurrentValue = 25.0; // Srd Srfs Temp state->dataScheduleMgr->Schedule(2).CurrentValue = 15.0; // Sky temp state->dataScheduleMgr->Schedule(3).CurrentValue = 22.0; // Grd temp @@ -1909,7 +1909,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp state->dataSurface->SurfOutDryBulbTemp(SurfNum) = 22; // Air temp state->dataSurface->SurfExtConvCoeff(SurfNum) = -6; - state->dataSurface->AirSkyRadSplit(SurfNum) = 1.0; + state->dataSurface->SurfAirSkyRadSplit(SurfNum) = 1.0; } CalcHeatBalanceOutsideSurf(*state); diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 4b3285c51e0..c17f3915073 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -2357,7 +2357,9 @@ TEST_F(LowTempRadiantSystemTest, LowTempElecRadSurfaceGroupTest) state->dataConstruction->Construct.allocate(1); state->dataConstruction->Construct(1).SourceSinkPresent = true; state->dataSurface->SurfIntConvSurfHasActiveInIt.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfIntConvSurfHasActiveInIt = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool = false; GetLowTempRadiantSystem(*state); EXPECT_EQ(2, state->dataLowTempRadSys->NumOfElecLowTempRadSys); @@ -3839,7 +3841,9 @@ TEST_F(LowTempRadiantSystemTest, GetLowTempRadiantSystem_MultipleTypes) state->dataConstruction->Construct.allocate(1); state->dataConstruction->Construct(1).SourceSinkPresent = true; state->dataSurface->SurfIntConvSurfHasActiveInIt.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(state->dataSurface->TotSurfaces); state->dataSurface->SurfIntConvSurfHasActiveInIt = false; + state->dataSurface->SurfIsRadSurfOrVentSlabOrPool = false; GetLowTempRadiantSystem(*state); diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 73ea1fe1f72..330242c0d49 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -103,6 +103,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcPerSolarBeamTest) state->dataSurface->SurfOpaqAO.allocate(state->dataSurface->TotSurfaces); state->dataHeatBal->BackSurfaces.allocate(NumTimeSteps, 24, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); state->dataHeatBal->OverlapAreas.allocate(NumTimeSteps, 24, state->dataBSDFWindow->MaxBkSurf, state->dataSurface->TotSurfaces); + state->dataSurface->SurfSunCosHourly.dimension(24, 3, 0.0); // Test non-integrated option first, CalcPerSolarBeam should set OutProjSLFracMult and InOutProjSLFracMult to 1.0 for all hours for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; ++SurfNum) { diff --git a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc index 726fe804caa..eeccade2a6b 100644 --- a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc +++ b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc @@ -648,8 +648,8 @@ TEST_F(EnergyPlusFixture, Test_UnitaryHybridAirConditioner_ValidateFieldsParsing EXPECT_EQ(state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).OperatingModes.size(), expectedOperatingModesSize); EXPECT_EQ(state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).OperatingModes.size(), expectedOperatingModesSize); // check if names for HybridUnitaryAC are converted to upper case - EXPECT_EQ("HYBRID UNIT 1", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).Name); - EXPECT_EQ("HYBRID UNIT 2", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).Name); + EXPECT_EQ("Hybrid Unit 1", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).Name); + EXPECT_EQ("Hybrid Unit 2", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).Name); } TEST_F(EnergyPlusFixture, Test_UnitaryHybridAirConditioner_ValidateMinimumIdfInput) From a65ace34c3cd00cb35962625233f74c6355fa580 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sun, 2 May 2021 20:32:35 -0700 Subject: [PATCH 08/25] data hb --- .../room-air-models.tex | 6 +- .../AirflowNetworkBalanceManager.cc | 2 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 6 +- src/EnergyPlus/ConvectionCoefficients.cc | 4 +- src/EnergyPlus/CrossVentMgr.cc | 32 +++++------ src/EnergyPlus/DataHeatBalance.hh | 41 +++++++------ src/EnergyPlus/DataSurfaces.cc | 6 +- src/EnergyPlus/DaylightingDevices.cc | 22 +++---- src/EnergyPlus/DaylightingManager.cc | 2 +- src/EnergyPlus/DisplacementVentMgr.cc | 52 ++++++++--------- src/EnergyPlus/EcoRoofManager.cc | 2 +- src/EnergyPlus/HeatBalanceAirManager.cc | 4 +- src/EnergyPlus/HeatBalanceKivaManager.cc | 4 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 57 ++++++++++--------- src/EnergyPlus/HighTempRadiantSystem.cc | 14 ++--- src/EnergyPlus/LowTempRadiantSystem.cc | 4 +- src/EnergyPlus/MundtSimMgr.cc | 6 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 2 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 +- src/EnergyPlus/SolarShading.cc | 52 ++++++++--------- src/EnergyPlus/SystemAvailabilityManager.cc | 4 +- src/EnergyPlus/ThermalComfort.cc | 6 +- src/EnergyPlus/UFADManager.cc | 48 ++++++++-------- src/EnergyPlus/VentilatedSlab.cc | 4 +- src/EnergyPlus/WindowComplexManager.cc | 6 +- src/EnergyPlus/WindowEquivalentLayer.cc | 6 +- src/EnergyPlus/WindowManager.cc | 16 +++--- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 6 +- tst/EnergyPlus/unit/AdvancedAFN.unit.cc | 6 +- .../unit/ChilledCeilingPanelSimple.unit.cc | 4 +- .../unit/ConvectionCoefficients.unit.cc | 4 +- .../unit/DisplacementVentMgr.unit.cc | 4 +- .../unit/HeatBalanceManager.unit.cc | 2 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 26 ++++----- .../unit/LowTempRadiantSystem.unit.cc | 16 +++--- .../unit/SystemAvailabilityManager.unit.cc | 12 ++-- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 12 ++-- tst/EnergyPlus/unit/WindowManager.unit.cc | 30 +++++----- .../unit/ZoneTempPredictorCorrector.unit.cc | 8 +-- 39 files changed, 274 insertions(+), 266 deletions(-) diff --git a/doc/engineering-reference/src/alternative-modeling-processes/room-air-models.tex b/doc/engineering-reference/src/alternative-modeling-processes/room-air-models.tex index de865097b61..7dd8bde537f 100644 --- a/doc/engineering-reference/src/alternative-modeling-processes/room-air-models.tex +++ b/doc/engineering-reference/src/alternative-modeling-processes/room-air-models.tex @@ -385,7 +385,7 @@ \subsubsection{Iterative procedure}\label{iterative-procedure} \subsubsection{Step 1}\label{step-1} -Subroutine \emph{HcUCSDDV} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{TempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\). This calculation is appropriate for situations with low air velocity. +Subroutine \emph{HcUCSDDV} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{SurfTempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\). This calculation is appropriate for situations with low air velocity. For surfaces that bound 2 subzones, the subroutine calculates h\(_{c}\) for each subzone and then averages them, weighting by the amount of surface in each subzone. @@ -857,7 +857,7 @@ \subsubsection{Iterative procedure}\label{iterative-procedure-1} \subsubsection{Step 1}\label{step-1-1} -Subroutine \emph{HcUCSDUF} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{TempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\) . This calculation is appropriate for situations with low air velocity. +Subroutine \emph{HcUCSDUF} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{SurfTempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\) . This calculation is appropriate for situations with low air velocity. For surfaces that bound 2 subzones, the subroutine calculates h\(_{c}\) for each subzone and then averages them, weighting by the amount of surface in each subzone. @@ -1160,7 +1160,7 @@ \subsubsection{Iterative procedure}\label{iterative-procedure-2} \subsubsection{Step 1}\label{step-1-2} -Subroutine \emph{HcUCSDUF} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{TempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\) . This calculation is appropriate for situations with low air velocity. +Subroutine \emph{HcUCSDUF} is quite straightforward. It loops through all the surfaces in each zone and decides whether the surface is located in the upper, mixed subzone or the lower, occupied subzone, or if the surface is in both subzones. If entirely in one subzone the subzone temperature is stored in the surface effective temperature variable \emph{SurfTempEffBulkAir(SurfNum)} and h\(_{c}\) for the surface is calculated by a call to subroutine \emph{CalcDetailedHcInForDVModel}. This routine uses the ``detailed'' natural convection coefficient calculation that depends on surface tilt and \(\Delta {T^{1/3}}\) . This calculation is appropriate for situations with low air velocity. For surfaces that bound 2 subzones, the subroutine calculates h\(_{c}\) for each subzone and then averages them, weighting by the amount of surface in each subzone. diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 6ea42260181..5047d74388c 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -13221,7 +13221,7 @@ namespace AirflowNetworkBalanceManager { Tcomfort = CurveValue(state, ComfortHighTempCurveNum, OutDryBulb); } ComfortBand = -0.0028 * (100 - MaxPPD) * (100 - MaxPPD) + 0.3419 * (100 - MaxPPD) - 6.6275; - Toperative = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + Toperative = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); if (Toperative > (Tcomfort + ComfortBand)) { if (openingProbability(state, ZoneNum, TimeCloseDuration)) { diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 0e98db7a32f..87bc63344d8 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -1313,7 +1313,7 @@ void CoolingPanelParams::CalcCoolingPanel(EnergyPlusData &state, int const Cooli CoolingPanelOn = false; } // Calculate the "zone" temperature for determining the output of the cooling panel - Tzone = Xr * state.dataHeatBal->MRT(ZoneNum) + ((1.0 - Xr) * state.dataHeatBalFanSys->MAT(ZoneNum)); + Tzone = Xr * state.dataHeatBal->ZoneMRT(ZoneNum) + ((1.0 - Xr) * state.dataHeatBalFanSys->MAT(ZoneNum)); // Logical controls: if the WaterInletTemperature is higher than Tzone, do not run the panel if (waterInletTemp >= Tzone) CoolingPanelOn = false; @@ -1545,9 +1545,9 @@ void CoolingPanelParams::SetCoolingPanelControlTemp(EnergyPlusData &state, Real6 if (SELECT_CASE_var == Control::MAT) { ControlTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == Control::MRT) { - ControlTemp = state.dataHeatBal->MRT(ZoneNum); + ControlTemp = state.dataHeatBal->ZoneMRT(ZoneNum); } else if (SELECT_CASE_var == Control::Operative) { - ControlTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + ControlTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); } else if (SELECT_CASE_var == Control::ODB) { ControlTemp = state.dataHeatBal->Zone(ZoneNum).OutDryBulbTemp; } else if (SELECT_CASE_var == Control::OWB) { diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index d61fd4e471f..e3826ddaa71 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -2666,7 +2666,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, { auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == AdjacentAirTemp) { - TAirConv = state.dataHeatBal->TempEffBulkAir(SurfNum); + TAirConv = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else { // currently set to mean air temp but should add error warning here TAirConv = state.dataHeatBalFanSys->MAT(Surface(SurfNum).Zone); @@ -6339,7 +6339,7 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int tmpAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == RefTempAdjacentAirTemp) { - tmpAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + tmpAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; } else if (SELECT_CASE_var == RefTempSupplyAirTemp) { tmpAirTemp = SupplyAirTemp; diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index 15c12edd59b..11b9e4ee7ef 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -191,7 +191,7 @@ namespace CrossVentMgr { SurfNum = state.dataUCSDShared->APos_Wall(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -206,7 +206,7 @@ namespace CrossVentMgr { state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; if (state.dataSurface->Surface(SurfNum).Tilt > 10.0 && state.dataSurface->Surface(SurfNum).Tilt < 170.0) { // Window Wall - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -215,11 +215,11 @@ namespace CrossVentMgr { state.dataCrossVentMgr->HA_R += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HWindow(Ctd); } if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -233,16 +233,16 @@ namespace CrossVentMgr { state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; - state.dataHeatBal->TempEffBulkAir(SurfNum) = + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -256,7 +256,7 @@ namespace CrossVentMgr { state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; - state.dataHeatBal->TempEffBulkAir(SurfNum) = + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); } @@ -268,7 +268,7 @@ namespace CrossVentMgr { SurfNum = state.dataUCSDShared->APos_Door(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -282,7 +282,7 @@ namespace CrossVentMgr { SurfNum = state.dataUCSDShared->APos_Internal(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -297,11 +297,11 @@ namespace CrossVentMgr { SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -314,7 +314,7 @@ namespace CrossVentMgr { state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; - state.dataHeatBal->TempEffBulkAir(SurfNum) = + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HCeiling(Ctd); @@ -325,11 +325,11 @@ namespace CrossVentMgr { SurfNum = state.dataUCSDShared->APos_Floor(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTJET(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Ujet); Hjet = state.dataRoomAirMod->CVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTREC(ZoneNum); CalcDetailedHcInForDVModel( state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->CVHcIn, state.dataRoomAirMod->Urec); Hrec = state.dataRoomAirMod->CVHcIn(SurfNum); @@ -342,7 +342,7 @@ namespace CrossVentMgr { state.dataCrossVentMgr->HAT_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * Hjet; state.dataCrossVentMgr->HA_J += state.dataSurface->Surface(SurfNum).Area * state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * Hjet; - state.dataHeatBal->TempEffBulkAir(SurfNum) = + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->JetRecAreaRatio(ZoneNum) * state.dataRoomAirMod->ZTJET(ZoneNum) + (1 - state.dataRoomAirMod->JetRecAreaRatio(ZoneNum)) * state.dataRoomAirMod->ZTREC(ZoneNum); state.dataRoomAirMod->CVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index c09b124f8ff..323b70d2c7e 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -2049,6 +2049,8 @@ struct HeatBalanceData : BaseGlobalStruct bool NoFfactorConstructionsUsed = true; bool NoCfactorConstructionsUsed = true; bool NoRegularMaterialsUsed = true; + + Array1D SNLoadHeatEnergy; Array1D SNLoadCoolEnergy; Array1D SNLoadHeatRate; @@ -2067,15 +2069,15 @@ struct HeatBalanceData : BaseGlobalStruct Array1D GroupSNLoadCoolEnergy; Array1D GroupSNLoadHeatRate; Array1D GroupSNLoadCoolRate; - Array1D MRT; // MEAN RADIANT TEMPERATURE (C) - Array1D ZoneTransSolar; // Exterior beam plus diffuse solar entering zone sum of WinTransSolar for exterior windows in zone (W) - Array1D - ZoneWinHeatGain; // Heat gain to zone from all exterior windows (includes oneTransSolar); sum of WinHeatGain for exterior windows in zone (W) + + Array1D ZoneMRT; // MEAN RADIANT TEMPERATURE (C) + Array1D ZoneTransSolar; // Exterior beam plus diffuse solar entering zone sum of WinTransSolar for exterior windows in zone (W) + Array1D ZoneWinHeatGain; // Heat gain to zone from all exterior windows (includes oneTransSolar); sum of WinHeatGain for exterior windows in zone (W) Array1D ZoneWinHeatGainRep; // = ZoneWinHeatGain when ZoneWinHeatGain >= 0 Array1D ZoneWinHeatLossRep; // = -ZoneWinHeatGain when ZoneWinHeatGain < 0 Array1D ZoneBmSolFrExtWinsRep; // Beam solar into zone from exterior windows [W] Array1D ZoneBmSolFrIntWinsRep; // Beam solar into zone from interior windows [W] - Array1D InitialZoneDifSolReflW; // Initial diffuse solar in zone from ext and int windows reflected from interior surfaces [W] + Array1D ZoneInitialDifSolReflW; // Initial diffuse solar in zone from ext and int windows reflected from interior surfaces [W] Array1D ZoneDifSolFrExtWinsRep; // Diffuse solar into zone from exterior windows [W] Array1D ZoneDifSolFrIntWinsRep; // Diffuse solar into zone from interior windows [W] Array1D ZoneOpaqSurfInsFaceCond; // Zone inside face opaque surface conduction (W) @@ -2095,6 +2097,7 @@ struct HeatBalanceData : BaseGlobalStruct Array1D ZnOpqSurfInsFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] Array1D ZnOpqSurfExtFaceCondGnRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondGainRep [J] Array1D ZnOpqSurfExtFaceCondLsRepEnrg; // Energy of ZoneOpaqSurfInsFaceCondLossRep [J] + Array1D SurfQRadThermInAbs; // Thermal radiation absorbed on inside surfaces Array1D SurfQRadSWOutIncident; // Exterior beam plus diffuse solar incident on surface (W/m2) Array1D SurfQRadSWOutIncidentBeam; // Exterior beam solar incident on surface (W/m2) @@ -2123,19 +2126,22 @@ struct HeatBalanceData : BaseGlobalStruct Array2D SurfWinFenLaySurfTempBack; // Back surface temperatures of fenestration layers Array1D SurfWinQRadSWwinAbsTotEnergy; // Energy of QRadSWwinAbsTot [J] Array1D SurfWinSWwinAbsTotalReport; // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W) - Array1D - SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out through inside of window surface (W) + Array1D SurfWinInitialDifSolInTransReport; // Report - Initial transmitted diffuse solar transmitted out + // through inside of window surface (W) Array2D SurfWinQRadSWwinAbs; // Short wave radiation absorbed in window glass layers Array2D SurfWinInitialDifSolwinAbs; // Initial diffuse solar absorbed in window glass layers from inside(W/m2) Array1D SurfOpaqSWOutAbsTotalReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (W) Array1D SurfOpaqSWOutAbsEnergyReport; // Report - Total exterior shortwave/solar absorbed on outside of surface (j) + + //Material Array1D NominalR; // Nominal R value of each material -- used in matching interzone surfaces Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions Array1D NominalU; // Nominal U value for each construction -- used in matching interzone surfaces - Array1D TempEffBulkAir; // air temperature adjacent to the surface used for inside surface heat balances - Array1D HConvIn; // INSIDE CONVECTION COEFFICIENT - Array1D - AnisoSkyMult; // Multiplier on exterior-surface sky view factor to account for anisotropy of sky radiance; = 1.0 for for isotropic sky + + Array1D SurfTempEffBulkAir; // air temperature adjacent to the surface used for inside surface heat balances + Array1D HConvIn; // INSIDE CONVECTION COEFFICIENT + Array1D SurfAnisoSkyMult; // Multiplier on exterior-surface sky view factor to account for + // anisotropy of sky radiance; = 1.0 for for isotropic sky // todo - solarshading Array1D DifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) Array3D DifShdgRatioIsoSkyHRTS; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) Array1D curDifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) @@ -2148,9 +2154,10 @@ struct HeatBalanceData : BaseGlobalStruct Array1D MultIsoSky; // Contribution to eff sky view factor from isotropic sky Array1D MultCircumSolar; // Contribution to eff sky view factor from circumsolar brightening Array1D MultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening - Array1D QS; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure + + Array1D QS; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure Array1D QSLights; // Like QS, but Lights short-wave only. - Array1D EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only. + Array1D EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only. Array1D ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA) Array1D TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF' Array1D QL; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) @@ -2346,14 +2353,14 @@ struct HeatBalanceData : BaseGlobalStruct this->GroupSNLoadCoolEnergy.deallocate(); this->GroupSNLoadHeatRate.deallocate(); this->GroupSNLoadCoolRate.deallocate(); - this->MRT.deallocate(); + this->ZoneMRT.deallocate(); this->ZoneTransSolar.deallocate(); this->ZoneWinHeatGain.deallocate(); this->ZoneWinHeatGainRep.deallocate(); this->ZoneWinHeatLossRep.deallocate(); this->ZoneBmSolFrExtWinsRep.deallocate(); this->ZoneBmSolFrIntWinsRep.deallocate(); - this->InitialZoneDifSolReflW.deallocate(); + this->ZoneInitialDifSolReflW.deallocate(); this->ZoneDifSolFrExtWinsRep.deallocate(); this->ZoneDifSolFrIntWinsRep.deallocate(); this->ZoneOpaqSurfInsFaceCond.deallocate(); @@ -2409,9 +2416,9 @@ struct HeatBalanceData : BaseGlobalStruct this->NominalR.deallocate(); this->NominalRforNominalUCalculation.deallocate(); this->NominalU.deallocate(); - this->TempEffBulkAir.deallocate(); + this->SurfTempEffBulkAir.deallocate(); this->HConvIn.deallocate(); - this->AnisoSkyMult.deallocate(); + this->SurfAnisoSkyMult.deallocate(); this->DifShdgRatioIsoSky.deallocate(); this->DifShdgRatioIsoSkyHRTS.deallocate(); this->curDifShdgRatioIsoSky.deallocate(); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 59f83e7b6ae..8d9e06c8dd9 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -290,8 +290,8 @@ Real64 SurfaceData::getInsideAirTemperature(EnergyPlusData &state, const int t_S // modifications at some of those places. It is quite logical that reference air temperature // for the surface is calculated as public function of SurfaceData structure (class) and is // later called as needed. Note that SurfaceNum had to be passed to this routine because of - // access to global array TempEffBulkAir. I would propose refactoring where TempEffBulkAir - // is part of SurfaceData structure and instead of calling TempEffBulkAir( SurfNum ) it should + // access to global array SurfTempEffBulkAir. I would propose refactoring where SurfTempEffBulkAir + // is part of SurfaceData structure and instead of calling SurfTempEffBulkAir( SurfNum ) it should // be called Surface( SurfNum ).TempEffBulkAir (Simon Vidanovic) Real64 RefAirTemp = 0; @@ -302,7 +302,7 @@ Real64 SurfaceData::getInsideAirTemperature(EnergyPlusData &state, const int t_S if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(Zone); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(t_SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(t_SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone // ControlledZoneAirFlag = .FALSE. diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 09d144069f4..0e9675cec27 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -111,9 +111,9 @@ namespace DaylightingDevices { // Although visible and solar radiation are similar, solar gain is simulated very differently from the // daylighting illuminance calculations. The gain from direct beam solar is found using the // solar beam transmittance. The diffuse solar, however, is more complicated. A sky/ground integration - // is NOT performed. Instead anisotropic sky view factor multipliers (AnisoSkyMult) are calculated for + // is NOT performed. Instead anisotropic sky view factor multipliers (SurfAnisoSkyMult) are calculated for // each surface. The diffuse sky/ground transmittance of the TDD is solved using a modification of the - // AnisoSkyMult. The ground radiation transmittance and anisotropic sky transmittance are found separately. + // SurfAnisoSkyMult. The ground radiation transmittance and anisotropic sky transmittance are found separately. // See CalcTDDTransSolIso, CalcTDDTransSolHorizon, CalcTDDTransSolAniso below. // For thermal conductive/convective gain, TDDs are treated as one big object with an effective R value. // The outside face temperature of the dome and the inside face temperature of the diffuser are calculated @@ -154,12 +154,12 @@ namespace DaylightingDevices { // shelf construction, and the sun and sky illuminance on the shelf. All the luminance is added to the // diffuse upgoing flux. The shelf view factor to sky is assumed to be 1.0 for lack of better information. // The outside shelf is treated similarly in the heat balance simulation, but here the shelf view factor to - // sky is conveniently given by AnisoSkyMult. NOTE: The solar shading code was modified to allow sunlit - // fraction, sunlit area, AnisoSkyMult, etc. to be calculated for attached shading surfaces. + // sky is conveniently given by SurfAnisoSkyMult. NOTE: The solar shading code was modified to allow sunlit + // fraction, sunlit area, SurfAnisoSkyMult, etc. to be calculated for attached shading surfaces. // Future shelf model improvements: // 1. Allow beam and downgoing flux to pass the end of the inside shelf depending on actual shelf goemetry. // 2. Reduce outside shelf view factor to sky (for daylighting) by taking into account anisotropic sky - // distribution and shading, i.e. the daylighting equivalent of AnisoSkyMult. + // distribution and shading, i.e. the daylighting equivalent of SurfAnisoSkyMult. // 3. Expand view factor to shelf calculation to handle more complicated geometry. // REFERENCES: // Mills, A. F. Heat and Mass Transfer, 1995, p. 499. (Shape factor for adjacent rectangles.) @@ -1246,11 +1246,11 @@ namespace DaylightingDevices { // and have a different transmittance applied to each component. // FluxInc = IsoSkyRad + CircumSolarRad + HorizonRad // FluxTrans = T1*IsoSkyRad + T2*CircumSolarRad + T3*HorizonRad - // It turns out that FluxTrans/FluxInc is equivalent to AnisoSkyTDDMult/AnisoSkyMult. - // AnisoSkyMult has been conveniently calculated already in AnisoSkyViewFactors in SolarShading.cc. - // AnisoSkyMult = MultIsoSky*DifShdgRatioIsoSky + MultCircumSolar*SunlitFrac + MultHorizonZenith*DifShdgRatioHoriz + // It turns out that FluxTrans/FluxInc is equivalent to AnisoSkyTDDMult/SurfAnisoSkyMult. + // SurfAnisoSkyMult has been conveniently calculated already in AnisoSkyViewFactors in SolarShading.cc. + // SurfAnisoSkyMult = MultIsoSky*DifShdgRatioIsoSky + MultCircumSolar*SunlitFrac + MultHorizonZenith*DifShdgRatioHoriz // In this routine a similar AnisoSkyTDDMult is calculated that applies the appropriate transmittance to each - // of the components above. The result is Trans = AnisoSkyTDDMult/AnisoSkyMult. + // of the components above. The result is Trans = AnisoSkyTDDMult/SurfAnisoSkyMult. // Shading and orientation are already taken care of by DifShdgRatioIsoSky and DifShdgRatioHoriz. // REFERENCES: @@ -1287,8 +1287,8 @@ namespace DaylightingDevices { TransTDD(state, PipeNum, COSI, DataDaylightingDevices::iRadType::SolarBeam) * CircumSolarRad + state.dataDaylightingDevicesData->TDDPipe(PipeNum).TransSolHorizon * HorizonRad; - if (state.dataHeatBal->AnisoSkyMult(DomeSurf) > 0.0) { - CalcTDDTransSolAniso = AnisoSkyTDDMult / state.dataHeatBal->AnisoSkyMult(DomeSurf); + if (state.dataHeatBal->SurfAnisoSkyMult(DomeSurf) > 0.0) { + CalcTDDTransSolAniso = AnisoSkyTDDMult / state.dataHeatBal->SurfAnisoSkyMult(DomeSurf); } else { CalcTDDTransSolAniso = 0.0; } diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 0f5d3cd7422..e27d6d8d72a 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -8196,7 +8196,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, for (ISky = 1; ISky <= 4; ++ISky) { // This is only an estimate because the anisotropic sky view of the shelf is not yet taken into account. - // AnisoSkyMult would be great to use but it is not available until the heat balance starts up. + // SurfAnisoSkyMult would be great to use but it is not available until the heat balance starts up. ZSK(ISky) = state.dataDaylightingManager->GILSK(IHR, ISky) * 1.0 * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectVis * state.dataDaylightingDevicesData->Shelf(ShelfNum).ViewFactor; diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 6e4a1af41b3..ae468f823da 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -218,7 +218,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); @@ -227,7 +227,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWall(Ctd); @@ -236,10 +236,10 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -251,7 +251,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); @@ -270,7 +270,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += @@ -279,7 +279,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += @@ -288,10 +288,10 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -303,12 +303,12 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } } if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); @@ -316,7 +316,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HWindow(Ctd); @@ -340,7 +340,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += @@ -349,7 +349,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += @@ -358,10 +358,10 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -373,12 +373,12 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } } if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Door Ceiling - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); @@ -386,7 +386,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Door Floor - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HDoor(Ctd); @@ -410,7 +410,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = 0.0; if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_OC += @@ -419,10 +419,10 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLU = state.dataRoomAirMod->DVHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); HLD = state.dataRoomAirMod->DVHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -434,7 +434,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataDispVentMgr->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * TempSurfIn(SurfNum) * HLD; state.dataDispVentMgr->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); @@ -446,7 +446,7 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_MX += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HCeiling(Ctd); @@ -459,12 +459,12 @@ void HcUCSDDV(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei SurfNum = state.dataUCSDShared->APos_Floor(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, TempSurfIn, state.dataRoomAirMod->DVHcIn); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->DVHcIn(SurfNum); state.dataDispVentMgr->HAT_FLOOR += state.dataSurface->Surface(SurfNum).Area * TempSurfIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); state.dataDispVentMgr->HA_FLOOR += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); state.dataRoomAirMod->DVHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); } // END FLOOR } diff --git a/src/EnergyPlus/EcoRoofManager.cc b/src/EnergyPlus/EcoRoofManager.cc index fe689d25373..c1944b5a00e 100644 --- a/src/EnergyPlus/EcoRoofManager.cc +++ b/src/EnergyPlus/EcoRoofManager.cc @@ -243,7 +243,7 @@ namespace EcoRoofManager { state.dataHeatBalSurf->HAirExtSurf(SurfNum)); } - RS = state.dataEnvrn->BeamSolarRad + state.dataHeatBal->AnisoSkyMult(SurfNum) * state.dataEnvrn->DifSolarRad; + RS = state.dataEnvrn->BeamSolarRad + state.dataHeatBal->SurfAnisoSkyMult(SurfNum) * state.dataEnvrn->DifSolarRad; Latm = 1.0 * Sigma * 1.0 * state.dataSurface->Surface(SurfNum).ViewFactorGround * pow_4(state.dataEnvrn->GroundTempKelvin) + 1.0 * Sigma * 1.0 * state.dataSurface->Surface(SurfNum).ViewFactorSky * pow_4(state.dataEnvrn->SkyTempKelvin); diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index a8369887291..2c26b451811 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -4682,7 +4682,7 @@ void ReportZoneMeanAirTemp(EnergyPlusData &state) // entire zone time step. state.dataHeatBal->ZnAirRpt(ZoneLoop).MeanAirTemp = state.dataHeatBalFanSys->ZTAV(ZoneLoop); state.dataHeatBal->ZnAirRpt(ZoneLoop).MeanAirHumRat = state.dataHeatBalFanSys->ZoneAirHumRatAvg(ZoneLoop); - state.dataHeatBal->ZnAirRpt(ZoneLoop).OperativeTemp = 0.5 * (state.dataHeatBalFanSys->ZTAV(ZoneLoop) + state.dataHeatBal->MRT(ZoneLoop)); + state.dataHeatBal->ZnAirRpt(ZoneLoop).OperativeTemp = 0.5 * (state.dataHeatBalFanSys->ZTAV(ZoneLoop) + state.dataHeatBal->ZoneMRT(ZoneLoop)); state.dataHeatBal->ZnAirRpt(ZoneLoop).MeanAirDewPointTemp = PsyTdpFnWPb(state, state.dataHeatBal->ZnAirRpt(ZoneLoop).MeanAirHumRat, state.dataEnvrn->OutBaroPress); @@ -4701,7 +4701,7 @@ void ReportZoneMeanAirTemp(EnergyPlusData &state) thisMRTFraction = state.dataZoneCtrls->TempControlledZone(TempControlledZoneID).FixedRadiativeFraction; } state.dataHeatBal->ZnAirRpt(ZoneLoop).ThermOperativeTemp = - (1.0 - thisMRTFraction) * state.dataHeatBalFanSys->ZTAV(ZoneLoop) + thisMRTFraction * state.dataHeatBal->MRT(ZoneLoop); + (1.0 - thisMRTFraction) * state.dataHeatBalFanSys->ZTAV(ZoneLoop) + thisMRTFraction * state.dataHeatBal->ZoneMRT(ZoneLoop); } } } diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index b2af669cb2b..f5bbe545865 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -374,7 +374,7 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state) state.dataHeatBalFanSys->QCoolingPanelSurf(floorSurface) + state.dataHeatBalFanSys->QSteamBaseboardSurf(floorSurface) + state.dataHeatBalFanSys->QElecBaseboardSurf(floorSurface); // HVAC - bcs->slabConvectiveTemp = state.dataHeatBal->TempEffBulkAir(floorSurface) + DataGlobalConstants::KelvinConv; + bcs->slabConvectiveTemp = state.dataHeatBal->SurfTempEffBulkAir(floorSurface) + DataGlobalConstants::KelvinConv; bcs->slabRadiantTemp = ThermalComfort::CalcSurfaceWeightedMRT(state, zoneNum, floorSurface) + DataGlobalConstants::KelvinConv; bcs->gradeForcedTerm = kmPtr->surfaceConvMap[floorSurface].f; bcs->gradeConvectionAlgorithm = kmPtr->surfaceConvMap[floorSurface].out; @@ -395,7 +395,7 @@ void KivaInstanceMap::setBoundaryConditions(EnergyPlusData &state) Real64 &A = state.dataSurface->Surface(wl).Area; Real64 Trad = ThermalComfort::CalcSurfaceWeightedMRT(state, zoneNum, wl); - Real64 Tconv = state.dataHeatBal->TempEffBulkAir(wl); + Real64 Tconv = state.dataHeatBal->SurfTempEffBulkAir(wl); QAtotal += Q * A; TARadTotal += Trad * A; diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index d0d11925ce6..7b27b730e44 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -415,7 +415,7 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) if (state.dataEnvrn->SunIsUp && state.dataEnvrn->DifSolarRad > 0.0) { AnisoSkyViewFactors(state); } else { - state.dataHeatBal->AnisoSkyMult = 0.0; + state.dataHeatBal->SurfAnisoSkyMult = 0.0; } // Set shading flag for exterior windows (except flags related to daylighting) and @@ -1323,7 +1323,8 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalFanSys->CTFTsrcConstPart.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalFanSys->CTFTuserConstPart.dimension(state.dataSurface->TotSurfaces, 0.0); } - state.dataHeatBal->TempEffBulkAir.dimension(state.dataSurface->TotSurfaces, 23.0); + + state.dataHeatBal->SurfTempEffBulkAir.dimension(state.dataSurface->TotSurfaces, 23.0); state.dataHeatBal->HConvIn.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->HcExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->HAirExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -1503,7 +1504,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Inside Face Adjacent Air Temperature", OutputProcessor::Unit::C, - state.dataHeatBal->TempEffBulkAir(loop), + state.dataHeatBal->SurfTempEffBulkAir(loop), "Zone", "State", Surface(loop).Name); @@ -2059,7 +2060,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBal->QL.dimension(state.dataGlobal->NumOfZones, 0.0); // UCSD - state.dataHeatBal->MRT.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); // Allocate Reporting Variables and set up tracking state.dataHeatBalSurf->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); @@ -2115,7 +2116,7 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); // First do the "bulk" initializations of arrays sized to NumOfZones - state.dataHeatBal->MRT = 23.0; // module level array + state.dataHeatBal->ZoneMRT = 23.0; // module level array state.dataHeatBalFanSys->MAT = 23.0; // DataHeatBalFanSys array state.dataHeatBalFanSys->ZT = 23.0; state.dataHeatBalFanSys->ZTAV = 23.0; @@ -2141,7 +2142,7 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) // "Bulk" initializations of arrays sized to TotSurfaces for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Loop through zones... - state.dataHeatBal->TempEffBulkAir(zoneNum) = 23.0; + state.dataHeatBal->SurfTempEffBulkAir(zoneNum) = 23.0; state.dataHeatBalFanSys->TempTstatAir(zoneNum) = 23.0; int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; @@ -2340,7 +2341,7 @@ void InitSolarHeatGains(EnergyPlusData &state) Array1D currGndSolarInc(state.dataSurface->TotSurfaces); // Ground diffuse solar incident on a surface for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataHeatBal->InitialZoneDifSolReflW(zoneNum) = 0.0; + state.dataHeatBal->ZoneInitialDifSolReflW(zoneNum) = 0.0; state.dataHeatBal->ZoneWinHeatGainRepEnergy(zoneNum) = 0.0; state.dataHeatBal->ZoneWinHeatLossRepEnergy(zoneNum) = 0.0; state.dataHeatBal->ZnOpqSurfInsFaceCondGnRepEnrg(zoneNum) = 0.0; @@ -2592,7 +2593,7 @@ void InitSolarHeatGains(EnergyPlusData &state) assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolObs)); // For linear indexing assert(equal_dimensions(state.dataSurface->SurfReflFacBmToBmSolObs, state.dataSurface->SurfReflFacBmToDiffSolGnd)); // For linear indexing for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum); + state.dataSurface->SurfSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); state.dataSurface->SurfGndSolarInc(SurfNum) = state.dataEnvrn->GndSolarRad * Surface(SurfNum).ViewFactorGround; state.dataSurface->SurfWinSkyGndSolarInc(SurfNum) = state.dataSurface->SurfGndSolarInc(SurfNum); state.dataSurface->SurfWinBmGndSolarInc(SurfNum) = 0.0; @@ -2655,11 +2656,11 @@ void InitSolarHeatGains(EnergyPlusData &state) // Beam from interior windows (EnclSolDBIntWin) reflected from floor is counted in DayltgInterReflIllFrIntWins, // EnclSolDB needs to subtract this part since it is already counted in EnclSolDB. - // Use InitialZoneDifSolReflW (Rob's previous work) as it better counts initial distribution of + // Use ZoneInitialDifSolReflW (Rob's previous work) as it better counts initial distribution of // diffuse solar rather than using weighted area*absorptance state.dataHeatBalSurf->EnclSolQDforDaylight(ZoneNum) = (state.dataSurface->EnclSolDB(ZoneNum) - state.dataSurface->EnclSolDBIntWin(ZoneNum)) * state.dataEnvrn->BeamSolarRad + - state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->InitialZoneDifSolReflW(ZoneNum); + state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); // to exclude diffuse solar now absorbed/transmitted in CalcWinTransDifSolInitialDistribution // EnclSolDB(ZoneNum) is Diffuse Solar from beam reflected from interior surfaces @@ -2669,7 +2670,7 @@ void InitSolarHeatGains(EnergyPlusData &state) // +EnclSolDS(ZoneNum)*DifSolarRad & // +EnclSolDG(ZoneNum)*GndSolarRad state.dataHeatBalSurf->EnclSolQD(ZoneNum) = state.dataSurface->EnclSolDB(ZoneNum) * state.dataEnvrn->BeamSolarRad + - state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->InitialZoneDifSolReflW(ZoneNum); + state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); } // Flux of diffuse solar in each zone @@ -2727,7 +2728,7 @@ void InitSolarHeatGains(EnergyPlusData &state) state.dataEnvrn->BeamSolarRad * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) * CosInc; // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum); + state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(SurfNum) = state.dataSurface->SurfGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground @@ -2760,7 +2761,7 @@ void InitSolarHeatGains(EnergyPlusData &state) currCosInc(SurfNum); // Incident (unreflected) diffuse solar from sky -- TDD_Diffuser calculated differently - state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum); + state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); // Incident diffuse solar from sky diffuse reflected from ground plus beam reflected from ground state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(SurfNum) = currGndSolarInc(SurfNum); // Incident diffuse solar from beam-to-diffuse reflection from ground @@ -2808,7 +2809,7 @@ void InitSolarHeatGains(EnergyPlusData &state) TransTDD(state, PipeNum, currCosInc(SurfNum), DataDaylightingDevices::iRadType::SolarBeam) / state.dataConstruction->Construct(ConstrNum).TransDiff; - currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum2) * + currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum2) * TransTDD(state, PipeNum, currCosInc(SurfNum), DataDaylightingDevices::iRadType::SolarAniso) / state.dataConstruction->Construct(ConstrNum).TransDiff; @@ -2832,12 +2833,12 @@ void InitSolarHeatGains(EnergyPlusData &state) int OutShelfSurf = state.dataDaylightingDevicesData->Shelf(ShelfNum).OutSurf; // Outside daylighting shelf present if > 0 currCosInc(SurfNum) = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); currBeamSolar(SurfNum) = state.dataEnvrn->BeamSolarRad; - currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum); + currSkySolarInc(SurfNum) = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum); // Shelf diffuse solar radiation Real64 ShelfSolarRad = (state.dataEnvrn->BeamSolarRad * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) * state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) + - state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(OutShelfSurf)) * + state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(OutShelfSurf)) * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectSol; // Add all reflected solar from the outside shelf to the ground solar @@ -5145,14 +5146,14 @@ void CalculateZoneMRT(EnergyPlusData &state, Optional_int_const ZoneToResimulate SumAET += state.dataHeatBalSurfMgr->SurfaceAE(SurfNum) * state.dataHeatBalSurf->TempSurfIn(SurfNum); } if (state.dataHeatBalSurfMgr->ZoneAESum(ZoneNum) > 0.01) { - state.dataHeatBal->MRT(ZoneNum) = SumAET / state.dataHeatBalSurfMgr->ZoneAESum(ZoneNum); + state.dataHeatBal->ZoneMRT(ZoneNum) = SumAET / state.dataHeatBalSurfMgr->ZoneAESum(ZoneNum); } else { if (state.dataHeatBalSurfMgr->CalculateZoneMRTfirstTime) { ShowWarningError( state, "Zone areas*inside surface emissivities are summing to zero, for Zone=\"" + state.dataHeatBal->Zone(ZoneNum).Name + "\""); ShowContinueError(state, "As a result, MRT will be set to MAT for that zone"); } - state.dataHeatBal->MRT(ZoneNum) = state.dataHeatBalFanSys->MAT(ZoneNum); + state.dataHeatBal->ZoneMRT(ZoneNum) = state.dataHeatBalFanSys->MAT(ZoneNum); } } @@ -5536,7 +5537,7 @@ void ReportSurfaceHeatBalance(EnergyPlusData &state) state.dataHeatBalSurf->SumSurfaceHeatEmission = 0.0; - state.dataHeatBalSurf->ZoneMRT({1, state.dataGlobal->NumOfZones}) = state.dataHeatBal->MRT({1, state.dataGlobal->NumOfZones}); + state.dataHeatBalSurf->ZoneMRT({1, state.dataGlobal->NumOfZones}) = state.dataHeatBal->ZoneMRT({1, state.dataGlobal->NumOfZones}); ReportSurfaceShading(state); auto &Surface(state.dataSurface->Surface); @@ -6477,7 +6478,7 @@ void CalcHeatBalanceInsideSurf(EnergyPlusData &state, if (state.dataGlobal->BeginEnvrnFlag && state.dataHeatBalSurfMgr->calcHeatBalInsideSurEnvrnFlag) { state.dataHeatBalSurf->TempInsOld = 23.0; state.dataHeatBalSurfMgr->RefAirTemp = 23.0; - state.dataHeatBal->TempEffBulkAir = 23.0; + state.dataHeatBal->SurfTempEffBulkAir = 23.0; state.dataHeatBalSurfMgr->calcHeatBalInsideSurfWarmupErrCount = 0; state.dataHeatBalSurfMgr->calcHeatBalInsideSurEnvrnFlag = false; @@ -6610,9 +6611,9 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); // for reporting surf adjacent air temp } else if (SELECT_CASE_var == AdjacentAirTemp) { - state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBal->TempEffBulkAir(SurfNum); + state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone int ZoneEquipConfigNum = ZoneNum; @@ -6641,11 +6642,11 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, } else { state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); } - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataHeatBalSurfMgr->RefAirTemp(SurfNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataHeatBalSurfMgr->RefAirTemp(SurfNum); // for reporting surf adjacent air temp } else { // currently set to mean air temp but should add error warning here state.dataHeatBalSurfMgr->RefAirTemp(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataHeatBalFanSys->MAT(ZoneNum); // for reporting surf adjacent air temp } } } @@ -7547,9 +7548,9 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(surfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); - state.dataHeatBal->TempEffBulkAir(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); // for reporting surf adjacent air temp } else if (SELECT_CASE_var == AdjacentAirTemp) { - state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBal->TempEffBulkAir(surfNum); + state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBal->SurfTempEffBulkAir(surfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone int ZoneEquipConfigNum = zoneNum; @@ -7577,11 +7578,11 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, } else { state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); } - state.dataHeatBal->TempEffBulkAir(surfNum) = state.dataHeatBalSurfMgr->RefAirTemp(surfNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(surfNum) = state.dataHeatBalSurfMgr->RefAirTemp(surfNum); // for reporting surf adjacent air temp } else { // currently set to mean air temp but should add error warning here state.dataHeatBalSurfMgr->RefAirTemp(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); - state.dataHeatBal->TempEffBulkAir(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); // for reporting surf adjacent air temp + state.dataHeatBal->SurfTempEffBulkAir(surfNum) = state.dataHeatBalFanSys->MAT(zoneNum); // for reporting surf adjacent air temp } } diff --git a/src/EnergyPlus/HighTempRadiantSystem.cc b/src/EnergyPlus/HighTempRadiantSystem.cc index 231492796f8..d74c435e20e 100644 --- a/src/EnergyPlus/HighTempRadiantSystem.cc +++ b/src/EnergyPlus/HighTempRadiantSystem.cc @@ -945,7 +945,7 @@ namespace HighTempRadiantSystem { // Determine the current setpoint temperature and the temperature at which the unit should be completely off SetPtTemp = GetCurrentScheduleValue(state, state.dataHighTempRadSys->HighTempRadSys(RadSysNum).SetptSchedPtr); OffTemp = SetPtTemp + 0.5 * state.dataHighTempRadSys->HighTempRadSys(RadSysNum).ThrottlRange; - OpTemp = (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)) / 2.0; // Approximate the "operative" temperature + OpTemp = (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)) / 2.0; // Approximate the "operative" temperature // Determine the fraction of maximum power to the unit (limiting the fraction range from zero to unity) { @@ -953,9 +953,9 @@ namespace HighTempRadiantSystem { if (SELECT_CASE_var == RadControlType::MATControl) { HeatFrac = (OffTemp - state.dataHeatBalFanSys->MAT(ZoneNum)) / state.dataHighTempRadSys->HighTempRadSys(RadSysNum).ThrottlRange; } else if (SELECT_CASE_var == RadControlType::MRTControl) { - HeatFrac = (OffTemp - state.dataHeatBal->MRT(ZoneNum)) / state.dataHighTempRadSys->HighTempRadSys(RadSysNum).ThrottlRange; + HeatFrac = (OffTemp - state.dataHeatBal->ZoneMRT(ZoneNum)) / state.dataHighTempRadSys->HighTempRadSys(RadSysNum).ThrottlRange; } else if (SELECT_CASE_var == RadControlType::OperativeControl) { - OpTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + OpTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); HeatFrac = (OffTemp - OpTemp) / state.dataHighTempRadSys->HighTempRadSys(RadSysNum).ThrottlRange; } } @@ -1057,9 +1057,9 @@ namespace HighTempRadiantSystem { if (SELECT_CASE_var == RadControlType::MATSPControl) { ZoneTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == RadControlType::MRTSPControl) { - ZoneTemp = state.dataHeatBal->MRT(ZoneNum); + ZoneTemp = state.dataHeatBal->ZoneMRT(ZoneNum); } else if (SELECT_CASE_var == RadControlType::OperativeSPControl) { - ZoneTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + ZoneTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); } else { assert(false); } @@ -1099,9 +1099,9 @@ namespace HighTempRadiantSystem { if (SELECT_CASE_var == RadControlType::MATControl) { ZoneTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == RadControlType::MRTControl) { - ZoneTemp = state.dataHeatBal->MRT(ZoneNum); + ZoneTemp = state.dataHeatBal->ZoneMRT(ZoneNum); } else if (SELECT_CASE_var == RadControlType::OperativeControl) { - ZoneTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + ZoneTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); } } diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index 448a06895fa..3bd8761ed26 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -5727,9 +5727,9 @@ namespace LowTempRadiantSystem { case LowTempRadiantControlTypes::MATControl: return state.dataHeatBalFanSys->MAT(this->ZonePtr); case LowTempRadiantControlTypes::MRTControl: - return state.dataHeatBal->MRT(this->ZonePtr); + return state.dataHeatBal->ZoneMRT(this->ZonePtr); case LowTempRadiantControlTypes::OperativeControl: - return 0.5 * (state.dataHeatBalFanSys->MAT(this->ZonePtr) + state.dataHeatBal->MRT(this->ZonePtr)); + return 0.5 * (state.dataHeatBalFanSys->MAT(this->ZonePtr) + state.dataHeatBal->ZoneMRT(this->ZonePtr)); case LowTempRadiantControlTypes::ODBControl: return state.dataHeatBal->Zone(this->ZonePtr).OutDryBulbTemp; case LowTempRadiantControlTypes::OWBControl: diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 79910676f3e..aa86edf5f8b 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -778,7 +778,7 @@ namespace MundtSimMgr { // Use direct coupling scheme to report air temperatures back to surface/system domains // a) Bulk air temperatures -> TempEffBulkAir(SurfNum) for (SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { - state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = + state.dataHeatBal->SurfTempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataMundtSimMgr->MundtAirSurf(SurfNum, state.dataMundtSimMgr->MundtZoneNum).TMeanAir; // set flag for reference air temperature state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = AdjacentAirTemp; @@ -800,7 +800,7 @@ namespace MundtSimMgr { for (SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { DeltaTemp = state.dataMundtSimMgr->MundtAirSurf(SurfNum, state.dataMundtSimMgr->MundtZoneNum).TMeanAir - state.dataMundtSimMgr->LineNode(state.dataMundtSimMgr->TstatNodeID, state.dataMundtSimMgr->MundtZoneNum).Temp; - state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = + state.dataHeatBal->SurfTempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataHeatBalFanSys->TempZoneThermostatSetPoint(ZoneNum) + DeltaTemp; // set flag for reference air temperature state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = AdjacentAirTemp; @@ -824,7 +824,7 @@ namespace MundtSimMgr { } else { // Controlled zone when the system is off --> Use the mixing model instead of the Mundt model // Bulk air temperatures -> TempEffBulkAir(SurfNum) for (SurfNum = 1; SurfNum <= NumOfSurfs; ++SurfNum) { - state.dataHeatBal->TempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataHeatBalFanSys->MAT(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfFirst + SurfNum - 1) = state.dataHeatBalFanSys->MAT(ZoneNum); // set flag for reference air temperature state.dataSurface->SurfTAirRef(SurfFirst + SurfNum - 1) = ZoneMeanAirTemp; } diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 0eee15b5bb8..ced3e325824 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -1088,7 +1088,7 @@ namespace RoomAirModelAirflowNetwork { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); SumHA += HA; } else if (state.dataSurface->SurfTAirRef(SurfNum) == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); SumHATref += HA * RefAirTemp; } else if (state.dataSurface->SurfTAirRef(SurfNum) == ZoneSupplyAirTemp) { // check whether this zone is a controlled zone or not diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 9ff75bd8637..500bcec4fab 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -950,7 +950,7 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // // set results for all surface for (int i = SurfFirst, j = 1; i <= SurfLast; ++i, ++j) { - state.dataHeatBal->TempEffBulkAir(i) = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(j).TadjacentAir; + state.dataHeatBal->SurfTempEffBulkAir(i) = state.dataRoomAirMod->AirPatternZoneInfo(ZoneNum).Surf(j).TadjacentAir; } // set flag for reference air temperature mode diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index bbe81b1ae48..b36ca33e33b 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -217,7 +217,7 @@ void InitSolarCalculations(EnergyPlusData &state) state.dataHeatBal->OverlapAreas = 0.0; state.dataHeatBal->CosIncAngHR = 0.0; state.dataHeatBal->CosIncAng = 0.0; - state.dataHeatBal->AnisoSkyMult = 1.0; // For isotropic sky; recalculated in AnisoSkyViewFactors if anisotropic radiance + state.dataHeatBal->SurfAnisoSkyMult = 1.0; // For isotropic sky; recalculated in AnisoSkyViewFactors if anisotropic radiance // WithShdgIsoSky=0.0 // WoShdgIsoSky=0.0 // WithShdgHoriz=0.0 @@ -234,7 +234,7 @@ void InitSolarCalculations(EnergyPlusData &state) state.dataHeatBal->ZoneTransSolar = 0.0; state.dataHeatBal->ZoneBmSolFrExtWinsRep = 0.0; state.dataHeatBal->ZoneBmSolFrIntWinsRep = 0.0; - state.dataHeatBal->InitialZoneDifSolReflW = 0.0; + state.dataHeatBal->ZoneInitialDifSolReflW = 0.0; state.dataHeatBal->ZoneDifSolFrExtWinsRep = 0.0; state.dataHeatBal->ZoneDifSolFrIntWinsRep = 0.0; state.dataHeatBal->ZoneWinHeatGain = 0.0; @@ -770,7 +770,7 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataGlobal->NumOfTimeStepInHour, 24, state.dataBSDFWindow->MaxBkSurf, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->CosIncAngHR.dimension(24, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->CosIncAng.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); - state.dataHeatBal->AnisoSkyMult.dimension(state.dataSurface->TotSurfaces, + state.dataHeatBal->SurfAnisoSkyMult.dimension(state.dataSurface->TotSurfaces, 1.0); // For isotropic sky: recalculated in AnisoSkyViewFactors if anisotropic radiance // ALLOCATE(WithShdgIsoSky(TotSurfaces)) // WithShdgIsoSky=0.0 @@ -816,7 +816,7 @@ void AllocateModuleArrays(EnergyPlusData &state) state.dataHeatBal->ZoneTransSolar.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneBmSolFrExtWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneBmSolFrIntWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->InitialZoneDifSolReflW.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->ZoneInitialDifSolReflW.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneDifSolFrExtWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneDifSolFrIntWinsRep.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBal->ZoneWinHeatGain.dimension(state.dataGlobal->NumOfZones, 0.0); @@ -1177,7 +1177,7 @@ void AllocateModuleArrays(EnergyPlusData &state) SetupOutputVariable(state, "Surface Anisotropic Sky Multiplier", OutputProcessor::Unit::None, - state.dataHeatBal->AnisoSkyMult(SurfLoop), + state.dataHeatBal->SurfAnisoSkyMult(SurfLoop), "Zone", "Average", state.dataSurface->Surface(SurfLoop).Name); @@ -2413,12 +2413,12 @@ void AnisoSkyViewFactors(EnergyPlusData &state) // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Calculates view factor multiplier, AnisoSkyMult, for diffuse + // Calculates view factor multiplier, SurfAnisoSkyMult, for diffuse // sky irradiance on exterior surfaces taking into account // anisotropic radiance of the sky. Called by InitSurfaceHeatBalance // In this case the diffuse sky irradiance on a surface is given by - // AnisoSkyMult(SurfNum) * DifSolarRad - // AnisoSkyMult accounts not only for the sky radiance distribution but + // SurfAnisoSkyMult(SurfNum) * DifSolarRad + // SurfAnisoSkyMult accounts not only for the sky radiance distribution but // also for the effects of shading of sky diffuse radiation by // shadowing surfaces such as overhangs. It does not account for reflection // of sky diffuse radiation from shadowing surfaces. @@ -2489,7 +2489,7 @@ void AnisoSkyViewFactors(EnergyPlusData &state) ZenithAng = std::acos(CosZenithAng); ZenithAngDeg = ZenithAng / DataGlobalConstants::DegToRadians; - state.dataHeatBal->AnisoSkyMult = 0.0; + state.dataHeatBal->SurfAnisoSkyMult = 0.0; // Relative air mass AirMassH = (1.0 - 0.1 * state.dataEnvrn->Elevation / 1000.0); @@ -2554,13 +2554,13 @@ void AnisoSkyViewFactors(EnergyPlusData &state) if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || state.dataHeatBal->SolarDistribution == MinimalShadowing) { - state.dataHeatBal->AnisoSkyMult(SurfNum) = + state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = state.dataHeatBal->MultIsoSky(SurfNum) * state.dataHeatBal->DifShdgRatioIsoSky(SurfNum) + state.dataHeatBal->MultCircumSolar(SurfNum) * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + state.dataHeatBal->MultHorizonZenith(SurfNum) * state.dataHeatBal->DifShdgRatioHoriz(SurfNum); } else { - state.dataHeatBal->AnisoSkyMult(SurfNum) = + state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = state.dataHeatBal->MultIsoSky(SurfNum) * state.dataHeatBal->DifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum) + state.dataHeatBal->MultCircumSolar(SurfNum) * @@ -2570,7 +2570,7 @@ void AnisoSkyViewFactors(EnergyPlusData &state) state.dataHeatBal->curDifShdgRatioIsoSky(SurfNum) = state.dataHeatBal->DifShdgRatioIsoSkyHRTS(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum); } - state.dataHeatBal->AnisoSkyMult(SurfNum) = max(0.0, state.dataHeatBal->AnisoSkyMult(SurfNum)); // make sure not negative. + state.dataHeatBal->SurfAnisoSkyMult(SurfNum) = max(0.0, state.dataHeatBal->SurfAnisoSkyMult(SurfNum)); // make sure not negative. } } @@ -8402,12 +8402,12 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) int SurfNum2 = state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome; Real64 CosInc = state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, SurfNum2); // Exterior diffuse solar incident on window (W/m2) - Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum2) + + Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum2) + state.dataEnvrn->GndSolarRad * state.dataSurface->Surface(SurfNum2).ViewFactorGround; // Exterior diffuse sky solar transmitted by TDD (W/m2) Real64 SkySolarTrans = state.dataEnvrn->DifSolarRad * TransTDD(state, PipeNum, CosInc, DataDaylightingDevices::iRadType::SolarAniso) * - state.dataHeatBal->AnisoSkyMult(SurfNum2); + state.dataHeatBal->SurfAnisoSkyMult(SurfNum2); // Exterior diffuse ground solar transmitted by TDD (W/m2) Real64 GndSolarTrans = state.dataEnvrn->GndSolarRad * state.dataDaylightingDevicesData->TDDPipe(PipeNum).TransSolIso * state.dataSurface->Surface(SurfNum2).ViewFactorGround; @@ -8438,10 +8438,10 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) (state.dataEnvrn->BeamSolarRad * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) * state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, OutShelfSurf) + - state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(OutShelfSurf)) * + state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(OutShelfSurf)) * state.dataDaylightingDevicesData->Shelf(ShelfNum).OutReflectSol; - Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->AnisoSkyMult(SurfNum) + + Real64 DifSolarInc = state.dataEnvrn->DifSolarRad * state.dataHeatBal->SurfAnisoSkyMult(SurfNum) + state.dataEnvrn->GndSolarRad * state.dataSurface->Surface(SurfNum).ViewFactorGround + ShelfSolarRad * state.dataDaylightingDevicesData->Shelf(ShelfNum).ViewFactor; @@ -9666,7 +9666,7 @@ void WindowShadingManager(EnergyPlusData &state) Real64 HorizSolar = 0.0; // Horizontal direct plus diffuse solar intensity if (state.dataEnvrn->SunIsUp) { Real64 SkySolarOnWindow = - state.dataHeatBal->AnisoSkyMult(ISurf) * state.dataEnvrn->DifSolarRad; // Sky diffuse solar intensity on window (W/m2) + state.dataHeatBal->SurfAnisoSkyMult(ISurf) * state.dataEnvrn->DifSolarRad; // Sky diffuse solar intensity on window (W/m2) BeamSolarOnWindow = state.dataEnvrn->BeamSolarRad * state.dataHeatBal->CosIncAng(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, ISurf) * state.dataHeatBal->SunlitFrac(state.dataGlobal->TimeStep, state.dataGlobal->HourOfDay, ISurf); @@ -11663,7 +11663,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) state.dataHeatBal->SurfWinInitialDifSolwinAbs = 0.0; // Init accumulator for total reflected diffuse solar within each zone for interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW = 0.0; + state.dataHeatBal->ZoneInitialDifSolReflW = 0.0; // Init accumulator for transmitted diffuse solar for all surfaces for reporting state.dataHeatBalSurf->SurfWinInitialDifSolInTrans = 0.0; @@ -11777,7 +11777,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) DifSolarReflW = WinDifSolarTrans_Factor * InsideDifReflectance; // Accumulate total reflected distributed diffuse solar for each zone for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(enclosureNum) += DifSolarReflW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum) += DifSolarReflW; // [W] // Accumulate Window and Zone total distributed diffuse solar to check for conservation of energy // For opaque surfaces all incident diffuse is either absorbed or reflected @@ -11817,7 +11817,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) DifSolarReflW = WinDifSolarTrans_Factor * state.dataConstruction->Construct(ConstrNum).ReflectSolDiffBack; // Accumulate total reflected distributed diffuse solar for each zone for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(enclosureNum) += DifSolarReflW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum) += DifSolarReflW; // [W] //------------------------------------------------------------------------------ // DISTRIBUTE TRANSMITTED DIFFUSE SOLAR THROUGH INTERIOR WINDOW TO ADJACENT ZONE @@ -11892,7 +11892,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) InterpSw(win_SwitchingFactor, construct.ReflectSolDiffBack, construct_sh.ReflectSolDiffBack); // Accumulate total reflected distributed diffuse solar for each zone for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(enclosureNum) += DifSolarReflW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum) += DifSolarReflW; // [W] // Accumulate transmitted Window and Zone total distributed diffuse solar to check for conservation of energy // This is not very effective since it assigns whatever distributed diffuse solar has not been @@ -11959,7 +11959,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) DifSolarReflW = WinDifSolarTrans_Factor * InsideDifReflectance; // Accumulate total reflected distributed diffuse solar for each zone for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(enclosureNum) += DifSolarReflW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum) += DifSolarReflW; // [W] // Now calc diffuse solar absorbed by shade/blind itself BlNum = state.dataSurface->SurfWinBlindNumber(HeatTransSurfNum); @@ -12031,7 +12031,7 @@ void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state) DifSolarReflW = WinDifSolarTrans_Factor * state.dataConstruction->Construct(ConstrNum).ReflectSolDiffBack; // Accumulate total reflected distributed diffuse solar for each zone for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(enclosureNum) += DifSolarReflW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(enclosureNum) += DifSolarReflW; // [W] //------------------------------------------------------------------------------ // DISTRIBUTE TRANSMITTED DIFFUSE SOLAR THROUGH INTERIOR WINDOW TO ADJACENT ZONE @@ -12142,7 +12142,7 @@ void CalcInteriorWinTransDifSolInitialDistribution( // of diffuse solar transmitted through the given interior window // to individual heat transfer surfaces in the given enclosure. // Diffuse solar transmitted through interior windows in this enclosure - // to adjacent enclosures, is added to the InitialZoneDifSolReflW + // to adjacent enclosures, is added to the ZoneInitialDifSolReflW // of the adjacent enclosure for subsequent interreflection calcs // METHODOLOGY EMPLOYED: @@ -12368,7 +12368,7 @@ void CalcInteriorWinTransDifSolInitialDistribution( // Get the adjacent zone/enclosure index // Add transmitted diffuse solar to total reflected distributed diffuse solar for each zone // for subsequent interreflection calcs - state.dataHeatBal->InitialZoneDifSolReflW(state.dataSurface->Surface(AdjSurfNum).SolarEnclIndex) += DifSolarTransW; // [W] + state.dataHeatBal->ZoneInitialDifSolReflW(state.dataSurface->Surface(AdjSurfNum).SolarEnclIndex) += DifSolarTransW; // [W] } } else if (ShadeFlag == WinShadingType::SwitchableGlazing) { // Switchable glazing @@ -12554,7 +12554,7 @@ void CalcInteriorWinTransDifSolInitialDistribution( } // opaque or window heat transfer surface } // HeatTransSurfNum = Zone(ZoneNum)%SurfaceFirst, Zone(ZoneNum)%SurfaceLast - state.dataHeatBal->InitialZoneDifSolReflW(IntWinEnclosureNum) += InitialZoneDifSolReflW_zone; + state.dataHeatBal->ZoneInitialDifSolReflW(IntWinEnclosureNum) += InitialZoneDifSolReflW_zone; // Check debug var for view factors here // ViewFactorTotal diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 6a91e14845e..36b9a87c008 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -5050,7 +5050,7 @@ namespace SystemAvailabilityManager { } else if (SELECT_CASE_var == state.dataSystemAvailabilityManager->HybridVentMode_OperT80) { if (state.dataThermalComforts->runningAverageASH >= 10.0 && state.dataThermalComforts->runningAverageASH <= 33.5) { state.dataSystemAvailabilityManager->HybridVentSysAvailMgrData(SysAvailNum).OperativeTemp = - 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); minAdaTem = 0.31 * state.dataThermalComforts->runningAverageASH + 14.3; maxAdaTem = 0.31 * state.dataThermalComforts->runningAverageASH + 21.3; state.dataSystemAvailabilityManager->HybridVentSysAvailMgrData(SysAvailNum).minAdaTem = minAdaTem; @@ -5071,7 +5071,7 @@ namespace SystemAvailabilityManager { } else if (SELECT_CASE_var == state.dataSystemAvailabilityManager->HybridVentMode_OperT90) { if (state.dataThermalComforts->runningAverageASH >= 10.0 && state.dataThermalComforts->runningAverageASH <= 33.5) { state.dataSystemAvailabilityManager->HybridVentSysAvailMgrData(SysAvailNum).OperativeTemp = - 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); minAdaTem = 0.31 * state.dataThermalComforts->runningAverageASH + 15.3; maxAdaTem = 0.31 * state.dataThermalComforts->runningAverageASH + 20.3; state.dataSystemAvailabilityManager->HybridVentSysAvailMgrData(SysAvailNum).minAdaTem = minAdaTem; diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index 7db4ef10687..e123d78b46c 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -2261,9 +2261,9 @@ namespace ThermalComfort { auto const SELECT_CASE_var(state.dataHeatBal->People(PeopleListNum).MRTCalcType); if (SELECT_CASE_var == ZoneAveraged) { - state.dataThermalComforts->RadTemp = state.dataHeatBal->MRT(state.dataThermalComforts->ZoneNum); + state.dataThermalComforts->RadTemp = state.dataHeatBal->ZoneMRT(state.dataThermalComforts->ZoneNum); } else if (SELECT_CASE_var == SurfaceWeighted) { - ZoneRadTemp = state.dataHeatBal->MRT(state.dataThermalComforts->ZoneNum); + ZoneRadTemp = state.dataHeatBal->ZoneMRT(state.dataThermalComforts->ZoneNum); SurfaceTemp = state.dataHeatBalSurf->TH(2, 1, state.dataHeatBal->People(PeopleListNum).SurfacePtr); state.dataThermalComforts->RadTemp = CalcSurfaceWeightedMRT(state, state.dataThermalComforts->ZoneNum, state.dataHeatBal->People(PeopleListNum).SurfacePtr); @@ -2347,7 +2347,7 @@ namespace ThermalComfort { } else { CurAirTemp = state.dataHeatBalFanSys->ZTAVComf(iZone); } - CurMeanRadiantTemp = state.dataHeatBal->MRT(iZone); + CurMeanRadiantTemp = state.dataHeatBal->ZoneMRT(iZone); OperTemp = CurAirTemp * 0.5 + CurMeanRadiantTemp * 0.5; HumidRatio = state.dataHeatBalFanSys->ZoneAirHumRatAvgComf(iZone); // for debugging diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index ac68d49f5a8..4cf616d8086 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -710,7 +710,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the upper subzone if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += @@ -720,7 +720,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is in the lower subzone if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWall(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += @@ -740,10 +740,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei // The Wall surface is partially in upper and partially in lower subzone if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -755,7 +755,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HWall(Ctd); @@ -774,7 +774,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += @@ -786,7 +786,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += @@ -798,10 +798,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -819,12 +819,12 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HAT_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; state.dataUFADManager->HA_OCWin += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } } if (state.dataSurface->Surface(SurfNum).Tilt <= 10.0) { // Window Ceiling - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += @@ -833,7 +833,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (state.dataSurface->Surface(SurfNum).Tilt >= 170.0) { // Window Floor - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HWindow(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += @@ -857,7 +857,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = Z1 - state.dataRoomAirMod->ZoneCeilingHeight((ZoneNum - 1) * 2 + 1); if (ZInfSurf > LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += @@ -866,7 +866,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HDoor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += @@ -875,10 +875,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -890,7 +890,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HDoor(Ctd); @@ -910,7 +910,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei ZInfSurf = 0.0; if (ZSupSurf < LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HInternal(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += @@ -919,10 +919,10 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei } if (ZInfSurf <= LayH && ZSupSurf >= LayH) { - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLU = state.dataRoomAirMod->UFHcIn(SurfNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTOC(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); HLD = state.dataRoomAirMod->UFHcIn(SurfNum); TmedDV = ((ZSupSurf - LayH) * state.dataRoomAirMod->ZTMX(ZoneNum) + (LayH - ZInfSurf) * state.dataRoomAirMod->ZTOC(ZoneNum)) / @@ -934,7 +934,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * state.dataHeatBalSurf->TempSurfIn(SurfNum) * HLD; state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * (LayH - ZInfSurf) / (ZSupSurf - ZInfSurf) * HLD; - state.dataHeatBal->TempEffBulkAir(SurfNum) = TmedDV; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = TmedDV; } state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HInternal(Ctd); @@ -946,7 +946,7 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei SurfNum = state.dataUCSDShared->APos_Ceiling(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTMX(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HCeiling(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_MX += @@ -960,13 +960,13 @@ void HcUCSDUF(EnergyPlusData &state, int const ZoneNum, Real64 const FractionHei SurfNum = state.dataUCSDShared->APos_Floor(Ctd); state.dataSurface->SurfTAirRef(SurfNum) = AdjacentAirTemp; if (SurfNum == 0) continue; - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); CalcDetailedHcInForDVModel(state, SurfNum, state.dataHeatBalSurf->TempSurfIn, state.dataRoomAirMod->UFHcIn); state.dataUCSDShared->HFloor(Ctd) = state.dataRoomAirMod->UFHcIn(SurfNum); state.dataUFADManager->HAT_OC += state.dataSurface->Surface(SurfNum).Area * state.dataHeatBalSurf->TempSurfIn(SurfNum) * state.dataUCSDShared->HFloor(Ctd); state.dataUFADManager->HA_OC += state.dataSurface->Surface(SurfNum).Area * state.dataUCSDShared->HFloor(Ctd); - state.dataHeatBal->TempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAirMod->ZTFloor(ZoneNum); state.dataRoomAirMod->UFHcIn(SurfNum) = state.dataUCSDShared->HFloor(Ctd); } // END FLOOR } diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index b93fbe5a45a..2f81929cd17 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -2912,9 +2912,9 @@ namespace VentilatedSlab { if (SELECT_CASE_var == state.dataVentilatedSlab->MATControl) { SetPointTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == state.dataVentilatedSlab->MRTControl) { - SetPointTemp = state.dataHeatBal->MRT(ZoneNum); + SetPointTemp = state.dataHeatBal->ZoneMRT(ZoneNum); } else if (SELECT_CASE_var == state.dataVentilatedSlab->OPTControl) { - SetPointTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->MRT(ZoneNum)); + SetPointTemp = 0.5 * (state.dataHeatBalFanSys->MAT(ZoneNum) + state.dataHeatBal->ZoneMRT(ZoneNum)); } else if (SELECT_CASE_var == state.dataVentilatedSlab->ODBControl) { SetPointTemp = state.dataEnvrn->OutDryBulbTemp; } else if (SELECT_CASE_var == state.dataVentilatedSlab->OWBControl) { diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index dffb7cfb438..c419cd6d177 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2772,7 +2772,7 @@ namespace WindowComplexManager { if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone // ControlledZoneAirFlag = .FALSE. @@ -2825,7 +2825,7 @@ namespace WindowComplexManager { if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNumAdj); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone ZoneEquipConfigNum = ZoneNum; @@ -2861,7 +2861,7 @@ namespace WindowComplexManager { tout = RefAirTemp + DataGlobalConstants::KelvinConv; // outside air temperature - tsky = state.dataHeatBal->MRT(ZoneNumAdj) + + tsky = state.dataHeatBal->ZoneMRT(ZoneNumAdj) + DataGlobalConstants::KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards // ! Add long-wave radiation from adjacent zone absorbed by glass layer closest to the adjacent zone. diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index 53094f6f3de..6ac1109604d 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -739,7 +739,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { ZoneEquipConfigNum = ZoneNum; // check whether this zone is a controlled zone or not @@ -783,7 +783,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNumAdj); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone ZoneEquipConfigNum = ZoneNum; @@ -815,7 +815,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, } Tout = RefAirTemp + DataGlobalConstants::KelvinConv; // outside air temperature - tsky = state.dataHeatBal->MRT(ZoneNumAdj) + + tsky = state.dataHeatBal->ZoneMRT(ZoneNumAdj) + DataGlobalConstants::KelvinConv; // TODO this misses IR from sources such as high temp radiant and baseboards // The IR radiance of this window's "exterior" surround is the IR radiance diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index af52927fe18..17caf38a96e 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2410,9 +2410,9 @@ namespace WindowManager { auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNum)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = RefAirTemp; } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone // ControlledZoneAirFlag = .FALSE. @@ -2446,12 +2446,12 @@ namespace WindowManager { } else { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); } - state.dataHeatBal->TempEffBulkAir(SurfNum) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = RefAirTemp; } else { // currently set to mean air temp but should add error warning here RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNum); - state.dataHeatBal->TempEffBulkAir(SurfNum) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = RefAirTemp; } } @@ -2679,9 +2679,9 @@ namespace WindowManager { auto const SELECT_CASE_var(state.dataSurface->SurfTAirRef(SurfNumAdj)); if (SELECT_CASE_var == ZoneMeanAirTemp) { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); - state.dataHeatBal->TempEffBulkAir(SurfNumAdj) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj) = RefAirTemp; } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNumAdj); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // determine ZoneEquipConfigNum for this zone ZoneEquipConfigNum = ZoneNumAdj; @@ -2709,11 +2709,11 @@ namespace WindowManager { } else { RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); } - state.dataHeatBal->TempEffBulkAir(SurfNumAdj) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj) = RefAirTemp; } else { // currently set to mean air temp but should add error warning here RefAirTemp = state.dataHeatBalFanSys->MAT(ZoneNumAdj); - state.dataHeatBal->TempEffBulkAir(SurfNumAdj) = RefAirTemp; + state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj) = RefAirTemp; } } diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 0a9003a5956..b722789c8c8 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -6789,7 +6789,7 @@ void CalcZoneSums(EnergyPlusData &state, RefAirTemp = MAT(ZoneNum); SumHA += HA; } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); SumHATref += HA * RefAirTemp; } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // check whether this zone is a controlled zone or not @@ -7039,7 +7039,7 @@ void CalcZoneComponentLoadSums(EnergyPlusData &state, // The zone air is the reference temperature RefAirTemp = MAT(ZoneNum); } else if (SELECT_CASE_var == AdjacentAirTemp) { - RefAirTemp = state.dataHeatBal->TempEffBulkAir(SurfNum); + RefAirTemp = state.dataHeatBal->SurfTempEffBulkAir(SurfNum); } else if (SELECT_CASE_var == ZoneSupplyAirTemp) { // check whether this zone is a controlled zone or not if (!ControlledZoneAirFlag) { @@ -7438,7 +7438,7 @@ void AdjustAirSetPointsforOpTempCntrl(EnergyPlusData &state, int const TempContr } // get mean radiant temperature for zone - thisMRT = state.dataHeatBal->MRT(ActualZoneNum); + thisMRT = state.dataHeatBal->ZoneMRT(ActualZoneNum); // modify setpoint for operative temperature control // traping for MRT fractions between 0.0 and 0.9 during get input, so shouldn't be able to divide by zero here. diff --git a/tst/EnergyPlus/unit/AdvancedAFN.unit.cc b/tst/EnergyPlus/unit/AdvancedAFN.unit.cc index 730fa6e6e8b..4559264f98d 100644 --- a/tst/EnergyPlus/unit/AdvancedAFN.unit.cc +++ b/tst/EnergyPlus/unit/AdvancedAFN.unit.cc @@ -109,9 +109,9 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_AdvancedTest_Test1) state->dataEnvrn->OutDryBulbTemp = 15.0; state->dataHeatBal->Zone.allocate(1); state->dataHeatBalFanSys->MAT.allocate(1); - state->dataHeatBal->MRT.allocate(1); + state->dataHeatBal->ZoneMRT.allocate(1); state->dataHeatBalFanSys->MAT(1) = 22.0; - state->dataHeatBal->MRT(1) = 22.0; + state->dataHeatBal->ZoneMRT(1) = 22.0; TimeOpenElapsed = 5.0; TimeCloseElapsed = 0.0; @@ -159,7 +159,7 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_AdvancedTest_Test1) EXPECT_EQ(1, CloseProbStatus); state->dataHeatBalFanSys->MAT(1) = 26.0; - state->dataHeatBal->MRT(1) = 26.0; + state->dataHeatBal->ZoneMRT(1) = 26.0; state->dataAirflowNetworkBalanceManager->OccupantVentilationControl(1).calc( *state, 1, TimeOpenElapsed, TimeCloseElapsed, OpenStatus, OpenProbStatus, CloseProbStatus); EXPECT_EQ(2, OpenProbStatus); diff --git a/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc b/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc index f9dbf44a620..5e30cd27691 100644 --- a/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc +++ b/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc @@ -77,8 +77,8 @@ TEST_F(EnergyPlusFixture, SetCoolingPanelControlTemp) state->dataChilledCeilingPanelSimple->CoolingPanel.allocate(1); state->dataHeatBalFanSys->MAT.allocate(1); state->dataHeatBalFanSys->MAT(1) = 22.0; - state->dataHeatBal->MRT.allocate(1); - state->dataHeatBal->MRT(1) = 20.0; + state->dataHeatBal->ZoneMRT.allocate(1); + state->dataHeatBal->ZoneMRT(1) = 20.0; state->dataHeatBal->Zone.allocate(1); state->dataHeatBal->Zone(1).OutDryBulbTemp = 10.0; state->dataHeatBal->Zone(1).OutWetBulbTemp = 5.0; diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index cae2a2d67fb..c39cb8933c9 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -713,8 +713,8 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->Surface.allocate(SurfNum); state->dataSurface->Surface(SurfNum).Zone = 1; state->dataRoomAirMod->AirModel.allocate(1); - state->dataHeatBal->TempEffBulkAir.allocate(1); - state->dataHeatBal->TempEffBulkAir(1) = 1.0; + state->dataHeatBal->SurfTempEffBulkAir.allocate(1); + state->dataHeatBal->SurfTempEffBulkAir(1) = 1.0; SurfTemp.allocate(1); HcIn.allocate(1); Vhc.allocate(1); diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 786d395c554..9fb5770dfe5 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -78,7 +78,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->IsZoneDV.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->IsZoneDV(1) = true; state->dataSurface->Surface.allocate(TotSurfaces); - state->dataHeatBal->TempEffBulkAir.allocate(TotSurfaces); + state->dataHeatBal->SurfTempEffBulkAir.allocate(TotSurfaces); state->dataHeatBalSurf->TempSurfIn.allocate(TotSurfaces); state->dataRoomAirMod->DVHcIn.allocate(TotSurfaces); state->dataRoomAirMod->ZTMX.allocate(state->dataGlobal->NumOfZones); @@ -242,7 +242,7 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataRoomAirMod->IsZoneDV.deallocate(); state->dataSurface->Surface.deallocate(); - state->dataHeatBal->TempEffBulkAir.deallocate(); + state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->TempSurfIn.deallocate(); state->dataRoomAirMod->DVHcIn.deallocate(); state->dataRoomAirMod->ZTMX.deallocate(); diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 9fc9c4c4070..81b304fb30d 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1234,7 +1234,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_TestZonePropertyLocalEnv) state->dataZoneEquip->ZoneEquipConfig(1).ReturnNode(1) = 4; state->dataZoneEquip->ZoneEquipConfig(1).FixedReturnFlow.allocate(1); - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataHeatBal->HConvIn.allocate(6); state->dataHeatBal->HConvIn(1) = 0.5; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 571ed5a42c4..05e961702da 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -744,7 +744,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -787,9 +787,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI // with supply air CalcHeatBalanceInsideSurf(*state); - EXPECT_EQ(24.0, state->dataHeatBal->TempEffBulkAir(1)); - EXPECT_EQ(23.0, state->dataHeatBal->TempEffBulkAir(2)); - EXPECT_EQ(20.0, state->dataHeatBal->TempEffBulkAir(3)); + EXPECT_EQ(24.0, state->dataHeatBal->SurfTempEffBulkAir(1)); + EXPECT_EQ(23.0, state->dataHeatBal->SurfTempEffBulkAir(2)); + EXPECT_EQ(20.0, state->dataHeatBal->SurfTempEffBulkAir(3)); // Supply air flow rate = 0 state->dataLoopNodes->Node(1).MassFlowRate = 0.0; @@ -797,9 +797,9 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataLoopNodes->Node(3).MassFlowRate = 0.0; state->dataLoopNodes->Node(4).MassFlowRate = 0.0; CalcHeatBalanceInsideSurf(*state); - EXPECT_EQ(24.0, state->dataHeatBal->TempEffBulkAir(1)); - EXPECT_EQ(23.0, state->dataHeatBal->TempEffBulkAir(2)); - EXPECT_EQ(24.0, state->dataHeatBal->TempEffBulkAir(3)); + EXPECT_EQ(24.0, state->dataHeatBal->SurfTempEffBulkAir(1)); + EXPECT_EQ(23.0, state->dataHeatBal->SurfTempEffBulkAir(2)); + EXPECT_EQ(24.0, state->dataHeatBal->SurfTempEffBulkAir(3)); state->dataZoneEquip->ZoneEquipConfig.deallocate(); state->dataSize->ZoneEqSizing.deallocate(); @@ -808,7 +808,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataLoopNodes->Node.deallocate(); state->dataGlobal->KickOffSimulation = false; state->dataHeatBalSurf->TempSurfInTmp.deallocate(); - state->dataHeatBal->TempEffBulkAir.deallocate(); + state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->TH.deallocate(); state->dataHeatBal->HConvIn.deallocate(); state->dataMstBal->HConvInFD.deallocate(); @@ -1282,7 +1282,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -1857,7 +1857,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -2424,7 +2424,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -2489,7 +2489,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataLoopNodes->Node.deallocate(); state->dataGlobal->KickOffSimulation = false; state->dataHeatBalSurf->TempSurfInTmp.deallocate(); - state->dataHeatBal->TempEffBulkAir.deallocate(); + state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->TH.deallocate(); state->dataHeatBal->HConvIn.deallocate(); state->dataMstBal->HConvInFD.deallocate(); @@ -3087,7 +3087,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) state->dataHeatBalFanSys->ZoneAirHumRat.allocate(1); state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBal->TempEffBulkAir.allocate(6); + state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataHeatBalSurf->TH.allocate(2, 2, 6); state->dataHeatBal->HConvIn.allocate(6); diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index c17f3915073..921d18c3dc4 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -2929,7 +2929,7 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) Real64 acceptibleError = 0.001; state->dataHeatBalFanSys->MAT.allocate(1); - state->dataHeatBal->MRT.allocate(1); + state->dataHeatBal->ZoneMRT.allocate(1); state->dataHeatBal->Zone.allocate(1); state->dataHeatBalSurf->TempSurfIn.allocate(1); state->dataHeatBalSurf->TempUserLoc.allocate(1); @@ -2939,7 +2939,7 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) // Test Data state->dataHeatBalFanSys->MAT(1) = 23.456; - state->dataHeatBal->MRT(1) = 12.345; + state->dataHeatBal->ZoneMRT(1) = 12.345; state->dataHeatBal->Zone(1).OutDryBulbTemp = 34.567; state->dataHeatBal->Zone(1).OutWetBulbTemp = 1.234; state->dataHeatBalSurf->TempSurfIn(1) = 5.678; @@ -2976,19 +2976,19 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) // Test 2: MRT Control state->dataLowTempRadSys->HydrRadSys(1).ControlType = LowTempRadiantControlTypes::MRTControl; - expectedResult = state->dataHeatBal->MRT(1); + expectedResult = state->dataHeatBal->ZoneMRT(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->HydrRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->HydrRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->CFloRadSys(1).ControlType = LowTempRadiantControlTypes::MRTControl; - expectedResult = state->dataHeatBal->MRT(1); + expectedResult = state->dataHeatBal->ZoneMRT(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->CFloRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->CFloRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->ElecRadSys(1).ControlType = LowTempRadiantControlTypes::MRTControl; - expectedResult = state->dataHeatBal->MRT(1); + expectedResult = state->dataHeatBal->ZoneMRT(1); actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->ElecRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->ElecRadSys(1).ControlType); @@ -2996,19 +2996,19 @@ TEST_F(LowTempRadiantSystemTest, setRadiantSystemControlTemperatureTest) // Test 3: Operative Temperature Control state->dataLowTempRadSys->HydrRadSys(1).ControlType = LowTempRadiantControlTypes::OperativeControl; - expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->MRT(1)) / 2.0; + expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->ZoneMRT(1)) / 2.0; actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->HydrRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->HydrRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->CFloRadSys(1).ControlType = LowTempRadiantControlTypes::OperativeControl; - expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->MRT(1)) / 2.0; + expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->ZoneMRT(1)) / 2.0; actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->CFloRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->CFloRadSys(1).ControlType); EXPECT_NEAR(expectedResult, actualResult, acceptibleError); state->dataLowTempRadSys->ElecRadSys(1).ControlType = LowTempRadiantControlTypes::OperativeControl; - expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->MRT(1)) / 2.0; + expectedResult = (state->dataHeatBalFanSys->MAT(1) + state->dataHeatBal->ZoneMRT(1)) / 2.0; actualResult = 0.0; // reset actualResult = state->dataLowTempRadSys->ElecRadSys(1).setRadiantSystemControlTemperature(*state, state->dataLowTempRadSys->ElecRadSys(1).ControlType); diff --git a/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc b/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc index 66b7a066099..1bac3e3fad5 100644 --- a/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc +++ b/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc @@ -455,7 +455,7 @@ TEST_F(EnergyPlusFixture, SysAvailManager_HybridVentilation_OT_CO2Control) state->dataAirLoop->PriAirSysAvailMgr.allocate(1); state->dataHeatBal->Zone.allocate(1); state->dataHeatBalFanSys->MAT.allocate(1); - state->dataHeatBal->MRT.allocate(1); + state->dataHeatBal->ZoneMRT.allocate(1); state->dataContaminantBalance->ZoneAirCO2.allocate(1); state->dataContaminantBalance->ZoneCO2SetPoint.allocate(1); state->dataAirLoop->PriAirSysAvailMgr.allocate(1); @@ -490,24 +490,24 @@ TEST_F(EnergyPlusFixture, SysAvailManager_HybridVentilation_OT_CO2Control) state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).ControlMode = 5; // 80% acceptance state->dataThermalComforts->runningAverageASH = 20.0; state->dataHeatBalFanSys->MAT(1) = 23.0; - state->dataHeatBal->MRT(1) = 27.0; + state->dataHeatBal->ZoneMRT(1) = 27.0; SystemAvailabilityManager::CalcHybridVentSysAvailMgr(*state, 1, 1); EXPECT_EQ(1, state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).VentilationCtrl); // Vent open state->dataHeatBalFanSys->MAT(1) = 26.0; - state->dataHeatBal->MRT(1) = 30.0; + state->dataHeatBal->ZoneMRT(1) = 30.0; SystemAvailabilityManager::CalcHybridVentSysAvailMgr(*state, 1, 1); EXPECT_EQ(2, state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).VentilationCtrl); // System operation state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).ControlMode = 6; // 90% acceptance state->dataHeatBalFanSys->MAT(1) = 23.0; - state->dataHeatBal->MRT(1) = 27.0; + state->dataHeatBal->ZoneMRT(1) = 27.0; SystemAvailabilityManager::CalcHybridVentSysAvailMgr(*state, 1, 1); EXPECT_EQ(1, state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).VentilationCtrl); // Vent open state->dataHeatBalFanSys->MAT(1) = 26.0; - state->dataHeatBal->MRT(1) = 30.0; + state->dataHeatBal->ZoneMRT(1) = 30.0; SystemAvailabilityManager::CalcHybridVentSysAvailMgr(*state, 1, 1); EXPECT_EQ(2, state->dataSystemAvailabilityManager->HybridVentSysAvailMgrData(1).VentilationCtrl); // System operation @@ -576,7 +576,7 @@ TEST_F(EnergyPlusFixture, SysAvailManager_HybridVentilation_OT_CO2Control) state->dataAirLoop->PriAirSysAvailMgr.deallocate(); state->dataHeatBal->Zone.deallocate(); state->dataHeatBalFanSys->MAT.deallocate(); - state->dataHeatBal->MRT.deallocate(); + state->dataHeatBal->ZoneMRT.deallocate(); state->dataContaminantBalance->ZoneAirCO2.deallocate(); state->dataContaminantBalance->ZoneCO2SetPoint.deallocate(); state->dataAirLoop->PriAirSysAvailMgr.deallocate(); diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index ed5572eb7d8..f018675394d 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -710,7 +710,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortFanger) // compare_err_stream( "" ); state->dataHeatBalFanSys->ZTAVComf(1) = 25.0; - state->dataHeatBal->MRT(1) = 26.0; + state->dataHeatBal->ZoneMRT(1) = 26.0; state->dataHeatBalFanSys->ZoneAirHumRatAvgComf(1) = 0.00529; // 0.002 to 0.006 CalcThermalComfortFanger(*state); @@ -719,7 +719,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortFanger) EXPECT_NEAR(state->dataThermalComforts->ThermalComfortData(1).FangerPPD, 38.3, 0.1); state->dataHeatBalFanSys->ZTAVComf(1) = 26.0; - state->dataHeatBal->MRT(1) = 27.0; + state->dataHeatBal->ZoneMRT(1) = 27.0; state->dataHeatBalFanSys->ZoneAirHumRatAvgComf(1) = 0.00529; // 0.002 to 0.006 CalcThermalComfortFanger(*state); @@ -728,7 +728,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortFanger) EXPECT_NEAR(state->dataThermalComforts->ThermalComfortData(1).FangerPPD, 20.6, 0.1); state->dataHeatBalFanSys->ZTAVComf(1) = 27.0; - state->dataHeatBal->MRT(1) = 28.0; + state->dataHeatBal->ZoneMRT(1) = 28.0; state->dataHeatBalFanSys->ZoneAirHumRatAvgComf(1) = 0.00529; // 0.002 to 0.006 CalcThermalComfortFanger(*state); @@ -737,7 +737,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortFanger) EXPECT_NEAR(state->dataThermalComforts->ThermalComfortData(1).FangerPPD, 9.4, 0.1); state->dataHeatBalFanSys->ZTAVComf(1) = 25.0; - state->dataHeatBal->MRT(1) = 26.0; + state->dataHeatBal->ZoneMRT(1) = 26.0; state->dataHeatBalFanSys->ZoneAirHumRatAvgComf(1) = 0.00629; // 0.002 to 0.006 CalcThermalComfortFanger(*state); @@ -951,7 +951,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) state->dataGlobal->NumOfZones = 1; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZTAVComf.allocate(state->dataGlobal->NumOfZones); - state->dataHeatBal->MRT.allocate(state->dataGlobal->NumOfZones); + state->dataHeatBal->ZoneMRT.allocate(state->dataGlobal->NumOfZones); state->dataHeatBalFanSys->ZoneAirHumRatAvgComf.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->IsZoneDV.allocate(state->dataGlobal->NumOfZones); state->dataRoomAirMod->IsZoneUI.allocate(state->dataGlobal->NumOfZones); @@ -1016,7 +1016,7 @@ TEST_F(EnergyPlusFixture, ThermalComfort_CalcThermalComfortASH55) Real64 CloUnit = 0.5; state->dataHeatBalFanSys->ZTAVComf(1) = AirTemp; - state->dataHeatBal->MRT(1) = RadTemp; + state->dataHeatBal->ZoneMRT(1) = RadTemp; state->dataHeatBalFanSys->ZoneAirHumRatAvgComf(1) = Psychrometrics::PsyWFnTdbRhPb(*state, state->dataHeatBalFanSys->ZTAVComf(1), RelHum, state->dataEnvrn->OutBaroPress); state->dataScheduleMgr->Schedule(1).CurrentValue = ActMet * BodySurfaceArea * state->dataThermalComforts->ActLevelConv; diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index ef81365453c..df7649b807b 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -206,12 +206,12 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) state->dataHeatBalFanSys->ZTAV.allocate(1); state->dataHeatBalFanSys->ZT.allocate(1); - state->dataHeatBal->MRT.allocate(1); + state->dataHeatBal->ZoneMRT.allocate(1); state->dataHeatBalFanSys->ZoneAirHumRatAvg.allocate(1); state->dataHeatBalFanSys->ZT(1) = 0.0; state->dataHeatBalFanSys->ZTAV(1) = 0.0; - state->dataHeatBal->MRT(1) = 0.0; + state->dataHeatBal->ZoneMRT(1) = 0.0; state->dataHeatBalFanSys->ZoneAirHumRatAvg(1) = 0.0; HeatBalanceManager::ManageHeatBalance(*state); @@ -244,7 +244,7 @@ TEST_F(EnergyPlusFixture, WindowFrameTest) state->dataHeatBal->SunlitFracWithoutReveal.dimension(1, 1, 3, 1.0); state->dataSurface->SurfOutDryBulbTemp(winNum) = T_out; - state->dataHeatBal->TempEffBulkAir(winNum) = T_in; + state->dataHeatBal->SurfTempEffBulkAir(winNum) = T_in; state->dataSurface->SurfWinIRfromParentZone(winNum) = DataGlobalConstants::StefanBoltzmann * std::pow(T_in + DataGlobalConstants::KelvinConv, 4); state->dataHeatBalFanSys->ZoneAirHumRatAvg.dimension(1, 0.01); state->dataHeatBalFanSys->ZoneAirHumRat.dimension(1, 0.01); @@ -502,7 +502,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataZoneEquip->ZoneEquipConfig(1).FixedReturnFlow.allocate(1); state->dataLoopNodes->Node.allocate(4); - state->dataHeatBal->TempEffBulkAir.allocate(3); + state->dataHeatBal->SurfTempEffBulkAir.allocate(3); state->dataHeatBalSurf->TempSurfInTmp.allocate(3); int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); @@ -521,9 +521,9 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalSurf->TempSurfInTmp(surfNum1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(surfNum2) = 20.0; state->dataHeatBalSurf->TempSurfInTmp(surfNum3) = 25.0; - state->dataHeatBal->TempEffBulkAir(surfNum1) = 10.0; - state->dataHeatBal->TempEffBulkAir(surfNum2) = 10.0; - state->dataHeatBal->TempEffBulkAir(surfNum3) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum1) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum2) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum3) = 10.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -603,19 +603,19 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) // Calculate temperature based on supply flow rate WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); - EXPECT_NEAR(20.0, state->dataHeatBal->TempEffBulkAir(surfNum2), 0.0001); + EXPECT_NEAR(20.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); // Calculate temperature based on zone temperature with supply flow rate = 0 state->dataLoopNodes->Node(1).MassFlowRate = 0.0; state->dataLoopNodes->Node(2).MassFlowRate = 0.0; WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); - EXPECT_NEAR(25.0, state->dataHeatBal->TempEffBulkAir(surfNum2), 0.0001); + EXPECT_NEAR(25.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); // Adjacent surface state->dataLoopNodes->Node(1).MassFlowRate = 0.1; state->dataLoopNodes->Node(2).MassFlowRate = 0.1; state->dataSurface->Surface(1).ExtBoundCond = 2; WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); - EXPECT_NEAR(20.0, state->dataHeatBal->TempEffBulkAir(surfNum2), 0.0001); + EXPECT_NEAR(20.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); state->dataLoopNodes->Node(1).MassFlowRate = 0.0; state->dataLoopNodes->Node(2).MassFlowRate = 0.0; @@ -623,7 +623,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->Surface(2).ExtBoundCond = 1; state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneSupplyAirTemp; WindowManager::CalcWindowHeatBalance(*state, surfNum2, state->dataHeatBal->HConvIn(surfNum2), inSurfTemp, outSurfTemp); - EXPECT_NEAR(25.0, state->dataHeatBal->TempEffBulkAir(surfNum2), 0.0001); + EXPECT_NEAR(25.0, state->dataHeatBal->SurfTempEffBulkAir(surfNum2), 0.0001); } TEST_F(EnergyPlusFixture, SpectralAngularPropertyTest) @@ -2731,7 +2731,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataZoneEquip->ZoneEquipConfig(1).FixedReturnFlow.allocate(1); state->dataLoopNodes->Node.allocate(4); - state->dataHeatBal->TempEffBulkAir.allocate(3); + state->dataHeatBal->SurfTempEffBulkAir.allocate(3); state->dataHeatBalSurf->TempSurfInTmp.allocate(3); int surfNum1 = UtilityRoutines::FindItemInList("WALL", state->dataSurface->Surface); @@ -2750,9 +2750,9 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataHeatBalSurf->TempSurfInTmp(surfNum1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(surfNum2) = 20.0; state->dataHeatBalSurf->TempSurfInTmp(surfNum3) = 25.0; - state->dataHeatBal->TempEffBulkAir(surfNum1) = 10.0; - state->dataHeatBal->TempEffBulkAir(surfNum2) = 10.0; - state->dataHeatBal->TempEffBulkAir(surfNum3) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum1) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum2) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(surfNum3) = 10.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index d103981ef00..ab0d577f5ad 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -1073,7 +1073,7 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataSurface->Surface.allocate(3); state->dataHeatBal->HConvIn.allocate(3); state->dataLoopNodes->Node.allocate(4); - state->dataHeatBal->TempEffBulkAir.allocate(3); + state->dataHeatBal->SurfTempEffBulkAir.allocate(3); state->dataHeatBalSurf->TempSurfInTmp.allocate(3); state->dataSurface->SurfTAirRef.allocate(3); @@ -1090,9 +1090,9 @@ TEST_F(EnergyPlusFixture, ZoneTempPredictorCorrector_CalcZoneSums_SurfConvection state->dataHeatBalSurf->TempSurfInTmp(1) = 15.0; state->dataHeatBalSurf->TempSurfInTmp(2) = 20.0; state->dataHeatBalSurf->TempSurfInTmp(3) = 25.0; - state->dataHeatBal->TempEffBulkAir(1) = 10.0; - state->dataHeatBal->TempEffBulkAir(2) = 10.0; - state->dataHeatBal->TempEffBulkAir(3) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(1) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(2) = 10.0; + state->dataHeatBal->SurfTempEffBulkAir(3) = 10.0; state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; From 24f0112d29cc24274d59a174159bd1720597c7fa Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 8 May 2021 18:38:06 -0700 Subject: [PATCH 09/25] shading vars --- src/EnergyPlus/ConvectionCoefficients.cc | 242 +++++++++++++------- src/EnergyPlus/DataSurfaces.hh | 13 +- src/EnergyPlus/DaylightingManager.cc | 33 +-- src/EnergyPlus/HeatBalanceManager.cc | 1 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 2 +- src/EnergyPlus/SolarReflectionManager.cc | 12 +- src/EnergyPlus/SolarShading.cc | 16 +- src/EnergyPlus/SurfaceGeometry.cc | 15 +- 8 files changed, 200 insertions(+), 134 deletions(-) diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index e3826ddaa71..f4c6144d868 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -624,8 +624,8 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorGroundIR * (pow_4(TSurf) - pow_4(TGround)) / (TSurf - TGround); // Compute air radiation coefficient - HAir = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * - (pow_4(TSurf) - pow_4(TAir)) / (TSurf - TAir); + HAir = DataGlobalConstants::StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * + (1.0 - state.dataSurface->SurfAirSkyRadSplit(SurfNum)) * (pow_4(TSurf) - pow_4(TAir)) / (TSurf - TAir); } } @@ -3271,7 +3271,8 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserValue; // reporting state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HExt = GetCurrentScheduleValue(state, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).ScheduleIndex); + HExt = GetCurrentScheduleValue(state, + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; @@ -3292,8 +3293,10 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, HExt); // Kiva convection handled in function above - state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting - state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting } else { assert(false); } @@ -3339,7 +3342,8 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac } state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HInt = GetCurrentScheduleValue(state, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).ScheduleIndex); + HInt = GetCurrentScheduleValue(state, + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); @@ -3351,9 +3355,11 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac // Kiva convection handled in function above state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserCurve; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { - EvaluateIntHcModels(state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq, HInt); + EvaluateIntHcModels( + state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq, HInt); // Kiva convection handled in function above - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; } else { assert(false); } @@ -3517,7 +3523,8 @@ void CalcISO15099WindowIntConvCoeff(EnergyPlusData &state, CalcISO15099WindowIntConvCoeff(state, SurfaceTemperature, AirTemperature, AirHumRat, Height, TiltDeg, sineTilt); // EMS override point (Violates Standard 15099? throw warning? scary. - if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); + if (state.dataSurface->SurfEMSOverrideIntConvCoef(SurfNum)) + state.dataHeatBal->HConvIn(SurfNum) = state.dataSurface->SurfEMSValueForIntConvCoef(SurfNum); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) if (state.dataHeatBal->HConvIn(SurfNum) < state.dataHeatBal->LowHConvLimit) @@ -4048,7 +4055,8 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) } } else if (Surface(SurfLoop).Tilt < 45.0) { // assume part of roof state.dataSurface->SurfOutConvFaceArea(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Area, Surface(SurfLoop).GrossArea); - state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Perimeter, Surface(SurfLoop).Perimeter); + state.dataSurface->SurfOutConvFacePerimeter(SurfLoop) = + max(state.dataConvectionCoefficient->RoofGeo.Perimeter, Surface(SurfLoop).Perimeter); state.dataSurface->SurfOutConvFaceHeight(SurfLoop) = max(state.dataConvectionCoefficient->RoofGeo.Height, z_del); } else if (Surface(SurfLoop).Tilt >= 135.0) { // assume floor over exterior, just use surface's geometry state.dataSurface->SurfOutConvFaceArea(SurfLoop) = Surface(SurfLoop).GrossArea; @@ -4521,7 +4529,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); + tmpHc = + CalcAlamdariHammondStableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondVerticalWall) { @@ -4541,7 +4550,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, return CalcAlamdariHammondStableHorizontal(Tsurf - Tamb, HorizHydrDiam); }; } else { - tmpHc = CalcAlamdariHammondUnstableHorizontal(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); + tmpHc = CalcAlamdariHammondUnstableHorizontal( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), SurfNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq3WallAwayFromHeat) { @@ -4609,7 +4619,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedAssistedWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedAssistedWall( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedOppossingWall) { @@ -4622,7 +4633,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedOpposingWall(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedOpposingWall( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneWallHeight(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableCeiling) { @@ -4635,8 +4647,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = - CalcBeausoleilMorrisonMixedStableCeiling(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedStableCeiling( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableCeiling) { @@ -4663,8 +4675,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = - CalcBeausoleilMorrisonMixedStableFloor(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedStableFloor( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableFloor) { @@ -4677,8 +4689,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, CalcZoneSystemACH(state, ZoneNum)); }; } else { - tmpHc = - CalcBeausoleilMorrisonMixedUnstableFloor(state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedUnstableFloor( + state, (Tsurface - Tzone), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfNum), Tsurface, ZoneNum); } state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FohannoPolidoriVerticalWall) { @@ -4713,8 +4725,10 @@ void EvaluateIntHcModels(EnergyPlusData &state, tmpHc = state.dataHeatBal->HConvIn(SurfNum); state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWindow) { - tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow( - state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowWallRatio(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum); + tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWindow(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), + state.dataSurface->SurfIntConvWindowWallRatio(SurfNum), + state.dataSurface->SurfIntConvWindowLocation(SurfNum), + ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } @@ -4725,8 +4739,8 @@ void EvaluateIntHcModels(EnergyPlusData &state, state.dataSurface->SurfTAirRef(SurfNum) = ZoneMeanAirTemp; } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWalls) { - tmpHc = - CalcGoldsteinNovoselacCeilingDiffuserWall(state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum); + tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWall( + state.dataSurface->SurfIntConvZonePerimLength(SurfNum), state.dataSurface->SurfIntConvWindowLocation(SurfNum), ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } @@ -4818,8 +4832,7 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat }; } else if (SELECT_CASE_var == HcExt_AlamdariHammondVerticalWall) { Real64 FaceHeight = state.dataSurface->SurfOutConvFaceHeight(SurfNum); - Hn = CalcAlamdariHammondVerticalWall( - state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), FaceHeight, SurfNum); + Hn = CalcAlamdariHammondVerticalWall(state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), FaceHeight, SurfNum); HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, FaceHeight); }; @@ -4840,14 +4853,16 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } else { HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } - Hn = CalcAlamdariHammondStableHorizontal(state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); + Hn = CalcAlamdariHammondStableHorizontal( + state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); } else if (SELECT_CASE_var == HcExt_AlamdariHammondUnstableHorizontal) { if (state.dataSurface->SurfOutConvFacePerimeter(SurfNum) > 0.0) { HydraulicDiameter = 4.0 * state.dataSurface->SurfOutConvFaceArea(SurfNum) / state.dataSurface->SurfOutConvFacePerimeter(SurfNum); } else { HydraulicDiameter = std::sqrt(state.dataSurface->SurfOutConvFaceArea(SurfNum)); } - Hn = CalcAlamdariHammondUnstableHorizontal(state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); + Hn = CalcAlamdariHammondUnstableHorizontal( + state, (TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum)), HydraulicDiameter, SurfNum); } } @@ -4876,8 +4891,12 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat HnFn = state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out; } } else if (SELECT_CASE_var == HcExt_SparrowWindward) { - Hf = CalcSparrowWindward( - state, Roughness, state.dataSurface->SurfOutConvFacePerimeter(SurfNum), state.dataSurface->SurfOutConvFaceArea(SurfNum), SurfWindSpeed, SurfNum); + Hf = CalcSparrowWindward(state, + Roughness, + state.dataSurface->SurfOutConvFacePerimeter(SurfNum), + state.dataSurface->SurfOutConvFaceArea(SurfNum), + SurfWindSpeed, + SurfNum); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). @@ -4901,8 +4920,12 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_SparrowLeeward) { - Hf = - CalcSparrowLeeward(state, Roughness, state.dataSurface->SurfOutConvFacePerimeter(SurfNum), state.dataSurface->SurfOutConvFaceArea(SurfNum), SurfWindSpeed, SurfNum); + Hf = CalcSparrowLeeward(state, + Roughness, + state.dataSurface->SurfOutConvFacePerimeter(SurfNum), + state.dataSurface->SurfOutConvFaceArea(SurfNum), + SurfWindSpeed, + SurfNum); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). const double area = 9999999.; @@ -4951,7 +4974,8 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Windward) { - Hf = CalcDOE2Windward(TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); + Hf = CalcDOE2Windward( + TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { @@ -4964,7 +4988,8 @@ void EvaluateExtHcModels(EnergyPlusData &state, int const SurfNum, int const Nat } HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Leeward) { - Hf = CalcDOE2Leeward(TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); + Hf = CalcDOE2Leeward( + TH(1, 1, SurfNum), state.dataSurface->SurfOutDryBulbTemp(SurfNum), Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass::Floor) { // used for exterior grade HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { @@ -5117,7 +5142,8 @@ void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum auto const SELECT_CASE_var(state.dataSurface->SurfOutConvClassification(SurfNum)); if (SELECT_CASE_var == OutConvClass_WindwardVertWall) { - state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum; + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = + state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardEqNum; if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallWindwardUserCurveNum; @@ -5128,7 +5154,8 @@ void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatVertWallUserCurveNum; } } else if (SELECT_CASE_var == OutConvClass_LeewardVertWall) { - state.dataSurface->SurfOutConvHfModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum; + state.dataSurface->SurfOutConvHfModelEq(SurfNum) = + state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardEqNum; if (state.dataSurface->SurfOutConvHfModelEq(SurfNum) == HcExt_UserCurve) { state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindWallLeewardUserCurveNum; @@ -5145,7 +5172,8 @@ void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum; } - state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum; + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = + state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizEqNum; if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatStableHorizUserCurveNum; @@ -5156,7 +5184,8 @@ void MapExtConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HWindHorizRoofUserCurveNum; } - state.dataSurface->SurfOutConvHnModelEq(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; + state.dataSurface->SurfOutConvHnModelEq(SurfNum) = + state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUnstableHorizEqNum; if (state.dataSurface->SurfOutConvHnModelEq(SurfNum) == HcExt_UserCurve) { state.dataSurface->SurfOutConvHfUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->OutsideFaceAdaptiveConvectionAlgo.HNatUstableHorizUserCurveNum; @@ -5961,7 +5990,8 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum auto const SELECT_CASE_var(state.dataSurface->SurfIntConvClassification(SurfNum)); if (SELECT_CASE_var == InConvClass_A1_VertWalls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolVertWallUserCurveNum; @@ -6009,91 +6039,106 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A1_Windows) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.FloorHeatCeilingCoolWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_VertWallsNonHeated) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_HeatedVerticalWall) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatHeatedWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_StableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_UnstableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_StableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_UnstableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A2_Windows) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.WallPanelHeatWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_VertWalls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_StableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_UnstableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_StableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_UnstableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_A3_Windows) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.SimpleBouyWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_VertWalls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallUserCurveNum; @@ -6106,31 +6151,36 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatVertWallNearHeaterUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_StableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_UnstableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_StableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_UnstableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_B_Windows) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ConvectiveHeatWindowsUserCurveNum; @@ -6142,14 +6192,16 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum // no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_FisherPedersenCeilDiffuserWalls; } else { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallEqNum; } if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_C_Ceiling) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirCeilingUserCurveNum; @@ -6161,7 +6213,8 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum // no perimeter, Goldstein Novolselac model not good so revert to fisher pedersen model state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_FisherPedersenCeilDiffuserFloor; } else { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirFloorEqNum; } if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = @@ -6174,80 +6227,93 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum // no perimeter, Goldstein Novolselac model not good so revert to ISO15099 state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_ISO15099Windows; } else { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsEqNum; } if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.CentralAirWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_Walls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircVertWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_StableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_UnstableHoriz) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableHorizUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_StableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircStableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_UnstableTilted) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircUnstableTiltedUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_D_Windows) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.ZoneFanCircWindowsUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_AssistFlowWalls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyAssistingFlowWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_OpposFlowWalls) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedBouyOppossingFlowWallUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_StableFloor) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_UnstableFloor) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableFloorUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_StableCeiling) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedStableCeilingUserCurveNum; } } else if (SELECT_CASE_var == InConvClass_E_UnstableCieling) { - state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum; + state.dataSurface->SurfIntConvHcModelEq(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedUnstableCeilingUserCurveNum; @@ -6255,7 +6321,8 @@ void MapIntConvClassificationToHcModels(EnergyPlusData &state, int const SurfNum } else if (SELECT_CASE_var == InConvClass_E_Windows) { state.dataSurface->SurfIntConvHcModelEq(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsEqNum; if (state.dataSurface->SurfIntConvHcModelEq(SurfNum) == HcInt_UserCurve) { - state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsUserCurveNum; + state.dataSurface->SurfIntConvHcUserCurveIndex(SurfNum) = + state.dataConvectionCoefficient->InsideFaceAdaptiveConvectionAlgo.MixedWindowsUserCurveNum; } } } @@ -6362,7 +6429,8 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int UserCurve.HcFnTempDiffDivHeightCurveNum, (std::abs(state.dataHeatBalSurf->TH(2, 1, SurfNum) - tmpAirTemp) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum))); HcFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { - return CurveValue(state, UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum)); + return CurveValue( + state, UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / state.dataSurface->SurfIntConvZoneWallHeight(SurfNum)); }; } @@ -6371,7 +6439,8 @@ void CalcUserDefinedInsideHcModel(EnergyPlusData &state, int const SurfNum, int } if (UserCurve.HcFnACHDivPerimLengthCurveNum > 0) { - HcFnACHDivPerimLength = CurveValue(state, UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / state.dataSurface->SurfIntConvZonePerimLength(SurfNum))); + HcFnACHDivPerimLength = + CurveValue(state, UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / state.dataSurface->SurfIntConvZonePerimLength(SurfNum))); } if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { @@ -6445,8 +6514,9 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int } if (UserCurve.HnFnTempDiffCurveNum > 0) { - HnFnTempDiff = - CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))); + HnFnTempDiff = CurveValue(state, + UserCurve.HnFnTempDiffCurveNum, + std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))); HnFnTempDiffFn = [&](double Tsurf, double Tamb, double, double, double) -> double { return CurveValue(state, UserCurve.HnFnTempDiffCurveNum, std::abs(Tsurf - Tamb)); }; @@ -6454,12 +6524,14 @@ void CalcUserDefinedOutsideHcModel(EnergyPlusData &state, int const SurfNum, int if (UserCurve.HnFnTempDiffDivHeightCurveNum > 0) { if (state.dataSurface->SurfOutConvFaceHeight(SurfNum) > 0.0) { - HnFnTempDiffDivHeight = CurveValue( - state, - UserCurve.HnFnTempDiffDivHeightCurveNum, - ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); + HnFnTempDiffDivHeight = + CurveValue(state, + UserCurve.HnFnTempDiffDivHeightCurveNum, + ((std::abs(state.dataHeatBalSurf->TH(1, 1, SurfNum) - state.dataSurface->SurfOutDryBulbTemp(SurfNum))) / + state.dataSurface->SurfOutConvFaceHeight(SurfNum))); HnFnTempDiffDivHeightFn = [=, &state](double Tsurf, double Tamb, double, double, double) -> double { - return CurveValue(state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); + return CurveValue( + state, UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / state.dataSurface->SurfOutConvFaceHeight(SurfNum))); }; } } diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index d3ef89b386d..d3baa34370f 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -636,8 +636,6 @@ namespace DataSurfaces { // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.) int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface - bool ShadowSurfSchedVaries; // true if the scheduling (transmittance) on a shading surface varies. - bool ShadowingSurf; // True if a surface is a shadowing surface bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0) Real64 SchedMinValue; // Schedule minimum value. @@ -679,14 +677,11 @@ namespace DataSurfaces { HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), - MirroredSurf(false), + MirroredSurf(false), SchedShadowSurfIndex(0), - SchedShadowSurfIndex(0), ShadowSurfSchedVaries(false), ShadowingSurf(false), IsTransparent(false), SchedMinValue(0.0), + IsTransparent(false), SchedMinValue(0.0), ShadowSurfDiffuseSolRefl(0.0), ShadowSurfDiffuseVisRefl(0.0), ShadowSurfGlazingFrac(0.0), ShadowSurfGlazingConstruct(0), - - MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), MovInsulIntPresent(false), - MovInsulIntPresentPrevTS(false), - + MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { @@ -1311,6 +1306,7 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIsPool; // true if this is a pool Array1D SurfICSPtr; // Index to ICS collector Array1D SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group + Array1D SurfIsShadowing; // True if a surface is a shadowing surface // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature @@ -1687,6 +1683,7 @@ struct SurfacesData : BaseGlobalStruct this->SurfIsPool.deallocate(); this->SurfICSPtr.deallocate(); this->SurfIsRadSurfOrVentSlabOrPool.deallocate(); + this->SurfIsShadowing.deallocate(); this->SurfGenericContam.deallocate(); this->SurfIntConvCoeff.deallocate(); this->SurfExtConvCoeff.deallocate(); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index e27d6d8d72a..41aa1ad3091 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -3145,8 +3145,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [&state, &GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { - // todo - how to find index of object objArr - int ObsSurfNum = surface.Index; + int const ObsSurfNum = surface.Index; if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { PierceSurface(surface, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface return hitObs; // Ray pierces surface @@ -3406,7 +3405,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( NearestHitSurfNumX = NearestHitSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->Surface(NearestHitSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(NearestHitSurfNum)) { if (dot(Ray, state.dataSurface->Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || @@ -3719,7 +3718,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( ReflSurfNumX = ReflSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { if (dot(RAYCOS, state.dataSurface->Surface(ReflSurfNum).OutNormVec) < 0.0) ReflSurfNumX = ReflSurfNum + 1; } // Require that the surface can have specular reflection @@ -3801,7 +3800,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( SpecReflectance = POLYF(std::abs(CosIncAngRefl), state.dataConstruction->Construct(ConstrNumRefl).ReflSolBeamFrontCoef); } - if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf && + if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct > 0) SpecReflectance = state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac * @@ -5884,7 +5883,7 @@ void DayltgHitObstruction(EnergyPlusData &state, ObTrans = 0.0; break; } - } else if (surface.ShadowingSurf) { + } else if (state.dataSurface->SurfIsShadowing(ISurf)) { PierceSurface(state, ISurf, R1, RN, DayltgHitObstructionHP, hit); if (hit) { // Shading surface is hit // Get solar transmittance of the shading surface @@ -5906,7 +5905,7 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { - int ObsSurfNum = surface.Index; + int const ObsSurfNum = surface.Index; if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { @@ -5915,7 +5914,7 @@ void DayltgHitObstruction(EnergyPlusData &state, ObTrans = 0.0; return true; } - } else if (surface.ShadowingSurf) { + } else if (state.dataSurface->SurfIsShadowing(ObsSurfNum)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); if (hit) { // Shading surface is hit // Get solar transmittance of the shading surface @@ -5980,7 +5979,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((surface.ShadowingSurf) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Wall/ceiling/floor is in same zone as window (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf) && (ISurf != window_base_iExtBoundCond))) // Exclude window's base or base-adjacent surfaces @@ -5999,7 +5998,8 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - if ((surface.ShadowingSurf) || // Shadowing surface + int const ISurf = surface.Index; + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window_base_p) && (&surface != window_base_adjacent_p))) // Exclude window's base or base-adjacent surfaces @@ -6073,7 +6073,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((surface.ShadowingSurf) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Wall/ceiling/floor is in same zone as windows (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (ISurf != window1_iBaseSurf) && (ISurf != window2_iBaseSurf) && // Exclude windows' base surfaces @@ -6098,7 +6098,8 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - if ((surface.ShadowingSurf) || // Shadowing surface + int const ISurf = surface.Index; + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window1_base_p) && (&surface != window2_base_p) && // Exclude windows' base surfaces @@ -7909,7 +7910,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, NearestHitSurfNumX = NearestHitSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->Surface(NearestHitSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(NearestHitSurfNum)) { if (dot(U, state.dataSurface->Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || @@ -9257,7 +9258,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &state, &RecPt, &RayVec, &hit, &NearestHitDistance_sq, &nearestHitSurface, &NearestHitPt](SurfaceData const &surface) { - int ObsSurfNum = surface.Index; + int const ObsSurfNum = surface.Index; if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(surface, RecPt, RayVec, state.dataDaylightingManager->HitPt, hit); // Check if ray pierces surface @@ -9331,7 +9332,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, if (state.dataSurface->SurfDaylightingShelfInd(ReflSurfNum) > 0) return; // Normal to reflecting surface in hemisphere containing window element DayltgSurfaceLumFromSunReflNorm = state.dataSurface->Surface(ReflSurfNum).OutNormVec; - if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { if (dot(DayltgSurfaceLumFromSunReflNorm, Ray) > 0.0) { DayltgSurfaceLumFromSunReflNorm *= -1.0; } @@ -9353,7 +9354,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, if (hitObs) return; // Obstruction was hit, blocking sun // Obstruction was not hit; sun reaches ReflHitPt. // Calculate luminance at ReflHitPt due to beam solar reflection (for unit beam normal illuminance) - if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { DiffVisRefl = state.dataSurface->Surface(ReflSurfNum).ShadowSurfDiffuseVisRefl; // Note that if the shadowing surface has a non-zero glazing fraction (e.g., neighboring bldg) that the above is // (1 - glazing fraction) * (vis refl of opaque part of shadowing surface); specular reflection is diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index ef77e240f24..6c5ee5d5cdc 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -223,6 +223,7 @@ namespace HeatBalanceManager { ObjexxFCL::Optional_int_const()); // EMS calling point // These Inits will still have to be looked at as the routines are re-engineered further + InitHeatBalance(state); // Initialize all heat balance related parameters ManageEMS( state, EMSManager::EMSCallFrom::BeginZoneTimestepAfterInitHeatBalance, anyRan, ObjexxFCL::Optional_int_const()); // EMS calling point diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 3e05303a520..9b3e2c46f2e 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -4589,7 +4589,7 @@ void InitEMSControlledConstructions(EnergyPlusData &state) Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); state.dataConstruction->Construct(Surface(SurfNum).Construction).IsUsed = true; - state.dataSurface->SurfActiveConstruction(SurfNum) = ConstrNum; + state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum);; } else { // have not checked yet or is not okay, so see if we need to warn about incompatible if (!state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index e9a274f2a61..817f3032442 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -701,9 +701,9 @@ namespace SolarReflectionManager { // according to the the right hand rule. If user inputs do not follow the rule, use the following // code to check the mirrored shading surface if (state.dataSolarReflectionManager->HitPtSurfNum > 0) { - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPtSurfNum)) { if (state.dataSolarReflectionManager->HitPtSurfNum + 1 < state.dataSurface->TotSurfaces) { - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum + 1).ShadowingSurf && + if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPtSurfNum + 1) && state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum + 1).MirroredSurf) { // Check whether the sun is behind the mirrored shading surface state.dataSolarReflectionManager->CosIncBmAtHitPt2 = @@ -929,7 +929,7 @@ namespace SolarReflectionManager { // Keep windows; keep shading surfaces with specular reflectance if ((state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataSurface->Surface(ReflSurfNum).ExtSolar) || (state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac > 0.0 && - state.dataSurface->Surface(ReflSurfNum).ShadowingSurf)) { + state.dataSurface->SurfIsShadowing(ReflSurfNum))) { // Skip if window and not sunlit if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataHeatBal->SunlitFrac(1, iHour, ReflSurfNum) < 0.01) @@ -1041,7 +1041,7 @@ namespace SolarReflectionManager { std::abs(state.dataSolarReflectionManager->CosIncAngRefl), state.dataConstruction->Construct(state.dataSolarReflectionManager->ConstrNumRefl).ReflSolBeamFrontCoef); } - if (state.dataSurface->Surface(ReflSurfNum).ShadowingSurf && + if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct > 0) { state.dataSolarReflectionManager->ConstrNumRefl = state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct; @@ -1173,7 +1173,7 @@ namespace SolarReflectionManager { // Each shading surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shading surface in order to get the right value // of DifShdgRatioIsoSky (the two sides can have different sky shadowing). - if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPntSurfNum)) { if (dot(state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->iRecSurfNum) .RayVec(state.dataSolarReflectionManager->iRayNum), state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).OutNormVec) > 0.0) { @@ -1234,7 +1234,7 @@ namespace SolarReflectionManager { continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; - if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).ShadowingSurf) { + if (!state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->iObsSurfNum)) { if (dot(state.dataSolarReflectionManager->URay, state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).OutNormVec) >= 0.0) continue; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 6313af9ab14..e840b2f9bbf 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -4960,7 +4960,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const state.dataSolarShading->SUNCOS(2) = state.dataSolarShading->cos_Phi[IPhi] * state.dataSolarShading->sin_Theta[ITheta]; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->Surface(SurfNum).ShadowingSurf && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; + if (!state.dataSurface->SurfIsShadowing(SurfNum) && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; state.dataSolarShading->CTHETA(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); @@ -4970,7 +4970,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->Surface(SurfNum).ShadowingSurf && + if (!state.dataSurface->SurfIsShadowing(SurfNum) && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -4998,7 +4998,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->Surface(SurfNum).ShadowingSurf && + if (!state.dataSurface->SurfIsShadowing(SurfNum) && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -5124,7 +5124,7 @@ void DetermineShadowingCombinations(EnergyPlusData &state) for (GRSNR = 1; GRSNR <= state.dataSurface->TotSurfaces; ++GRSNR) { // Loop through all surfaces (looking for potential receiving surfaces)... - ShadowingSurf = state.dataSurface->Surface(GRSNR).ShadowingSurf; + ShadowingSurf = state.dataSurface->SurfIsShadowing(GRSNR); NGSS = 0; NSBS = 0; NBKS = 0; @@ -5614,7 +5614,7 @@ void SHADOW(EnergyPlusData &state, { #endif NGRS = state.dataSurface->Surface(GRSNR).BaseSurf; - if (state.dataSurface->Surface(GRSNR).ShadowingSurf) NGRS = GRSNR; + if (state.dataSurface->SurfIsShadowing(GRSNR)) NGRS = GRSNR; // Compute the X and Y displacements of a shadow. XS = state.dataSurface->Surface(NGRS).lcsx.x * state.dataSolarShading->SUNCOS(1) + @@ -10314,7 +10314,7 @@ void SkyDifSolarShading(EnergyPlusData &state) for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Cosine of angle of incidence on surface of solar // radiation from patch - ShadowingSurf = state.dataSurface->Surface(SurfNum).ShadowingSurf; + ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); if (!ShadowingSurf && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; @@ -10326,7 +10326,7 @@ void SkyDifSolarShading(EnergyPlusData &state) SHADOW(state, 24, 0); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ShadowingSurf = state.dataSurface->Surface(SurfNum).ShadowingSurf; + ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -10353,7 +10353,7 @@ void SkyDifSolarShading(EnergyPlusData &state) } // End of Phi loop for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ShadowingSurf = state.dataSurface->Surface(SurfNum).ShadowingSurf; + ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 9005f4a134d..d5475df01dd 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -376,11 +376,11 @@ namespace SurfaceGeometry { state.dataSurface->SurfAirSkyRadSplit(SurfNum) = std::sqrt(0.5 * (1.0 + state.dataSurface->Surface(SurfNum).CosTilt)); // Set flag that determines whether a surface is a shadowing surface - state.dataSurface->Surface(SurfNum).ShadowingSurf = false; + state.dataSurface->SurfIsShadowing(SurfNum) = false; if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Shading || state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_F || state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_B) { - state.dataSurface->Surface(SurfNum).ShadowingSurf = true; + state.dataSurface->SurfIsShadowing(SurfNum) = true; if (state.dataSurface->ShadingSurfaceFirst == -1) state.dataSurface->ShadingSurfaceFirst = SurfNum; state.dataSurface->ShadingSurfaceLast = SurfNum; } @@ -949,6 +949,7 @@ namespace SurfaceGeometry { state.dataSurface->SurfICSPtr.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIsShadowing.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; @@ -967,6 +968,7 @@ namespace SurfaceGeometry { state.dataSurface->SurfICSPtr(SurfNum) = 0; state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(SurfNum) = false; state.dataSurface->SurfDaylightingShelfInd(SurfNum) = 0; + state.dataSurface->SurfIsShadowing(SurfNum) = false; } state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); @@ -3232,7 +3234,6 @@ namespace SurfaceGeometry { ShowContinueError(state, "...Schedule values > 1 have no meaning for shading elements."); } if (std::abs(SchedMinValue - SchedMaxValue) > 1.0e-6) { - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfSchedVaries = true; state.dataSurface->ShadingTransmittanceVaries = true; } } @@ -6249,7 +6250,6 @@ namespace SurfaceGeometry { ShowContinueError(state, "...Schedule values > 1 have no meaning for shading elements."); } if (std::abs(SchedMinValue - SchedMaxValue) > 1.0e-6) { - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfSchedVaries = true; state.dataSurface->ShadingTransmittanceVaries = true; } } @@ -9089,11 +9089,8 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).ViewFactorGroundIR = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ViewFactorGroundIR; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).ViewFactorSkyIR = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ViewFactorSkyIR; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedShadowSurfIndex = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedShadowSurfIndex; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).ShadowSurfSchedVaries = - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfSchedVaries; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedMinValue = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMinValue; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).IsTransparent = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).IsTransparent; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).ShadowingSurf = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowingSurf; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).MaterialMovInsulExt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).MaterialMovInsulInt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedMovInsulExt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulExt; @@ -12442,7 +12439,7 @@ namespace SurfaceGeometry { HeatTransSurf = state.dataSurface->Surface(ThisSurf).HeatTransSurf; // Kludge for daylighting shelves - if (state.dataSurface->Surface(ThisSurf).ShadowingSurf) { + if (state.dataSurface->SurfIsShadowing(ThisSurf)) { ThisBaseSurface = ThisSurf; HeatTransSurf = true; } @@ -13694,8 +13691,6 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).OSCPtr = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).OSCPtr; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).SchedShadowSurfIndex = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedShadowSurfIndex; - state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).ShadowSurfSchedVaries = - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfSchedVaries; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).MaterialMovInsulExt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).MaterialMovInsulInt = From cb8ccff1362d6eeb7c563ae6075e771d83f5415c Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 11 May 2021 15:58:30 -0700 Subject: [PATCH 10/25] shadowing surface --- src/EnergyPlus/DataSurfaces.hh | 51 +++++---- src/EnergyPlus/DaylightingManager.cc | 78 ++++++------- src/EnergyPlus/OutputReports.cc | 2 +- src/EnergyPlus/SolarReflectionManager.cc | 30 ++--- src/EnergyPlus/SolarShading.cc | 6 +- src/EnergyPlus/SurfaceGeometry.cc | 118 +++++++++++--------- tst/EnergyPlus/unit/SolarShading.unit.cc | 4 +- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 3 + 8 files changed, 153 insertions(+), 139 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index d3baa34370f..1bcdcd08dbf 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -635,15 +635,9 @@ namespace DataSurfaces { bool MirroredSurf; // True if it is a mirrored surface // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.) - int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface - bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0) - Real64 SchedMinValue; // Schedule minimum value. - - // Optional parameters specific to solar reflection from surfaces - Real64 ShadowSurfDiffuseSolRefl; // Diffuse solar reflectance of opaque portion - Real64 ShadowSurfDiffuseVisRefl; // Diffuse visible reflectance of opaque portion - Real64 ShadowSurfGlazingFrac; // Glazing fraction - int ShadowSurfGlazingConstruct; // Glazing construction number + int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface + bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0) + Real64 SchedMinValue; // Schedule minimum value. int MaterialMovInsulExt; // Pointer to the material used for exterior movable insulation int MaterialMovInsulInt; // Pointer to the material used for interior movable insulation @@ -677,13 +671,9 @@ namespace DataSurfaces { HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), - MirroredSurf(false), SchedShadowSurfIndex(0), - - IsTransparent(false), SchedMinValue(0.0), - ShadowSurfDiffuseSolRefl(0.0), ShadowSurfDiffuseVisRefl(0.0), ShadowSurfGlazingFrac(0.0), ShadowSurfGlazingConstruct(0), - MaterialMovInsulExt(0), MaterialMovInsulInt(0), SchedMovInsulExt(0), SchedMovInsulInt(0), - activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), - SolarEnclSurfIndex(0), IsAirBoundarySurf(false) + MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), MaterialMovInsulExt(0), MaterialMovInsulInt(0), + SchedMovInsulExt(0), SchedMovInsulInt(0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), + FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { } @@ -1270,6 +1260,16 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfReflFacSkySolGnd; Array2D SurfCosIncAveBmToBmSolObs; + // Optional parameters specific to solar reflection from surfaces + Array1D SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion + Array1D SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion + Array1D SurfShadowGlazingFrac; // Glazing fraction + Array1D SurfShadowGlazingConstruct; // Glazing construction number + Array1D SurfShadowPossibleObstruction; // True if a surface can be an exterior obstruction + Array1D SurfShadowRecSurfNum; // Receiving surface number + Array1D> + SurfShadowDisabledZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model + // Surface EMS Array1D SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value Array1D SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden @@ -1331,12 +1331,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIntConvSurfGetsRadiantHeat; Array1D SurfIntConvSurfHasActiveInIt; - // Surface Shadow Properties - Array1D SurfShadowSurfPossibleObstruction; // True if a surface can be an exterior obstruction - Array1D SurfShadowSurfRecSurfNum; // Receiving surface number - Array1D> - SurfDisabledShadowingZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model - // Surface Window Heat Balance Array2D SurfWinA; // Time step value of factor for beam absorbed in window glass layers Array2D SurfWinADiffFront; // Time step value of factor for diffuse absorbed in window layers @@ -1446,7 +1440,7 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfWinStormWinFlagPrevDay; // Previous time step value of StormWinFlag Array1D SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0 // if no shading device or shading device is off = 1.0 if shading device is on; - // For time intervals longer than a time step, = fraction of time that shading device is on. + // For time intervals longer than a time step, = fraction of time that shading device is on. EPVector SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step; // 0 otherwise Array1D SurfWinHasShadeOrBlindLayer; // mark as true if the window construction has a shade or a blind layer @@ -1664,9 +1658,14 @@ struct SurfacesData : BaseGlobalStruct this->SurfLowTempErrCount.deallocate(); this->SurfHighTempErrCount.deallocate(); - this->SurfShadowSurfPossibleObstruction.deallocate(); - this->SurfShadowSurfRecSurfNum.deallocate(); - this->SurfDisabledShadowingZoneList.deallocate(); + this->SurfShadowDiffuseSolRefl.deallocate(); + this->SurfShadowDiffuseVisRefl.deallocate(); + this->SurfShadowGlazingFrac.deallocate(); + this->SurfShadowGlazingConstruct.deallocate(); + this->SurfShadowPossibleObstruction.deallocate(); + this->SurfShadowRecSurfNum.deallocate(); + this->SurfShadowDisabledZoneList.deallocate(); + this->SurfDaylightingShelfInd.deallocate(); this->SurfSchedExternalShadingFrac.deallocate(); this->SurfExternalShadingSchInd.deallocate(); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 41aa1ad3091..002213f89e3 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -518,7 +518,8 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->PHSUNHR(IHR) = state.dataDaylightingManager->PHSUN; state.dataDaylightingManager->SPHSUNHR(IHR) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(IHR) = std::cos(state.dataDaylightingManager->PHSUN); - state.dataDaylightingManager->THSUNHR(IHR) = std::atan2(state.dataSurface->SurfSunCosHourly(IHR, 2), state.dataSurface->SurfSunCosHourly(IHR, 1)); + state.dataDaylightingManager->THSUNHR(IHR) = + std::atan2(state.dataSurface->SurfSunCosHourly(IHR, 2), state.dataSurface->SurfSunCosHourly(IHR, 1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(IHR); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(IHR); @@ -545,7 +546,8 @@ void CalcDayltgCoefficients(EnergyPlusData &state) state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay) = std::sin(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->CPHSUNHR(state.dataGlobal->HourOfDay) = std::cos(state.dataDaylightingManager->PHSUN); state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay) = - std::atan2(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 2), state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 1)); + std::atan2(state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 2), + state.dataSurface->SurfSunCosHourly(state.dataGlobal->HourOfDay, 1)); // Get exterior horizontal illuminance from sky and sun state.dataDaylightingManager->THSUN = state.dataDaylightingManager->THSUNHR(state.dataGlobal->HourOfDay); state.dataDaylightingManager->SPHSUN = state.dataDaylightingManager->SPHSUNHR(state.dataGlobal->HourOfDay); @@ -1758,8 +1760,8 @@ void FigureDayltgCoeffsAtPointsSetupForWindow( ShelfNum = state.dataSurface->SurfDaylightingShelfInd(IWin); if (ShelfNum > 0) { - InShelfSurf = - state.dataDaylightingDevicesData->Shelf(state.dataSurface->SurfDaylightingShelfInd(IWin)).InSurf; // Inside daylighting shelf present if > 0 + InShelfSurf = state.dataDaylightingDevicesData->Shelf(state.dataSurface->SurfDaylightingShelfInd(IWin)) + .InSurf; // Inside daylighting shelf present if > 0 } else { InShelfSurf = 0; } @@ -3135,7 +3137,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { PierceSurface(state, ObsSurfNum, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface if (hitObs) break; } @@ -3146,7 +3148,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [&state, &GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { int const ObsSurfNum = surface.Index; - if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { PierceSurface(surface, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface return hitObs; // Ray pierces surface } else { @@ -3395,10 +3397,10 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // This is a daylighting shelf, for which reflection is separately calculated ObsVisRefl = 0.0; } else { - ObsVisRefl = state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfDiffuseVisRefl; - if (state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingConstruct > 0) - ObsVisRefl += state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingFrac * - state.dataConstruction->Construct(state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingConstruct) + ObsVisRefl = state.dataSurface->SurfShadowDiffuseVisRefl(NearestHitSurfNum); + if (state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum) > 0) + ObsVisRefl += state.dataSurface->SurfShadowGlazingFrac(NearestHitSurfNum) * + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum)) .ReflectVisDiffFront; } } @@ -3501,7 +3503,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; PierceSurface(state, ObsSurfNum, GroundHitPt, SUNCOS_iHour, ObsHitPt, hitObs); if (hitObs) break; } @@ -3708,7 +3710,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( if (state.dataSurface->CalcSolRefl) { // Receiving surface number corresponding this window - RecSurfNum = state.dataSurface->SurfShadowSurfRecSurfNum(IWin2); + RecSurfNum = state.dataSurface->SurfShadowRecSurfNum(IWin2); if (RecSurfNum > 0) { // interior windows do not apply if (state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).NumPossibleObs > 0) { // This window has associated obstructions that could reflect beam onto the window @@ -3723,7 +3725,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } // Require that the surface can have specular reflection if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window || - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac > 0.0) { + state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) > 0.0) { ReflNorm = state.dataSurface->Surface(ReflSurfNumX).OutNormVec; // Vector to sun that is mirrored in obstruction SunVecMir = RAYCOS - 2.0 * dot(RAYCOS, ReflNorm) * ReflNorm; @@ -3768,7 +3770,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window) { // Reflecting surface is a window. // Receiving surface number for this reflecting window. - ReflSurfRecNum = state.dataSurface->SurfShadowSurfRecSurfNum(ReflSurfNum); + ReflSurfRecNum = state.dataSurface->SurfShadowRecSurfNum(ReflSurfNum); if (ReflSurfRecNum > 0) { // Loop over possible obstructions for this reflecting window for (int loop2 = 1, loop2_end = state.dataSolarReflectionManager->SolReflRecSurf(ReflSurfRecNum).NumPossibleObs; @@ -3783,7 +3785,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; if (ObsSurfNum == ReflSurfNum) continue; PierceSurface(state, ObsSurfNum, HitPtRefl, RAYCOS, HitPtObs, hitObs); if (hitObs) break; @@ -3800,12 +3802,11 @@ void FigureDayltgCoeffsAtPointsForSunPosition( SpecReflectance = POLYF(std::abs(CosIncAngRefl), state.dataConstruction->Construct(ConstrNumRefl).ReflSolBeamFrontCoef); } - if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct > 0) + if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) SpecReflectance = - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac * + state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) * POLYF(std::abs(CosIncAngRefl), - state.dataConstruction->Construct(state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct) + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum)) .ReflSolBeamFrontCoef); TVisRefl = POLYF(CosIncAngRec, state.dataConstruction->Construct(IConst).TransVisBeamCoef) * state.dataSurface->SurfWinGlazedFrac(IWin) * state.dataSurface->SurfWinLightWellEff(IWin); @@ -5875,7 +5876,7 @@ void DayltgHitObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ISurf)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ISurf)) continue; IType = surface.Class; if ((IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf)) { PierceSurface(state, ISurf, R1, RN, DayltgHitObstructionHP, hit); @@ -5906,7 +5907,8 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { int const ObsSurfNum = surface.Index; - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) + return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); @@ -5979,7 +5981,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Wall/ceiling/floor is in same zone as window (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf) && (ISurf != window_base_iExtBoundCond))) // Exclude window's base or base-adjacent surfaces @@ -5999,7 +6001,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); int const ISurf = surface.Index; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window_base_p) && (&surface != window_base_adjacent_p))) // Exclude window's base or base-adjacent surfaces @@ -6073,7 +6075,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Wall/ceiling/floor is in same zone as windows (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (ISurf != window1_iBaseSurf) && (ISurf != window2_iBaseSurf) && // Exclude windows' base surfaces @@ -6099,7 +6101,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); int const ISurf = surface.Index; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window1_base_p) && (&surface != window2_base_p) && // Exclude windows' base surfaces @@ -7857,7 +7859,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; PierceSurface(state, ObsSurfNum, DayltgInterReflectedIllumGroundHitPt, SUNCOS_IHR, DayltgInterReflectedIllumObsHitPt, hitObs); if (hitObs) break; } @@ -7897,12 +7899,11 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // Skip daylighting shelves, whose reflection is separately calculated ObsVisRefl = 0.0; } else { - ObsVisRefl = state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfDiffuseVisRefl; - if (state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingConstruct > 0) - ObsVisRefl += - state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingFrac * - state.dataConstruction->Construct(state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfGlazingConstruct) - .ReflectVisDiffFront; + ObsVisRefl = state.dataSurface->SurfShadowDiffuseVisRefl(NearestHitSurfNum); + if (state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum) > 0) + ObsVisRefl += state.dataSurface->SurfShadowGlazingFrac(NearestHitSurfNum) * + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum)) + .ReflectVisDiffFront; // Note in the above that ShadowSurfDiffuseVisRefl is the reflectance of opaque part of // shadowing surface times (1 - ShadowSurfGlazingFrac) } @@ -8287,7 +8288,8 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // TH 7/7/2010 moved from inside the loop: DO JB = 1,MaxSlatAngs if (BlindOn) - ProfileAngle(state, IWin, state.dataSurface->SurfSunCosHourly(IHR, {1, 3}), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); + ProfileAngle( + state, IWin, state.dataSurface->SurfSunCosHourly(IHR, {1, 3}), state.dataHeatBal->Blind(BlNum).SlatOrientation, ProfAng); for (JB = 1; JB <= MaxSlatAngs; ++JB) { if (!state.dataSurface->SurfWinMovableSlats(IWin) && JB > 1) break; @@ -8625,7 +8627,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; if (CalledFrom == DataDaylighting::iCalledFor::RefPoint) { ComplexFenestrationLuminancesGroundHitPt(1) = state.dataBSDFWindow->ComplexWind(IWin).DaylghtGeom(CurCplxFenState).RefPoint(iRefPoint).GndPt(iGndElem, WinEl).x; @@ -9229,7 +9231,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(state, ObsSurfNum, RecPt, RayVec, HitPt, hit); if (hit) { // Ray pierces surface @@ -9259,7 +9261,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &state, &RecPt, &RayVec, &hit, &NearestHitDistance_sq, &nearestHitSurface, &NearestHitPt](SurfaceData const &surface) { int const ObsSurfNum = surface.Index; - if (state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(surface, RecPt, RayVec, state.dataDaylightingManager->HitPt, hit); // Check if ray pierces surface if (hit) { // Ray pierces surface @@ -9345,7 +9347,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, // Sun reaches ReflHitPt if vector from ReflHitPt to sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; // Exclude as a possible obstructor ReflSurfNum and its base surface (if it has one) if (ObsSurfNum == ReflSurfNum || ObsSurfNum == state.dataSurface->Surface(ReflSurfNum).BaseSurf) continue; PierceSurface(state, ObsSurfNum, ReflHitPt, SUNCOS_IHR, DayltgSurfaceLumFromSunObsHitPt, hitObs); @@ -9355,7 +9357,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, // Obstruction was not hit; sun reaches ReflHitPt. // Calculate luminance at ReflHitPt due to beam solar reflection (for unit beam normal illuminance) if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { - DiffVisRefl = state.dataSurface->Surface(ReflSurfNum).ShadowSurfDiffuseVisRefl; + DiffVisRefl = state.dataSurface->SurfShadowDiffuseVisRefl(ReflSurfNum); // Note that if the shadowing surface has a non-zero glazing fraction (e.g., neighboring bldg) that the above is // (1 - glazing fraction) * (vis refl of opaque part of shadowing surface); specular reflection is // excluded in this value of DiffVisRefl. diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index 201e708be6f..ad91314346f 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -1051,7 +1051,7 @@ void DXFOutLines(EnergyPlusData &state, std::string const &ColorScheme) if (state.dataSurface->Surface(surf).Class != SurfaceClass::Shading) continue; if (state.dataSurface->Surface(surf).ZoneName != state.dataHeatBal->Zone(zones).Name) continue; colorindex = ColorNo::ShdAtt; - if (state.dataSurface-SurfIsPV(surf)) colorindex = ColorNo::PV; + if (state.dataSurface->SurfIsPV(surf)) colorindex = ColorNo::PV; ++surfcount; print(dxffile, Format_710, state.dataSurface->Surface(surf).ZoneName + ':' + state.dataSurface->Surface(surf).Name); diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 817f3032442..0a38dc7c713 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -236,12 +236,12 @@ namespace SolarReflectionManager { // Shading surfaces are always not exposed to solar (ExtSolar = False) RecSurfNum = 0; for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; + state.dataSurface->SurfShadowRecSurfNum(SurfNum) = 0; if (state.dataSurface->Surface(SurfNum).ExtSolar) { ++RecSurfNum; state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).SurfNum = SurfNum; state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).SurfName = state.dataSurface->Surface(SurfNum).Name; - state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = RecSurfNum; + state.dataSurface->SurfShadowRecSurfNum(SurfNum) = RecSurfNum; // Warning if any receiving surface vertex is below ground level, taken to be at Z = 0 in absolute coords for (loop = 1; loop <= state.dataSurface->Surface(SurfNum).Sides; ++loop) { @@ -528,7 +528,7 @@ namespace SolarReflectionManager { } else { // Shading surface is nearest hit state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).HitPtSolRefl(RayNum, RecPtNum) = - state.dataSurface->Surface(NearestHitSurfNum).ShadowSurfDiffuseSolRefl; + state.dataSurface->SurfShadowDiffuseSolRefl(NearestHitSurfNum); } } else { // No obstructions were hit by this ray @@ -814,8 +814,10 @@ namespace SolarReflectionManager { state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) += ReflBmToDiffSolGnd(state.dataSolarReflectionManager->RecPtNum); } - state.dataSurface->SurfReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; - state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) /= state.dataSolarReflectionManager->NumRecPts; + state.dataSurface->SurfReflFacBmToDiffSolObs(iHour, state.dataSolarReflectionManager->SurfNum) /= + state.dataSolarReflectionManager->NumRecPts; + state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) /= + state.dataSolarReflectionManager->NumRecPts; // Do not allow SurfReflFacBmToDiffSolGnd to exceed the surface's unobstructed ground view factor state.dataSurface->SurfReflFacBmToDiffSolGnd(iHour, state.dataSolarReflectionManager->SurfNum) = @@ -928,8 +930,7 @@ namespace SolarReflectionManager { state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop); // Reflecting surface number // Keep windows; keep shading surfaces with specular reflectance if ((state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataSurface->Surface(ReflSurfNum).ExtSolar) || - (state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac > 0.0 && - state.dataSurface->SurfIsShadowing(ReflSurfNum))) { + (state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) > 0.0 && state.dataSurface->SurfIsShadowing(ReflSurfNum))) { // Skip if window and not sunlit if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataHeatBal->SunlitFrac(1, iHour, ReflSurfNum) < 0.01) @@ -990,8 +991,8 @@ namespace SolarReflectionManager { hitObs = false; if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window) { // Reflecting surface is a window // Receiving surface number for this window - int const ReflSurfRecNum = - state.dataSurface->SurfShadowSurfRecSurfNum(ReflSurfNum); // Receiving surface number corresponding to a reflecting surface number + int const ReflSurfRecNum = state.dataSurface->SurfShadowRecSurfNum( + ReflSurfNum); // Receiving surface number corresponding to a reflecting surface number if (ReflSurfRecNum > 0) { // Loop over possible obstructions for this window for (int loop2 = 1, @@ -1011,7 +1012,7 @@ namespace SolarReflectionManager { } } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; if (ObsSurfNum == ReflSurfNum) continue; // TH2 CR8959 -- Skip mirrored surfaces @@ -1042,11 +1043,10 @@ namespace SolarReflectionManager { state.dataConstruction->Construct(state.dataSolarReflectionManager->ConstrNumRefl).ReflSolBeamFrontCoef); } if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct > 0) { - state.dataSolarReflectionManager->ConstrNumRefl = - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingConstruct; + state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) { + state.dataSolarReflectionManager->ConstrNumRefl = state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum); state.dataSolarReflectionManager->SpecReflectance = - state.dataSurface->Surface(ReflSurfNum).ShadowSurfGlazingFrac * + state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) * POLYF( std::abs(state.dataSolarReflectionManager->CosIncAngRefl), state.dataConstruction->Construct(state.dataSolarReflectionManager->ConstrNumRefl).ReflSolBeamFrontCoef); @@ -1230,7 +1230,7 @@ namespace SolarReflectionManager { for (state.dataSolarReflectionManager->iObsSurfNum = 1; state.dataSolarReflectionManager->iObsSurfNum <= state.dataSurface->TotSurfaces; ++state.dataSolarReflectionManager->iObsSurfNum) { - if (!state.dataSurface->SurfShadowSurfPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) + if (!state.dataSurface->SurfShadowPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 9aa4e28c85c..146409ad409 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -662,12 +662,12 @@ void GetShadowingInput(EnergyPlusData &state) if (SurfZoneGroup == CurZoneGroup && DisableSelfShadingWithinGroup) { for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { // Loop through all zones in the zone list - state.dataSurface->SurfDisabledShadowingZoneList(SurfNum).push_back( + state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); } } else if (SurfZoneGroup != CurZoneGroup && DisableSelfShadingBetweenGroup) { for (int ZoneNum = 1; ZoneNum <= state.dataHeatBal->ZoneList(CurZoneGroup).NumOfZones; ZoneNum++) { - state.dataSurface->SurfDisabledShadowingZoneList(SurfNum).push_back( + state.dataSurface->SurfShadowDisabledZoneList(SurfNum).push_back( state.dataHeatBal->ZoneList(CurZoneGroup).Zone(ZoneNum)); } } @@ -5889,7 +5889,7 @@ void SHDGSS(EnergyPlusData &state, continue; // Disable all shadowing surfaces in all zones. Attached shading surfaces are not part of a zone, zone value is 0. } } else if (state.dataSysVars->DisableGroupSelfShading) { - std::vector DisabledZones = state.dataSurface->SurfDisabledShadowingZoneList(CurSurf); + std::vector DisabledZones = state.dataSurface->SurfShadowDisabledZoneList(CurSurf); bool isDisabledShadowSurf = false; for (int i : DisabledZones) { if (surface.Zone == i) { diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index d5475df01dd..8e003f63d6f 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -931,9 +931,21 @@ namespace SurfaceGeometry { state.dataSurface->SurfAirSkyRadSplit(SurfNum) = 0.0; } // Following are surface property arrays used in SurfaceGeometry - state.dataSurface->SurfShadowSurfPossibleObstruction.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfShadowSurfRecSurfNum.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfDisabledShadowingZoneList.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowPossibleObstruction.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowRecSurfNum.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowDisabledZoneList.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowDiffuseSolRefl.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowDiffuseVisRefl.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowGlazingFrac.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfShadowGlazingConstruct.allocate(state.dataSurface->TotSurfaces); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { + state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = false; + state.dataSurface->SurfShadowRecSurfNum(SurfNum) = 0; + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = 0.0; + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = 0.0; + state.dataSurface->SurfShadowGlazingFrac(SurfNum) = 0.0; + state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = 0; + } state.dataSurface->SurfSchedExternalShadingFrac.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfExternalShadingSchInd.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHasSurroundingSurfProperties.allocate(state.dataSurface->TotSurfaces); @@ -951,8 +963,6 @@ namespace SurfaceGeometry { state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIsShadowing.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; - state.dataSurface->SurfShadowSurfRecSurfNum(SurfNum) = 0; state.dataSurface->SurfSchedExternalShadingFrac(SurfNum) = false; state.dataSurface->SurfExternalShadingSchInd(SurfNum) = 0; state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = false; @@ -1351,8 +1361,6 @@ namespace SurfaceGeometry { GetMovableInsulationData(state, ErrorsFound); - if (state.dataSurface->CalcSolRefl) GetShadingSurfReflectanceData(state, ErrorsFound); - state.dataSurface->TotSurfaces = NumSurfs + AddedSubSurfaces + NeedToAddSurfaces + NeedToAddSubSurfaces; if (ErrorsFound) { @@ -2524,6 +2532,8 @@ namespace SurfaceGeometry { SetupShadeSurfacesForSolarCalcs(state); // if shading surfaces are solar collectors or PV, then we need full solar calc. + if (state.dataSurface->CalcSolRefl) GetShadingSurfReflectanceData(state, ErrorsFound); + LayNumOutside = 0; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Check for EcoRoof and only 1 allowed to be used. @@ -2552,7 +2562,7 @@ namespace SurfaceGeometry { // Set flag that determines whether a surface can be an exterior obstruction // Also set associated surfaces for Kiva foundations and build heat transfer surface lists for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = false; + state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = false; if (state.dataSurface->Surface(SurfNum).HeatTransSurf) { state.dataSurface->AllHTSurfaceList.push_back(SurfNum); int const zoneNum(state.dataSurface->Surface(SurfNum).Zone); @@ -2605,7 +2615,7 @@ namespace SurfaceGeometry { // Exclude air boundary surfaces if (state.dataSurface->Surface(SurfNum).IsAirBoundarySurf) continue; - state.dataSurface->SurfShadowSurfPossibleObstruction(SurfNum) = true; + state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = true; } // Check for IRT surfaces in invalid places. @@ -7006,16 +7016,16 @@ namespace SurfaceGeometry { // For shading surfaces, initialize value of reflectance values to default values. These values // may be overridden below for shading surfaces with an associated Shading Surface Reflectance object. for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Shading || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_F || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_B || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Overhang || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Fin)) + if (!(state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Shading || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_F || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_B || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Overhang || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Fin)) continue; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseSolRefl = 0.2; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseVisRefl = 0.2; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingFrac = 0.0; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingConstruct = 0; + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = 0.2; + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = 0.2; + state.dataSurface->SurfShadowGlazingFrac(SurfNum) = 0.0; + state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = 0; } // Get the total number of Shading Surface Reflectance objects @@ -7038,8 +7048,8 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - SurfNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(1), state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); + SurfNum = + UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (SurfNum == 0) { ShowWarningError(state, cCurrentModuleObject + "=\"" + state.dataIPShortCut->cAlphaArgs(1) + "\", invalid specification"); ShowContinueError(state, @@ -7051,47 +7061,47 @@ namespace SurfaceGeometry { // Check that associated surface is a shading surface WrongSurfaceType = false; if (SurfNum != 0) { - if (!(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Shading || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_F || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_B || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Overhang || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Fin)) + if (!(state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Shading || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_F || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_B || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Overhang || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Fin)) WrongSurfaceType = true; if (WrongSurfaceType) { ShowSevereError(state, - "GetShadingSurfReflectanceData: " + cCurrentModuleObject + "=\"" + - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", surface is not a shading surface."); + "GetShadingSurfReflectanceData: " + cCurrentModuleObject + "=\"" + state.dataSurface->Surface(SurfNum).Name + + "\", surface is not a shading surface."); ErrorsFound = true; continue; } } // If associated surface is a shading surface, set reflectance values - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingFrac = state.dataIPShortCut->rNumericArgs(3); - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseSolRefl = + state.dataSurface->SurfShadowGlazingFrac(SurfNum) = state.dataIPShortCut->rNumericArgs(3); + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(1); - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseVisRefl = + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(2); if (state.dataIPShortCut->rNumericArgs(3) > 0.0) { GlConstrNum = UtilityRoutines::FindItemInList( state.dataIPShortCut->cAlphaArgs(2), state.dataConstruction->Construct, state.dataHeatBal->TotConstructs); if (GlConstrNum == 0) { ShowSevereError(state, - cCurrentModuleObject + "=\"" + state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name + "\", " + + cCurrentModuleObject + "=\"" + state.dataSurface->Surface(SurfNum).Name + "\", " + state.dataIPShortCut->cAlphaFieldNames(2) + " not found=" + state.dataIPShortCut->cAlphaArgs(2)); ErrorsFound = true; } else { state.dataConstruction->Construct(GlConstrNum).IsUsed = true; } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingConstruct = GlConstrNum; + state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = GlConstrNum; } SurfNum = UtilityRoutines::FindItemInList( - "Mir-" + state.dataIPShortCut->cAlphaArgs(1), state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); + "Mir-" + state.dataIPShortCut->cAlphaArgs(1), state.dataSurface->Surface, state.dataSurface->TotSurfaces); if (SurfNum == 0) continue; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingFrac = state.dataIPShortCut->rNumericArgs(3); - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseSolRefl = + state.dataSurface->SurfShadowGlazingFrac(SurfNum) = state.dataIPShortCut->rNumericArgs(3); + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(1); - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseVisRefl = + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = (1.0 - state.dataIPShortCut->rNumericArgs(3)) * state.dataIPShortCut->rNumericArgs(2); if (state.dataIPShortCut->rNumericArgs(3) > 0.0) { GlConstrNum = UtilityRoutines::FindItemInList( @@ -7099,7 +7109,7 @@ namespace SurfaceGeometry { if (GlConstrNum != 0) { state.dataConstruction->Construct(GlConstrNum).IsUsed = true; } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingConstruct = GlConstrNum; + state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = GlConstrNum; } } // End of loop over Shading Surface Reflectance objects @@ -7110,31 +7120,31 @@ namespace SurfaceGeometry { "Visible Reflectance,Surface Glazing Fraction,Surface Glazing Contruction\n"); for (SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Shading || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_F || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Detached_B || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Overhang || - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Fin)) + if (!(state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Shading || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_F || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_B || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Overhang || + state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Fin)) continue; constexpr auto fmt{"ShadingProperty Reflectance,{},{},{:.2R},{:.2R},{:.2R}, {}\n"}; - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingConstruct != 0) { + if (state.dataSurface->SurfShadowGlazingConstruct(SurfNum) != 0) { print(state.files.eio, fmt, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, - cSurfaceClass(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class), - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseSolRefl, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseVisRefl, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingFrac, - state.dataConstruction->Construct(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingConstruct).Name); + state.dataSurface->Surface(SurfNum).Name, + cSurfaceClass(state.dataSurface->Surface(SurfNum).Class), + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum), + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum), + state.dataSurface->SurfShadowGlazingFrac(SurfNum), + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(SurfNum)).Name); } else { print(state.files.eio, fmt, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Name, - cSurfaceClass(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class), - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseSolRefl, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfDiffuseVisRefl, - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).ShadowSurfGlazingFrac, + state.dataSurface->Surface(SurfNum).Name, + cSurfaceClass(state.dataSurface->Surface(SurfNum).Class), + state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum), + state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum), + state.dataSurface->SurfShadowGlazingFrac(SurfNum), "N/A"); } } diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 330242c0d49..fcd145a8995 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1457,9 +1457,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { if (state->dataSurface->Surface(SurfNum).ExtBoundCond == 0 && state->dataSurface->Surface(SurfNum).Zone != 0) { - int ZoneSize = state->dataSurface->SurfDisabledShadowingZoneList(SurfNum).size(); + int ZoneSize = state->dataSurface->SurfShadowDisabledZoneList(SurfNum).size(); EXPECT_EQ(1, ZoneSize); - std::vector DisabledZones = state->dataSurface->SurfDisabledShadowingZoneList(SurfNum); + std::vector DisabledZones = state->dataSurface->SurfShadowDisabledZoneList(SurfNum); for (int i : DisabledZones) { EXPECT_EQ(1, i); } diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 93fb170f775..13205053782 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -109,6 +109,9 @@ TEST_F(EnergyPlusFixture, BaseSurfaceRectangularTest) state->dataSurface->Surface(ThisSurf).Vertex(4).y = 0.0; state->dataSurface->Surface(ThisSurf).Vertex(4).z = 2.0; + state->dataSurface->SurfIsShadowing.allocate(state->dataSurface->TotSurfaces); + state->dataSurface->SurfIsShadowing = false; + ProcessSurfaceVertices(*state, ThisSurf, ErrorsFound); EXPECT_FALSE(ErrorsFound); EXPECT_EQ(SurfaceShape::Rectangle, state->dataSurface->Surface(ThisSurf).Shape); From be5af2f1fcb347d5fd9f1f9e0a18c7d5792e9c67 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 12 May 2021 10:41:10 -0700 Subject: [PATCH 11/25] movable insul --- src/EnergyPlus/DataSurfaces.hh | 22 ++++++---- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 14 +++--- src/EnergyPlus/SurfaceGeometry.cc | 44 +++++++++---------- src/EnergyPlus/SwimmingPool.cc | 2 +- .../unit/HeatBalanceIntRadExchange.unit.cc | 6 +-- .../unit/HeatBalanceMovableInsulation.unit.cc | 18 +++++--- .../unit/HeatBalanceSurfaceManager.unit.cc | 1 - tst/EnergyPlus/unit/SwimmingPool.unit.cc | 10 ++--- .../unit/UnitaryHybridAirConditioner.unit.cc | 4 +- 10 files changed, 67 insertions(+), 56 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 1bcdcd08dbf..21d7b3fafe9 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -639,11 +639,6 @@ namespace DataSurfaces { bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0) Real64 SchedMinValue; // Schedule minimum value. - int MaterialMovInsulExt; // Pointer to the material used for exterior movable insulation - int MaterialMovInsulInt; // Pointer to the material used for interior movable insulation - int SchedMovInsulExt; // Schedule for exterior movable insulation - int SchedMovInsulInt; // Schedule for interior movable insulation - // Window Parameters (when surface is Window) int activeWindowShadingControl; // Active window shading control (windows only) std::vector windowShadingControlList; // List of possible window shading controls @@ -671,8 +666,8 @@ namespace DataSurfaces { HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), - MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), MaterialMovInsulExt(0), MaterialMovInsulInt(0), - SchedMovInsulExt(0), SchedMovInsulInt(0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), + MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), + activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { } @@ -1260,7 +1255,7 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfReflFacSkySolGnd; Array2D SurfCosIncAveBmToBmSolObs; - // Optional parameters specific to solar reflection from surfaces + // Surface parameters specific to solar reflection from surfaces Array1D SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion Array1D SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion Array1D SurfShadowGlazingFrac; // Glazing fraction @@ -1270,6 +1265,12 @@ struct SurfacesData : BaseGlobalStruct Array1D> SurfShadowDisabledZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model + // Surface movable insulation properties + Array1D SurfMaterialMovInsulExt; // Pointer to the material used for exterior movable insulation + Array1D SurfMaterialMovInsulInt; // Pointer to the material used for interior movable insulation + Array1D SurfSchedMovInsulExt; // Schedule for exterior movable insulation + Array1D SurfSchedMovInsulInt; // Schedule for interior movable insulation + // Surface EMS Array1D SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value Array1D SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden @@ -1666,6 +1667,11 @@ struct SurfacesData : BaseGlobalStruct this->SurfShadowRecSurfNum.deallocate(); this->SurfShadowDisabledZoneList.deallocate(); + this->SurfMaterialMovInsulExt.deallocate(); + this->SurfMaterialMovInsulInt.deallocate(); + this->SurfSchedMovInsulExt.deallocate(); + this->SurfSchedMovInsulInt.deallocate(); + this->SurfDaylightingShelfInd.deallocate(); this->SurfSchedExternalShadingFrac.deallocate(); this->SurfExternalShadingSchInd.deallocate(); diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index d9180a8c62d..afc39688a15 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -439,7 +439,7 @@ namespace HeatBalanceIntRadExchange { if (state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum) != state.dataHeatBalSurf->SurfMovInsulIntPresentPrevTS(SurfNum)) { auto const &thissurf(state.dataSurface->Surface(SurfNum)); Real64 AbsorpDiff = std::abs(state.dataConstruction->Construct(thissurf.Construction).InsideAbsorpThermal - - state.dataMaterial->Material(thissurf.MaterialMovInsulInt).AbsorpThermal); + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).AbsorpThermal); if (AbsorpDiff > 0.01) { MovableInsulationChange = true; } diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 9b3e2c46f2e..38116ea62e6 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2335,7 +2335,7 @@ void EvalOutsideMovableInsulation(EnergyPlusData &state) { // This subroutine determines whether or not outside movable insulation on opaque surfaces is present at the current time. for (int SurfNum : state.dataHeatBalSurf->SurfMovInsulIndexList) { - Real64 MovInsulSchedVal = GetCurrentScheduleValue(state, state.dataSurface->Surface(SurfNum).SchedMovInsulExt); + Real64 MovInsulSchedVal = GetCurrentScheduleValue(state, state.dataSurface->SurfSchedMovInsulExt(SurfNum)); if (MovInsulSchedVal <= 0) { // Movable insulation not present at current time state.dataHeatBalSurf->SurfMovInsulExtPresent(SurfNum) = false; int ConstrNum = state.dataSurface->SurfActiveConstruction(SurfNum); @@ -2347,7 +2347,7 @@ void EvalOutsideMovableInsulation(EnergyPlusData &state) state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).Roughness; continue; } - auto const MaterialIndex(state.dataSurface->Surface(SurfNum).MaterialMovInsulExt); + auto const MaterialIndex(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)); auto const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); state.dataHeatBalSurf->SurfMovInsulExtPresent(SurfNum) = true; state.dataHeatBalSurf->SurfMovInsulHExt(SurfNum) = 1.0 / (MovInsulSchedVal * state.dataMaterial->Material(MaterialIndex).Resistance); @@ -2366,7 +2366,7 @@ void EvalInsideMovableInsulation(EnergyPlusData &state) { // This subroutine determines whether or not inside movable insulation is present at the current time. for (int SurfNum : state.dataHeatBalSurf->SurfMovInsulIndexList) { - Real64 MovInsulSchedVal = GetCurrentScheduleValue(state, state.dataSurface->Surface(SurfNum).SchedMovInsulInt); + Real64 MovInsulSchedVal = GetCurrentScheduleValue(state, state.dataSurface->SurfSchedMovInsulInt(SurfNum)); if (MovInsulSchedVal <= 0.0) { // Movable insulation not present at current time state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum) = false; int ConstrNum = state.dataSurface->SurfActiveConstruction(SurfNum); @@ -2374,7 +2374,7 @@ void EvalInsideMovableInsulation(EnergyPlusData &state) state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum) = state.dataConstruction->Construct(ConstrNum).InsideAbsorpThermal; continue; } - auto const MaterialIndex(state.dataSurface->Surface(SurfNum).MaterialMovInsulInt); + auto const MaterialIndex(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)); auto const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum) = true; state.dataHeatBalSurf->SurfMovInsulHInt(SurfNum) = 1.0 / (MovInsulSchedVal * state.dataMaterial->Material(MaterialIndex).Resistance); @@ -3651,7 +3651,7 @@ void InitIntSolarDistribution(EnergyPlusData &state) // the fraction that is absorbed plus the back reflected portion (first order reflection only) // to the plane between the transparent insulation and the exterior surface face. state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) = - state.dataMaterial->Material(Surface(SurfNum).MaterialMovInsulExt).Trans * state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) * + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Trans * state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) * ((state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpSolar / AbsExt) + (1 - state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpSolar)); state.dataHeatBal->SurfOpaqSWOutAbsTotalReport(SurfNum) = @@ -7086,7 +7086,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, ShowSevereError(state, "Interior movable insulation is not valid with embedded sources/sinks"); ShowContinueError(state, "Construction " + construct.Name + " contains an internal source or sink but also uses"); ShowContinueError(state, - "interior movable insulation " + state.dataMaterial->Material(Surface(SurfNum).MaterialMovInsulInt).Name + + "interior movable insulation " + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + " for a surface with that construction."); ShowContinueError(state, "This is not currently allowed because the heat balance equations do not currently accommodate " @@ -8632,7 +8632,7 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, ShowSevereError(state, "Exterior movable insulation is not valid with embedded sources/sinks"); ShowContinueError(state, "Construction " + construct.Name + " contains an internal source or sink but also uses"); ShowContinueError(state, - "exterior movable insulation " + state.dataMaterial->Material(Surface(SurfNum).MaterialMovInsulExt).Name + + "exterior movable insulation " + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Name + " for a surface with that construction."); ShowContinueError(state, "This is not currently allowed because the heat balance equations do not currently accommodate this combination."); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 8e003f63d6f..4376daf590d 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -938,6 +938,10 @@ namespace SurfaceGeometry { state.dataSurface->SurfShadowDiffuseVisRefl.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowGlazingFrac.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowGlazingConstruct.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfMaterialMovInsulExt.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfMaterialMovInsulInt.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfSchedMovInsulExt.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfSchedMovInsulInt.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = false; state.dataSurface->SurfShadowRecSurfNum(SurfNum) = 0; @@ -945,6 +949,10 @@ namespace SurfaceGeometry { state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = 0.0; state.dataSurface->SurfShadowGlazingFrac(SurfNum) = 0.0; state.dataSurface->SurfShadowGlazingConstruct(SurfNum) = 0; + state.dataSurface->SurfMaterialMovInsulExt(SurfNum) = 0; + state.dataSurface->SurfMaterialMovInsulInt(SurfNum) = 0; + state.dataSurface->SurfSchedMovInsulExt(SurfNum) = 0; + state.dataSurface->SurfSchedMovInsulInt(SurfNum) = 0; } state.dataSurface->SurfSchedExternalShadingFrac.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfExternalShadingSchInd.allocate(state.dataSurface->TotSurfaces); @@ -1359,8 +1367,6 @@ namespace SurfaceGeometry { GetIntMassSurfaceData(state, ErrorsFound, NumSurfs); - GetMovableInsulationData(state, ErrorsFound); - state.dataSurface->TotSurfaces = NumSurfs + AddedSubSurfaces + NeedToAddSurfaces + NeedToAddSubSurfaces; if (ErrorsFound) { @@ -2532,6 +2538,8 @@ namespace SurfaceGeometry { SetupShadeSurfacesForSolarCalcs(state); // if shading surfaces are solar collectors or PV, then we need full solar calc. + GetMovableInsulationData(state, ErrorsFound); + if (state.dataSurface->CalcSolRefl) GetShadingSurfReflectanceData(state, ErrorsFound); LayNumOutside = 0; @@ -2733,7 +2741,7 @@ namespace SurfaceGeometry { } // Initialize surface with movable insulation index list for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { - if (state.dataSurface->Surface(SurfNum).MaterialMovInsulExt > 0 || state.dataSurface->Surface(SurfNum).MaterialMovInsulInt > 0) { + if (state.dataSurface->SurfMaterialMovInsulExt(SurfNum) > 0 || state.dataSurface->SurfMaterialMovInsulInt(SurfNum) > 0) { state.dataHeatBalSurf->SurfMovInsulIndexList.push_back(SurfNum); } } @@ -9101,10 +9109,6 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedShadowSurfIndex = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedShadowSurfIndex; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedMinValue = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMinValue; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).IsTransparent = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).IsTransparent; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).MaterialMovInsulExt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).MaterialMovInsulInt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedMovInsulExt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulExt; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).SchedMovInsulInt = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulInt; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).activeWindowShadingControl = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).activeWindowShadingControl; state.dataSurfaceGeometry->SurfaceTmp(SurfNum + 1).windowShadingControlList = @@ -11361,7 +11365,7 @@ namespace SurfaceGeometry { state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); SurfNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataSurfaceGeometry->SurfaceTmp, state.dataSurface->TotSurfaces); + state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface, state.dataSurface->TotSurfaces); MaterNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataMaterial->Material, state.dataHeatBal->TotMaterials); SchNum = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); @@ -11439,21 +11443,21 @@ namespace SurfaceGeometry { { auto const SELECT_CASE_var(InslType); if (SELECT_CASE_var == 1) { - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt > 0) { + if (state.dataSurface->SurfMaterialMovInsulExt(SurfNum) > 0) { ShowSevereError(state, cCurrentModuleObject + ", " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\", already assigned."); ShowContinueError( state, "\"Outside\", was already assigned Material=\"" + - state.dataMaterial->Material(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt).Name + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + "\"."); ShowContinueError(state, "attempting to assign Material=\"" + state.dataMaterial->Material(MaterNum).Name + "\"."); ErrorsFound = true; } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt = MaterNum; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulExt = SchNum; + state.dataSurface->SurfMaterialMovInsulExt(SurfNum) = MaterNum; + state.dataSurface->SurfSchedMovInsulExt(SurfNum) = SchNum; state.dataSurface->AnyMovableInsulation = true; if (state.dataMaterial->Material(MaterNum).Resistance <= 0.0) { if (state.dataMaterial->Material(MaterNum).Conductivity <= 0.0 || @@ -11486,21 +11490,21 @@ namespace SurfaceGeometry { } } } else if (SELECT_CASE_var == 2) { - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt > 0) { + if (state.dataSurface->SurfMaterialMovInsulInt(SurfNum) > 0) { ShowSevereError(state, cCurrentModuleObject + ", " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\", already assigned."); ShowContinueError( state, "\"Inside\", was already assigned Material=\"" + - state.dataMaterial->Material(state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt).Name + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + "\"."); ShowContinueError(state, "attempting to assign Material=\"" + state.dataMaterial->Material(MaterNum).Name + "\"."); ErrorsFound = true; } - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt = MaterNum; - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulInt = SchNum; + state.dataSurface->SurfMaterialMovInsulInt(SurfNum) = MaterNum; + state.dataSurface->SurfSchedMovInsulInt(SurfNum) = SchNum; state.dataSurface->AnyMovableInsulation = true; if (state.dataMaterial->Material(MaterNum).Resistance <= 0.0) { if (state.dataMaterial->Material(MaterNum).Conductivity <= 0.0 || @@ -11522,7 +11526,7 @@ namespace SurfaceGeometry { } else { } } - if (state.dataSurfaceGeometry->SurfaceTmp(SurfNum).Class == SurfaceClass::Window) { + if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Window) { ShowSevereError(state, cCurrentModuleObject + ", " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\""); @@ -13701,12 +13705,6 @@ namespace SurfaceGeometry { state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).OSCPtr = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).OSCPtr; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).SchedShadowSurfIndex = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedShadowSurfIndex; - state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).MaterialMovInsulExt = - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulExt; - state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).MaterialMovInsulInt = - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).MaterialMovInsulInt; - state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).SchedMovInsulExt = - state.dataSurfaceGeometry->SurfaceTmp(SurfNum).SchedMovInsulExt; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).activeWindowShadingControl = state.dataSurfaceGeometry->SurfaceTmp(SurfNum).activeWindowShadingControl; state.dataSurfaceGeometry->SurfaceTmp(state.dataSurface->TotSurfaces).windowShadingControlList = diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index ee4b8915898..42dc1f56976 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -423,7 +423,7 @@ void SwimmingPoolData::ErrorCheckSetupPoolSurface( state.dataSurface->Surface(this->SurfacePtr).Name + " is a pool and is defined as a window. This is not allowed. A pool must be a floor that is NOT a window."); ErrorsFound = true; - } else if (state.dataSurface->Surface(this->SurfacePtr).MaterialMovInsulInt > 0) { + } else if (state.dataSurface->SurfMaterialMovInsulInt(this->SurfacePtr) > 0) { ShowSevereError(state, state.dataSurface->Surface(this->SurfacePtr).Name + " is a pool and has movable insulation. This is not allowed. Remove the movable insulation for this surface."); diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index 846354f3df6..e6a691661bb 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -300,20 +300,20 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_UpdateMovableInsulationFlagT state->dataConstruction->Construct.allocate(1); state->dataMaterial->Material.allocate(1); state->dataSurface->Surface.allocate(1); + state->dataSurface->SurfMaterialMovInsulInt.allocate(1); state->dataHeatBalSurf->SurfMovInsulIntPresent.allocate(1); state->dataHeatBalSurf->SurfMovInsulIntPresentPrevTS.allocate(1); state->dataHeatBalSurf->SurfMovInsulIndexList.push_back(1); SurfNum = 1; - state->dataSurface->Surface(1).MaterialMovInsulInt = 1; state->dataHeatBalSurf->SurfMovInsulIntPresent(1) = false; state->dataHeatBalSurf->SurfMovInsulIntPresentPrevTS(1) = false; state->dataSurface->Surface(1).Construction = 1; - state->dataSurface->Surface(1).MaterialMovInsulInt = 1; + state->dataSurface->SurfMaterialMovInsulInt(1)= -1; + state->dataConstruction->Construct(1).InsideAbsorpThermal = 0.9; state->dataMaterial->Material(1).AbsorpThermal = 0.5; state->dataMaterial->Material(1).Resistance = 1.25; - state->dataSurface->Surface(1).SchedMovInsulInt = -1; state->dataMaterial->Material(1).AbsorpSolar = 0.25; // Test 1: Movable insulation present but wasn't in previous time step, also movable insulation emissivity different than base construction diff --git a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc index 7a0f909e669..9bbcb54d07b 100644 --- a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc @@ -72,8 +72,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceMovableInsulation_EvalOutsideMovableInsulat int SurfNum = 1; state->dataSurface->Surface.allocate(SurfNum); - state->dataSurface->Surface(SurfNum).SchedMovInsulExt = 1; - state->dataSurface->Surface(SurfNum).MaterialMovInsulExt = 1; + state->dataSurface->SurfSchedMovInsulExt.allocate(SurfNum); + state->dataSurface->SurfMaterialMovInsulExt.allocate(SurfNum); + state->dataSurface->SurfSchedMovInsulExt(SurfNum) = 1; + state->dataSurface->SurfMaterialMovInsulExt(SurfNum) = 1; state->dataHeatBalSurf->SurfMovInsulExtPresent.allocate(SurfNum); state->dataHeatBalSurf->SurfMovInsulHExt.allocate(SurfNum); state->dataHeatBalSurf->SurfAbsSolarExt.allocate(SurfNum); @@ -120,8 +122,11 @@ TEST_F(EnergyPlusFixture, HeatBalanceMovableInsulation_EvalInsideMovableInsulati int SurfNum = 1; state->dataSurface->Surface.allocate(SurfNum); - state->dataSurface->Surface(SurfNum).SchedMovInsulInt = 1; - state->dataSurface->Surface(SurfNum).MaterialMovInsulInt = 1; + + state->dataSurface->SurfSchedMovInsulInt.allocate(SurfNum); + state->dataSurface->SurfMaterialMovInsulInt.allocate(SurfNum); + state->dataSurface->SurfSchedMovInsulInt(SurfNum) = 1; + state->dataSurface->SurfMaterialMovInsulInt(SurfNum) = 1; state->dataHeatBalSurf->SurfMovInsulIntPresent.allocate(SurfNum); state->dataHeatBalSurf->SurfMovInsulHInt.allocate(SurfNum); state->dataHeatBalSurf->SurfAbsSolarInt.allocate(SurfNum); @@ -275,6 +280,8 @@ TEST_F(EnergyPlusFixture, SurfaceControlMovableInsulation_InvalidWindowSimpleGla state->dataSurfaceGeometry->SinBldgRelNorth = 0.0; // set surface data state->dataSurface->TotSurfaces = 1; + state->dataSurface->Surface.allocate(1); + state->dataSurface->SurfMaterialMovInsulExt.allocate(1); state->dataSurfaceGeometry->SurfaceTmp.allocate(1); int SurfNum = 0; int TotHTSurfs = state->dataSurface->TotSurfaces = 1; @@ -284,10 +291,11 @@ TEST_F(EnergyPlusFixture, SurfaceControlMovableInsulation_InvalidWindowSimpleGla // get heat tranfer surface data SurfaceGeometry::GetHTSurfaceData(*state, ErrorsFound, SurfNum, TotHTSurfs, 0, 0, 0, BaseSurfCls, BaseSurfIDs, NeedToAddSurfaces); // get movable insulation object data + state->dataSurface->Surface(1) = state->dataSurfaceGeometry->SurfaceTmp(1); SurfaceGeometry::GetMovableInsulationData(*state, ErrorsFound); // check movable insulation material EXPECT_EQ(state->dataSurfaceGeometry->SurfaceTmp(1).BaseSurfName, "ZN001:WALL001"); // base surface name - EXPECT_EQ(state->dataSurfaceGeometry->SurfaceTmp(1).MaterialMovInsulExt, 4); // index to movable insulation material + EXPECT_EQ(state->dataSurface->SurfMaterialMovInsulExt(1), 4); // index to movable insulation material EXPECT_EQ(state->dataMaterial->Material(4).Name, "SIMPLEGLAZINGSYSTEM"); // name of movable insulation material EXPECT_EQ(state->dataMaterial->Material(4).Group, DataHeatBalance::WindowSimpleGlazing); // invalid material group type EXPECT_TRUE(ErrorsFound); // error found due to invalid material diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index a113510510a..a5e0bca14d6 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -138,7 +138,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) state->dataSurface->Surface.allocate(SurfNum); state->dataSurface->Surface(SurfNum).Class = DataSurfaces::SurfaceClass::Wall; state->dataSurface->Surface(SurfNum).Area = 10.0; - state->dataSurface->Surface(SurfNum).MaterialMovInsulExt = 1; state->dataSurface->SurfOutDryBulbTemp.allocate(SurfNum); state->dataSurface->SurfOutDryBulbTemp = 0; state->dataEnvrn->SkyTemp = 23.0; diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index 1f954e8ef25..851f198bfcc 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -247,7 +247,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataConstruction->Construct.allocate(1); state->dataSurface->SurfIsPool.allocate(1); state->dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(1); - + state->dataSurface->SurfMaterialMovInsulInt.allocate(1); // testing variables static std::string const Alpha1("FirstString"); static std::string const Alpha2("SecondString"); @@ -300,7 +300,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; - state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; + state->dataSurface->SurfMaterialMovInsulInt(poolReference.SurfacePtr) = 1; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); @@ -312,7 +312,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; - state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; + state->dataSurface->SurfMaterialMovInsulInt(poolReference.SurfacePtr) = 1; state->dataSurface->Surface(poolReference.SurfacePtr).Construction = 1; state->dataConstruction->Construct(state->dataSurface->Surface(poolReference.SurfacePtr).Construction).SourceSinkPresent = true; @@ -326,7 +326,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Wall; - state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 1; + state->dataSurface->SurfMaterialMovInsulInt(poolReference.SurfacePtr) = 1; state->dataConstruction->Construct(state->dataSurface->Surface(poolReference.SurfacePtr).Construction).SourceSinkPresent = false; poolReference.ErrorCheckSetupPoolSurface(*state, Alpha1, Alpha2, AlphaField2, ErrFnd); @@ -339,7 +339,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) state->dataSurface->SurfIsRadSurfOrVentSlabOrPool(poolReference.SurfacePtr) = false; state->dataSurface->Surface(poolReference.SurfacePtr).HeatTransferAlgorithm = DataSurfaces::iHeatTransferModel::CTF; state->dataSurface->Surface(poolReference.SurfacePtr).Class = DataSurfaces::SurfaceClass::Floor; - state->dataSurface->Surface(poolReference.SurfacePtr).MaterialMovInsulInt = 0; + state->dataSurface->SurfMaterialMovInsulInt(poolReference.SurfacePtr) = 0; state->dataConstruction->Construct(state->dataSurface->Surface(poolReference.SurfacePtr).Construction).SourceSinkPresent = false; state->dataSurface->Surface(poolReference.SurfacePtr).Zone = 7; state->dataSurface->SurfIsPool(poolReference.SurfacePtr) = false; diff --git a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc index eeccade2a6b..726fe804caa 100644 --- a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc +++ b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc @@ -648,8 +648,8 @@ TEST_F(EnergyPlusFixture, Test_UnitaryHybridAirConditioner_ValidateFieldsParsing EXPECT_EQ(state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).OperatingModes.size(), expectedOperatingModesSize); EXPECT_EQ(state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).OperatingModes.size(), expectedOperatingModesSize); // check if names for HybridUnitaryAC are converted to upper case - EXPECT_EQ("Hybrid Unit 1", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).Name); - EXPECT_EQ("Hybrid Unit 2", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).Name); + EXPECT_EQ("HYBRID UNIT 1", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(1).Name); + EXPECT_EQ("HYBRID UNIT 2", state->dataHybridUnitaryAC->ZoneHybridUnitaryAirConditioner(2).Name); } TEST_F(EnergyPlusFixture, Test_UnitaryHybridAirConditioner_ValidateMinimumIdfInput) From 4b0d247d61b206fcc0a02283308d0ee5d22a3b2b Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 12 May 2021 17:21:12 -0700 Subject: [PATCH 12/25] fix unit test --- tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc | 2 +- tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc | 7 +++++++ tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index e6a691661bb..cf640ce34b4 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -309,7 +309,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_UpdateMovableInsulationFlagT state->dataHeatBalSurf->SurfMovInsulIntPresent(1) = false; state->dataHeatBalSurf->SurfMovInsulIntPresentPrevTS(1) = false; state->dataSurface->Surface(1).Construction = 1; - state->dataSurface->SurfMaterialMovInsulInt(1)= -1; + state->dataSurface->SurfMaterialMovInsulInt(1)= 1; state->dataConstruction->Construct(1).InsideAbsorpThermal = 0.9; state->dataMaterial->Material(1).AbsorpThermal = 0.5; diff --git a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc index 9bbcb54d07b..6fcc3d323b0 100644 --- a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc @@ -282,6 +282,13 @@ TEST_F(EnergyPlusFixture, SurfaceControlMovableInsulation_InvalidWindowSimpleGla state->dataSurface->TotSurfaces = 1; state->dataSurface->Surface.allocate(1); state->dataSurface->SurfMaterialMovInsulExt.allocate(1); + state->dataSurface->SurfSchedMovInsulExt.allocate(1); + state->dataSurface->SurfMaterialMovInsulInt.allocate(1); + state->dataSurface->SurfSchedMovInsulInt.allocate(1); + state->dataSurface->SurfMaterialMovInsulExt = 0; + state->dataSurface->SurfSchedMovInsulExt = 0; + state->dataSurface->SurfMaterialMovInsulInt = 0; + state->dataSurface->SurfSchedMovInsulInt = 0; state->dataSurfaceGeometry->SurfaceTmp.allocate(1); int SurfNum = 0; int TotHTSurfs = state->dataSurface->TotSurfaces = 1; diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index a5e0bca14d6..381a9b8fc1e 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -133,6 +133,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_CalcOutsideSurfTemp) state->dataHeatBalSurf->SurfQAdditionalHeatSourceOutside(SurfNum) = 0.0; state->dataSurface->SurfHasSurroundingSurfProperties.allocate(SurfNum); state->dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = 0; + state->dataSurface->SurfMaterialMovInsulExt.allocate(SurfNum); + state->dataSurface->SurfMaterialMovInsulExt(SurfNum) = 1; state->dataHeatBalSurf->TH.allocate(2, 2, 1); state->dataSurface->Surface.allocate(SurfNum); From a65105a0325bd1a4201817571c25abac26ae92f3 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 12 May 2021 18:15:01 -0700 Subject: [PATCH 13/25] clang-format --- src/EnergyPlus/DataSurfaces.hh | 6 ++--- src/EnergyPlus/DaylightingManager.cc | 18 +++++++-------- src/EnergyPlus/GeneralRoutines.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 12 ++++++---- src/EnergyPlus/Photovoltaics.cc | 6 ++--- src/EnergyPlus/SolarCollectors.cc | 19 +++++++--------- src/EnergyPlus/SteamBaseboardRadiator.cc | 3 ++- src/EnergyPlus/SurfaceGeometry.cc | 22 +++++++++---------- src/EnergyPlus/TranspiredCollector.cc | 14 ++++++------ tst/EnergyPlus/unit/DataSurfaces.unit.cc | 6 ++--- .../unit/HeatBalanceIntRadExchange.unit.cc | 2 +- .../unit/HeatBalanceMovableInsulation.unit.cc | 2 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 2 +- tst/EnergyPlus/unit/ICSCollector.unit.cc | 2 +- 14 files changed, 57 insertions(+), 59 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 21d7b3fafe9..cf849150a0e 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -666,9 +666,9 @@ namespace DataSurfaces { HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), - MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), - activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), - FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) + MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), activeWindowShadingControl(0), + HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), + IsAirBoundarySurf(false) { } diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 002213f89e3..748d0d60a25 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -3399,9 +3399,9 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } else { ObsVisRefl = state.dataSurface->SurfShadowDiffuseVisRefl(NearestHitSurfNum); if (state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum) > 0) - ObsVisRefl += state.dataSurface->SurfShadowGlazingFrac(NearestHitSurfNum) * - state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum)) - .ReflectVisDiffFront; + ObsVisRefl += + state.dataSurface->SurfShadowGlazingFrac(NearestHitSurfNum) * + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(NearestHitSurfNum)).ReflectVisDiffFront; } } NearestHitSurfNumX = NearestHitSurfNum; @@ -3803,11 +3803,10 @@ void FigureDayltgCoeffsAtPointsForSunPosition( POLYF(std::abs(CosIncAngRefl), state.dataConstruction->Construct(ConstrNumRefl).ReflSolBeamFrontCoef); } if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) - SpecReflectance = - state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) * - POLYF(std::abs(CosIncAngRefl), - state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum)) - .ReflSolBeamFrontCoef); + SpecReflectance = state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) * + POLYF(std::abs(CosIncAngRefl), + state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum)) + .ReflSolBeamFrontCoef); TVisRefl = POLYF(CosIncAngRec, state.dataConstruction->Construct(IConst).TransVisBeamCoef) * state.dataSurface->SurfWinGlazedFrac(IWin) * state.dataSurface->SurfWinLightWellEff(IWin); state.dataDaylightingManager->EDIRSUdisk(iHour, 1) += SunVecMir(3) * SpecReflectance * TVisRefl; // Bare window @@ -5907,8 +5906,7 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { int const ObsSurfNum = surface.Index; - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) - return false; // Do Consider separate octree without filtered surfaces + if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 96fc30d2fd2..0b468de0635 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -946,7 +946,7 @@ void CalcPassiveExteriorBaffleGap(EnergyPlusData &state, Real64 sum_area = 0.0; Real64 sum_produc_area_drybulb = 0.0; Real64 sum_produc_area_wetbulb = 0.0; - for (int SurfNum: SurfPtrARR) { + for (int SurfNum : SurfPtrARR) { sum_area += state.dataSurface->Surface(SurfNum).Area; sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 38116ea62e6..b5100715929 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -3651,7 +3651,8 @@ void InitIntSolarDistribution(EnergyPlusData &state) // the fraction that is absorbed plus the back reflected portion (first order reflection only) // to the plane between the transparent insulation and the exterior surface face. state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(SurfNum) = - state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Trans * state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) * + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Trans * + state.dataHeatBalSurf->SurfQRadSWOutMvIns(SurfNum) * ((state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpSolar / AbsExt) + (1 - state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).AbsorpSolar)); state.dataHeatBal->SurfOpaqSWOutAbsTotalReport(SurfNum) = @@ -4589,7 +4590,8 @@ void InitEMSControlledConstructions(EnergyPlusData &state) Surface(SurfNum).Construction = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); state.dataConstruction->Construct(Surface(SurfNum).Construction).IsUsed = true; - state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum);; + state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum); + ; } else { // have not checked yet or is not okay, so see if we need to warn about incompatible if (!state.dataRuntimeLang->EMSConstructActuatorChecked(state.dataSurface->SurfEMSConstructionOverrideValue(SurfNum), SurfNum)) { @@ -7086,7 +7088,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, ShowSevereError(state, "Interior movable insulation is not valid with embedded sources/sinks"); ShowContinueError(state, "Construction " + construct.Name + " contains an internal source or sink but also uses"); ShowContinueError(state, - "interior movable insulation " + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + + "interior movable insulation " + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + " for a surface with that construction."); ShowContinueError(state, "This is not currently allowed because the heat balance equations do not currently accommodate " @@ -8632,7 +8635,8 @@ void CalcOutsideSurfTemp(EnergyPlusData &state, ShowSevereError(state, "Exterior movable insulation is not valid with embedded sources/sinks"); ShowContinueError(state, "Construction " + construct.Name + " contains an internal source or sink but also uses"); ShowContinueError(state, - "exterior movable insulation " + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Name + + "exterior movable insulation " + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)).Name + " for a surface with that construction."); ShowContinueError(state, "This is not currently allowed because the heat balance equations do not currently accommodate this combination."); diff --git a/src/EnergyPlus/Photovoltaics.cc b/src/EnergyPlus/Photovoltaics.cc index ecbf38db33e..e37f5abf533 100644 --- a/src/EnergyPlus/Photovoltaics.cc +++ b/src/EnergyPlus/Photovoltaics.cc @@ -942,10 +942,10 @@ namespace Photovoltaics { state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.IncidenceAngle = std::acos(state.dataHeatBal->SurfCosIncidenceAngle(ThisSurf)) / DataGlobalConstants::DegToRadians; // (deg) from dataHeatBalance state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.ZenithAngle = - std::acos(state.dataEnvrn->SOLCOS(3)) / DataGlobalConstants::DegToRadians; //(degrees), - state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Tamb = state.dataSurface->SurfOutDryBulbTemp(ThisSurf); //(deg. C) + std::acos(state.dataEnvrn->SOLCOS(3)) / DataGlobalConstants::DegToRadians; //(degrees), + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Tamb = state.dataSurface->SurfOutDryBulbTemp(ThisSurf); //(deg. C) state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.WindSpeed = state.dataSurface->SurfOutWindSpeed(ThisSurf); // (m/s) - state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Altitude = state.dataEnvrn->Elevation; // from DataEnvironment via USE + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.Altitude = state.dataEnvrn->Elevation; // from DataEnvironment via USE if (((state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.IcBeam + state.dataPhotovoltaic->PVarray(PVnum).SNLPVinto.IcDiffuse) > state.dataPhotovoltaic->MinIrradiance) && diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 24e1a55e305..703d0360929 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -1137,9 +1137,8 @@ namespace SolarCollectors { { auto const SELECT_CASE_var(state.dataSolarCollectors->Parameters(ParamNum).TestType); if (SELECT_CASE_var == TestTypeEnum::INLET) { - FRULpTest = - state.dataSolarCollectors->Parameters(ParamNum).eff1 + - state.dataSolarCollectors->Parameters(ParamNum).eff2 * (inletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); + FRULpTest = state.dataSolarCollectors->Parameters(ParamNum).eff1 + + state.dataSolarCollectors->Parameters(ParamNum).eff2 * (inletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); TestTypeMod = 1.0; } else if (SELECT_CASE_var == TestTypeEnum::AVERAGE) { @@ -1149,9 +1148,8 @@ namespace SolarCollectors { TestTypeMod = 1.0 / (1.0 - FRULpTest / (2.0 * mCpATest)); } else if (SELECT_CASE_var == TestTypeEnum::OUTLET) { - FRULpTest = - state.dataSolarCollectors->Parameters(ParamNum).eff1 + - state.dataSolarCollectors->Parameters(ParamNum).eff2 * (outletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); + FRULpTest = state.dataSolarCollectors->Parameters(ParamNum).eff1 + + state.dataSolarCollectors->Parameters(ParamNum).eff2 * (outletTemp - state.dataSurface->SurfOutDryBulbTemp(SurfNum)); TestTypeMod = 1.0 / (1.0 - FRULpTest / mCpATest); } } @@ -1224,8 +1222,7 @@ namespace SolarCollectors { // Calculate temperature of stagnant fluid in collector Real64 A = -FRULT; Real64 B = -FRUL + 2.0 * FRULT * state.dataSurface->SurfOutDryBulbTemp(SurfNum); - Real64 C = -FRULT * pow_2(state.dataSurface->SurfOutDryBulbTemp(SurfNum)) + - FRUL * state.dataSurface->SurfOutDryBulbTemp(SurfNum) - + Real64 C = -FRULT * pow_2(state.dataSurface->SurfOutDryBulbTemp(SurfNum)) + FRUL * state.dataSurface->SurfOutDryBulbTemp(SurfNum) - FRTAN * incidentAngleModifier * state.dataHeatBal->SurfQRadSWOutIncident(SurfNum); Real64 qEquation = (pow_2(B) - 4.0 * A * C); if (qEquation < 0.0) { @@ -1766,9 +1763,9 @@ namespace SolarCollectors { int NumCovers = state.dataSolarCollectors->Parameters(ParamNum).NumOfCovers; int SurfNum = this->Surface; - Real64 TempAbsPlate = this->SavedTempOfAbsPlate; // absorber plate average temperature [C] - Real64 TempInnerCover = this->SavedTempOfInnerCover; // inner cover average temperature [C] - Real64 TempOuterCover = this->SavedTempOfOuterCover; // outer cover average temperature [C] + Real64 TempAbsPlate = this->SavedTempOfAbsPlate; // absorber plate average temperature [C] + Real64 TempInnerCover = this->SavedTempOfInnerCover; // inner cover average temperature [C] + Real64 TempOuterCover = this->SavedTempOfOuterCover; // outer cover average temperature [C] Real64 TempOutdoorAir = state.dataSurface->SurfOutDryBulbTemp(SurfNum); // outdoor air temperature [C] Real64 EmissOfAbsPlate = state.dataSolarCollectors->Parameters(ParamNum).EmissOfAbsPlate; // emissivity of absorber plate diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index f0e4c06f336..a65ef960614 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -718,7 +718,8 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).TotSurfToDistrib = MinFraction; } if (state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum) != 0) { - state.dataSurface->SurfIntConvSurfGetsRadiantHeat(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum)) = true; + state.dataSurface->SurfIntConvSurfGetsRadiantHeat( + state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SurfacePtr(SurfNum)) = true; } AllFracsSummed += state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).FracDistribToSurf(SurfNum); diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 4376daf590d..20fdc84ea9c 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -11364,8 +11364,8 @@ namespace SurfaceGeometry { state.dataIPShortCut->lAlphaFieldBlanks, state.dataIPShortCut->cAlphaFieldNames, state.dataIPShortCut->cNumericFieldNames); - SurfNum = UtilityRoutines::FindItemInList( - state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface, state.dataSurface->TotSurfaces); + SurfNum = + UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataSurface->Surface, state.dataSurface->TotSurfaces); MaterNum = UtilityRoutines::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataMaterial->Material, state.dataHeatBal->TotMaterials); SchNum = GetScheduleIndex(state, state.dataIPShortCut->cAlphaArgs(4)); @@ -11447,11 +11447,10 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ", " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\", already assigned."); - ShowContinueError( - state, - "\"Outside\", was already assigned Material=\"" + - state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + - "\"."); + ShowContinueError(state, + "\"Outside\", was already assigned Material=\"" + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + + "\"."); ShowContinueError(state, "attempting to assign Material=\"" + state.dataMaterial->Material(MaterNum).Name + "\"."); ErrorsFound = true; @@ -11494,11 +11493,10 @@ namespace SurfaceGeometry { ShowSevereError(state, cCurrentModuleObject + ", " + state.dataIPShortCut->cAlphaFieldNames(2) + "=\"" + state.dataIPShortCut->cAlphaArgs(2) + "\", already assigned."); - ShowContinueError( - state, - "\"Inside\", was already assigned Material=\"" + - state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + - "\"."); + ShowContinueError(state, + "\"Inside\", was already assigned Material=\"" + + state.dataMaterial->Material(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)).Name + + "\"."); ShowContinueError(state, "attempting to assign Material=\"" + state.dataMaterial->Material(MaterNum).Name + "\"."); ErrorsFound = true; diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 259c662a158..68a8fdf5a29 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -912,18 +912,18 @@ namespace TranspiredCollector { // determine average ambient temperature Real64 sum_area = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_area += state.dataSurface->Surface(SurfNum).Area; } if (!state.dataEnvrn->IsRain) { Real64 sum_produc_area_drybulb = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); } Tamb = sum_produc_area_drybulb / sum_area; } else { // when raining we use wet bulb not drybulb Real64 sum_produc_area_wetbulb = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); } Tamb = sum_produc_area_wetbulb / sum_area; @@ -1035,18 +1035,18 @@ namespace TranspiredCollector { // Active UTSC calculation // first do common things for both correlations Real64 sum_area = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_area += state.dataSurface->Surface(SurfNum).Area; } if (!state.dataEnvrn->IsRain) { Real64 sum_produc_area_drybulb = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); } Tamb = sum_produc_area_drybulb / sum_area; } else { // when raining we use wet bulb not drybulb Real64 sum_produc_area_wetbulb = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); } Tamb = sum_produc_area_wetbulb / sum_area; @@ -1322,7 +1322,7 @@ namespace TranspiredCollector { Real64 sum_area = 0.0; Real64 sum_produc_area_drybulb = 0.0; Real64 sum_produc_area_wetbulb = 0.0; - for (int SurfNum: state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { + for (int SurfNum : state.dataTranspiredCollector->UTSC(UTSCNum).SurfPtrs) { sum_area += state.dataSurface->Surface(SurfNum).Area; sum_produc_area_wetbulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutWetBulbTemp(SurfNum); sum_produc_area_drybulb += state.dataSurface->Surface(SurfNum).Area * state.dataSurface->SurfOutDryBulbTemp(SurfNum); diff --git a/tst/EnergyPlus/unit/DataSurfaces.unit.cc b/tst/EnergyPlus/unit/DataSurfaces.unit.cc index 8eea07865e5..d6573d671aa 100644 --- a/tst/EnergyPlus/unit/DataSurfaces.unit.cc +++ b/tst/EnergyPlus/unit/DataSurfaces.unit.cc @@ -187,9 +187,9 @@ TEST_F(EnergyPlusFixture, DataSurfaces_SetSurfaceOutBulbTempAtTest) EXPECT_FALSE(ErrorsFound); // expect no errors SetSurfaceOutBulbTempAt(*state); EXPECT_EQ("T3-RF1 - FLOOR:N", state->dataSurface->Surface(1).Name); - EXPECT_GT(state->dataSurface->Surface(1).Centroid.z, 20000.0); // this condition is fatal - EXPECT_LT(state->dataSurface->SurfOutDryBulbTemp(1), -100.0); // this condition is fatal - EXPECT_LT(state->dataSurface->SurfOutWetBulbTemp(1), -100.0); // this condition is fatal + EXPECT_GT(state->dataSurface->Surface(1).Centroid.z, 20000.0); // this condition is fatal + EXPECT_LT(state->dataSurface->SurfOutDryBulbTemp(1), -100.0); // this condition is fatal + EXPECT_LT(state->dataSurface->SurfOutWetBulbTemp(1), -100.0); // this condition is fatal } TEST_F(EnergyPlusFixture, SurfaceTest_Plane) diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index cf640ce34b4..19d944f4f88 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -309,7 +309,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_UpdateMovableInsulationFlagT state->dataHeatBalSurf->SurfMovInsulIntPresent(1) = false; state->dataHeatBalSurf->SurfMovInsulIntPresentPrevTS(1) = false; state->dataSurface->Surface(1).Construction = 1; - state->dataSurface->SurfMaterialMovInsulInt(1)= 1; + state->dataSurface->SurfMaterialMovInsulInt(1) = 1; state->dataConstruction->Construct(1).InsideAbsorpThermal = 0.9; state->dataMaterial->Material(1).AbsorpThermal = 0.5; diff --git a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc index 6fcc3d323b0..ce857488fce 100644 --- a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc @@ -302,7 +302,7 @@ TEST_F(EnergyPlusFixture, SurfaceControlMovableInsulation_InvalidWindowSimpleGla SurfaceGeometry::GetMovableInsulationData(*state, ErrorsFound); // check movable insulation material EXPECT_EQ(state->dataSurfaceGeometry->SurfaceTmp(1).BaseSurfName, "ZN001:WALL001"); // base surface name - EXPECT_EQ(state->dataSurface->SurfMaterialMovInsulExt(1), 4); // index to movable insulation material + EXPECT_EQ(state->dataSurface->SurfMaterialMovInsulExt(1), 4); // index to movable insulation material EXPECT_EQ(state->dataMaterial->Material(4).Name, "SIMPLEGLAZINGSYSTEM"); // name of movable insulation material EXPECT_EQ(state->dataMaterial->Material(4).Group, DataHeatBalance::WindowSimpleGlazing); // invalid material group type EXPECT_TRUE(ErrorsFound); // error found due to invalid material diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 381a9b8fc1e..9c23fe2db9e 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -1903,7 +1903,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) int SurfNum; for (SurfNum = 1; SurfNum <= 6; SurfNum++) { - state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp + state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp state->dataSurface->SurfOutDryBulbTemp(SurfNum) = 22; // Air temp state->dataSurface->SurfExtConvCoeff(SurfNum) = -6; state->dataSurface->SurfAirSkyRadSplit(SurfNum) = 1.0; diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index eb8a3207dc9..62aeed81622 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -111,7 +111,7 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataSurface->SurfIsICS.allocate(NumOfSurf); state->dataSurface->SurfICSPtr.allocate(NumOfSurf); state->dataSurface->SurfIsICS(SurfNum) = true; - + // allocate construction variable data state->dataConstruction->Construct.allocate(ConstrNum); state->dataConstruction->Construct(ConstrNum).LayerPoint.allocate(MatNum); From 4d622549420ee57a0ea3cff87c720618e8ceb523 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 13 May 2021 17:07:14 -0700 Subject: [PATCH 14/25] reorder some heat balance arrays --- src/EnergyPlus/DataHeatBalSurface.hh | 16 +- src/EnergyPlus/DataHeatBalance.hh | 50 ++- src/EnergyPlus/DataSurfaces.cc | 4 +- src/EnergyPlus/DataSurfaces.hh | 8 - src/EnergyPlus/DaylightingDevices.cc | 2 +- src/EnergyPlus/DaylightingManager.cc | 2 +- src/EnergyPlus/HeatBalanceManager.cc | 30 +- src/EnergyPlus/HeatBalanceManager.hh | 2 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 288 +++++++++--------- src/EnergyPlus/InternalHeatGains.cc | 8 +- src/EnergyPlus/SolarShading.cc | 37 +-- src/EnergyPlus/WindowComplexManager.cc | 8 +- src/EnergyPlus/WindowManager.cc | 6 +- .../WindowManagerExteriorThermal.cc | 6 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 20 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 8 +- 16 files changed, 259 insertions(+), 236 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index 51c24a605bb..764dae36a12 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -217,18 +217,8 @@ struct HeatBalSurfData : BaseGlobalStruct // unusedREAL(r64), ALLOCATABLE, DIMENSION(:) :: QBV !Beam solar absorbed by interior shades in a zone, plus // diffuse from beam not absorbed in zone, plus // beam absorbed at inside surfaces - Array1D EnclSolQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering - // through exterior windows and reflecting from interior surfaces, - // beam from exterior windows reflecting from interior surfaces, - // and beam entering through interior windows (considered diffuse) - Array1D EnclSolQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering - // through exterior windows, beam from exterior windows reflecting - // from interior surfaces, and beam entering through interior windows - // (considered diffuse) - // Originally QD, now used only for EnclSolQSDifSol calc for daylighting - Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + Array1D SurfNetLWRadToSurf; // Net interior long wavelength radiation to a surface from other surfaces - Array1D ZoneMRT; // Zone Mean Radiant Temperature Array1D SurfOpaqQRadSWLightsInAbs; // Short wave from Lights radiation absorbed on inside of opaque surface // Variables that are used in both the Surface Heat Balance and the Moisture Balance Array1D SurfOpaqQRadSWOutAbs; // Short wave radiation absorbed on outside of opaque surface @@ -354,11 +344,7 @@ struct HeatBalSurfData : BaseGlobalStruct this->SurfOpaqInsFaceBeamSolAbsorbed.deallocate(); this->SurfTempOut.deallocate(); this->SurfQRadSWOutMvIns.deallocate(); - this->EnclSolQD.deallocate(); - this->EnclSolQDforDaylight.deallocate(); - this->EnclSolVMULT.deallocate(); this->SurfNetLWRadToSurf.deallocate(); - this->ZoneMRT.deallocate(); this->SurfOpaqQRadSWLightsInAbs.deallocate(); this->SurfOpaqQRadSWOutAbs.deallocate(); this->SurfOpaqQRadSWInAbs.deallocate(); diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index d589e96efec..4b8d9cc6e72 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -282,6 +282,11 @@ namespace DataHeatBalance { constexpr Real64 HighDiffusivityThreshold(1.e-5); // used to check if Material properties are out of line. constexpr Real64 ThinMaterialLayerThreshold(0.003); // 3 mm lower limit to expected material layers + // Const for initialization + constexpr Real64 ZoneInitialTemp(23.0); // Zone temperature for initialization + constexpr Real64 SurfInitialTemp(23.0); // Surface temperature for initialization + constexpr Real64 SurfInitialConvCoeff(3.076); // Surface convective coefficient for initialization + // Air Argon Krypton Xenon extern Array2D const GasCoeffsCon; // Gas conductivity coefficients for gases in a mixture @@ -2155,12 +2160,30 @@ struct HeatBalanceData : BaseGlobalStruct Array1D MultCircumSolar; // Contribution to eff sky view factor from circumsolar brightening Array1D MultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening - Array1D QS; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure - Array1D QSLights; // Like QS, but Lights short-wave only. - Array1D EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only. - Array1D ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA) - Array1D TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF' - Array1D QL; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) + Array1D + EnclSolQSWRad; // Zone short-wave flux density; used to calculate short-wave radiation absorbed on inside surfaces of zone or enclosure + Array1D EnclSolQSWRadLights; // Like QS, but Lights short-wave only. + Array1D EnclSolDB; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces + Array1D EnclSolDBSSG; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces. + // Used only for scheduled surface gains + Array1D EnclSolDBIntWin; // Value of factor for beam solar entering a zone through interior windows + // (considered to contribute to diffuse in zone) + Array1D EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only. + Array1D EnclSolQD; // Diffuse solar radiation in a zone from sky and ground diffuse entering + // through exterior windows and reflecting from interior surfaces, + // beam from exterior windows reflecting from interior surfaces, + // and beam entering through interior windows (considered diffuse) + Array1D EnclSolQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering + // through exterior windows, beam from exterior windows reflecting + // from interior surfaces, and beam entering through interior windows + // (considered diffuse) + // Originally QD, now used only for EnclSolQSDifSol calc for daylighting + Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) + Array1D EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) + + Array1D ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA) + Array1D TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF' + Array2D SunlitFracHR; // Hourly fraction of heat transfer surface that is sunlit Array2D CosIncAngHR; // Hourly cosine of beam radiation incidence angle on surface Array3D SunlitFrac; // TimeStep fraction of heat transfer surface that is sunlit @@ -2431,12 +2454,21 @@ struct HeatBalanceData : BaseGlobalStruct this->MultIsoSky.deallocate(); this->MultCircumSolar.deallocate(); this->MultHorizonZenith.deallocate(); - this->QS.deallocate(); - this->QSLights.deallocate(); + + this->EnclSolQSWRad.deallocate(); + this->EnclSolQSWRadLights.deallocate(); + this->EnclSolDB.deallocate(); + this->EnclSolDBSSG.deallocate(); + this->EnclSolDBIntWin.deallocate(); this->EnclSolQSDifSol.deallocate(); + this->EnclSolQD.deallocate(); + this->EnclSolQDforDaylight.deallocate(); + this->EnclSolVMULT.deallocate(); + this->EnclRadQThermalRad.deallocate(); + this->ITABSF.deallocate(); this->TMULT.deallocate(); - this->QL.deallocate(); + this->SunlitFracHR.deallocate(); this->CosIncAngHR.deallocate(); this->SunlitFrac.deallocate(); diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 1371d2d97f2..91191dbee72 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -421,7 +421,7 @@ Real64 SurfaceData::getSWIncident(EnergyPlusData &state, const int t_SurfNum) // PURPOSE OF THIS SUBROUTINE: // Return total short wave incident to the surface - return state.dataHeatBal->SurfQRadSWOutIncident(t_SurfNum) + state.dataHeatBal->QS(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); + return state.dataHeatBal->SurfQRadSWOutIncident(t_SurfNum) + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); } Real64 SurfaceData::getSWBeamIncident(EnergyPlusData &state, const int t_SurfNum) @@ -450,7 +450,7 @@ Real64 SurfaceData::getSWDiffuseIncident(EnergyPlusData &state, const int t_Surf // Return total short wave diffuse incident to the surface return state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(t_SurfNum) + state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(t_SurfNum) + - state.dataHeatBal->QS(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); } int SurfaceData::getTotLayers(EnergyPlusData &state) const diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index cf849150a0e..3be6e9b6e88 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1210,11 +1210,6 @@ struct SurfacesData : BaseGlobalStruct Array1D Y0; // Y-component of translation vector Array1D Z0; // Z-component of translation vector - Array1D EnclSolDB; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces - Array1D EnclSolDBSSG; // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces. - // Used only for scheduled surface gains - Array1D EnclSolDBIntWin; // Value of factor for beam solar entering a zone through interior windows - // (considered to contribute to diffuse in zone) std::vector AllHTSurfaceList; // List of all heat transfer surfaces std::vector AllIZSurfaceList; // List of all interzone heat transfer surfaces std::vector AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces @@ -1606,8 +1601,6 @@ struct SurfacesData : BaseGlobalStruct this->X0.deallocate(); this->Y0.deallocate(); this->Z0.deallocate(); - this->EnclSolDB.deallocate(); - this->EnclSolDBSSG.deallocate(); this->SurfOpaqAI.deallocate(); this->SurfOpaqAO.deallocate(); this->SurfBmToBmReflFacObs.deallocate(); @@ -1625,7 +1618,6 @@ struct SurfacesData : BaseGlobalStruct this->SurfReflFacSkySolObs.deallocate(); this->SurfReflFacSkySolGnd.deallocate(); this->SurfCosIncAveBmToBmSolObs.deallocate(); - this->EnclSolDBIntWin.deallocate(); this->SurfSunlitArea.deallocate(); this->SurfSunlitFrac.deallocate(); this->SurfSkySolarInc.deallocate(); diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 0e9675cec27..7cf2eaf83b3 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1512,7 +1512,7 @@ namespace DaylightingDevices { // Add diffuse interior shortwave reflected from zone surfaces and from zone sources, lights, etc. QRefl += - state.dataHeatBal->QS(state.dataSurface->Surface(DiffSurf).SolarEnclIndex) * state.dataSurface->Surface(DiffSurf).Area * transDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(DiffSurf).SolarEnclIndex) * state.dataSurface->Surface(DiffSurf).Area * transDiff; TotTDDPipeGain = state.dataSurface->SurfWinTransSolar(state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome) - state.dataHeatBal->SurfQRadSWOutIncident(DiffSurf) * state.dataSurface->Surface(DiffSurf).Area + diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 748d0d60a25..35114ba54a6 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -10677,7 +10677,7 @@ void DayltgInterReflIllFrIntWins(EnergyPlusData &state, int &ZoneNum) // Zone nu // TH, CR 7873, 9/17/2009 BmInterReflIll = 0.0; if (state.dataDaylightingData->ZoneDaylight(ZoneNum).TotInsSurfArea > 0) { - BmInterReflIll = (state.dataSurface->EnclSolDBIntWin(ZoneNum) * state.dataEnvrn->BeamSolarRad * state.dataEnvrn->PDIRLW * + BmInterReflIll = (state.dataHeatBal->EnclSolDBIntWin(ZoneNum) * state.dataEnvrn->BeamSolarRad * state.dataEnvrn->PDIRLW * state.dataDaylightingData->ZoneDaylight(ZoneNum).FloorVisRefl) / (state.dataDaylightingData->ZoneDaylight(ZoneNum).TotInsSurfArea * (1.0 - state.dataDaylightingData->ZoneDaylight(ZoneNum).AveVisDiffReflect)); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 6c5ee5d5cdc..428d0ffc8e1 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5703,6 +5703,19 @@ namespace HeatBalanceManager { } } + void AllocateZoneHeatBalArrays(EnergyPlusData &state) + { + // Allocate zone / encl hb arrays + state.dataHeatBal->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolDBIntWin.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolQSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolQD.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclSolQDforDaylight.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->EnclRadQThermalRad.dimension(state.dataGlobal->NumOfZones, 0.0); + state.dataHeatBal->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); + + } void AllocateHeatBalArrays(EnergyPlusData &state) { @@ -5741,12 +5754,8 @@ namespace HeatBalanceManager { // Use the total number of zones or surfaces to allocate variables to avoid a limit // Allocate real Variables // Following used for Calculations - // Allocate zone / encl hb arrays - state.dataSurface->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataSurface->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolQSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); - // Allocate variables in DataHeatBalSys + AllocateZoneHeatBalArrays(state); state.dataHeatBalFanSys->SumConvHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBalFanSys->SumLatentHTRadSys.dimension(state.dataGlobal->NumOfZones, 0.0); state.dataHeatBalFanSys->SumConvPool.dimension(state.dataGlobal->NumOfZones, 0.0); @@ -5860,6 +5869,17 @@ namespace HeatBalanceManager { state.dataHeatBalFanSys->ZoneHighSETHours.allocate(state.dataGlobal->NumOfZones); state.dataHeatBalMgr->CountWarmupDayPoints = 0; + + for (int loop = 1; loop <= state.dataGlobal->NumOfZones; ++loop) { + // CurrentModuleObject='Zone' + SetupOutputVariable(state, + "Zone Mean Radiant Temperature", + OutputProcessor::Unit::C, + state.dataHeatBal->ZoneMRT(loop), + "Zone", + "State", + state.dataHeatBal->Zone(loop).Name); + } } // End Initialization Section of the Module diff --git a/src/EnergyPlus/HeatBalanceManager.hh b/src/EnergyPlus/HeatBalanceManager.hh index f1b3e017498..2de7edc59d6 100644 --- a/src/EnergyPlus/HeatBalanceManager.hh +++ b/src/EnergyPlus/HeatBalanceManager.hh @@ -132,6 +132,8 @@ namespace HeatBalanceManager { void InitHeatBalance(EnergyPlusData &state); + void AllocateZoneHeatBalArrays(EnergyPlusData &state); + void AllocateHeatBalArrays(EnergyPlusData &state); void RecKeepHeatBalance(EnergyPlusData &state); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index b5100715929..c0cca69f382 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -318,14 +318,11 @@ void InitSurfaceHeatBalance(EnergyPlusData &state) if (state.dataGlobal->AnyLocalEnvironmentsInModel) { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { if (state.dataSurface->SurfHasLinkedOutAirNode(SurfNum)) { - state.dataSurface->SurfOutDryBulbTemp(SurfNum) = - state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirDryBulb; - state.dataSurface->SurfOutWetBulbTemp(SurfNum) = - state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWetBulb; - state.dataSurface->SurfOutWindSpeed(SurfNum) = - state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindSpeed; - state.dataSurface->SurfOutWindDir(SurfNum) = - state.dataLoopNodes->Node(state.dataSurface->SurfLinkedOutAirNode(SurfNum)).OutAirWindDir; + int const linkedNode = state.dataSurface->SurfLinkedOutAirNode(SurfNum); + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = state.dataLoopNodes->Node(linkedNode).OutAirDryBulb; + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = state.dataLoopNodes->Node(linkedNode).OutAirWetBulb; + state.dataSurface->SurfOutWindSpeed(SurfNum) = state.dataLoopNodes->Node(linkedNode).OutAirWindSpeed; + state.dataSurface->SurfOutWindDir(SurfNum) = state.dataLoopNodes->Node(linkedNode).OutAirWindDir; } if (state.dataHeatBalSurfMgr->InitSurfaceHeatBalancefirstTime && state.dataSurface->SurfHasSurroundingSurfProperties(SurfNum)) { @@ -1347,7 +1344,7 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) state.dataHeatBalFanSys->CTFTuserConstPart.dimension(state.dataSurface->TotSurfaces, 0.0); } - state.dataHeatBal->SurfTempEffBulkAir.dimension(state.dataSurface->TotSurfaces, 23.0); + state.dataHeatBal->SurfTempEffBulkAir.dimension(state.dataSurface->TotSurfaces, ZoneInitialTemp); state.dataHeatBal->HConvIn.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->HcExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataHeatBalSurf->HAirExtSurf.dimension(state.dataSurface->TotSurfaces, 0.0); @@ -2095,27 +2092,6 @@ void AllocateSurfaceHeatBalArrays(EnergyPlusData &state) } } - state.dataHeatBalSurf->EnclSolQD.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBalSurf->EnclSolQDforDaylight.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->QL.dimension(state.dataGlobal->NumOfZones, 0.0); - - // UCSD - state.dataHeatBal->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); - - // Allocate Reporting Variables and set up tracking - state.dataHeatBalSurf->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); - - for (int loop = 1; loop <= state.dataGlobal->NumOfZones; ++loop) { - // CurrentModuleObject='Zone' - SetupOutputVariable(state, - "Zone Mean Radiant Temperature", - OutputProcessor::Unit::C, - state.dataHeatBalSurf->ZoneMRT(loop), - "Zone", - "State", - state.dataHeatBal->Zone(loop).Name); - } - SetupOutputVariable(state, "Site Total Surface Heat Emission to Air", OutputProcessor::Unit::J, @@ -2156,41 +2132,42 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); // First do the "bulk" initializations of arrays sized to NumOfZones - state.dataHeatBal->ZoneMRT = 23.0; // module level array - state.dataHeatBalFanSys->MAT = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->ZT = 23.0; - state.dataHeatBalFanSys->ZTAV = 23.0; - state.dataHeatBalFanSys->XMAT = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->XM2T = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->XM3T = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->XM4T = 23.0; - state.dataHeatBalFanSys->XMPT = 23.0; - state.dataHeatBalFanSys->DSXMAT = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->DSXM2T = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->DSXM3T = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->DSXM4T = 23.0; - state.dataHeatBalFanSys->ZoneTMX = 23.0; // DataHeatBalFanSys array - state.dataHeatBalFanSys->ZoneTM2 = 23.0; // DataHeatBalFanSys array - // Initialize the Zone Humidity Ratio here so that it is available for EMPD implementations - state.dataHeatBalFanSys->ZoneAirHumRatAvg = state.dataEnvrn->OutHumRat; - state.dataHeatBalFanSys->ZoneAirHumRat = state.dataEnvrn->OutHumRat; - state.dataHeatBalFanSys->ZoneAirHumRatOld = state.dataEnvrn->OutHumRat; - state.dataHeatBalFanSys->SumHmAW = 0.0; - state.dataHeatBalFanSys->SumHmARa = 0.0; - state.dataHeatBalFanSys->SumHmARaW = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + state.dataHeatBal->ZoneMRT(zoneNum) = ZoneInitialTemp; // module level array + state.dataHeatBalFanSys->MAT(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->ZT(zoneNum) = ZoneInitialTemp; + state.dataHeatBalFanSys->ZTAV(zoneNum) = ZoneInitialTemp; + state.dataHeatBalFanSys->XMAT(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->XM2T(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->XM3T(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->XM4T(zoneNum) = ZoneInitialTemp; + state.dataHeatBalFanSys->XMPT(zoneNum) = ZoneInitialTemp; + state.dataHeatBalFanSys->DSXMAT(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->DSXM2T(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->DSXM3T(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->DSXM4T(zoneNum) = ZoneInitialTemp; + state.dataHeatBalFanSys->ZoneTMX(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + state.dataHeatBalFanSys->ZoneTM2(zoneNum) = ZoneInitialTemp; // DataHeatBalFanSys array + // Initialize the Zone Humidity Ratio here so that it is available for EMPD implementations + state.dataHeatBalFanSys->ZoneAirHumRatAvg(zoneNum) = state.dataEnvrn->OutHumRat; + state.dataHeatBalFanSys->ZoneAirHumRat(zoneNum) = state.dataEnvrn->OutHumRat; + state.dataHeatBalFanSys->ZoneAirHumRatOld(zoneNum) = state.dataEnvrn->OutHumRat; + state.dataHeatBalFanSys->SumHmAW(zoneNum) = 0.0; + state.dataHeatBalFanSys->SumHmARa(zoneNum) = 0.0; + state.dataHeatBalFanSys->SumHmARaW(zoneNum) = 0.0; + state.dataHeatBalFanSys->TempTstatAir(zoneNum) = ZoneInitialTemp; + } // "Bulk" initializations of arrays sized to TotSurfaces for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - // Loop through zones... - state.dataHeatBal->SurfTempEffBulkAir(zoneNum) = 23.0; - state.dataHeatBalFanSys->TempTstatAir(zoneNum) = 23.0; int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = SurfInitialTemp; state.dataHeatBalSurf->SUMH(SurfNum) = 0; // module level array - state.dataHeatBalSurf->TempSurfIn(SurfNum) = 23.0; // module level array - state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = 23.0; // module level array - state.dataHeatBal->HConvIn(SurfNum) = 3.076; // module level array + state.dataHeatBalSurf->TempSurfIn(SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBal->HConvIn(SurfNum) = SurfInitialConvCoeff; // module level array state.dataHeatBalSurf->HcExtSurf(SurfNum) = 0.0; state.dataHeatBalSurf->HAirExtSurf(SurfNum) = 0.0; state.dataHeatBalSurf->HSkyExtSurf(SurfNum) = 0.0; @@ -2240,12 +2217,12 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) if (firstSurfWin >= 0) { for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { // Initialize window frame and divider temperatures - state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) = 23.0; - state.dataSurface->SurfWinFrameTempSurfInOld(SurfNum) = 23.0; - state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) = 23.0; - state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) = 23.0; - state.dataSurface->SurfWinDividerTempSurfInOld(SurfNum) = 23.0; - state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) = 23.0; + state.dataSurface->SurfWinFrameTempSurfIn(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinFrameTempSurfInOld(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinFrameTempSurfOut(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinDividerTempSurfIn(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinDividerTempSurfInOld(SurfNum) = SurfInitialTemp; + state.dataSurface->SurfWinDividerTempSurfOut(SurfNum) = SurfInitialTemp; // Initialize previous-timestep shading indicators state.dataSurface->SurfWinExtIntShadePrevTS(SurfNum) = WinShadingType::NoShade; @@ -2255,17 +2232,35 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) } // end of Zone // "Bulk" initializations of temperature arrays with dimensions (TotSurface,MaxCTFTerms,2) - state.dataHeatBalSurf->TH = 23.0; // module level array - state.dataHeatBalSurf->THM = 23.0; // module level array - state.dataHeatBalSurf->QH = 0.0; - state.dataHeatBalSurf->QHM = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + for (int side = 1; side <= 2; ++side) { + for (int CTFTermNum = 1; CTFTermNum <= Construction::MaxCTFTerms; ++CTFTermNum) { + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + state.dataHeatBalSurf->TH(side, CTFTermNum, SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBalSurf->THM(side, CTFTermNum, SurfNum) = SurfInitialTemp; // module level array + state.dataHeatBalSurf->QH(side, CTFTermNum, SurfNum) = 0.0; + state.dataHeatBalSurf->QHM(side, CTFTermNum, SurfNum) = 0.0; + } + } + } + } if (state.dataHeatBal->AnyInternalHeatSourceInInput) { - state.dataHeatBalSurf->TsrcHist = 23.0; - state.dataHeatBalSurf->TsrcHistM = 23.0; - state.dataHeatBalSurf->TuserHist = 23.0; - state.dataHeatBalSurf->TuserHistM = 23.0; - state.dataHeatBalSurf->QsrcHist = 0.0; - state.dataHeatBalSurf->QsrcHistM = 0.0; + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + int const firstSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceFirst; + int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; + for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { + for (int CTFTermNum = 1; CTFTermNum <= Construction::MaxCTFTerms; ++CTFTermNum) { + state.dataHeatBalSurf->TsrcHist(SurfNum, CTFTermNum) = SurfInitialTemp; + state.dataHeatBalSurf->TsrcHistM(SurfNum, CTFTermNum) = SurfInitialTemp; + state.dataHeatBalSurf->TuserHist(SurfNum, CTFTermNum) = SurfInitialTemp; + state.dataHeatBalSurf->TuserHistM(SurfNum, CTFTermNum) = SurfInitialTemp; + state.dataHeatBalSurf->QsrcHist(SurfNum, CTFTermNum) = 0.0; + state.dataHeatBalSurf->QsrcHistM(SurfNum, CTFTermNum) = 0.0; + } + } + } } state.dataHeatBal->CondFDRelaxFactor = state.dataHeatBal->CondFDRelaxFactorInput; @@ -2347,8 +2342,8 @@ void EvalOutsideMovableInsulation(EnergyPlusData &state) state.dataMaterial->Material(state.dataConstruction->Construct(ConstrNum).LayerPoint(1)).Roughness; continue; } - auto const MaterialIndex(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)); - auto const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); + int const MaterialIndex(state.dataSurface->SurfMaterialMovInsulExt(SurfNum)); + int const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); state.dataHeatBalSurf->SurfMovInsulExtPresent(SurfNum) = true; state.dataHeatBalSurf->SurfMovInsulHExt(SurfNum) = 1.0 / (MovInsulSchedVal * state.dataMaterial->Material(MaterialIndex).Resistance); if (MaterialGroupNum == DataHeatBalance::WindowGlass || MaterialGroupNum == DataHeatBalance::GlassEquivalentLayer) { @@ -2374,8 +2369,8 @@ void EvalInsideMovableInsulation(EnergyPlusData &state) state.dataHeatBalSurf->SurfAbsThermalInt(SurfNum) = state.dataConstruction->Construct(ConstrNum).InsideAbsorpThermal; continue; } - auto const MaterialIndex(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)); - auto const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); + int const MaterialIndex(state.dataSurface->SurfMaterialMovInsulInt(SurfNum)); + int const MaterialGroupNum(state.dataMaterial->Material(MaterialIndex).Group); state.dataHeatBalSurf->SurfMovInsulIntPresent(SurfNum) = true; state.dataHeatBalSurf->SurfMovInsulHInt(SurfNum) = 1.0 / (MovInsulSchedVal * state.dataMaterial->Material(MaterialIndex).Resistance); if (MaterialGroupNum == DataHeatBalance::WindowGlass || MaterialGroupNum == DataHeatBalance::GlassEquivalentLayer) { @@ -2644,8 +2639,8 @@ void InitSolarHeatGains(EnergyPlusData &state) } if (resetSolar) { for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataHeatBalSurf->EnclSolQD(zoneNum) = 0.0; - state.dataHeatBalSurf->EnclSolQDforDaylight(zoneNum) = 0.0; + state.dataHeatBal->EnclSolQD(zoneNum) = 0.0; + state.dataHeatBal->EnclSolQDforDaylight(zoneNum) = 0.0; } // TTD domes are currently not considered in the window list of a zone @@ -2753,9 +2748,9 @@ void InitSolarHeatGains(EnergyPlusData &state) // EnclSolDB needs to subtract this part since it is already counted in EnclSolDB. // Use ZoneInitialDifSolReflW (Rob's previous work) as it better counts initial distribution of // diffuse solar rather than using weighted area*absorptance - state.dataHeatBalSurf->EnclSolQDforDaylight(ZoneNum) = - (state.dataSurface->EnclSolDB(ZoneNum) - state.dataSurface->EnclSolDBIntWin(ZoneNum)) * state.dataEnvrn->BeamSolarRad + - state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); + state.dataHeatBal->EnclSolQDforDaylight(ZoneNum) = + (state.dataHeatBal->EnclSolDB(ZoneNum) - state.dataHeatBal->EnclSolDBIntWin(ZoneNum)) * state.dataEnvrn->BeamSolarRad + + state.dataHeatBal->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); // to exclude diffuse solar now absorbed/transmitted in CalcWinTransDifSolInitialDistribution // EnclSolDB(ZoneNum) is Diffuse Solar from beam reflected from interior surfaces @@ -2764,15 +2759,15 @@ void InitSolarHeatGains(EnergyPlusData &state) // QD(ZoneNum) = EnclSolDB(ZoneNum)*BeamSolarRad & // +EnclSolDS(ZoneNum)*DifSolarRad & // +EnclSolDG(ZoneNum)*GndSolarRad - state.dataHeatBalSurf->EnclSolQD(ZoneNum) = state.dataSurface->EnclSolDB(ZoneNum) * state.dataEnvrn->BeamSolarRad + - state.dataSurface->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); + state.dataHeatBal->EnclSolQD(ZoneNum) = state.dataHeatBal->EnclSolDB(ZoneNum) * state.dataEnvrn->BeamSolarRad + + state.dataHeatBal->EnclSolDBSSG(ZoneNum) + state.dataHeatBal->ZoneInitialDifSolReflW(ZoneNum); } // Flux of diffuse solar in each zone state.dataHeatBal->EnclSolQSDifSol = 0.0; for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { - state.dataHeatBal->EnclSolQSDifSol(enclNum) = state.dataHeatBalSurf->EnclSolQDforDaylight(enclNum); + state.dataHeatBal->EnclSolQSDifSol(enclNum) = state.dataHeatBal->EnclSolQDforDaylight(enclNum); } if (state.dataHeatBalSurf->InterZoneWindow) { @@ -2782,9 +2777,8 @@ void InitSolarHeatGains(EnergyPlusData &state) auto lZone(state.dataHeatBalSurf->FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing for (int otherEnclNum = 1; otherEnclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { if ((otherEnclNum != enclNum) && (state.dataHeatBalSurf->RecDifShortFromZ(otherEnclNum))) { - EnclSolQSDifSol_sum += - state.dataHeatBalSurf->FractDifShortZtoZ[lZone] * - state.dataHeatBalSurf->EnclSolQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) + EnclSolQSDifSol_sum += state.dataHeatBalSurf->FractDifShortZtoZ[lZone] * + state.dataHeatBal->EnclSolQDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } state.dataHeatBal->EnclSolQSDifSol(enclNum) += EnclSolQSDifSol_sum; @@ -2795,9 +2789,9 @@ void InitSolarHeatGains(EnergyPlusData &state) for (int enclNum = 1; enclNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclNum) { if (state.dataHeatBalSurf->InterZoneWindow) state.dataHeatBal->EnclSolQSDifSol(enclNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclNum, enclNum) * state.dataHeatBalSurf->EnclSolVMULT(enclNum); + state.dataHeatBalSurf->FractDifShortZtoZ(enclNum, enclNum) * state.dataHeatBal->EnclSolVMULT(enclNum); else - state.dataHeatBal->EnclSolQSDifSol(enclNum) *= state.dataHeatBalSurf->EnclSolVMULT(enclNum); + state.dataHeatBal->EnclSolQSDifSol(enclNum) *= state.dataHeatBal->EnclSolVMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -3544,11 +3538,12 @@ void InitIntSolarDistribution(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); - if (!allocated(state.dataHeatBal->QS)) state.dataHeatBal->QS.allocate(state.dataViewFactor->NumOfSolarEnclosures); - if (!allocated(state.dataHeatBal->QSLights)) state.dataHeatBal->QSLights.allocate(state.dataViewFactor->NumOfSolarEnclosures); + if (!allocated(state.dataHeatBal->EnclSolQSWRad)) state.dataHeatBal->EnclSolQSWRad.allocate(state.dataViewFactor->NumOfSolarEnclosures); + if (!allocated(state.dataHeatBal->EnclSolQSWRadLights)) + state.dataHeatBal->EnclSolQSWRadLights.allocate(state.dataViewFactor->NumOfSolarEnclosures); - state.dataHeatBal->QS = 0.0; - state.dataHeatBal->QSLights = 0.0; + state.dataHeatBal->EnclSolQSWRad = 0.0; + state.dataHeatBal->EnclSolQSWRadLights = 0.0; // COMPUTE TOTAL SHORT-WAVE RADIATION ORIGINATING IN ZONE. // Note: If sun is not up, QS is only internal gains @@ -3557,8 +3552,8 @@ void InitIntSolarDistribution(EnergyPlusData &state) for (int zoneNum : state.dataViewFactor->ZoneSolarInfo(enclosureNum).ZoneNums) { sumZoneQLTSW += state.dataHeatBal->ZoneIntGain(zoneNum).QLTSW; } - state.dataHeatBal->QS(enclosureNum) = state.dataHeatBalSurf->EnclSolQD(enclosureNum) + sumZoneQLTSW; - state.dataHeatBal->QSLights(enclosureNum) = sumZoneQLTSW; + state.dataHeatBal->EnclSolQSWRad(enclosureNum) = state.dataHeatBal->EnclSolQD(enclosureNum) + sumZoneQLTSW; + state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) = sumZoneQLTSW; } if (state.dataHeatBalSurf->InterZoneWindow) { // DO INTERZONE DISTRIBUTION. @@ -3574,11 +3569,11 @@ void InitIntSolarDistribution(EnergyPlusData &state) for (int zoneNum : state.dataViewFactor->ZoneSolarInfo(OtherenclosureNum).ZoneNums) { sumZoneQLTSW += state.dataHeatBal->ZoneIntGain(zoneNum).QLTSW; } - state.dataHeatBal->QS(enclosureNum) += state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * - (state.dataHeatBalSurf->EnclSolQD(OtherenclosureNum) + sumZoneQLTSW); + state.dataHeatBal->EnclSolQSWRad(enclosureNum) += state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * + (state.dataHeatBal->EnclSolQD(OtherenclosureNum) + sumZoneQLTSW); state.dataHeatBal->ZoneDifSolFrIntWinsRep(enclosureNum) += state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, OtherenclosureNum) * - state.dataHeatBalSurf->EnclSolQD(OtherenclosureNum); + state.dataHeatBal->EnclSolQD(OtherenclosureNum); state.dataHeatBal->ZoneDifSolFrIntWinsRepEnergy(enclosureNum) = state.dataHeatBal->ZoneDifSolFrIntWinsRep(enclosureNum) * state.dataGlobal->TimeStepZoneSec; } @@ -3611,14 +3606,14 @@ void InitIntSolarDistribution(EnergyPlusData &state) // COMPUTE CONVECTIVE GAINS AND ZONE FLUX DENSITY. for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { if (state.dataHeatBalSurf->InterZoneWindow) { - state.dataHeatBal->QS(enclosureNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBalSurf->EnclSolVMULT(enclosureNum); + state.dataHeatBal->EnclSolQSWRad(enclosureNum) *= + state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); // CR 8695, VMULT not based on visible - state.dataHeatBal->QSLights(enclosureNum) *= - state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBalSurf->EnclSolVMULT(enclosureNum); + state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) *= + state.dataHeatBalSurf->FractDifShortZtoZ(enclosureNum, enclosureNum) * state.dataHeatBal->EnclSolVMULT(enclosureNum); } else { - state.dataHeatBal->QS(enclosureNum) *= state.dataHeatBalSurf->EnclSolVMULT(enclosureNum); - state.dataHeatBal->QSLights(enclosureNum) *= state.dataHeatBalSurf->EnclSolVMULT(enclosureNum); + state.dataHeatBal->EnclSolQSWRad(enclosureNum) *= state.dataHeatBal->EnclSolVMULT(enclosureNum); + state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) *= state.dataHeatBal->EnclSolVMULT(enclosureNum); } } @@ -3636,8 +3631,8 @@ void InitIntSolarDistribution(EnergyPlusData &state) Real64 AbsIntSurfVis = state.dataConstruction->Construct(ConstrNum).InsideAbsorpSolar; // Inside opaque surface visible absorptance to fix CR 8695 change to - state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) += state.dataHeatBal->QS(solEnclosureNum) * AbsIntSurf; - state.dataHeatBalSurf->SurfOpaqQRadSWLightsInAbs(SurfNum) += state.dataHeatBal->QSLights(solEnclosureNum) * AbsIntSurfVis; + state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(SurfNum) += state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * AbsIntSurf; + state.dataHeatBalSurf->SurfOpaqQRadSWLightsInAbs(SurfNum) += state.dataHeatBal->EnclSolQSWRadLights(solEnclosureNum) * AbsIntSurfVis; // Calculate absorbed solar on outside if movable exterior insulation in place if (state.dataSurface->AnyMovableInsulation && @@ -3685,10 +3680,10 @@ void InitIntSolarDistribution(EnergyPlusData &state) // These calculations are repeated from InitInternalHeatGains for the Zone Component Loads Report Real64 pulseMultipler = 0.01; // use to create a pulse for the load component report computations, the W/sqft pulse for the zone if (!state.dataGlobal->doLoadComponentPulseNow) { - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * + state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); } else { - state.dataHeatBalSurfMgr->curQL = state.dataHeatBal->QL(radEnclosureNum); + state.dataHeatBalSurfMgr->curQL = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion // a small amount to create a "pulse" of heat that is used for the state.dataHeatBalSurfMgr->adjQL = @@ -3703,14 +3698,15 @@ void InitIntSolarDistribution(EnergyPlusData &state) if (NOT_SHADED(ShadeFlag)) { // No window shading for (int IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, IGlass) += - state.dataHeatBal->QS(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffBack(IGlass); + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffBack(IGlass); } } else if (ConstrNumSh != 0 && ShadeFlag != WinShadingType::SwitchableGlazing) { // Interior, exterior or between-glass shade, screen or blind in place for (int IGlass = 1; IGlass <= state.dataConstruction->Construct(ConstrNumSh).TotGlassLayers; ++IGlass) { if (ANY_SHADE_SCREEN(ShadeFlag)) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, IGlass) += - state.dataHeatBal->QS(solEnclosureNum) * state.dataConstruction->Construct(ConstrNumSh).AbsDiffBack(IGlass); + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * + state.dataConstruction->Construct(ConstrNumSh).AbsDiffBack(IGlass); } else if (BITF_TEST_ANY(BITF(ShadeFlag), BITF(WinShadingType::IntBlind) | BITF(WinShadingType::ExtBlind))) { Real64 BlAbsDiffBk; // Glass layer back diffuse solar absorptance when blind in place if (state.dataSurface->SurfWinMovableSlats(SurfNum)) { @@ -3723,11 +3719,12 @@ void InitIntSolarDistribution(EnergyPlusData &state) } else { BlAbsDiffBk = state.dataConstruction->Construct(ConstrNumSh).BlAbsDiffBack(1, IGlass); } - state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, IGlass) += state.dataHeatBal->QS(solEnclosureNum) * BlAbsDiffBk; + state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, IGlass) += + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * BlAbsDiffBk; } } if (ShadeFlag == WinShadingType::IntShade) { - state.dataSurface->SurfWinIntLWAbsByShade(SurfNum) = state.dataHeatBal->QL(radEnclosureNum) * + state.dataSurface->SurfWinIntLWAbsByShade(SurfNum) = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * state.dataConstruction->Construct(ConstrNumSh).ShadeAbsorpThermal * state.dataHeatBal->TMULT(radEnclosureNum); } else if (ShadeFlag == WinShadingType::IntBlind) { @@ -3742,11 +3739,11 @@ void InitIntSolarDistribution(EnergyPlusData &state) EffBlEmiss = state.dataSurface->SurfaceWindow(SurfNum).EffShBlindEmiss(1); } state.dataSurface->SurfWinIntLWAbsByShade(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * EffBlEmiss * state.dataHeatBal->TMULT(radEnclosureNum); + state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * EffBlEmiss * state.dataHeatBal->TMULT(radEnclosureNum); } if (ANY_SHADE_SCREEN(ShadeFlag)) { state.dataSurface->SurfWinIntSWAbsByShade(SurfNum) = - state.dataHeatBal->QS(solEnclosureNum) * state.dataConstruction->Construct(ConstrNumSh).AbsDiffBackShade; + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataConstruction->Construct(ConstrNumSh).AbsDiffBackShade; } else if (ANY_BLIND(ShadeFlag)) { Real64 AbsDiffBkBl; if (state.dataSurface->SurfWinMovableSlats(SurfNum)) { @@ -3758,7 +3755,7 @@ void InitIntSolarDistribution(EnergyPlusData &state) } else { AbsDiffBkBl = state.dataConstruction->Construct(ConstrNumSh).AbsDiffBackBlind(1); } - state.dataSurface->SurfWinIntSWAbsByShade(SurfNum) = state.dataHeatBal->QS(solEnclosureNum) * AbsDiffBkBl; + state.dataSurface->SurfWinIntSWAbsByShade(SurfNum) = state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * AbsDiffBkBl; } // Correct for divider shadowing if (ANY_EXTERIOR_SHADE_BLIND_SCREEN(ShadeFlag)) { @@ -3769,9 +3766,10 @@ void InitIntSolarDistribution(EnergyPlusData &state) for (int IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, IGlass) += - state.dataHeatBal->QS(solEnclosureNum) * InterpSw(state.dataSurface->SurfWinSwitchingFactor(SurfNum), - state.dataConstruction->Construct(ConstrNum).AbsDiffBack(IGlass), - state.dataConstruction->Construct(ConstrNumSh).AbsDiffBack(IGlass)); + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * + InterpSw(state.dataSurface->SurfWinSwitchingFactor(SurfNum), + state.dataConstruction->Construct(ConstrNum).AbsDiffBack(IGlass), + state.dataConstruction->Construct(ConstrNumSh).AbsDiffBack(IGlass)); } } // End of shading flag check @@ -3779,8 +3777,8 @@ void InitIntSolarDistribution(EnergyPlusData &state) // Note that FrameQRadInAbs is initially calculated in InitSolarHeatGains if (state.dataSurface->SurfWinFrameArea(SurfNum) > 0.0) state.dataSurface->SurfWinFrameQRadInAbs(SurfNum) += - (state.dataHeatBal->QS(solEnclosureNum) * state.dataSurface->SurfWinFrameSolAbsorp(SurfNum) + - (state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) + + (state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataSurface->SurfWinFrameSolAbsorp(SurfNum) + + (state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(SurfNum)) * @@ -3829,8 +3827,8 @@ void InitIntSolarDistribution(EnergyPlusData &state) } // Note that DividerQRadInAbs is initially calculated in InitSolarHeatGains state.dataSurface->SurfWinDividerQRadInAbs(SurfNum) += - (state.dataHeatBal->QS(solEnclosureNum) * DividerSolAbs + - (state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) + + (state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * DividerSolAbs + + (state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(SurfNum)) * @@ -3842,10 +3840,10 @@ void InitIntSolarDistribution(EnergyPlusData &state) // These calculations are repeated from InitInternalHeatGains for the Zone Component Loads Report Real64 pulseMultipler = 0.01; // the W/sqft pulse for the zone if (!state.dataGlobal->doLoadComponentPulseNow) { - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * + state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); } else { - state.dataHeatBalSurfMgr->curQL = state.dataHeatBal->QL(radEnclosureNum); + state.dataHeatBalSurfMgr->curQL = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion // a small amount to create a "pulse" of heat that is used for the state.dataHeatBalSurfMgr->adjQL = @@ -3860,7 +3858,7 @@ void InitIntSolarDistribution(EnergyPlusData &state) int EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; for (int Lay = 1; Lay <= state.dataWindowEquivLayer->CFS(EQLNum).NL; ++Lay) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNum, Lay) += - state.dataHeatBal->QS(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffBackEQL(Lay); + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffBackEQL(Lay); } // Window frame has not been included for equivalent layer model yet @@ -3873,7 +3871,7 @@ void InitIntSolarDistribution(EnergyPlusData &state) int TotGlassLayers = state.dataConstruction->Construct(ConstrNum).TotGlassLayers; for (int IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNumAdjZone, IGlass) += - state.dataHeatBal->QS(solEnclosureNum) * + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataConstruction->Construct(Surface(SurfNumAdjZone).Construction).AbsDiff(IGlass); // Note that AbsDiff rather than AbsDiffBack is used in the above since the // radiation from the current zone is incident on the outside of the adjacent @@ -3884,7 +3882,7 @@ void InitIntSolarDistribution(EnergyPlusData &state) int const EQLNum = state.dataConstruction->Construct(AdjConstrNum).EQLConsPtr; for (int Lay = 1; Lay <= state.dataWindowEquivLayer->CFS(EQLNum).NL; ++Lay) { state.dataHeatBal->SurfWinQRadSWwinAbs(SurfNumAdjZone, Lay) += - state.dataHeatBal->QS(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffFrontEQL(Lay); + state.dataHeatBal->EnclSolQSWRad(solEnclosureNum) * state.dataConstruction->Construct(ConstrNum).AbsDiffFrontEQL(Lay); // Note that AbsDiffFrontEQL rather than AbsDiffBackEQL is used in the above // since the radiation from the current zone is incident on the outside of the // adjacent zone's window. @@ -4181,8 +4179,8 @@ void ComputeIntSWAbsorpFactors(EnergyPlusData &state) Real64 const SmallestAreaAbsProductAllowed( 0.01); // Avoid a division by zero of the user has entered a bunch of surfaces with zero absorptivity on the inside - if (!allocated(state.dataHeatBalSurf->EnclSolVMULT)) { - state.dataHeatBalSurf->EnclSolVMULT.dimension(state.dataViewFactor->NumOfSolarEnclosures, 0.0); + if (!allocated(state.dataHeatBal->EnclSolVMULT)) { + state.dataHeatBal->EnclSolVMULT.dimension(state.dataViewFactor->NumOfSolarEnclosures, 0.0); } if (state.dataHeatBalSurfMgr->ComputeIntSWAbsorpFactorsfirstTime) { state.dataHeatBalSurfMgr->FirstCalcZone.dimension(state.dataGlobal->NumOfZones, true); @@ -4313,7 +4311,7 @@ void ComputeIntSWAbsorpFactors(EnergyPlusData &state) } // End of loop over surfaces in zone if (SUM1 > SmallestAreaAbsProductAllowed) { // Everything is okay, proceed with the regular calculation - state.dataHeatBalSurf->EnclSolVMULT(enclosureNum) = 1.0 / SUM1; + state.dataHeatBal->EnclSolVMULT(enclosureNum) = 1.0 / SUM1; } else { // the sum of area*solar absorptance for all surfaces in the zone is zero--either the user screwed up // or they really want to disallow any solar from being absorbed on the inside surfaces. Fire off a @@ -4327,7 +4325,7 @@ void ComputeIntSWAbsorpFactors(EnergyPlusData &state) state.dataViewFactor->ZoneSolarInfo(enclosureNum).Name); state.dataHeatBalSurfMgr->FirstCalcZone(enclosureNum) = false; } - state.dataHeatBalSurf->EnclSolVMULT(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolVMULT(enclosureNum) = 0.0; } } // End of zone/enclosure loop } @@ -4371,9 +4369,9 @@ void ComputeDifSolExcZonesWIZWindows(EnergyPlusData &state, int const NumberOfEn if (!state.dataHeatBal->Zone(surfZoneNum).HasInterZoneWindow) continue; int NZ = Surface(SurfNum).SolarEnclIndex; int MZ = Surface(Surface(SurfNum).ExtBoundCond).SolarEnclIndex; - state.dataHeatBalSurf->FractDifShortZtoZ(NZ, MZ) += state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff * - state.dataHeatBalSurf->EnclSolVMULT(NZ) * Surface(SurfNum).Area; - if (state.dataHeatBalSurf->EnclSolVMULT(NZ) != 0.0) state.dataHeatBalSurf->RecDifShortFromZ(NZ) = true; + state.dataHeatBalSurf->FractDifShortZtoZ(NZ, MZ) += + state.dataConstruction->Construct(Surface(SurfNum).Construction).TransDiff * state.dataHeatBal->EnclSolVMULT(NZ) * Surface(SurfNum).Area; + if (state.dataHeatBal->EnclSolVMULT(NZ) != 0.0) state.dataHeatBalSurf->RecDifShortFromZ(NZ) = true; } // Compute fractions for multiple passes. @@ -5582,8 +5580,6 @@ void ReportSurfaceHeatBalance(EnergyPlusData &state) state.dataHeatBalSurf->SumSurfaceHeatEmission = 0.0; - state.dataHeatBalSurf->ZoneMRT({1, state.dataGlobal->NumOfZones}) = state.dataHeatBal->ZoneMRT({1, state.dataGlobal->NumOfZones}); - ReportSurfaceShading(state); auto &Surface(state.dataSurface->Surface); @@ -7162,7 +7158,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (state.dataSurface->SurfWinIRfromParentZone(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(SurfNum))) - - state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * state.dataConstruction->Construct(surface.Construction).TransDiff; + state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * surface.Area * + state.dataConstruction->Construct(surface.Construction).TransDiff; // Transmitted solar | Convection | IR exchange | IR // Zone diffuse interior shortwave reflected back into the TDD state.dataSurface->SurfWinHeatTransfer(SurfNum) = state.dataSurface->SurfWinHeatGain(SurfNum); @@ -7175,8 +7172,8 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, (Sigma_Temp_4 - (state.dataSurface->SurfWinIRfromParentZone(SurfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(SurfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(SurfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(SurfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(SurfNum))); - state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * state.dataConstruction->Construct(surface.Construction).TransDiff; + state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * surface.Area * + state.dataConstruction->Construct(surface.Construction).TransDiff; } else { // Regular window if (state.dataHeatBal->InsideSurfIterations == 0) { // Do windows only once // Get outside convection coeff for exterior window here to avoid calling @@ -7915,7 +7912,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, (state.dataSurface->SurfWinIRfromParentZone(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum))) - - state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * + state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * surface.Area * state.dataConstruction->Construct(surface.Construction) .TransDiff; // Transmitted solar | Convection | IR exchange | IR // Zone diffuse interior shortwave reflected back into the TDD @@ -7930,7 +7927,8 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, (state.dataSurface->SurfWinIRfromParentZone(surfNum) + state.dataHeatBalFanSys->QHTRadSysSurf(surfNum) + state.dataHeatBalFanSys->QCoolingPanelSurf(surfNum) + state.dataHeatBalFanSys->QHWBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QSteamBaseboardSurf(surfNum) + state.dataHeatBalFanSys->QElecBaseboardSurf(surfNum))); - state.dataSurface->SurfWinLossSWZoneToOutWinRep(surfNum) = state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * + state.dataSurface->SurfWinLossSWZoneToOutWinRep(surfNum) = state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * + surface.Area * state.dataConstruction->Construct(surface.Construction).TransDiff; } else { // Regular window if (state.dataHeatBal->InsideSurfIterations == 0) { // Do windows only once diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 7932a643724..6c5de7aa1c4 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -6469,11 +6469,11 @@ namespace InternalHeatGains { // QL is per radiant enclosure (one or more zones if grouped by air boundaries) for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfRadiantEnclosures; ++enclosureNum) { auto &thisEnclosure(state.dataViewFactor->ZoneRadiantInfo(enclosureNum)); - state.dataHeatBal->QL(enclosureNum) = 0.0; + state.dataHeatBal->EnclRadQThermalRad(enclosureNum) = 0.0; for (int const zoneNum : thisEnclosure.ZoneNums) { Real64 zoneQL; SumAllInternalRadiationGains(state, zoneNum, zoneQL); - state.dataHeatBal->QL(enclosureNum) += zoneQL; + state.dataHeatBal->EnclRadQThermalRad(enclosureNum) += zoneQL; } } @@ -6491,9 +6491,9 @@ namespace InternalHeatGains { int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; if (!state.dataGlobal->doLoadComponentPulseNow) { state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->QL(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); } else { - state.dataInternalHeatGains->curQL = state.dataHeatBal->QL(radEnclosureNum); + state.dataInternalHeatGains->curQL = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion // a small amount to create a "pulse" of heat that is used for the delayed loads state.dataInternalHeatGains->adjQL = diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 146409ad409..fdac0fdd0c3 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -6272,7 +6272,6 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Array2D CFDirBoverlap; // Directional boverlap (Direction, IBack) if (state.dataSolarShading->MustAllocSolarShading) { - state.dataSurface->EnclSolDBIntWin.allocate(state.dataGlobal->NumOfZones); state.dataSolarShading->IntBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); state.dataSolarShading->ExtBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); state.dataSolarShading->WinTransBmSolar.allocate(state.dataSurface->TotSurfaces); @@ -6288,9 +6287,9 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) ++state.dataTimingsData->NumIntSolarDist_Calls; #endif for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { - state.dataSurface->EnclSolDB(zoneNum) = 0.0; - state.dataSurface->EnclSolDBSSG(zoneNum) = 0.0; - state.dataSurface->EnclSolDBIntWin(zoneNum) = 0.0; + state.dataHeatBal->EnclSolDB(zoneNum) = 0.0; + state.dataHeatBal->EnclSolDBSSG(zoneNum) = 0.0; + state.dataHeatBal->EnclSolDBIntWin(zoneNum) = 0.0; int const firstSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceFirst; int const lastSurfWin = state.dataHeatBal->Zone(zoneNum).WindowSurfaceLast; for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { @@ -7934,7 +7933,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) int AdjSurfNum = state.dataSurface->Surface(BackSurfNum).ExtBoundCond; if (AdjSurfNum > 0) { int adjEnclosureNum = state.dataSurface->Surface(AdjSurfNum).SolarEnclIndex; - state.dataSurface->EnclSolDBIntWin(adjEnclosureNum) += BOverlap * TransBeamWin; //[m2] + state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += BOverlap * TransBeamWin; //[m2] state.dataSurface->SurfWinBmSolTransThruIntWinRep(BackSurfNum) += BOverlap * TransBeamWin * state.dataEnvrn->BeamSolarRad; //[W] state.dataSurface->SurfWinBmSolTransThruIntWinRepEnergy(BackSurfNum) = @@ -8069,7 +8068,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) int AdjSurfNum = state.dataSurface->Surface(BackSurfaceNumber).ExtBoundCond; if (AdjSurfNum > 0) { int adjEnclosureNum = state.dataSurface->Surface(AdjSurfNum).SolarEnclIndex; - state.dataSurface->EnclSolDBIntWin(adjEnclosureNum) += + state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += CFDirBoverlap(IBack, CurTrnDir) * state.dataSurface->SurfaceWindow(BackSurfaceNumber) .ComplexFen.State(CurBackState) .IntegratedBkTrans(bestBackTrn); @@ -8204,7 +8203,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) int AdjSurfNum = state.dataSurface->Surface(BackSurfNum).ExtBoundCond; if (AdjSurfNum > 0) { int adjEnclosureNum = state.dataSurface->Surface(AdjSurfNum).SolarEnclIndex; - state.dataSurface->EnclSolDBIntWin(adjEnclosureNum) += BOverlap * TransBeamWin; //[m2] + state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += BOverlap * TransBeamWin; //[m2] state.dataSurface->SurfWinBmSolTransThruIntWinRep(BackSurfNum) += BOverlap * TransBeamWin * state.dataEnvrn->BeamSolarRad; //[W] state.dataSurface->SurfWinBmSolTransThruIntWinRepEnergy(BackSurfNum) = @@ -8270,7 +8269,7 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // Contribution (assumed diffuse) to adjacent zone of beam radiation passing // through this window - state.dataSurface->EnclSolDBIntWin(adjEnclosureNum) += BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) * + state.dataHeatBal->EnclSolDBIntWin(adjEnclosureNum) += BTOTWinZone * state.dataSolarShading->ISABSF(FloorNum) * state.dataConstruction->Construct(FlConstrNum).TransDiff / AbsBeamTotWin; @@ -8301,11 +8300,11 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) } } } - state.dataSurface->EnclSolDBSSG(enclosureNum) = BTOTZoneSSG - BABSZoneSSG; - state.dataSurface->EnclSolDB(enclosureNum) = BTOTZone - BABSZone; + state.dataHeatBal->EnclSolDBSSG(enclosureNum) = BTOTZoneSSG - BABSZoneSSG; + state.dataHeatBal->EnclSolDB(enclosureNum) = BTOTZone - BABSZone; - if (state.dataSurface->EnclSolDB(enclosureNum) < 0.0) { - state.dataSurface->EnclSolDB(enclosureNum) = 0.0; + if (state.dataHeatBal->EnclSolDB(enclosureNum) < 0.0) { + state.dataHeatBal->EnclSolDB(enclosureNum) = 0.0; } // Variables for reporting @@ -8472,8 +8471,8 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) // Add interior window contribution to EnclSolDB for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { - state.dataSurface->EnclSolDB(enclosureNum) += state.dataSurface->EnclSolDBIntWin(enclosureNum); - state.dataHeatBal->ZoneBmSolFrIntWinsRep(enclosureNum) = state.dataSurface->EnclSolDBIntWin(enclosureNum) * state.dataEnvrn->BeamSolarRad; + state.dataHeatBal->EnclSolDB(enclosureNum) += state.dataHeatBal->EnclSolDBIntWin(enclosureNum); + state.dataHeatBal->ZoneBmSolFrIntWinsRep(enclosureNum) = state.dataHeatBal->EnclSolDBIntWin(enclosureNum) * state.dataEnvrn->BeamSolarRad; state.dataHeatBal->ZoneBmSolFrIntWinsRepEnergy(enclosureNum) = state.dataHeatBal->ZoneBmSolFrIntWinsRep(enclosureNum) * state.dataGlobal->TimeStepZoneSec; //[J] } @@ -8556,13 +8555,9 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) using ScheduleManager::GetCurrentScheduleValue; using namespace MultiLayerOptics; - if (state.dataSolarShading->MustAllocSolarShading) { - state.dataSurface->EnclSolDBIntWin.allocate(state.dataGlobal->NumOfZones); - } - // TODO - allocation - state.dataSurface->EnclSolDB = 0.0; - state.dataSurface->EnclSolDBIntWin = 0.0; + state.dataHeatBal->EnclSolDB = 0.0; + state.dataHeatBal->EnclSolDBIntWin = 0.0; state.dataSurface->SurfOpaqAI = 0.0; state.dataSurface->SurfOpaqAO = 0.0; @@ -8755,7 +8750,7 @@ void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) state.dataHeatBal->ZoneDifSolFrExtWinsRepEnergy(enclosureNum) = state.dataHeatBal->ZoneDifSolFrExtWinsRep(enclosureNum) * state.dataGlobal->TimeStepZoneSec; //[J] } - state.dataSurface->EnclSolDB(enclosureNum) = BTOTZone - BABSZone; + state.dataHeatBal->EnclSolDB(enclosureNum) = BTOTZone - BABSZone; } } diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index c419cd6d177..55d84434dda 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -3102,7 +3102,7 @@ namespace WindowComplexManager { if (CalcCondition == DataBSDFWindow::noCondition) { ShadeFlag = state.dataSurface->SurfWinShadingFlag(SurfNum); dir = state.dataHeatBal->SurfQRadSWOutIncident(SurfNum) + - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex); // TODO, check , ! + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex); // TODO, check , ! // currently using Exterior beam plus diffuse solar incident on surface // plus zone short wave. CHECK // if (dir.ne.0.0d0) then @@ -3460,11 +3460,11 @@ namespace WindowComplexManager { // Construct(ConstrNumSh)%TransDiff) // END IF state.dataSurface->SurfWinHeatGain(SurfNum) -= - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; state.dataSurface->SurfWinHeatTransfer(SurfNum) -= - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; if (ShadeFlag == WinShadingType::IntShade || ShadeFlag == WinShadingType::ExtShade) { state.dataSurface->SurfWinShadingAbsorbedSolar(SurfNum) = diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 17caf38a96e..35d07ae6b5a 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -3926,12 +3926,12 @@ namespace WindowManager { state.dataConstruction->Construct(ConstrNumSh).TransDiff); } state.dataSurface->SurfWinHeatGain(SurfNum) -= - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; state.dataSurface->SurfWinHeatTransfer(SurfNum) -= - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; // shouldn't this be + outward flowing fraction of absorbed SW? -- do not know whose comment this is? LKL (9/2012) state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; if (ANY_SHADE_SCREEN(ShadeFlag) || ANY_BLIND(ShadeFlag)) { state.dataSurface->SurfWinShadingAbsorbedSolar(SurfNum) = diff --git a/src/EnergyPlus/WindowManagerExteriorThermal.cc b/src/EnergyPlus/WindowManagerExteriorThermal.cc index f89496a773e..f681e9c31a4 100644 --- a/src/EnergyPlus/WindowManagerExteriorThermal.cc +++ b/src/EnergyPlus/WindowManagerExteriorThermal.cc @@ -243,10 +243,10 @@ namespace WindowManager { } auto TransDiff = construction.TransDiff; - state.dataSurface->SurfWinHeatGain(SurfNum) -= state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * TransDiff; - state.dataSurface->SurfWinHeatTransfer(SurfNum) -= state.dataHeatBal->QS(surface.SolarEnclIndex) * surface.Area * TransDiff; + state.dataSurface->SurfWinHeatGain(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * surface.Area * TransDiff; + state.dataSurface->SurfWinHeatTransfer(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(surface.SolarEnclIndex) * surface.Area * TransDiff; state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->QS(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * surface.Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * surface.Area * TransDiff; for (auto k = 1; k <= surface.getTotLayers(state); ++k) { state.dataSurface->SurfaceWindow(SurfNum).ThetaFace(2 * k - 1) = state.dataWindowManager->thetas(2 * k - 1); diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 9c23fe2db9e..6ad17ba0c98 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -739,7 +739,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -772,7 +771,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataHeatBalFanSys->ZoneLatentGain.allocate(1); state->dataGlobal->TimeStepZoneSec = 900; SolarShading::AllocateModuleArrays(*state); - + HeatBalanceManager::AllocateZoneHeatBalArrays(*state); AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); @@ -803,7 +802,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceI state->dataLoopNodes->Node.deallocate(); state->dataGlobal->KickOffSimulation = false; state->dataHeatBalSurf->TempSurfInTmp.deallocate(); - state->dataHeatBal->SurfTempEffBulkAir.deallocate(); state->dataHeatBalSurf->TH.deallocate(); state->dataHeatBal->HConvIn.deallocate(); state->dataMstBal->HConvInFD.deallocate(); @@ -1277,7 +1275,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -1317,6 +1314,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) // Set up AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); + HeatBalanceManager::AllocateZoneHeatBalArrays(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); OutAirNodeManager::GetOutAirNodesInput(*state); @@ -1853,7 +1851,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -1887,6 +1884,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) // Set up AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); + HeatBalanceManager::AllocateZoneHeatBalArrays(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); @@ -1974,7 +1972,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_SurfaceCOnstructionIndexTest state->dataConstruction->Construct(1).CTFTUserOut(0) = 0.5; state->dataConstruction->Construct(1).CTFTUserIn(0) = 0.25; state->dataConstruction->Construct(1).CTFTUserSource(0) = 0.25; - + SurfaceGeometry::AllocateSurfaceArrays(*state); AllocateSurfaceHeatBalArrays(*state); // allocates a host of variables related to CTF calculations OutputProcessor::GetReportVariableInput(*state); @@ -2421,7 +2419,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA state->dataHeatBalSurf->TempSurfInTmp(4) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(5) = 25.0; state->dataHeatBalSurf->TempSurfInTmp(6) = 25.0; - state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataLoopNodes->Node(1).Temp = 20.0; state->dataLoopNodes->Node(2).Temp = 20.0; @@ -2463,6 +2460,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); + HeatBalanceManager::AllocateZoneHeatBalArrays(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); state->dataSurface->SurfTAirRef(1) = DataSurfaces::ZoneMeanAirTemp; @@ -2573,10 +2571,10 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInterzoneRadFactorCalc) state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); state->dataSurface->Surface.allocate(state->dataSurface->TotSurfaces); state->dataConstruction->Construct.allocate(state->dataHeatBal->TotConstructs); - state->dataHeatBalSurf->EnclSolVMULT.allocate(state->dataGlobal->NumOfZones); + state->dataHeatBal->EnclSolVMULT.allocate(state->dataGlobal->NumOfZones); state->dataConstruction->Construct(1).TransDiff = 0.1; - state->dataHeatBalSurf->EnclSolVMULT(1) = 1.0; - state->dataHeatBalSurf->EnclSolVMULT(2) = 1.0; + state->dataHeatBal->EnclSolVMULT(1) = 1.0; + state->dataHeatBal->EnclSolVMULT(2) = 1.0; state->dataSurface->Surface(1).HeatTransSurf = true; state->dataSurface->Surface(1).Construction = 1; @@ -3076,7 +3074,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) state->dataHeatBalFanSys->ZoneAirHumRat.allocate(1); state->dataHeatBalSurf->TempSurfInTmp.allocate(6); - state->dataHeatBal->SurfTempEffBulkAir.allocate(6); state->dataHeatBalSurf->TH.allocate(2, 2, 6); state->dataHeatBal->HConvIn.allocate(6); @@ -3094,6 +3091,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestInitHBInterzoneWindow) AllocateSurfaceHeatBalArrays(*state); createFacilityElectricPowerServiceObject(*state); + HeatBalanceManager::AllocateZoneHeatBalArrays(*state); SolarShading::AllocateModuleArrays(*state); SolarShading::DetermineShadowingCombinations(*state); diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index df7649b807b..8d21320cfb7 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -563,7 +563,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataSurface->SurfWinGainIRGlazToZoneRep.allocate(3); state->dataSurface->SurfWinGapConvHtFlowRep.allocate(3); state->dataSurface->SurfWinGapConvHtFlowRepEnergy.allocate(3); - state->dataHeatBal->QS.allocate(1); + state->dataHeatBal->EnclSolQSWRad.allocate(1); state->dataSurface->SurfWinLossSWZoneToOutWinRep.allocate(3); state->dataSurface->SurfWinSysSolTransmittance.allocate(3); state->dataSurface->SurfWinSysSolAbsorptance.allocate(3); @@ -596,7 +596,7 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalFanSys->QSteamBaseboardSurf = 0.0; state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; - state->dataHeatBal->QS = 0.0; + state->dataHeatBal->EnclSolQSWRad = 0.0; Real64 inSurfTemp; Real64 outSurfTemp; @@ -2792,7 +2792,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataSurface->SurfWinGainIRGlazToZoneRep.allocate(3); state->dataSurface->SurfWinGapConvHtFlowRep.allocate(3); state->dataSurface->SurfWinGapConvHtFlowRepEnergy.allocate(3); - state->dataHeatBal->QS.allocate(1); + state->dataHeatBal->EnclSolQSWRad.allocate(1); state->dataSurface->SurfWinLossSWZoneToOutWinRep.allocate(3); state->dataSurface->SurfWinSysSolTransmittance.allocate(3); state->dataSurface->SurfWinSysSolAbsorptance.allocate(3); @@ -2824,7 +2824,7 @@ TEST_F(EnergyPlusFixture, WindowManager_SrdLWRTest) state->dataHeatBalFanSys->QSteamBaseboardSurf = 0.0; state->dataHeatBalFanSys->QElecBaseboardSurf = 0.0; state->dataSurface->SurfWinTransSolar = 0.0; - state->dataHeatBal->QS = 0.0; + state->dataHeatBal->EnclSolQSWRad = 0.0; Real64 inSurfTemp; Real64 outSurfTemp; From fd55ea47e7e7b0798cdf5a16c7152a74d164daf6 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 15 May 2021 11:23:04 -0700 Subject: [PATCH 15/25] more array initialization reordering; reduce duplicate condition checks and function calls --- src/EnergyPlus/DataHeatBalance.hh | 4 +- src/EnergyPlus/DataSurfaces.cc | 30 +----------- src/EnergyPlus/DataSurfaces.hh | 4 -- src/EnergyPlus/DaylightingDevices.cc | 4 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 11 +++-- src/EnergyPlus/InternalHeatGains.cc | 4 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 - src/EnergyPlus/SolarShading.cc | 48 +++++-------------- src/EnergyPlus/SolarShading.hh | 4 -- src/EnergyPlus/WindowComplexManager.cc | 11 +++-- src/EnergyPlus/WindowManager.cc | 12 ++--- 11 files changed, 38 insertions(+), 96 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index 4b8d9cc6e72..a0435280dab 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -283,8 +283,8 @@ namespace DataHeatBalance { constexpr Real64 ThinMaterialLayerThreshold(0.003); // 3 mm lower limit to expected material layers // Const for initialization - constexpr Real64 ZoneInitialTemp(23.0); // Zone temperature for initialization - constexpr Real64 SurfInitialTemp(23.0); // Surface temperature for initialization + constexpr Real64 ZoneInitialTemp(23.0); // Zone temperature for initialization + constexpr Real64 SurfInitialTemp(23.0); // Surface temperature for initialization constexpr Real64 SurfInitialConvCoeff(3.076); // Surface convective coefficient for initialization // Air Argon Krypton Xenon diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 91191dbee72..8f358403103 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -421,35 +421,7 @@ Real64 SurfaceData::getSWIncident(EnergyPlusData &state, const int t_SurfNum) // PURPOSE OF THIS SUBROUTINE: // Return total short wave incident to the surface - return state.dataHeatBal->SurfQRadSWOutIncident(t_SurfNum) + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); -} - -Real64 SurfaceData::getSWBeamIncident(EnergyPlusData &state, const int t_SurfNum) -{ - // SUBROUTINE INFORMATION: - // AUTHOR Simon Vidanovic - // DATE WRITTEN July 2016 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Return total short wave incident from outside beam - - return state.dataHeatBal->SurfQRadSWOutIncidentBeam(t_SurfNum); -} - -Real64 SurfaceData::getSWDiffuseIncident(EnergyPlusData &state, const int t_SurfNum) -{ - // SUBROUTINE INFORMATION: - // AUTHOR Simon Vidanovic - // DATE WRITTEN July 2016 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Return total short wave diffuse incident to the surface - - return state.dataHeatBal->SurfQRadSWOutIncidentSkyDiffuse(t_SurfNum) + state.dataHeatBal->SurfQRadSWOutIncidentGndDiffuse(t_SurfNum) + + return state.dataHeatBal->SurfQRadSWOutIncident(t_SurfNum) + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(t_SurfNum).SolarEnclIndex); } diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 3be6e9b6e88..be2b8896352 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -692,10 +692,6 @@ namespace DataSurfaces { static Real64 getSWIncident(EnergyPlusData &state, int t_SurfNum); - static Real64 getSWBeamIncident(EnergyPlusData &state, int t_SurfNum); - - static Real64 getSWDiffuseIncident(EnergyPlusData &state, int t_SurfNum); - int getTotLayers(EnergyPlusData &state) const; Real64 get_average_height(EnergyPlusData &state) const; diff --git a/src/EnergyPlus/DaylightingDevices.cc b/src/EnergyPlus/DaylightingDevices.cc index 7cf2eaf83b3..7f77f36095d 100644 --- a/src/EnergyPlus/DaylightingDevices.cc +++ b/src/EnergyPlus/DaylightingDevices.cc @@ -1511,8 +1511,8 @@ namespace DaylightingDevices { state.dataSurface->SurfWinTransSolar(DiffSurf); // Add diffuse interior shortwave reflected from zone surfaces and from zone sources, lights, etc. - QRefl += - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(DiffSurf).SolarEnclIndex) * state.dataSurface->Surface(DiffSurf).Area * transDiff; + QRefl += state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(DiffSurf).SolarEnclIndex) * + state.dataSurface->Surface(DiffSurf).Area * transDiff; TotTDDPipeGain = state.dataSurface->SurfWinTransSolar(state.dataDaylightingDevicesData->TDDPipe(PipeNum).Dome) - state.dataHeatBal->SurfQRadSWOutIncident(DiffSurf) * state.dataSurface->Surface(DiffSurf).Area + diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index c0cca69f382..3e6880e96b5 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2164,10 +2164,10 @@ void InitThermalAndFluxHistories(EnergyPlusData &state) int const lastSurf = state.dataHeatBal->Zone(zoneNum).HTSurfaceLast; for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = SurfInitialTemp; - state.dataHeatBalSurf->SUMH(SurfNum) = 0; // module level array + state.dataHeatBalSurf->SUMH(SurfNum) = 0; // module level array state.dataHeatBalSurf->TempSurfIn(SurfNum) = SurfInitialTemp; // module level array state.dataHeatBalSurf->TempSurfInTmp(SurfNum) = SurfInitialTemp; // module level array - state.dataHeatBal->HConvIn(SurfNum) = SurfInitialConvCoeff; // module level array + state.dataHeatBal->HConvIn(SurfNum) = SurfInitialConvCoeff; // module level array state.dataHeatBalSurf->HcExtSurf(SurfNum) = 0.0; state.dataHeatBalSurf->HAirExtSurf(SurfNum) = 0.0; state.dataHeatBalSurf->HSkyExtSurf(SurfNum) = 0.0; @@ -2724,8 +2724,11 @@ void InitSolarHeatGains(EnergyPlusData &state) if (state.dataHeatBal->CalcWindowRevealReflection) CalcBeamSolarOnWinRevealSurface(state); - if (state.dataWindowManager->inExtWindowModel->isExternalLibraryModel() && state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { - CalcInteriorSolarDistributionWCE(state); + if (state.dataWindowManager->inExtWindowModel->isExternalLibraryModel()) { + CalcAbsorbedOnExteriorOpaqueSurfaces(state); + } else if (state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { + CalcAbsorbedOnExteriorOpaqueSurfaces(state); + CalcInteriorSolarDistributionWCESimple(state); } else { CalcInteriorSolarDistribution(state); } diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 6c5de7aa1c4..fb396d44bae 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -6490,8 +6490,8 @@ namespace InternalHeatGains { for (int SurfNum = firstSurf; SurfNum <= lastSurf; ++SurfNum) { int const radEnclosureNum = state.dataHeatBal->Zone(zoneNum).RadiantEnclosureNum; if (!state.dataGlobal->doLoadComponentPulseNow) { - state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = - state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); + state.dataHeatBal->SurfQRadThermInAbs(SurfNum) = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum) * + state.dataHeatBal->TMULT(radEnclosureNum) * state.dataHeatBal->ITABSF(SurfNum); } else { state.dataInternalHeatGains->curQL = state.dataHeatBal->EnclRadQThermalRad(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 500bcec4fab..9ff554a51f3 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -207,7 +207,6 @@ void CalcTempDistModel(EnergyPlusData &state, int const ZoneNum) // index number // appropriate subroutine // Using/Aliasing - using DataSurfaces::ZoneMeanAirTemp; using General::FindNumberInList; using ScheduleManager::GetCurrentScheduleValue; @@ -778,7 +777,6 @@ void SetSurfHBDataForTempDistModel(EnergyPlusData &state, int const ZoneNum) // using DataHVACGlobals::RetTempMin; using DataSurfaces::AdjacentAirTemp; using DataSurfaces::AirFlowWindow_Destination_ReturnAir; - using DataSurfaces::ZoneMeanAirTemp; using InternalHeatGains::SumAllReturnAirConvectionGains; using InternalHeatGains::SumAllReturnAirLatentGains; using Psychrometrics::PsyCpAirFnW; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index fdac0fdd0c3..09d11ff6105 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -761,6 +761,17 @@ void AllocateModuleArrays(EnergyPlusData &state) // TODO - check allocation here state.dataSolarShading->CTHETA.dimension(state.dataSurface->TotSurfaces, 0.0); state.dataSolarShading->SAREA.dimension(state.dataSurface->TotSurfaces, 0.0); + if (!state.dataWindowManager->inExtWindowModel->isExternalLibraryModel() || !state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { + state.dataSolarShading->IntBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->ExtBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransBmSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransDifSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransDifSolarGnd.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransDifSolarSky.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransBmBmSolar.allocate(state.dataSurface->TotSurfaces); + state.dataSolarShading->WinTransBmDifSolar.allocate(state.dataSurface->TotSurfaces); + } + state.dataHeatBal->SunlitFracHR.dimension(24, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SunlitFrac.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); state.dataHeatBal->SunlitFracWithoutReveal.dimension(state.dataGlobal->NumOfTimeStepInHour, 24, state.dataSurface->TotSurfaces, 0.0); @@ -6271,18 +6282,6 @@ void CalcInteriorSolarDistribution(EnergyPlusData &state) Array1D CFBoverlap; // Sum of boverlap for each back surface Array2D CFDirBoverlap; // Directional boverlap (Direction, IBack) - if (state.dataSolarShading->MustAllocSolarShading) { - state.dataSolarShading->IntBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->ExtBeamAbsByShadFac.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolarGnd.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransDifSolarSky.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmBmSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->WinTransBmDifSolar.allocate(state.dataSurface->TotSurfaces); - state.dataSolarShading->MustAllocSolarShading = false; - } - #ifdef EP_Count_Calls ++state.dataTimingsData->NumIntSolarDist_Calls; #endif @@ -8521,25 +8520,6 @@ void CalcAbsorbedOnExteriorOpaqueSurfaces(EnergyPlusData &state) } } -void CalcInteriorSolarDistributionWCE(EnergyPlusData &state) -{ - - // SUBROUTINE INFORMATION: - // AUTHOR Simon Vidanovic - // DATE WRITTEN May 2017 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // Calculates solar distribution - - CalcAbsorbedOnExteriorOpaqueSurfaces(state); - - if (state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { - CalcInteriorSolarDistributionWCESimple(state); - } // else for built in BSDF (possible future implementation) -} - void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state) { @@ -10021,11 +10001,7 @@ void WindowShadingManager(EnergyPlusData &state) state.dataSurface->SurfWinSlatsAngIndex(ISurf) = SlatsAngIndex; state.dataSurface->SurfWinSlatsAngInterpFac(ISurf) = (SlatAng - DeltaAng * (SlatsAngIndex - 1)) * DeltaAng_inv; - // TODO: floating point error is causing the result diff - // double test1 = state.dataSurface->SurfWinSlatsAngInterpFac(ISurf); - // double test2 = (SlatAng - DeltaAng * (SlatsAngIndex - 1)) / DeltaAng; - // std::cout << state.dataEnvrn->Month << "," << state.dataEnvrn->DayOfMonth << "," << state.dataGlobal->HourOfDay << "," << - // state.dataGlobal->TimeStep << "," << std::abs(test1 - test2) << "\n"; + } } } // End of check if interior or exterior or between glass blind in place diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index 16150f2a449..49c938e634f 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -247,8 +247,6 @@ namespace SolarShading { void CalcAbsorbedOnExteriorOpaqueSurfaces(EnergyPlusData &state); - void CalcInteriorSolarDistributionWCE(EnergyPlusData &state); - void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state); int WindowScheduledSolarAbs(EnergyPlusData &state, @@ -430,7 +428,6 @@ struct SolarShadingData : BaseGlobalStruct std::unique_ptr penumbra = nullptr; #endif - bool MustAllocSolarShading = true; bool GetInputFlag = true; bool firstTime = true; bool debugging = false; @@ -530,7 +527,6 @@ struct SolarShadingData : BaseGlobalStruct this->ShadowingCalcFrequency = 0; // Frequency for Shadowing Calculations this->ShadowingDaysLeft = 0; // Days left in current shadowing period this->debugging = false; - this->MustAllocSolarShading = true; this->GetInputFlag = true; this->firstTime = true; this->HCNS.deallocate(); diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 55d84434dda..909525ff2bd 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -3459,12 +3459,13 @@ namespace WindowComplexManager { // TransDiff = InterpSW(SurfaceWindow(SurfNum)%SwitchingFactor,Construct(ConstrNum)%TransDiff, & // Construct(ConstrNumSh)%TransDiff) // END IF - state.dataSurface->SurfWinHeatGain(SurfNum) -= - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; - state.dataSurface->SurfWinHeatTransfer(SurfNum) -= - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataSurface->SurfWinHeatGain(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * + state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataSurface->SurfWinHeatTransfer(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * + state.dataSurface->Surface(SurfNum).Area * TransDiff; state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * + TransDiff; if (ShadeFlag == WinShadingType::IntShade || ShadeFlag == WinShadingType::ExtShade) { state.dataSurface->SurfWinShadingAbsorbedSolar(SurfNum) = diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 35d07ae6b5a..e0276a8ccfd 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -3925,13 +3925,14 @@ namespace WindowManager { state.dataConstruction->Construct(ConstrNum).TransDiff, state.dataConstruction->Construct(ConstrNumSh).TransDiff); } - state.dataSurface->SurfWinHeatGain(SurfNum) -= - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; - state.dataSurface->SurfWinHeatTransfer(SurfNum) -= - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataSurface->SurfWinHeatGain(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * + state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataSurface->SurfWinHeatTransfer(SurfNum) -= state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * + state.dataSurface->Surface(SurfNum).Area * TransDiff; // shouldn't this be + outward flowing fraction of absorbed SW? -- do not know whose comment this is? LKL (9/2012) state.dataSurface->SurfWinLossSWZoneToOutWinRep(SurfNum) = - state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * TransDiff; + state.dataHeatBal->EnclSolQSWRad(state.dataSurface->Surface(SurfNum).SolarEnclIndex) * state.dataSurface->Surface(SurfNum).Area * + TransDiff; if (ANY_SHADE_SCREEN(ShadeFlag) || ANY_BLIND(ShadeFlag)) { state.dataSurface->SurfWinShadingAbsorbedSolar(SurfNum) = @@ -6682,7 +6683,6 @@ namespace WindowManager { TVisNorm = TScBmBmVis * (TBmBmVis + TDifVis * RGlFrontVis * RScBackVis / (1 - RGlDiffFrontVis * RScDifBackVis)) + TScBmDifVis * TDifVis / (1 - RGlDiffFrontVis * RScDifBackVis); } else { - // TODO - NOT USING SurfWinSlatAngThisTS VarSlats = false; if (state.dataHeatBal->Blind(BlNum).SlatAngleType == VariableSlats) VarSlats = true; SlatAng = state.dataHeatBal->Blind(BlNum).SlatAngle * DataGlobalConstants::DegToRadians; From 63474d7c41cf784b6fcfb7631261857ab1ad01f8 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 15 May 2021 16:19:02 -0700 Subject: [PATCH 16/25] clean up --- .../Interzone Air Wall NFP and Design.md | 2 +- src/EnergyPlus/DataHeatBalSurface.hh | 20 +++-- src/EnergyPlus/DataHeatBalance.hh | 5 +- src/EnergyPlus/DataSurfaces.hh | 81 +++++++++---------- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 1 - src/EnergyPlus/HeatBalanceManager.cc | 33 +++++--- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 13 +-- src/EnergyPlus/SolarShading.cc | 2 - src/EnergyPlus/SurfaceGeometry.cc | 2 - 9 files changed, 83 insertions(+), 76 deletions(-) diff --git a/design/FY2019/Interzone Air Wall NFP and Design.md b/design/FY2019/Interzone Air Wall NFP and Design.md index 25bfc455b94..e4a87c6e4e0 100644 --- a/design/FY2019/Interzone Air Wall NFP and Design.md +++ b/design/FY2019/Interzone Air Wall NFP and Design.md @@ -398,7 +398,7 @@ Pertinent variables (*inferring units from usage - not documented - grrr*): `DataHeatBalance::QL` [W?] - Total thermal radiation added to a zone `DataHeatBalance::QS` [W?] - Zone short-wave flux density `DataHeatBalance::QSLights` [W?] - Like QS, but Lights short-wave only. - `DataHeatBalance::EnclSolQSDifSol` [W?] - Like QS, but diffuse solar short-wave only. + `DataHeatBalance::QSDifSol` [W?] - Like QS, but diffuse solar short-wave only. Pertinent functions: diff --git a/src/EnergyPlus/DataHeatBalSurface.hh b/src/EnergyPlus/DataHeatBalSurface.hh index 764dae36a12..73241bd4ccf 100644 --- a/src/EnergyPlus/DataHeatBalSurface.hh +++ b/src/EnergyPlus/DataHeatBalSurface.hh @@ -97,14 +97,16 @@ struct HeatBalSurfData : BaseGlobalStruct Array1D CTFSourceIn0; // Construct.CTFSourceIn(0) Array1D TH11Surf; // TH(1,1,SurfNum) Array1D QsrcHistSurf1; // QsrcHist(SurfNum, 1) - Array1D_int IsAdiabatic; // 0 not adiabatic, 1 is adiabatic - Array1D_int IsNotAdiabatic; // 1 not adiabatic, 0 is adiabatic - Array1D_int IsSource; // 0 no internal source/sink, 1 has internal source/sing - Array1D_int IsNotSource; // 1 no internal source/sink, 0 has internal source/sing - Array1D_int IsPoolSurf; // 0 not pool, 1 is pool - Array1D_int IsNotPoolSurf; // 1 not pool, 0 is pool - Array1D TempTermSurf; // TempTerm for heatbalance equation - Array1D TempDivSurf; // Divisor for heatbalance equation + + // todo: merge Is and IsNot and reduce the assignation at each time steps + Array1D_int IsAdiabatic; // 0 not adiabatic, 1 is adiabatic + Array1D_int IsNotAdiabatic; // 1 not adiabatic, 0 is adiabatic + Array1D_int IsSource; // 0 no internal source/sink, 1 has internal source/sing + Array1D_int IsNotSource; // 1 no internal source/sink, 0 has internal source/sing + Array1D_int IsPoolSurf; // 0 not pool, 1 is pool + Array1D_int IsNotPoolSurf; // 1 not pool, 0 is pool + Array1D TempTermSurf; // TempTerm for heatbalance equation + Array1D TempDivSurf; // Divisor for heatbalance equation // end group added to support CalcHeatBalanceInsideSurf2CTFOnly Array1D TempSurfIn; // Temperature of the Inside Surface for each heat transfer surface Array1D TempInsOld; // TempSurfIn from previous iteration for convergence check @@ -117,6 +119,8 @@ struct HeatBalSurfData : BaseGlobalStruct Array1D TempUserLoc; // Temperature at the user specified location for each heat transfer surface Array1D TempSurfInRep; // Temperature of the Inside Surface for each heat transfer surface Array1D TempSurfInMovInsRep; // Temperature of interior movable insulation on the side facing the zone + + // todo: to SurfRep arrays // (report) Array1D QConvInReport; // Surface convection heat gain at inside face [J] Array1D QdotConvInRep; // Surface convection heat transfer rate at inside face surface [W] diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index a0435280dab..377157d9fd5 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -2143,10 +2143,11 @@ struct HeatBalanceData : BaseGlobalStruct Array1D NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions Array1D NominalU; // Nominal U value for each construction -- used in matching interzone surfaces + // todo - rename and reordering Array1D SurfTempEffBulkAir; // air temperature adjacent to the surface used for inside surface heat balances Array1D HConvIn; // INSIDE CONVECTION COEFFICIENT Array1D SurfAnisoSkyMult; // Multiplier on exterior-surface sky view factor to account for - // anisotropy of sky radiance; = 1.0 for for isotropic sky // todo - solarshading + // anisotropy of sky radiance; = 1.0 for for isotropic sky Array1D DifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) Array3D DifShdgRatioIsoSkyHRTS; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) Array1D curDifShdgRatioIsoSky; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky) @@ -2181,9 +2182,11 @@ struct HeatBalanceData : BaseGlobalStruct Array1D EnclSolVMULT; // 1/(Sum Of A Zone's Inside Surfaces Area*Absorptance) Array1D EnclRadQThermalRad; // TOTAL THERMAL RADIATION ADDED TO ZONE or Radiant Enclosure (group of zones) + // todo - the following in absorptance branch Array1D ITABSF; // FRACTION OF THERMAL FLUX ABSORBED (PER UNIT AREA) Array1D TMULT; // TMULT - MULTIPLIER TO COMPUTE 'ITABSF' + // todo - the following in absorptance branch Array2D SunlitFracHR; // Hourly fraction of heat transfer surface that is sunlit Array2D CosIncAngHR; // Hourly cosine of beam radiation incidence angle on surface Array3D SunlitFrac; // TimeStep fraction of heat transfer surface that is sunlit diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index be2b8896352..9f70e9a534a 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1218,6 +1218,8 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s) Array1D SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree) Array1D SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for + Array1D SurfLowTempErrCount; + Array1D SurfHighTempErrCount; // Surface solar arrays Array1D SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface @@ -1281,8 +1283,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfWindDirEMSOverrideValue; // value to use for EMS override of outside wind direction (deg) // Surface Properties - Array1D SurfLowTempErrCount; - Array1D SurfHighTempErrCount; Array1D SurfDaylightingShelfInd; // Pointer to daylighting shelf Array1D SurfSchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported Array1D SurfExternalShadingSchInd; // Schedule for a the external shading @@ -1597,36 +1597,49 @@ struct SurfacesData : BaseGlobalStruct this->X0.deallocate(); this->Y0.deallocate(); this->Z0.deallocate(); - this->SurfOpaqAI.deallocate(); - this->SurfOpaqAO.deallocate(); + this->AllHTSurfaceList.clear(); + this->AllIZSurfaceList.clear(); + this->AllHTNonWindowSurfaceList.clear(); + this->AllHTWindowSurfaceList.clear(); + this->AllSurfaceListReportOrder.clear(); + + this->SurfOutDryBulbTemp.deallocate(); + this->SurfOutWetBulbTemp.deallocate(); + this->SurfOutWindSpeed.deallocate(); + this->SurfOutWindDir.deallocate(); + this->SurfGenericContam.deallocate(); + this->SurfLowTempErrCount.deallocate(); + this->SurfHighTempErrCount.deallocate(); + this->SurfAirSkyRadSplit.deallocate(); + this->SurfSunCosHourly.deallocate(); + this->SurfSunlitArea.deallocate(); + this->SurfSunlitFrac.deallocate(); + this->SurfSkySolarInc.deallocate(); + this->SurfGndSolarInc.deallocate(); this->SurfBmToBmReflFacObs.deallocate(); this->SurfBmToDiffReflFacObs.deallocate(); this->SurfBmToDiffReflFacGnd.deallocate(); this->SurfSkyDiffReflFacGnd.deallocate(); - this->SurfWinA.deallocate(); - this->SurfWinADiffFront.deallocate(); - this->SurfWinACFOverlap.deallocate(); - this->SurfAirSkyRadSplit.deallocate(); - this->SurfSunCosHourly.deallocate(); + this->SurfOpaqAI.deallocate(); + this->SurfOpaqAO.deallocate(); + this->SurfPenumbraID.deallocate(); this->SurfReflFacBmToDiffSolObs.deallocate(); this->SurfReflFacBmToDiffSolGnd.deallocate(); this->SurfReflFacBmToBmSolObs.deallocate(); this->SurfReflFacSkySolObs.deallocate(); this->SurfReflFacSkySolGnd.deallocate(); this->SurfCosIncAveBmToBmSolObs.deallocate(); - this->SurfSunlitArea.deallocate(); - this->SurfSunlitFrac.deallocate(); - this->SurfSkySolarInc.deallocate(); - this->SurfGndSolarInc.deallocate(); - this->AllHTSurfaceList.clear(); - this->AllIZSurfaceList.clear(); - this->AllHTNonWindowSurfaceList.clear(); - this->AllHTWindowSurfaceList.clear(); - this->AllSurfaceListReportOrder.clear(); - this->SurfOutDryBulbTemp.deallocate(); - this->SurfOutWetBulbTemp.deallocate(); - this->SurfOutWindSpeed.deallocate(); - this->SurfOutWindDir.deallocate(); + this->SurfShadowDiffuseSolRefl.deallocate(); + this->SurfShadowDiffuseVisRefl.deallocate(); + this->SurfShadowGlazingFrac.deallocate(); + this->SurfShadowGlazingConstruct.deallocate(); + this->SurfShadowPossibleObstruction.deallocate(); + this->SurfShadowRecSurfNum.deallocate(); + this->SurfShadowDisabledZoneList.deallocate(); + this->SurfMaterialMovInsulExt.deallocate(); + this->SurfMaterialMovInsulInt.deallocate(); + this->SurfSchedMovInsulExt.deallocate(); + this->SurfSchedMovInsulInt.deallocate(); this->SurfEMSConstructionOverrideON.deallocate(); this->SurfEMSConstructionOverrideValue.deallocate(); this->SurfEMSOverrideIntConvCoef.deallocate(); @@ -1643,23 +1656,6 @@ struct SurfacesData : BaseGlobalStruct this->SurfViewFactorGroundEMSOverrideValue.deallocate(); this->SurfWindDirEMSOverrideOn.deallocate(); this->SurfWindDirEMSOverrideValue.deallocate(); - - this->SurfLowTempErrCount.deallocate(); - this->SurfHighTempErrCount.deallocate(); - - this->SurfShadowDiffuseSolRefl.deallocate(); - this->SurfShadowDiffuseVisRefl.deallocate(); - this->SurfShadowGlazingFrac.deallocate(); - this->SurfShadowGlazingConstruct.deallocate(); - this->SurfShadowPossibleObstruction.deallocate(); - this->SurfShadowRecSurfNum.deallocate(); - this->SurfShadowDisabledZoneList.deallocate(); - - this->SurfMaterialMovInsulExt.deallocate(); - this->SurfMaterialMovInsulInt.deallocate(); - this->SurfSchedMovInsulExt.deallocate(); - this->SurfSchedMovInsulInt.deallocate(); - this->SurfDaylightingShelfInd.deallocate(); this->SurfSchedExternalShadingFrac.deallocate(); this->SurfExternalShadingSchInd.deallocate(); @@ -1667,7 +1663,6 @@ struct SurfacesData : BaseGlobalStruct this->SurfSurroundingSurfacesNum.deallocate(); this->SurfHasLinkedOutAirNode.deallocate(); this->SurfLinkedOutAirNode.deallocate(); - this->SurfPenumbraID.deallocate(); this->SurfExtEcoRoof.deallocate(); this->SurfExtCavityPresent.deallocate(); this->SurfExtCavNum.deallocate(); @@ -1677,10 +1672,9 @@ struct SurfacesData : BaseGlobalStruct this->SurfICSPtr.deallocate(); this->SurfIsRadSurfOrVentSlabOrPool.deallocate(); this->SurfIsShadowing.deallocate(); - this->SurfGenericContam.deallocate(); + this->SurfTAirRef.deallocate(); this->SurfIntConvCoeff.deallocate(); this->SurfExtConvCoeff.deallocate(); - this->SurfTAirRef.deallocate(); this->SurfIntConvClassification.deallocate(); this->SurfIntConvHcModelEq.deallocate(); this->SurfIntConvHcUserCurveIndex.deallocate(); @@ -1700,6 +1694,9 @@ struct SurfacesData : BaseGlobalStruct this->SurfIntConvSurfGetsRadiantHeat.deallocate(); this->SurfIntConvSurfHasActiveInIt.deallocate(); + this->SurfWinA.deallocate(); + this->SurfWinADiffFront.deallocate(); + this->SurfWinACFOverlap.deallocate(); this->SurfWinTransSolar.deallocate(); this->SurfWinBmSolar.deallocate(); this->SurfWinBmBmSolar.deallocate(); diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index afc39688a15..7931599d554 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -2000,7 +2000,6 @@ namespace HeatBalanceIntRadExchange { { static std::string const routineName("GetRadiantSystemSurface: "); // include trailing blank space - // TODO - find by index? // For radiant zone equipment, find the referenced surface and check if it is in the same zone or radiant enclosure int const surfNum = UtilityRoutines::FindItemInList(SurfaceName, state.dataSurface->Surface); diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 428d0ffc8e1..1cdd3783cae 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -5706,15 +5706,30 @@ namespace HeatBalanceManager { void AllocateZoneHeatBalArrays(EnergyPlusData &state) { // Allocate zone / encl hb arrays - state.dataHeatBal->EnclSolDB.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolDBSSG.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolDBIntWin.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolQSDifSol.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolQD.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclSolQDforDaylight.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->EnclRadQThermalRad.dimension(state.dataGlobal->NumOfZones, 0.0); - state.dataHeatBal->ZoneMRT.dimension(state.dataGlobal->NumOfZones, 0.0); - + state.dataHeatBal->EnclSolDB.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclSolDBSSG.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclSolDBIntWin.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclSolQSDifSol.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclSolQD.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclSolQDforDaylight.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->EnclRadQThermalRad.allocate(state.dataGlobal->NumOfZones); + state.dataHeatBal->ZoneMRT.allocate(state.dataGlobal->NumOfZones); + for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { + state.dataHeatBal->EnclSolDB(zoneNum) = 0.0; + state.dataHeatBal->EnclSolDBSSG(zoneNum) = 0.0; + state.dataHeatBal->EnclSolDBIntWin(zoneNum) = 0.0; + state.dataHeatBal->EnclSolQSDifSol(zoneNum) = 0.0; + state.dataHeatBal->EnclSolQD(zoneNum) = 0.0; + state.dataHeatBal->EnclSolQDforDaylight(zoneNum) = 0.0; + state.dataHeatBal->EnclRadQThermalRad(zoneNum) = 0.0; + state.dataHeatBal->ZoneMRT(zoneNum) = 0.0; + } + state.dataHeatBal->EnclSolQSWRad.allocate(state.dataViewFactor->NumOfSolarEnclosures); + state.dataHeatBal->EnclSolQSWRadLights.allocate(state.dataViewFactor->NumOfSolarEnclosures); + for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { + state.dataHeatBal->EnclSolQSWRad(enclosureNum) = 0.0; + state.dataHeatBal->EnclSolQSWRadLights(enclosureNum) = 0.0; + } } void AllocateHeatBalArrays(EnergyPlusData &state) { diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 3e6880e96b5..de74393743c 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2726,9 +2726,9 @@ void InitSolarHeatGains(EnergyPlusData &state) if (state.dataWindowManager->inExtWindowModel->isExternalLibraryModel()) { CalcAbsorbedOnExteriorOpaqueSurfaces(state); - } else if (state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { - CalcAbsorbedOnExteriorOpaqueSurfaces(state); - CalcInteriorSolarDistributionWCESimple(state); + if (state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { + CalcInteriorSolarDistributionWCESimple(state); + } } else { CalcInteriorSolarDistribution(state); } @@ -3541,13 +3541,6 @@ void InitIntSolarDistribution(EnergyPlusData &state) auto &Surface(state.dataSurface->Surface); - if (!allocated(state.dataHeatBal->EnclSolQSWRad)) state.dataHeatBal->EnclSolQSWRad.allocate(state.dataViewFactor->NumOfSolarEnclosures); - if (!allocated(state.dataHeatBal->EnclSolQSWRadLights)) - state.dataHeatBal->EnclSolQSWRadLights.allocate(state.dataViewFactor->NumOfSolarEnclosures); - - state.dataHeatBal->EnclSolQSWRad = 0.0; - state.dataHeatBal->EnclSolQSWRadLights = 0.0; - // COMPUTE TOTAL SHORT-WAVE RADIATION ORIGINATING IN ZONE. // Note: If sun is not up, QS is only internal gains for (int enclosureNum = 1; enclosureNum <= state.dataViewFactor->NumOfSolarEnclosures; ++enclosureNum) { diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 09d11ff6105..41820b844e2 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -10000,8 +10000,6 @@ void WindowShadingManager(EnergyPlusData &state) Real64 SlatsAngIndex = 1 + int(SlatAng * DeltaAng_inv); state.dataSurface->SurfWinSlatsAngIndex(ISurf) = SlatsAngIndex; state.dataSurface->SurfWinSlatsAngInterpFac(ISurf) = (SlatAng - DeltaAng * (SlatsAngIndex - 1)) * DeltaAng_inv; - - } } } // End of check if interior or exterior or between glass blind in place diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 20fdc84ea9c..f553308eee1 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -50,7 +50,6 @@ #include #include #include -#include // ObjexxFCL Headers #include @@ -62,7 +61,6 @@ #include #include #include -#include #include #include #include From fcfbb32620e3cc3a831190b650f72d3169e021af Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Sat, 15 May 2021 16:37:24 -0700 Subject: [PATCH 17/25] fix clang format --- src/EnergyPlus/HeatBalanceSurfaceManager.hh | 4 ++-- src/EnergyPlus/SolarReflectionManager.cc | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.hh b/src/EnergyPlus/HeatBalanceSurfaceManager.hh index 66e5f640dd6..4c6c202476f 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.hh +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.hh @@ -173,8 +173,8 @@ namespace HeatBalanceSurfaceManager { const std::vector &IZSurfs, // Last zone to simulate Optional_int_const ZoneToResimulate = _); - void TestSurfTempCalcHeatBalanceInsideSurf( - EnergyPlusData &state, Real64 TH12, int const SurfNum, DataHeatBalance::ZoneData &zone, int WarmupSurfTemp); + void + TestSurfTempCalcHeatBalanceInsideSurf(EnergyPlusData &state, Real64 TH12, int const SurfNum, DataHeatBalance::ZoneData &zone, int WarmupSurfTemp); void CalcOutsideSurfTemp(EnergyPlusData &state, int SurfNum, // Surface number DO loop counter diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 0a38dc7c713..796ae4e69ab 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -1230,8 +1230,7 @@ namespace SolarReflectionManager { for (state.dataSolarReflectionManager->iObsSurfNum = 1; state.dataSolarReflectionManager->iObsSurfNum <= state.dataSurface->TotSurfaces; ++state.dataSolarReflectionManager->iObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) - continue; + if (!state.dataSurface->SurfShadowPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; if (!state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->iObsSurfNum)) { From 2f12d06f5429ae99989b3b22009322b701b8ec95 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Tue, 18 May 2021 22:20:24 -0700 Subject: [PATCH 18/25] revert some fields --- src/EnergyPlus/DataSurfaces.hh | 22 ++++----- src/EnergyPlus/DaylightingManager.cc | 55 ++++++++++----------- src/EnergyPlus/SolarReflectionManager.cc | 16 +++--- src/EnergyPlus/SolarShading.cc | 18 +++---- src/EnergyPlus/SurfaceGeometry.cc | 14 ++---- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 3 -- 6 files changed, 56 insertions(+), 72 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 9f70e9a534a..018d8e15497 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -633,6 +633,8 @@ namespace DataSurfaces { int OSCPtr; // Pointer to OSC data structure int OSCMPtr; // "Pointer" to OSCM data structure (other side conditions from a model) bool MirroredSurf; // True if it is a mirrored surface + bool IsShadowing; // True if a surface is a shadowing surface + bool IsShadowPossibleObstruction; // True if a surface can be an exterior obstruction // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.) int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface @@ -666,9 +668,9 @@ namespace DataSurfaces { HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0), HeatTransferAlgorithm(iHeatTransferModel::NotSet), BaseSurf(0), NumSubSurfaces(0), Zone(0), ExtBoundCond(0), ExtSolar(false), ExtWind(false), ViewFactorGround(0.0), ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), - MirroredSurf(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), activeWindowShadingControl(0), - HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), - IsAirBoundarySurf(false) + MirroredSurf(false), IsShadowing(false), IsShadowPossibleObstruction(false), SchedShadowSurfIndex(0), IsTransparent(false), + SchedMinValue(0.0), activeWindowShadingControl(0), HasShadeControl(false), activeShadedConstruction(0), FrameDivider(0), + Multiplier(1.0), SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false) { } @@ -1249,12 +1251,11 @@ struct SurfacesData : BaseGlobalStruct Array2D SurfCosIncAveBmToBmSolObs; // Surface parameters specific to solar reflection from surfaces - Array1D SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion - Array1D SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion - Array1D SurfShadowGlazingFrac; // Glazing fraction - Array1D SurfShadowGlazingConstruct; // Glazing construction number - Array1D SurfShadowPossibleObstruction; // True if a surface can be an exterior obstruction - Array1D SurfShadowRecSurfNum; // Receiving surface number + Array1D SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion + Array1D SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion + Array1D SurfShadowGlazingFrac; // Glazing fraction + Array1D SurfShadowGlazingConstruct; // Glazing construction number + Array1D SurfShadowRecSurfNum; // Receiving surface number Array1D> SurfShadowDisabledZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model @@ -1298,7 +1299,6 @@ struct SurfacesData : BaseGlobalStruct Array1D SurfIsPool; // true if this is a pool Array1D SurfICSPtr; // Index to ICS collector Array1D SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group - Array1D SurfIsShadowing; // True if a surface is a shadowing surface // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature @@ -1633,7 +1633,6 @@ struct SurfacesData : BaseGlobalStruct this->SurfShadowDiffuseVisRefl.deallocate(); this->SurfShadowGlazingFrac.deallocate(); this->SurfShadowGlazingConstruct.deallocate(); - this->SurfShadowPossibleObstruction.deallocate(); this->SurfShadowRecSurfNum.deallocate(); this->SurfShadowDisabledZoneList.deallocate(); this->SurfMaterialMovInsulExt.deallocate(); @@ -1671,7 +1670,6 @@ struct SurfacesData : BaseGlobalStruct this->SurfIsPool.deallocate(); this->SurfICSPtr.deallocate(); this->SurfIsRadSurfOrVentSlabOrPool.deallocate(); - this->SurfIsShadowing.deallocate(); this->SurfTAirRef.deallocate(); this->SurfIntConvCoeff.deallocate(); this->SurfExtConvCoeff.deallocate(); diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 35114ba54a6..ebdc9cfc59f 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -3137,7 +3137,7 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) { PierceSurface(state, ObsSurfNum, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface if (hitObs) break; } @@ -3146,9 +3146,8 @@ Real64 CalcObstrMultiplier(EnergyPlusData &state, } else { // Surface octree search // Lambda function for the octree to test for surface hit - auto surfaceHit = [&state, &GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { - int const ObsSurfNum = surface.Index; - if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { + auto surfaceHit = [&GroundHitPt, &hitObs, &URay, &ObsHitPt](SurfaceData const &surface) -> bool { + if (surface.IsShadowPossibleObstruction) { PierceSurface(surface, GroundHitPt, URay, ObsHitPt, hitObs); // Check if ray pierces surface return hitObs; // Ray pierces surface } else { @@ -3407,7 +3406,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( NearestHitSurfNumX = NearestHitSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->SurfIsShadowing(NearestHitSurfNum)) { + if (state.dataSurface->Surface(NearestHitSurfNum).IsShadowing) { if (dot(Ray, state.dataSurface->Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || @@ -3503,7 +3502,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; PierceSurface(state, ObsSurfNum, GroundHitPt, SUNCOS_iHour, ObsHitPt, hitObs); if (hitObs) break; } @@ -3720,7 +3719,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( ReflSurfNumX = ReflSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { + if (state.dataSurface->Surface(ReflSurfNum).IsShadowing) { if (dot(RAYCOS, state.dataSurface->Surface(ReflSurfNum).OutNormVec) < 0.0) ReflSurfNumX = ReflSurfNum + 1; } // Require that the surface can have specular reflection @@ -3785,7 +3784,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; if (ObsSurfNum == ReflSurfNum) continue; PierceSurface(state, ObsSurfNum, HitPtRefl, RAYCOS, HitPtObs, hitObs); if (hitObs) break; @@ -3802,7 +3801,7 @@ void FigureDayltgCoeffsAtPointsForSunPosition( SpecReflectance = POLYF(std::abs(CosIncAngRefl), state.dataConstruction->Construct(ConstrNumRefl).ReflSolBeamFrontCoef); } - if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) + if (state.dataSurface->Surface(ReflSurfNum).IsShadowing && state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) SpecReflectance = state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) * POLYF(std::abs(CosIncAngRefl), state.dataConstruction->Construct(state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum)) @@ -5875,7 +5874,7 @@ void DayltgHitObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); - if (!state.dataSurface->SurfShadowPossibleObstruction(ISurf)) continue; + if (!surface.IsShadowPossibleObstruction) continue; IType = surface.Class; if ((IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf)) { PierceSurface(state, ISurf, R1, RN, DayltgHitObstructionHP, hit); @@ -5883,7 +5882,7 @@ void DayltgHitObstruction(EnergyPlusData &state, ObTrans = 0.0; break; } - } else if (state.dataSurface->SurfIsShadowing(ISurf)) { + } else if (surface.IsShadowing) { PierceSurface(state, ISurf, R1, RN, DayltgHitObstructionHP, hit); if (hit) { // Shading surface is hit // Get solar transmittance of the shading surface @@ -5905,8 +5904,7 @@ void DayltgHitObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit and update transmittance if hit auto solarTransmittance = [=, &state, &R1, &RN, &hit, &ObTrans](SurfaceData const &surface) -> bool { - int const ObsSurfNum = surface.Index; - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) return false; // Do Consider separate octree without filtered surfaces + if (!surface.IsShadowPossibleObstruction) return false; // Do Consider separate octree without filtered surfaces auto const sClass(surface.Class); if ((sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && (&surface != window_base_p)) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); @@ -5914,7 +5912,7 @@ void DayltgHitObstruction(EnergyPlusData &state, ObTrans = 0.0; return true; } - } else if (state.dataSurface->SurfIsShadowing(ObsSurfNum)) { + } else if (surface.IsShadowing) { PierceSurface(surface, R1, RN, state.dataDaylightingManager->DayltgHitObstructionHP, hit); if (hit) { // Shading surface is hit // Get solar transmittance of the shading surface @@ -5979,7 +5977,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Wall/ceiling/floor is in same zone as window (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf) && (ISurf != window_base_iExtBoundCond))) // Exclude window's base or base-adjacent surfaces @@ -5998,8 +5996,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - int const ISurf = surface.Index; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window_base_p) && (&surface != window_base_adjacent_p))) // Exclude window's base or base-adjacent surfaces @@ -6073,7 +6070,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Wall/ceiling/floor is in same zone as windows (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (ISurf != window1_iBaseSurf) && (ISurf != window2_iBaseSurf) && // Exclude windows' base surfaces @@ -6098,8 +6095,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - int const ISurf = surface.Index; - if ((state.dataSurface->SurfIsShadowing(ISurf)) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window1_base_p) && (&surface != window2_base_p) && // Exclude windows' base surfaces @@ -7857,7 +7853,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; PierceSurface(state, ObsSurfNum, DayltgInterReflectedIllumGroundHitPt, SUNCOS_IHR, DayltgInterReflectedIllumObsHitPt, hitObs); if (hitObs) break; } @@ -7909,7 +7905,7 @@ void DayltgInterReflectedIllum(EnergyPlusData &state, NearestHitSurfNumX = NearestHitSurfNum; // Each shadowing surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shadowing surface for reflection. - if (state.dataSurface->SurfIsShadowing(NearestHitSurfNum)) { + if (state.dataSurface->Surface(NearestHitSurfNum).IsShadowing) { if (dot(U, state.dataSurface->Surface(NearestHitSurfNum).OutNormVec) > 0.0) NearestHitSurfNumX = NearestHitSurfNum + 1; } if (!state.dataSysVars->DetailedSkyDiffuseAlgorithm || !state.dataSurface->ShadingTransmittanceVaries || @@ -8625,7 +8621,7 @@ void ComplexFenestrationLuminances(EnergyPlusData &state, // Sun reaches ground point if vector from this point to the sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; if (CalledFrom == DataDaylighting::iCalledFor::RefPoint) { ComplexFenestrationLuminancesGroundHitPt(1) = state.dataBSDFWindow->ComplexWind(IWin).DaylghtGeom(CurCplxFenState).RefPoint(iRefPoint).GndPt(iGndElem, WinEl).x; @@ -9229,7 +9225,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, if (state.dataSurface->TotSurfaces < octreeCrossover) { // Linear search through surfaces for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { + if (state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(state, ObsSurfNum, RecPt, RayVec, HitPt, hit); if (hit) { // Ray pierces surface @@ -9258,8 +9254,7 @@ void DayltgClosestObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &state, &RecPt, &RayVec, &hit, &NearestHitDistance_sq, &nearestHitSurface, &NearestHitPt](SurfaceData const &surface) { - int const ObsSurfNum = surface.Index; - if (state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) { + if (surface.IsShadowPossibleObstruction) { // Determine if this ray hits the surface and, if so, get the distance from the receiving point to the hit PierceSurface(surface, RecPt, RayVec, state.dataDaylightingManager->HitPt, hit); // Check if ray pierces surface if (hit) { // Ray pierces surface @@ -9332,7 +9327,7 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, if (state.dataSurface->SurfDaylightingShelfInd(ReflSurfNum) > 0) return; // Normal to reflecting surface in hemisphere containing window element DayltgSurfaceLumFromSunReflNorm = state.dataSurface->Surface(ReflSurfNum).OutNormVec; - if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { + if (state.dataSurface->Surface(ReflSurfNum).IsShadowing) { if (dot(DayltgSurfaceLumFromSunReflNorm, Ray) > 0.0) { DayltgSurfaceLumFromSunReflNorm *= -1.0; } @@ -9345,16 +9340,16 @@ void DayltgSurfaceLumFromSun(EnergyPlusData &state, // Sun reaches ReflHitPt if vector from ReflHitPt to sun is unobstructed hitObs = false; for (ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; // Exclude as a possible obstructor ReflSurfNum and its base surface (if it has one) if (ObsSurfNum == ReflSurfNum || ObsSurfNum == state.dataSurface->Surface(ReflSurfNum).BaseSurf) continue; PierceSurface(state, ObsSurfNum, ReflHitPt, SUNCOS_IHR, DayltgSurfaceLumFromSunObsHitPt, hitObs); if (hitObs) break; } - if (hitObs) return; // Obstruction was hit, blocking sun + if (hitObs) return; // Obstruction was hit, blocking s auto surfaceHit = [&state, &GroundHitPtun // Obstruction was not hit; sun reaches ReflHitPt. // Calculate luminance at ReflHitPt due to beam solar reflection (for unit beam normal illuminance) - if (state.dataSurface->SurfIsShadowing(ReflSurfNum)) { + if (state.dataSurface->Surface(ReflSurfNum).IsShadowing) { DiffVisRefl = state.dataSurface->SurfShadowDiffuseVisRefl(ReflSurfNum); // Note that if the shadowing surface has a non-zero glazing fraction (e.g., neighboring bldg) that the above is // (1 - glazing fraction) * (vis refl of opaque part of shadowing surface); specular reflection is diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 796ae4e69ab..8b6561b7849 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -701,9 +701,9 @@ namespace SolarReflectionManager { // according to the the right hand rule. If user inputs do not follow the rule, use the following // code to check the mirrored shading surface if (state.dataSolarReflectionManager->HitPtSurfNum > 0) { - if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPtSurfNum)) { + if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum).IsShadowing) { if (state.dataSolarReflectionManager->HitPtSurfNum + 1 < state.dataSurface->TotSurfaces) { - if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPtSurfNum + 1) && + if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum + 1).IsShadowing && state.dataSurface->Surface(state.dataSolarReflectionManager->HitPtSurfNum + 1).MirroredSurf) { // Check whether the sun is behind the mirrored shading surface state.dataSolarReflectionManager->CosIncBmAtHitPt2 = @@ -930,7 +930,7 @@ namespace SolarReflectionManager { state.dataSolarReflectionManager->SolReflRecSurf(RecSurfNum).PossibleObsSurfNums(loop); // Reflecting surface number // Keep windows; keep shading surfaces with specular reflectance if ((state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataSurface->Surface(ReflSurfNum).ExtSolar) || - (state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) > 0.0 && state.dataSurface->SurfIsShadowing(ReflSurfNum))) { + (state.dataSurface->SurfShadowGlazingFrac(ReflSurfNum) > 0.0 && state.dataSurface->Surface(ReflSurfNum).IsShadowing)) { // Skip if window and not sunlit if (state.dataSurface->Surface(ReflSurfNum).Class == SurfaceClass::Window && state.dataHeatBal->SunlitFrac(1, iHour, ReflSurfNum) < 0.01) @@ -1012,7 +1012,7 @@ namespace SolarReflectionManager { } } else { // Reflecting surface is a building shade for (int ObsSurfNum = 1; ObsSurfNum <= state.dataSurface->TotSurfaces; ++ObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(ObsSurfNum)) continue; + if (!state.dataSurface->Surface(ObsSurfNum).IsShadowPossibleObstruction) continue; if (ObsSurfNum == ReflSurfNum) continue; // TH2 CR8959 -- Skip mirrored surfaces @@ -1042,7 +1042,7 @@ namespace SolarReflectionManager { std::abs(state.dataSolarReflectionManager->CosIncAngRefl), state.dataConstruction->Construct(state.dataSolarReflectionManager->ConstrNumRefl).ReflSolBeamFrontCoef); } - if (state.dataSurface->SurfIsShadowing(ReflSurfNum) && + if (state.dataSurface->Surface(ReflSurfNum).IsShadowing && state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum) > 0) { state.dataSolarReflectionManager->ConstrNumRefl = state.dataSurface->SurfShadowGlazingConstruct(ReflSurfNum); state.dataSolarReflectionManager->SpecReflectance = @@ -1173,7 +1173,7 @@ namespace SolarReflectionManager { // Each shading surface has a "mirror" duplicate surface facing in the opposite direction. // The following gets the correct side of a shading surface in order to get the right value // of DifShdgRatioIsoSky (the two sides can have different sky shadowing). - if (state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->HitPntSurfNum)) { + if (state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).IsShadowing) { if (dot(state.dataSolarReflectionManager->SolReflRecSurf(state.dataSolarReflectionManager->iRecSurfNum) .RayVec(state.dataSolarReflectionManager->iRayNum), state.dataSurface->Surface(state.dataSolarReflectionManager->HitPntSurfNum).OutNormVec) > 0.0) { @@ -1230,10 +1230,10 @@ namespace SolarReflectionManager { for (state.dataSolarReflectionManager->iObsSurfNum = 1; state.dataSolarReflectionManager->iObsSurfNum <= state.dataSurface->TotSurfaces; ++state.dataSolarReflectionManager->iObsSurfNum) { - if (!state.dataSurface->SurfShadowPossibleObstruction(state.dataSolarReflectionManager->iObsSurfNum)) continue; + if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).IsShadowPossibleObstruction) continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; - if (!state.dataSurface->SurfIsShadowing(state.dataSolarReflectionManager->iObsSurfNum)) { + if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).IsShadowing) { if (dot(state.dataSolarReflectionManager->URay, state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).OutNormVec) >= 0.0) continue; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 41820b844e2..515505b7897 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -4971,7 +4971,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const state.dataSolarShading->SUNCOS(2) = state.dataSolarShading->cos_Phi[IPhi] * state.dataSolarShading->sin_Theta[ITheta]; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->SurfIsShadowing(SurfNum) && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; + if (!state.dataSurface->Surface(SurfNum).IsShadowing && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; state.dataSolarShading->CTHETA(SurfNum) = state.dataSolarShading->SUNCOS(1) * state.dataSurface->Surface(SurfNum).OutNormVec(1) + state.dataSolarShading->SUNCOS(2) * state.dataSurface->Surface(SurfNum).OutNormVec(2) + state.dataSolarShading->SUNCOS(3) * state.dataSurface->Surface(SurfNum).OutNormVec(3); @@ -4981,7 +4981,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->SurfIsShadowing(SurfNum) && + if (!state.dataSurface->Surface(SurfNum).IsShadowing && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -5009,7 +5009,7 @@ void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (!state.dataSurface->SurfIsShadowing(SurfNum) && + if (!state.dataSurface->Surface(SurfNum).IsShadowing && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -5135,7 +5135,7 @@ void DetermineShadowingCombinations(EnergyPlusData &state) for (GRSNR = 1; GRSNR <= state.dataSurface->TotSurfaces; ++GRSNR) { // Loop through all surfaces (looking for potential receiving surfaces)... - ShadowingSurf = state.dataSurface->SurfIsShadowing(GRSNR); + ShadowingSurf = state.dataSurface->Surface(GRSNR).IsShadowing; NGSS = 0; NSBS = 0; NBKS = 0; @@ -5625,7 +5625,7 @@ void SHADOW(EnergyPlusData &state, { #endif NGRS = state.dataSurface->Surface(GRSNR).BaseSurf; - if (state.dataSurface->SurfIsShadowing(GRSNR)) NGRS = GRSNR; + if (state.dataSurface->Surface(GRSNR).IsShadowing) NGRS = GRSNR; // Compute the X and Y displacements of a shadow. XS = state.dataSurface->Surface(NGRS).lcsx.x * state.dataSolarShading->SUNCOS(1) + @@ -8818,7 +8818,6 @@ void PerformSolarCalculations(EnergyPlusData &state) // Using/Aliasing using DaylightingManager::CalcDayltgCoefficients; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // na @@ -8907,7 +8906,6 @@ void PerformSolarCalculations(EnergyPlusData &state) CalcBeamSolSpecularReflFactors(state); if (state.dataGlobal->BeginSimFlag) CalcSkySolDiffuseReflFactors(state); } - // Calculate daylighting coefficients CalcDayltgCoefficients(state); } @@ -10284,7 +10282,7 @@ void SkyDifSolarShading(EnergyPlusData &state) for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { // Cosine of angle of incidence on surface of solar // radiation from patch - ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); + ShadowingSurf = state.dataSurface->Surface(SurfNum).IsShadowing; if (!ShadowingSurf && !state.dataSurface->Surface(SurfNum).HeatTransSurf) continue; @@ -10296,7 +10294,7 @@ void SkyDifSolarShading(EnergyPlusData &state) SHADOW(state, 24, 0); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); + ShadowingSurf = state.dataSurface->Surface(SurfNum).IsShadowing; if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; @@ -10323,7 +10321,7 @@ void SkyDifSolarShading(EnergyPlusData &state) } // End of Phi loop for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - ShadowingSurf = state.dataSurface->SurfIsShadowing(SurfNum); + ShadowingSurf = state.dataSurface->Surface(SurfNum).IsShadowing; if (!ShadowingSurf && (!state.dataSurface->Surface(SurfNum).HeatTransSurf || !state.dataSurface->Surface(SurfNum).ExtSolar)) continue; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index f553308eee1..d3b6157be71 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -374,11 +374,11 @@ namespace SurfaceGeometry { state.dataSurface->SurfAirSkyRadSplit(SurfNum) = std::sqrt(0.5 * (1.0 + state.dataSurface->Surface(SurfNum).CosTilt)); // Set flag that determines whether a surface is a shadowing surface - state.dataSurface->SurfIsShadowing(SurfNum) = false; + state.dataSurface->Surface(SurfNum).IsShadowing = false; if (state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Shading || state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_F || state.dataSurface->Surface(SurfNum).Class == SurfaceClass::Detached_B) { - state.dataSurface->SurfIsShadowing(SurfNum) = true; + state.dataSurface->Surface(SurfNum).IsShadowing = true; if (state.dataSurface->ShadingSurfaceFirst == -1) state.dataSurface->ShadingSurfaceFirst = SurfNum; state.dataSurface->ShadingSurfaceLast = SurfNum; } @@ -929,7 +929,6 @@ namespace SurfaceGeometry { state.dataSurface->SurfAirSkyRadSplit(SurfNum) = 0.0; } // Following are surface property arrays used in SurfaceGeometry - state.dataSurface->SurfShadowPossibleObstruction.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowRecSurfNum.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowDisabledZoneList.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfShadowDiffuseSolRefl.allocate(state.dataSurface->TotSurfaces); @@ -941,7 +940,6 @@ namespace SurfaceGeometry { state.dataSurface->SurfSchedMovInsulExt.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfSchedMovInsulInt.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = false; state.dataSurface->SurfShadowRecSurfNum(SurfNum) = 0; state.dataSurface->SurfShadowDiffuseSolRefl(SurfNum) = 0.0; state.dataSurface->SurfShadowDiffuseVisRefl(SurfNum) = 0.0; @@ -967,7 +965,6 @@ namespace SurfaceGeometry { state.dataSurface->SurfICSPtr.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIsRadSurfOrVentSlabOrPool.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfDaylightingShelfInd.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfIsShadowing.allocate(state.dataSurface->TotSurfaces); for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfSchedExternalShadingFrac(SurfNum) = false; state.dataSurface->SurfExternalShadingSchInd(SurfNum) = 0; @@ -984,7 +981,6 @@ namespace SurfaceGeometry { state.dataSurface->SurfICSPtr(SurfNum) = 0; state.dataSurface->SurfIsRadSurfOrVentSlabOrPool(SurfNum) = false; state.dataSurface->SurfDaylightingShelfInd(SurfNum) = 0; - state.dataSurface->SurfIsShadowing(SurfNum) = false; } state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); @@ -2568,7 +2564,7 @@ namespace SurfaceGeometry { // Set flag that determines whether a surface can be an exterior obstruction // Also set associated surfaces for Kiva foundations and build heat transfer surface lists for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = false; + state.dataSurface->Surface(SurfNum).IsShadowPossibleObstruction = false; if (state.dataSurface->Surface(SurfNum).HeatTransSurf) { state.dataSurface->AllHTSurfaceList.push_back(SurfNum); int const zoneNum(state.dataSurface->Surface(SurfNum).Zone); @@ -2621,7 +2617,7 @@ namespace SurfaceGeometry { // Exclude air boundary surfaces if (state.dataSurface->Surface(SurfNum).IsAirBoundarySurf) continue; - state.dataSurface->SurfShadowPossibleObstruction(SurfNum) = true; + state.dataSurface->Surface(SurfNum).IsShadowPossibleObstruction = true; } // Check for IRT surfaces in invalid places. @@ -12449,7 +12445,7 @@ namespace SurfaceGeometry { HeatTransSurf = state.dataSurface->Surface(ThisSurf).HeatTransSurf; // Kludge for daylighting shelves - if (state.dataSurface->SurfIsShadowing(ThisSurf)) { + if (state.dataSurface->Surface(ThisSurf).IsShadowing) { ThisBaseSurface = ThisSurf; HeatTransSurf = true; } diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 13205053782..93fb170f775 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -109,9 +109,6 @@ TEST_F(EnergyPlusFixture, BaseSurfaceRectangularTest) state->dataSurface->Surface(ThisSurf).Vertex(4).y = 0.0; state->dataSurface->Surface(ThisSurf).Vertex(4).z = 2.0; - state->dataSurface->SurfIsShadowing.allocate(state->dataSurface->TotSurfaces); - state->dataSurface->SurfIsShadowing = false; - ProcessSurfaceVertices(*state, ThisSurf, ErrorsFound); EXPECT_FALSE(ErrorsFound); EXPECT_EQ(SurfaceShape::Rectangle, state->dataSurface->Surface(ThisSurf).Shape); From 43c1fb6eceb025a88f39bbcf7e50addec71303c4 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 19 May 2021 08:46:41 -0700 Subject: [PATCH 19/25] complex window fix --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index de74393743c..d617268aca8 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2724,7 +2724,7 @@ void InitSolarHeatGains(EnergyPlusData &state) if (state.dataHeatBal->CalcWindowRevealReflection) CalcBeamSolarOnWinRevealSurface(state); - if (state.dataWindowManager->inExtWindowModel->isExternalLibraryModel()) { + if (state.dataWindowManager->inExtWindowModel->isExternalLibraryModel() && state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { CalcAbsorbedOnExteriorOpaqueSurfaces(state); if (state.dataWindowManager->winOpticalModel->isSimplifiedModel()) { CalcInteriorSolarDistributionWCESimple(state); From fdd6bb7b641931a72d5ff0a1381d7d2403d08dde Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 19 May 2021 10:03:55 -0700 Subject: [PATCH 20/25] clang --- src/EnergyPlus/DaylightingManager.cc | 8 ++++---- src/EnergyPlus/SolarReflectionManager.cc | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index ebdc9cfc59f..fadec5a26c9 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -5977,7 +5977,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((surface.IsShadowing) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Wall/ceiling/floor is in same zone as window (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && (ISurf != window_iBaseSurf) && (ISurf != window_base_iExtBoundCond))) // Exclude window's base or base-adjacent surfaces @@ -5996,7 +5996,7 @@ void DayltgHitInteriorObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - if ((surface.IsShadowing) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window_base_p) && (&surface != window_base_adjacent_p))) // Exclude window's base or base-adjacent surfaces @@ -6070,7 +6070,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, for (int ISurf = 1; ISurf <= state.dataSurface->TotSurfaces; ++ISurf) { auto const &surface(state.dataSurface->Surface(ISurf)); IType = surface.Class; - if ((surface.IsShadowing) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Wall/ceiling/floor is in same zone as windows (IType == SurfaceClass::Wall || IType == SurfaceClass::Roof || IType == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (ISurf != window1_iBaseSurf) && (ISurf != window2_iBaseSurf) && // Exclude windows' base surfaces @@ -6095,7 +6095,7 @@ void DayltgHitBetWinObstruction(EnergyPlusData &state, // Lambda function for the octree to test for surface hit auto surfaceHit = [=, &R1, &hit, &state](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); - if ((surface.IsShadowing) || // Shadowing surface + if ((surface.IsShadowing) || // Shadowing surface ((surface.SolarEnclIndex == window2_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass::Wall || sClass == SurfaceClass::Roof || sClass == SurfaceClass::Floor) && // Wall, ceiling/roof, or floor (&surface != window1_base_p) && (&surface != window2_base_p) && // Exclude windows' base surfaces diff --git a/src/EnergyPlus/SolarReflectionManager.cc b/src/EnergyPlus/SolarReflectionManager.cc index 8b6561b7849..209a94d4b0d 100644 --- a/src/EnergyPlus/SolarReflectionManager.cc +++ b/src/EnergyPlus/SolarReflectionManager.cc @@ -1230,7 +1230,8 @@ namespace SolarReflectionManager { for (state.dataSolarReflectionManager->iObsSurfNum = 1; state.dataSolarReflectionManager->iObsSurfNum <= state.dataSurface->TotSurfaces; ++state.dataSolarReflectionManager->iObsSurfNum) { - if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).IsShadowPossibleObstruction) continue; + if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).IsShadowPossibleObstruction) + continue; // Horizontal roof surfaces cannot be obstructions for rays from ground if (state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).Tilt < 5.0) continue; if (!state.dataSurface->Surface(state.dataSolarReflectionManager->iObsSurfNum).IsShadowing) { From 2624f193e85c0f993017899f844462c413f8fc6f Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Thu, 20 May 2021 11:54:16 -0700 Subject: [PATCH 21/25] remove index --- src/EnergyPlus/DataSurfaces.cc | 42 +++++++++++++++---------------- src/EnergyPlus/DataSurfaces.hh | 9 +++---- src/EnergyPlus/SurfaceGeometry.cc | 1 - 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 8f358403103..5643a27e3e4 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -204,7 +204,7 @@ void SurfaceData::set_computed_geometry() } } -void SurfaceData::SetOutBulbTempAt(EnergyPlusData &state) +void SetOutBulbTempAt(EnergyPlusData &state, int const SurfNum) { // SUBROUTINE INFORMATION: // AUTHOR Noel Keen (LBL)/Linda Lawrie @@ -216,27 +216,27 @@ void SurfaceData::SetOutBulbTempAt(EnergyPlusData &state) // Routine provides facility for doing bulk Set Temperature at Height. if (state.dataEnvrn->SiteTempGradient == 0.0) { - state.dataSurface->SurfOutDryBulbTemp(Index) = state.dataEnvrn->OutDryBulbTemp; - state.dataSurface->SurfOutWetBulbTemp(Index) = state.dataEnvrn->OutWetBulbTemp; + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = state.dataEnvrn->OutDryBulbTemp; + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = state.dataEnvrn->OutWetBulbTemp; } else { // Base temperatures at Z = 0 (C) Real64 const BaseDryTemp(state.dataEnvrn->OutDryBulbTemp + state.dataEnvrn->WeatherFileTempModCoeff); Real64 const BaseWetTemp(state.dataEnvrn->OutWetBulbTemp + state.dataEnvrn->WeatherFileTempModCoeff); - Real64 const Z(Centroid.z); // Centroid value + Real64 const Z(state.dataSurface->Surface(SurfNum).Centroid.z); // Centroid value if (Z <= 0.0) { - state.dataSurface->SurfOutDryBulbTemp(Index) = BaseDryTemp; - state.dataSurface->SurfOutWetBulbTemp(Index) = BaseWetTemp; + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = BaseDryTemp; + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = BaseWetTemp; } else { - state.dataSurface->SurfOutDryBulbTemp(Index) = + state.dataSurface->SurfOutDryBulbTemp(SurfNum) = BaseDryTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); - state.dataSurface->SurfOutWetBulbTemp(Index) = + state.dataSurface->SurfOutWetBulbTemp(SurfNum) = BaseWetTemp - state.dataEnvrn->SiteTempGradient * DataEnvironment::EarthRadius * Z / (DataEnvironment::EarthRadius + Z); } } } -void SurfaceData::SetWindSpeedAt(EnergyPlusData &state, Real64 const fac) +void SetWindSpeedAt(EnergyPlusData &state, int const SurfNum, Real64 const fac) { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie @@ -248,21 +248,21 @@ void SurfaceData::SetWindSpeedAt(EnergyPlusData &state, Real64 const fac) // Routine provides facility for doing bulk Set Windspeed at Height. if (state.dataEnvrn->SiteWindExp == 0.0) { - state.dataSurface->SurfOutWindSpeed(Index) = state.dataEnvrn->WindSpeed; + state.dataSurface->SurfOutWindSpeed(SurfNum) = state.dataEnvrn->WindSpeed; } else { - Real64 const Z(Centroid.z); // Centroid value + Real64 const Z(state.dataSurface->Surface(SurfNum).Centroid.z); // Centroid value if (Z <= 0.0) { - state.dataSurface->SurfOutWindSpeed(Index) = 0.0; + state.dataSurface->SurfOutWindSpeed(SurfNum) = 0.0; } else { // [Met] - at meterological Station, Height of measurement is usually 10m above ground // LocalWindSpeed = Windspeed [Met] * (Wind Boundary LayerThickness [Met]/Height [Met])**Wind Exponent[Met] & // * (Height above ground / Site Wind Boundary Layer Thickness) ** Site Wind Exponent - state.dataSurface->SurfOutWindSpeed(Index) = fac * std::pow(Z, state.dataEnvrn->SiteWindExp); + state.dataSurface->SurfOutWindSpeed(SurfNum) = fac * std::pow(Z, state.dataEnvrn->SiteWindExp); } } } -void SurfaceData::SetWindDirAt(EnergyPlusData &state, Real64 const fac) +void SetWindDirAt(EnergyPlusData &state, int const SurfNum, Real64 const fac) { // SUBROUTINE INFORMATION: // AUTHOR X Luo @@ -274,7 +274,7 @@ void SurfaceData::SetWindDirAt(EnergyPlusData &state, Real64 const fac) // Routine provides facility for doing bulk Set Windspeed locally. // Using/Aliasing - state.dataSurface->SurfOutWindDir(Index) = fac; + state.dataSurface->SurfOutWindDir(SurfNum) = fac; } Real64 SurfaceData::getInsideAirTemperature(EnergyPlusData &state, const int t_SurfNum) const @@ -601,8 +601,8 @@ Real64 SurfaceData::get_average_height(EnergyPlusData &state) const void SetSurfaceOutBulbTempAt(EnergyPlusData &state) { - for (auto &surface : state.dataSurface->Surface) { - surface.SetOutBulbTempAt(state); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { + SetOutBulbTempAt(state, SurfNum); } } @@ -623,16 +623,16 @@ void SetSurfaceWindSpeedAt(EnergyPlusData &state) { Real64 const fac(state.dataEnvrn->WindSpeed * state.dataEnvrn->WeatherFileWindModCoeff * std::pow(state.dataEnvrn->SiteWindBLHeight, -state.dataEnvrn->SiteWindExp)); - for (auto &surface : state.dataSurface->Surface) { - surface.SetWindSpeedAt(state, fac); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { + SetWindSpeedAt(state, SurfNum, fac); } } void SetSurfaceWindDirAt(EnergyPlusData &state) { // Using/Aliasing - for (auto &surface : state.dataSurface->Surface) { - surface.SetWindDirAt(state, state.dataEnvrn->WindDir); + for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { + SetWindDirAt(state, SurfNum, state.dataEnvrn->WindDir); } } diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 018d8e15497..89eb2771d2d 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -551,7 +551,6 @@ namespace DataSurfaces { using Plane = Vector4; // Members - int Index; std::string Name; // User supplied name of the surface (must be unique) int Construction; // Pointer to the construction in the Construct derived type int ConstructionStoredInputValue; // holds the original value for Construction per surface input @@ -659,7 +658,7 @@ namespace DataSurfaces { bool IsAirBoundarySurf; // True if surface is an air boundary surface (Construction:AirBoundary) // Default Constructor SurfaceData() - : Index(0), Construction(0), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None), Sides(0), Area(0.0), + : Construction(0), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None), Sides(0), Area(0.0), GrossArea(0.0), NetAreaShadowCalc(0.0), Perimeter(0.0), Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0), Width(0.0), shapeCat(ShapeCat::Unknown), plane(0.0, 0.0, 0.0, 0.0), Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0), lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(3, 0.0), SinAzim(0.0), @@ -678,11 +677,11 @@ namespace DataSurfaces { // Set Precomputed Parameters void set_computed_geometry(); - void SetOutBulbTempAt(EnergyPlusData &state); + void SetOutBulbTempAt(EnergyPlusData &state, int const SurfNum); - void SetWindDirAt(EnergyPlusData &state, Real64 const fac); + void SetWindDirAt(EnergyPlusData &state, int const SurfNum, Real64 const fac); - void SetWindSpeedAt(EnergyPlusData &state, Real64 const fac); + void SetWindSpeedAt(EnergyPlusData &state, int const SurfNum, Real64 const fac); Real64 getInsideAirTemperature(EnergyPlusData &state, const int t_SurfNum) const; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index d3b6157be71..00dda71d0b0 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -2731,7 +2731,6 @@ namespace SurfaceGeometry { // Initialize run time surface arrays for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { state.dataSurface->SurfActiveConstruction(SurfNum) = state.dataSurface->Surface(SurfNum).Construction; - state.dataSurface->Surface(SurfNum).Index = SurfNum; } // Initialize surface with movable insulation index list for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; SurfNum++) { From 14e9c20ec9fd7f6a2b7461d4d313af71df57eb3f Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 21 May 2021 18:11:31 -0700 Subject: [PATCH 22/25] fix eio diff --- src/EnergyPlus/ConvectionCoefficients.cc | 138 +++++++++--------- src/EnergyPlus/DataSurfaces.hh | 8 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 10 +- src/EnergyPlus/OutputReports.cc | 16 +- src/EnergyPlus/SurfaceGeometry.cc | 8 +- src/EnergyPlus/WindowManager.cc | 6 +- .../unit/ConvectionCoefficients.unit.cc | 6 +- .../unit/DisplacementVentMgr.unit.cc | 4 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 6 +- tst/EnergyPlus/unit/ICSCollector.unit.cc | 4 +- 10 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index f4c6144d868..3f22d654296 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -187,7 +187,7 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, if (state.dataGlobal->BeginEnvrnFlag && state.dataConvectionCoefficient->MyEnvirnFlag) { bool anyAdaptiveConvectionAlgorithm = false; for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) == DataHeatBalance::AdaptiveConvectionAlgorithm) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == DataHeatBalance::AdaptiveConvectionAlgorithm) { anyAdaptiveConvectionAlgorithm = true; break; } @@ -265,10 +265,10 @@ void InitInteriorConvectionCoeffs(EnergyPlusData &state, int algoNum; bool standardAlgo; - if (state.dataSurface->SurfIntConvCoeff(SurfNum) <= -1) { // Set by user using one of the standard algorithms... - algoNum = std::abs(state.dataSurface->SurfIntConvCoeff(SurfNum)); + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) <= -1) { // Set by user using one of the standard algorithms... + algoNum = std::abs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)); standardAlgo = true; - } else if (state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) { // Not set by user, uses Zone Setting + } else if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == 0) { // Not set by user, uses Zone Setting algoNum = Zone(ZoneNum).InsideConvectionAlgo; standardAlgo = true; } else { @@ -422,10 +422,10 @@ void InitExteriorConvectionCoeff(EnergyPlusData &state, int algoNum; bool standardAlgo; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) <= -1) { // Set by user using one of the standard algorithms... - algoNum = std::abs(state.dataSurface->SurfExtConvCoeff(SurfNum)); + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) <= -1) { // Set by user using one of the standard algorithms... + algoNum = std::abs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)); standardAlgo = true; - } else if (state.dataSurface->SurfExtConvCoeff(SurfNum) == 0) { // Not set by user, uses Zone Setting + } else if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) == 0) { // Not set by user, uses Zone Setting algoNum = Zone(Surface(SurfNum).Zone).OutsideConvectionAlgo; standardAlgo = true; } else { @@ -1359,12 +1359,12 @@ void GetUserConvectionCoefficients(EnergyPlusData &state) ShowContinueError(state, "Check Input Entered :" + Alphas(Ptr + 1)); ErrorsFound = true; } - if (state.dataSurface->SurfExtConvCoeff(Found) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(Found) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", invalid value"); ShowContinueError(state, "Duplicate (Outside) assignment attempt"); ErrorsFound = true; } else { - state.dataSurface->SurfExtConvCoeff(Found) = PotentialAssignedValue; + state.dataSurface->SurfExtConvCoeffIndex(Found) = PotentialAssignedValue; } } @@ -1465,12 +1465,12 @@ void GetUserConvectionCoefficients(EnergyPlusData &state) } } } - if (state.dataSurface->SurfIntConvCoeff(Found) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(Found) != 0) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alphas(1) + ", duplicate (inside)"); ShowContinueError(state, "Duplicate (Inside) assignment attempt."); ErrorsFound = true; } else { - state.dataSurface->SurfIntConvCoeff(Found) = PotentialAssignedValue; + state.dataSurface->SurfIntConvCoeffIndex(Found) = PotentialAssignedValue; } } else if (SELECT_CASE_var == std::string()) { // Blank @@ -1966,7 +1966,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -1975,10 +1975,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -1987,7 +1987,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2014,7 +2014,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2023,10 +2023,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2035,7 +2035,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2062,7 +2062,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2071,10 +2071,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2083,7 +2083,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2110,7 +2110,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2119,10 +2119,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2131,7 +2131,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2158,7 +2158,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2167,10 +2167,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2179,7 +2179,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2205,7 +2205,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2214,10 +2214,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2226,7 +2226,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2253,7 +2253,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2262,10 +2262,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2274,7 +2274,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2301,7 +2301,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2310,10 +2310,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2322,7 +2322,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2349,7 +2349,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2358,10 +2358,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2370,7 +2370,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2397,7 +2397,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes SurfacesOfType = true; if (ConvectionType == "OUTSIDE") { if (Surface(SurfNum).OSCPtr > 0) continue; - if (state.dataSurface->SurfExtConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2406,10 +2406,10 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountOutside; } } else { - state.dataSurface->SurfExtConvCoeff(SurfNum) = Value; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = Value; } } else { - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { if (state.dataGlobal->DisplayExtraWarnings) { ShowWarningError(state, "User Supplied Convection Coefficients, Multiple Surface Assignments=\"" + SurfaceTypes + @@ -2418,7 +2418,7 @@ void ApplyConvectionValue(EnergyPlusData &state, std::string const &SurfaceTypes ++SurfaceCountInside; } } else { - state.dataSurface->SurfIntConvCoeff(SurfNum) = Value; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = Value; } } } @@ -2678,7 +2678,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, state.dataRoomAirMod->AirModel(Surface(SurfNum).Zone).AirModelType == DataRoomAirModel::RoomAirModel::UCSDUFE) { // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum); @@ -2693,7 +2693,7 @@ void CalcDetailedHcInForDVModel(EnergyPlusData &state, Hf = 4.3 * Vhc()(Surface(SurfNum).Zone); // Set HConvIn using the proper correlation based on DeltaTemp and CosTiltSurf - if (state.dataSurface->SurfIntConvCoeff(SurfNum) != 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) != 0) { HcIn(SurfNum) = SetIntConvectionCoeff(state, SurfNum); @@ -3260,10 +3260,10 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac auto &Surface(state.dataSurface->Surface); { - auto const SELECT_CASE_var(state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).OverrideType); + auto const SELECT_CASE_var(state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { - HExt = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).OverrideValue; + HExt = state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).OverrideValue; if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); @@ -3272,7 +3272,7 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { HExt = GetCurrentScheduleValue(state, - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).ScheduleIndex); + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; @@ -3282,21 +3282,21 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedOutsideHcModel( - state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).UserCurveIndex, HExt); + state, SurfNum, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).UserCurveIndex, HExt); // Kiva convection handled in function above state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserCurve; // reporting state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { EvaluateExtHcModels(state, SurfNum, - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq, + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq, + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq, HExt); // Kiva convection handled in function above state.dataSurface->SurfOutConvHfModelEq(SurfNum) = - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq; // reporting state.dataSurface->SurfOutConvHnModelEq(SurfNum) = - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(SurfNum)).HcModelEq; // reporting + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).HcModelEq; // reporting } else { assert(false); } @@ -3333,17 +3333,17 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac auto &Surface(state.dataSurface->Surface); { - auto const SELECT_CASE_var(state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).OverrideType); + auto const SELECT_CASE_var(state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { - HInt = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).OverrideValue; + HInt = state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).OverrideValue; if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { HInt = GetCurrentScheduleValue(state, - state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).ScheduleIndex); + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); @@ -3351,15 +3351,15 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserSchedule; // reporting } else if (SELECT_CASE_var == ConvCoefUserCurve) { CalcUserDefinedInsideHcModel( - state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).UserCurveIndex, HInt); + state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).UserCurveIndex, HInt); // Kiva convection handled in function above state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserCurve; // reporting } else if (SELECT_CASE_var == ConvCoefSpecifiedModel) { EvaluateIntHcModels( - state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq, HInt); + state, SurfNum, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).HcModelEq, HInt); // Kiva convection handled in function above state.dataSurface->SurfIntConvHcModelEq(SurfNum) = - state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(SurfNum)).HcModelEq; + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).HcModelEq; } else { assert(false); } @@ -4089,11 +4089,11 @@ void SetupAdaptiveConvectionStaticMetaData(EnergyPlusData &state) print(state.files.eio, Format_901, Surface(SurfLoop).Name, - state.dataSurface->SurfExtConvCoeff(SurfLoop), + state.dataSurface->SurfExtConvCoeffIndex(SurfLoop), state.dataSurface->SurfOutConvFaceArea(SurfLoop), state.dataSurface->SurfOutConvFacePerimeter(SurfLoop), state.dataSurface->SurfOutConvFaceHeight(SurfLoop), - state.dataSurface->SurfIntConvCoeff(SurfLoop), + state.dataSurface->SurfIntConvCoeffIndex(SurfLoop), state.dataSurface->SurfIntConvZoneWallHeight(SurfLoop), state.dataSurface->SurfIntConvZonePerimLength(SurfLoop), state.dataSurface->SurfIntConvZoneHorizHydrDiam(SurfLoop), diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index 89eb2771d2d..c1b021fc860 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1301,8 +1301,8 @@ struct SurfacesData : BaseGlobalStruct // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature - Array1D SurfIntConvCoeff; // Interior Convection Coefficient pointer (different data structure) when being overridden - Array1D SurfExtConvCoeff; // Exterior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfIntConvCoeffIndex; // Interior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfExtConvCoeffIndex; // Exterior Convection Coefficient pointer (different data structure) when being overridden Array1D SurfIntConvClassification; // current classification for inside face air flow regime and surface orientation Array1D SurfIntConvHcModelEq; // current convection model for inside face Array1D SurfIntConvHcUserCurveIndex; // current index to user convection model if used @@ -1670,8 +1670,8 @@ struct SurfacesData : BaseGlobalStruct this->SurfICSPtr.deallocate(); this->SurfIsRadSurfOrVentSlabOrPool.deallocate(); this->SurfTAirRef.deallocate(); - this->SurfIntConvCoeff.deallocate(); - this->SurfExtConvCoeff.deallocate(); + this->SurfIntConvCoeffIndex.deallocate(); + this->SurfExtConvCoeffIndex.deallocate(); this->SurfIntConvClassification.deallocate(); this->SurfIntConvHcModelEq.deallocate(); this->SurfIntConvHcUserCurveIndex.deallocate(); diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index d617268aca8..160a9675c60 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -6214,7 +6214,7 @@ void CalcHeatBalanceOutsideSurf(EnergyPlusData &state, if (state.dataEnvrn->IsRain) { // Raining: since wind exposed, outside surface gets wet - if (state.dataSurface->SurfExtConvCoeff(SurfNum) <= 0) { // Reset HcExtSurf because of wetness + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) <= 0) { // Reset HcExtSurf because of wetness state.dataHeatBalSurf->HcExtSurf(SurfNum) = 1000.0; } else { // User set state.dataHeatBalSurf->HcExtSurf(SurfNum) = SetExtConvectionCoeff(state, SurfNum); @@ -7194,7 +7194,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, EmisOut = WindowEquivalentLayer::EQLWindowOutsideEffectiveEmiss(state, ConstrNum); } // Set Exterior Convection Coefficient... - if (state.dataSurface->SurfExtConvCoeff(SurfNum) > 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); @@ -7233,7 +7233,7 @@ void CalcHeatBalanceInsideSurf2(EnergyPlusData &state, } } else { // Interior Surface - if (state.dataSurface->SurfExtConvCoeff(SurfNum) > 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(SurfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(SurfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, SurfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of @@ -7952,7 +7952,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, EmisOut = WindowEquivalentLayer::EQLWindowOutsideEffectiveEmiss(state, ConstrNum); } // Set Exterior Convection Coefficient... - if (state.dataSurface->SurfExtConvCoeff(surfNum) > 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(surfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); @@ -7991,7 +7991,7 @@ void CalcHeatBalanceInsideSurf2CTFOnly(EnergyPlusData &state, } } else { // Interior Surface - if (state.dataSurface->SurfExtConvCoeff(surfNum) > 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(surfNum) > 0) { state.dataHeatBalSurf->HcExtSurf(surfNum) = ConvectionCoefficients::SetExtConvectionCoeff(state, surfNum); } else { // Exterior Convection Coefficient for the Interior or Interzone Window is the Interior Convection Coeff of diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index ad91314346f..33e593aad6a 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -1569,10 +1569,10 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices << format("{:.2R}", state.dataSurface->Surface(surf).Width) << "," << format("{:.2R}", state.dataSurface->Surface(surf).Height) << "," << format("{:.2R}", state.dataSurface->Surface(surf).Reveal) << ","; - if (state.dataSurface->SurfIntConvCoeff(surf) > 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(surf) > 0) { { auto const SELECT_CASE_var( - state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeff(surf)).OverrideType); + state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(surf)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { IntConvCoeffCalc = "User Supplied Value"; } else if (SELECT_CASE_var == ConvCoefSchedule) { @@ -1583,13 +1583,13 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices ExtConvCoeffCalc = "User Specified Model"; } } - } else if (state.dataSurface->SurfIntConvCoeff(surf) < 0) { // not in use yet. - IntConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfIntConvCoeff(surf))); + } else if (state.dataSurface->SurfIntConvCoeffIndex(surf) < 0) { // not in use yet. + IntConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfIntConvCoeffIndex(surf))); } - if (state.dataSurface->SurfExtConvCoeff(surf) > 0) { + if (state.dataSurface->SurfExtConvCoeffIndex(surf) > 0) { { auto const SELECT_CASE_var( - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeff(surf)).OverrideType); + state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(surf)).OverrideType); if (SELECT_CASE_var == ConvCoefValue) { ExtConvCoeffCalc = "User Supplied Value"; } else if (SELECT_CASE_var == ConvCoefSchedule) { @@ -1600,8 +1600,8 @@ void DetailsForSurfaces(EnergyPlusData &state, int const RptType) // (1=Vertices ExtConvCoeffCalc = "User Specified Model"; } } - } else if (state.dataSurface->SurfExtConvCoeff(surf) < 0) { - ExtConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfExtConvCoeff(surf))); + } else if (state.dataSurface->SurfExtConvCoeffIndex(surf) < 0) { + ExtConvCoeffCalc = ConvCoeffCalcs(std::abs(state.dataSurface->SurfExtConvCoeffIndex(surf))); } if (state.dataSurface->Surface(surf).ExtBoundCond == ExternalEnvironment) { *eiostream << "ExternalEnvironment" diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 00dda71d0b0..a97589c2332 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -984,8 +984,8 @@ namespace SurfaceGeometry { } state.dataSurface->SurfLowTempErrCount.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfHighTempErrCount.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfIntConvCoeff.allocate(state.dataSurface->TotSurfaces); - state.dataSurface->SurfExtConvCoeff.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfIntConvCoeffIndex.allocate(state.dataSurface->TotSurfaces); + state.dataSurface->SurfExtConvCoeffIndex.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfTAirRef.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIntConvClassification.allocate(state.dataSurface->TotSurfaces); state.dataSurface->SurfIntConvHcModelEq.allocate(state.dataSurface->TotSurfaces); @@ -1008,8 +1008,8 @@ namespace SurfaceGeometry { for (int SurfNum = 1; SurfNum <= state.dataSurface->TotSurfaces; ++SurfNum) { state.dataSurface->SurfLowTempErrCount(SurfNum) = 0; state.dataSurface->SurfHighTempErrCount(SurfNum) = 0; - state.dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; - state.dataSurface->SurfExtConvCoeff(SurfNum) = 0.0; + state.dataSurface->SurfIntConvCoeffIndex(SurfNum) = 0; + state.dataSurface->SurfExtConvCoeffIndex(SurfNum) = 0; state.dataSurface->SurfTAirRef(SurfNum) = 0; state.dataSurface->SurfIntConvClassification(SurfNum) = 0; state.dataSurface->SurfIntConvHcModelEq(SurfNum) = 0; diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index e0276a8ccfd..ff339c882cb 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2459,7 +2459,7 @@ namespace WindowManager { // Reset hcin if necessary since too small a value sometimes causes non-convergence // of window layer heat balance solution. - if (state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) { + if (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == 0) { if (state.dataWindowManager->hcin <= state.dataHeatBal->LowHConvLimit) { // may be redundent now, check is also in HeatBalanceConvectionCoeffs.cc // hcin = 3.076d0 !BG this is rather high value and abrupt change. changed to set to lower limit @@ -3319,8 +3319,8 @@ namespace WindowManager { } // call for new interior film coeff (since it is temperature dependent) if using Detailed inside coef model - if (((state.dataSurface->SurfIntConvCoeff(SurfNum) == 0) && (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == ASHRAETARP)) || - (state.dataSurface->SurfIntConvCoeff(SurfNum) == -2)) { + if (((state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == 0) && (state.dataHeatBal->Zone(ZoneNum).InsideConvectionAlgo == ASHRAETARP)) || + (state.dataSurface->SurfIntConvCoeffIndex(SurfNum) == -2)) { // coef model is "detailed" and not prescribed by user // need to find inside face index, varies with shade/blind etc. if (ANY_INTERIOR_SHADE_BLIND(ShadeFlag)) { diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index c39cb8933c9..9cd3b0608a8 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -718,7 +718,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) SurfTemp.allocate(1); HcIn.allocate(1); Vhc.allocate(1); - state->dataSurface->SurfIntConvCoeff.allocate(SurfNum); + state->dataSurface->SurfIntConvCoeffIndex.allocate(SurfNum); state->dataSurface->SurfTAirRef.allocate(SurfNum); // Test 1: CalcWaltonUnstableHorizontalOrTilt calculation for Hn DeltaTemp = 1.0; @@ -730,7 +730,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) // Test 2/3: CalcDetailedHcInForDVModel calculation for Hn state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::AdjacentAirTemp; - state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state->dataSurface->SurfIntConvCoeffIndex(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDDV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; @@ -741,7 +741,7 @@ TEST_F(ConvectionCoefficientsFixture, EvaluateHnModels) state->dataSurface->Surface(SurfNum).HeatTransSurf = true; state->dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::AdjacentAirTemp; - state->dataSurface->SurfIntConvCoeff(SurfNum) = 0.0; + state->dataSurface->SurfIntConvCoeffIndex(SurfNum) = 0.0; state->dataRoomAirMod->AirModel(state->dataSurface->Surface(SurfNum).Zone).AirModelType = DataRoomAirModel::RoomAirModel::UCSDCV; state->dataSurface->Surface(SurfNum).CosTilt = 1.0; SurfTemp(1) = 0.0; diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 9fb5770dfe5..5ec84a1cc5e 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -159,9 +159,9 @@ TEST_F(EnergyPlusFixture, DisplacementVentMgr_HcUCSDDV_Door_Test) state->dataSurface->Surface(3).Vertex(4).y = -1.48693002; state->dataSurface->Surface(3).Vertex(4).z = 8.5343999852; - state->dataSurface->SurfIntConvCoeff.allocate(TotSurfaces); + state->dataSurface->SurfIntConvCoeffIndex.allocate(TotSurfaces); state->dataSurface->SurfTAirRef.allocate(TotSurfaces); - state->dataSurface->SurfIntConvCoeff = 0.0; + state->dataSurface->SurfIntConvCoeffIndex = 0.0; state->dataSurface->SurfTAirRef = 0; state->dataRoomAirMod->AirModel.allocate(state->dataGlobal->NumOfZones); diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index 6ad17ba0c98..3308cb0965d 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -1347,7 +1347,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertyLocalEnv) // Test if local value used in surface hc calculation // Surface(1) - local; Surface(2) - global; for (int SurfNum = 1; SurfNum <= 6; SurfNum++) { - state->dataSurface->SurfExtConvCoeff(SurfNum) = -1; + state->dataSurface->SurfExtConvCoeffIndex(SurfNum) = -1; } CalcHeatBalanceOutsideSurf(*state); Real64 HExt_Expect_Surf1 = ConvectionCoefficients::CalcASHRAESimpExtConvectCoeff(5, 1.5); @@ -1903,7 +1903,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfPropertySrdSurfLWR) for (SurfNum = 1; SurfNum <= 6; SurfNum++) { state->dataHeatBalSurf->TH(1, 1, SurfNum) = 20; // Surf temp state->dataSurface->SurfOutDryBulbTemp(SurfNum) = 22; // Air temp - state->dataSurface->SurfExtConvCoeff(SurfNum) = -6; + state->dataSurface->SurfExtConvCoeffIndex(SurfNum) = -6; state->dataSurface->SurfAirSkyRadSplit(SurfNum) = 1.0; } CalcHeatBalanceOutsideSurf(*state); @@ -2469,7 +2469,7 @@ TEST_F(EnergyPlusFixture, HeatBalanceSurfaceManager_TestSurfTempCalcHeatBalanceA InitSurfaceHeatBalance(*state); for (int SurfNum = 1; SurfNum <= state->dataSurface->TotSurfaces; SurfNum++) { - state->dataSurface->SurfExtConvCoeff(SurfNum) = -1; + state->dataSurface->SurfExtConvCoeffIndex(SurfNum) = -1; } // Test Additional Heat Source Calculation diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 62aeed81622..4286b7420c9 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -133,8 +133,8 @@ TEST_F(EnergyPlusFixture, ICSSolarCollectorTest_CalcPassiveExteriorBaffleGapTest state->dataHeatBal->SurfQRadSWOutIncident(1) = 0.0; // set user defined conv. coeff. calculation to false state->dataConvectionCoefficient->GetUserSuppliedConvectionCoeffs = false; - state->dataSurface->SurfExtConvCoeff.allocate(NumOfSurf); - state->dataSurface->SurfExtConvCoeff(SurfNum) = 0; + state->dataSurface->SurfExtConvCoeffIndex.allocate(NumOfSurf); + state->dataSurface->SurfExtConvCoeffIndex(SurfNum) = 0; state->dataSurface->SurfHasSurroundingSurfProperties.allocate(NumOfSurf); state->dataSurface->SurfHasSurroundingSurfProperties(SurfNum) = false; state->dataSurface->SurfEMSOverrideExtConvCoef.allocate(NumOfSurf); From 1e1bcad6090ceb1fd8bed65302a76fe352885656 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Fri, 21 May 2021 18:29:42 -0700 Subject: [PATCH 23/25] clang --- src/EnergyPlus/ConvectionCoefficients.cc | 8 ++++---- src/EnergyPlus/DataSurfaces.hh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 3f22d654296..a8364bce7c7 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -3271,8 +3271,8 @@ Real64 SetExtConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac state.dataSurface->SurfOutConvHfModelEq(SurfNum) = HcExt_UserValue; // reporting state.dataSurface->SurfOutConvHnModelEq(SurfNum) = HcExt_None; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HExt = GetCurrentScheduleValue(state, - state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).ScheduleIndex); + HExt = GetCurrentScheduleValue( + state, state.dataSurface->UserExtConvectionCoeffs(state.dataSurface->SurfExtConvCoeffIndex(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; @@ -3342,8 +3342,8 @@ Real64 SetIntConvectionCoeff(EnergyPlusData &state, int const SurfNum) // Surfac } state.dataSurface->SurfIntConvHcModelEq(SurfNum) = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { - HInt = GetCurrentScheduleValue(state, - state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).ScheduleIndex); + HInt = GetCurrentScheduleValue( + state, state.dataSurface->UserIntConvectionCoeffs(state.dataSurface->SurfIntConvCoeffIndex(SurfNum)).ScheduleIndex); // Need to check for validity if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { state.dataSurfaceGeometry->kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index c1b021fc860..d95ca81a96e 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1301,8 +1301,8 @@ struct SurfacesData : BaseGlobalStruct // Surface ConvCoeff Properties Array1D SurfTAirRef; // Flag for reference air temperature - Array1D SurfIntConvCoeffIndex; // Interior Convection Coefficient pointer (different data structure) when being overridden - Array1D SurfExtConvCoeffIndex; // Exterior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfIntConvCoeffIndex; // Interior Convection Coefficient pointer (different data structure) when being overridden + Array1D SurfExtConvCoeffIndex; // Exterior Convection Coefficient pointer (different data structure) when being overridden Array1D SurfIntConvClassification; // current classification for inside face air flow regime and surface orientation Array1D SurfIntConvHcModelEq; // current convection model for inside face Array1D SurfIntConvHcUserCurveIndex; // current index to user convection model if used From 053ec95c2e6e984e1fbe0ccf7cf759e3b1c67d35 Mon Sep 17 00:00:00 2001 From: xuanluo113 Date: Wed, 26 May 2021 16:04:37 -0700 Subject: [PATCH 24/25] shading para initialization --- src/EnergyPlus/SurfaceGeometry.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index a97589c2332..8cc27eccc18 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -925,7 +925,7 @@ namespace SurfaceGeometry { state.dataSurface->SurfOutWindSpeed(SurfNum) = 0.0; state.dataSurface->SurfOutWindDir(SurfNum) = 0.0; state.dataSurface->SurfGenericContam(SurfNum) = 0.0; - state.dataSurface->SurfPenumbraID(SurfNum) = 0; + state.dataSurface->SurfPenumbraID(SurfNum) = -1; state.dataSurface->SurfAirSkyRadSplit(SurfNum) = 0.0; } // Following are surface property arrays used in SurfaceGeometry From fe0f6a7003bf5f95aafc5ca16effa2b321ad4b28 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Fri, 28 May 2021 12:20:32 -0500 Subject: [PATCH 25/25] Engrg ref equation ReflSolar equation cleanup --- ...ffuse-reflection-of-beam-solar-and-sky.tex | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex b/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex index bd054db629a..12177f37fa8 100644 --- a/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex +++ b/doc/engineering-reference/src/solar-radiation-reflected-from-exterior/diffuse-reflection-of-beam-solar-and-sky.tex @@ -59,31 +59,35 @@ \subsection{Sky Solar Radiation Diffusely Reflected from Obstructions}\label{sky The factor for reflection of sky radiation from obstructions onto a receiving surface is calculated in subroutine CalcSkySolDiffuseReflFactors. It is given by: \begin{equation} -\begin{array}{l}{\rm{SurfReflFacSkySolObs(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}ViewFacSk{y_{obs,i}}DifShdgRatioIsoSk{y_{obs,i}}{\rho_{obs,i}}\cos {\alpha_i}/\pi } } \end{array} +\begin{array}{l} +{SurfReflFacSkySolObs(RecSurfNum)} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}ViewFacSk{y_{obs,i}}DifShdgRatioIsoSk{y_{obs,i}}{\rho_{obs,i}}\cos {\alpha_i}/\pi } } +\end{array} \end{equation} where -RecSurfNum is the receiving surface number, +\({RecSurfNum}\) is the receiving surface number, \({N_{rec}}\) is the number of receiving points, \({N_{ray}}\) is the number of rays, -``\emph{obs,i}'' denotes the obstruction hit by ray \emph{i}, +\({obs,i}\) denotes the obstruction hit by ray \emph{i}, -\emph{Hit\(_{obs,i}\)} = 1 if ray \emph{i} hits an obstruction, = 0 otherwise, +\({Hit\(_{obs,i}}\) = 1 if ray \emph{i} hits an obstruction, = 0 otherwise, -\emph{ViewFacSky\(_{obs,i}\)} = unobstructed sky view factor of the obstruction = \((1 + \cos til{t_{obs}})/2\) , +\({ViewFacSky\(_{obs,i}}\) = unobstructed sky view factor of the obstruction = \((1 + \cos til{t_{obs}})/2\) , -\emph{DifShdgRatioIsoSky\(_{obs,i}\)} = (obstructed sky irradiance on obstruction)/(unobstructed sky irradiance on obstruction) +\({DifShdgRatioIsoSky\(_{obs,i}}\) = (obstructed sky irradiance on obstruction)/(unobstructed sky irradiance on obstruction) In this equation, the product \emph{ViewFacSky*DifShdgRatioIsoSky} is the sky irradiance at the hit point divided by the horizontal sky irradiance taking into account shadowing of sky diffuse radiation on the obstruction by other obstructions, and assuming that the radiance of the sky is uniform. Note that we ignore secondary reflections here and in the following sections. In the present case this means that the irradiance at the hit point due to reflection of sky radiation from the ground or from other obstructions is not considered. The above reflection factor is used in the timestep calculation to find the irradiance on a receiving surface due to sky radiation reflected from obstructions: \begin{equation} -QRadSWOutIncSkyDiffReflObs(RecSurfNum) = DifSolarRad * SurfReflFacSkySolObs(RecSurfNum) (W/m^{2}) +\begin{array}{l} +{QRadSWOutIncSkyDiffReflObs(RecSurfNum)} = \\{DifSolarRad * SurfReflFacSkySolObs(RecSurfNum) (W/m^{2})} +\end{array} \end{equation} where \emph{DifSolarRad} is the horizontal sky irradiance on an unobstructed horizontal plane (W/m\(^{2}\)). @@ -102,7 +106,7 @@ \subsection{Sky Solar Radiation Diffusely Reflected from the Ground}\label{sky-s \begin{equation} \begin{array}{l} -{\rm{SurfReflFacSkySolGnd(RecSurfNum)}} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {\left[ {(Hi{t_{gnd,i}}d{\Omega_i}\cos {\alpha_i}/\pi )\sum\limits_{j(i)}^{{N_{ray}}} {Hi{t_{sky,j(i)}}\cos {\alpha_{j(i)}}d{\Omega_{j(i)}}/\pi } } \right]} } +{SurfReflFacSkySolGnd(RecSurfNum)} = \\\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {\left[ {(Hi{t_{gnd,i}}d{\Omega_i}\cos {\alpha_i}/\pi )\sum\limits_{j(i)}^{{N_{ray}}} {Hi{t_{sky,j(i)}}\cos {\alpha_{j(i)}}d{\Omega_{j(i)}}/\pi } } \right]} } \end{array} \end{equation} @@ -119,7 +123,9 @@ \subsection{Sky Solar Radiation Diffusely Reflected from the Ground}\label{sky-s This factor is used in the timestep calculation to find the irradiance on a receiving surface due to sky radiation reflected from the ground: \begin{equation} -QRadSWOutIncSkyDiffReflGnd(RecSurfNum) = DifSolarRad * {\rho_{gnd}} * SurfReflFacSkySolGnd(RecSurfNum)~ (W/m^{2}) +\begin{array}{l} +{QRadSWOutIncSkyDiffReflGnd(RecSurfNum)} = \\{DifSolarRad * {\rho_{gnd}} * SurfReflFacSkySolGnd(RecSurfNum)~ (W/m^{2})} +\end{array} \end{equation} where \({\rho_{gnd}}\) is the solar reflectance of the ground, which is assumed to be uniform over the ground plane but may vary monthly (because of snow cover, for example). @@ -134,7 +140,7 @@ \subsection{Beam Solar Radiation Diffusely Reflected from Obstructions}\label{be {\scriptsize \begin{equation} -{\rm{SurfReflFacBmToDiffSolObs(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}Hi{t_{obs,i,sun}}d{\Omega_i}\cos {\alpha_i}{\rho_{obs,i}}\cos {\alpha_{sun,obs,i}}} } +{SurfReflFacBmToDiffSolObs(RecSurfNum,IHr)} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{obs,i}}Hi{t_{obs,i,sun}}d{\Omega_i}\cos {\alpha_i}{\rho_{obs,i}}\cos {\alpha_{sun,obs,i}}} } \end{equation}} where @@ -165,7 +171,7 @@ \subsection{Beam Solar Radiation Diffusely Reflected from the Ground}\label{beam {\scriptsize \begin{equation} -{\rm{SurfReflFacBmToDiffSolGnd(RecSurfNum,IHr)}} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{gnd,i}}Hi{t_{gnd,i,sun}}d{\Omega_i}\cos {\alpha_{gnd,i}}\cos {\alpha_{sun,gnd}}} } +{SurfReflFacBmToDiffSolGnd(RecSurfNum,IHr)} = \frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {\sum\limits_{i = 1}^{{N_{ray}}} {Hi{t_{gnd,i}}Hi{t_{gnd,i,sun}}d{\Omega_i}\cos {\alpha_{gnd,i}}\cos {\alpha_{sun,gnd}}} } \end{equation}} where @@ -179,7 +185,11 @@ \subsection{Beam Solar Radiation Diffusely Reflected from the Ground}\label{beam This factor is used in the timestep calculation to find the diffuse irradiance on a receiving surface due to beam solar diffusely reflected from the ground: \begin{equation} -QRadSWOutIncBmToDiffReflGnd(RecSurfNum) = BeamSolarRad * {\rho_{gnd}} * (WeightNow * SurfReflFacBmToDiffSolGnd(RecSurfNum,HourOfDay) + WeightPreviousHour * SurfReflFacBmToDiffSolGnd(RecSurfNum,PreviousHour)) +\begin{split} +QRadSWOutIncBmToDiffReflGnd(RecSurfNum) = +\\BeamSolarRad * {\rho_{gnd}} * (WeightNow * SurfReflFacBmToDiffSolGnd(RecSurfNum,HourOfDay) +\\+ WeightPreviousHour * SurfReflFacBmToDiffSolGnd(RecSurfNum,PreviousHour)) +\end{split} \end{equation} \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{beam-solar-radiation-specularly-reflected-from-obstructions} @@ -223,7 +233,10 @@ \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{b The factor for specular reflection of beam solar from obstruction onto a receiving surface is calculated in subroutine CalcBeamSolSpecularReflFactors. It is given by: \begin{equation} -{\rm{SurfReflFacBmToBmSolObs(RecSurfNum,IHr) }} = \sum\limits_{\scriptstyle \substack{specularly \, reflecting \, surfaces}} \left[ {\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {{f_{C,glazed}}{\rho_{spec}}({\alpha_C})\cos {\alpha_D}} } \right] +\begin{split} +{{SurfReflFacBmToBmSolObs(RecSurfNum,IHr) } = +\\\sum\limits_{\scriptstyle \substack{specularly \, reflecting \, surfaces}} \left[ {\frac{1}{{{N_{rec}}}}\sum\limits_1^{{N_{rec}}} {{f_{C,glazed}}{\rho_{spec}}({\alpha_C})\cos {\alpha_D}} } \right] +\end{split} \end{equation} The program assumes that specular reflection from a surface is due to glazing. If the reflecting surface is a window belonging to the building itself (as in Figure~\ref{fig:solar-reflection-from-building-surfaces-onto}), then \({f_{C,glazed}}\) is the fraction of the window that is glazed (which is 1.0 unless the window has dividers). @@ -243,5 +256,9 @@ \subsection{Beam Solar Radiation Specularly Reflected from Obstructions}\label{b The above specular reflection factor is used in the timestep calculation to find the beam irradiance on a receiving surface due to beam-beam reflection from obstructions: \begin{equation} -QRadSWOutIncBmToBmReflObsRecSurfNum) = BeamSolarRad * (WeightNow * SurfReflFacBmToBmSolObs(RecSurfNum,HourOfDay) + WeightPreviousHour * SurfReflFacBmToBmSolObs(RecSurfNum,PreviousHour)) +\begin{split} +QRadSWOutIncBmToBmReflObsRecSurfNum) = +\\BeamSolarRad * (WeightNow * SurfReflFacBmToBmSolObs(RecSurfNum,HourOfDay) +\\+ WeightPreviousHour * SurfReflFacBmToBmSolObs(RecSurfNum,PreviousHour)) +\end{split} \end{equation}