diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 67875d0a3ed..793ca54ed47 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -281,7 +281,6 @@ namespace Window { Real64 EpsGlIR; // IR absorptance of front or back of isolated glass Real64 RhoGlIR; // IR reflectance of inside face of inside glass int NGlass; // Number of glass layers in a construction - int LayNum; // Layer number for a glass layer int LayPtr; // Material number corresponding to LayNum Real64 Phi; // Incidence angle (deg) Real64 CosPhi; // Cosine of incidence angle @@ -504,7 +503,7 @@ namespace Window { // Loop over glass layers in the construction for (int IGlass = 1; IGlass <= NGlass; ++IGlass) { - LayNum = 1 + 2 * (IGlass - 1); + int LayNum = 1 + 2 * (IGlass - 1); if (ExtShade || ExtBlind || ExtScreen) LayNum = 2 + 2 * (IGlass - 1); if (BGShade || BGBlind) { LayNum = 1; @@ -801,7 +800,7 @@ namespace Window { // Loop over glass layers in the construction. for (int IGlass = 1; IGlass <= NGlass; ++IGlass) { - LayNum = 1 + (NGlass - IGlass) * 2; + int LayNum = 1 + (NGlass - IGlass) * 2; if (ExtShade || ExtBlind || ExtScreen) LayNum = 2 + (NGlass - IGlass) * 2; if (BGShade || BGBlind) { if (NGlass == 2) { @@ -1505,11 +1504,11 @@ namespace Window { assert(matFen != nullptr); if (mat->group == Material::Group::Shade) { - Real64 EpsGlIR = s_mat->materials(state.dataConstruction->Construct(ConstrNumSh).LayerPoint(TotLay - 1))->AbsorpThermalBack; - Real64 RhoGlIR = 1 - EpsGlIR; - Real64 TauShIR = matFen->TransThermal; - Real64 EpsShIR = matFen->AbsorpThermal; - Real64 RhoShIR = max(0.0, 1.0 - TauShIR - EpsShIR); + EpsGlIR = s_mat->materials(state.dataConstruction->Construct(ConstrNumSh).LayerPoint(TotLay - 1))->AbsorpThermalBack; + RhoGlIR = 1 - EpsGlIR; + TauShIR = matFen->TransThermal; + EpsShIR = matFen->AbsorpThermal; + RhoShIR = max(0.0, 1.0 - TauShIR - EpsShIR); surfShade.effShadeEmi = EpsShIR * (1.0 + RhoGlIR * TauShIR / (1.0 - RhoGlIR * RhoShIR)); surfShade.effGlassEmi = EpsGlIR * TauShIR / (1.0 - RhoGlIR * RhoShIR); @@ -1528,9 +1527,9 @@ namespace Window { surfShade.blind.TAR.interpSlatAng( matBlind->TARs[surfShade.blind.slatAngIdxLo], matBlind->TARs[surfShade.blind.slatAngIdxHi], surfShade.blind.slatAngInterpFac); - Real64 TauShIR = surfShade.blind.TAR.IR.Ft.Tra; - Real64 EpsShIR = surfShade.blind.TAR.IR.Bk.Emi; - Real64 RhoShIR = max(0.0, 1.0 - TauShIR - EpsShIR); + TauShIR = surfShade.blind.TAR.IR.Ft.Tra; + EpsShIR = surfShade.blind.TAR.IR.Bk.Emi; + RhoShIR = max(0.0, 1.0 - TauShIR - EpsShIR); surfShade.effShadeEmi = EpsShIR * (1.0 + surfShade.glass.rhoIR * TauShIR / (1.0 - surfShade.glass.rhoIR * RhoShIR)); surfShade.effGlassEmi = surfShade.glass.epsIR * TauShIR / (1.0 - surfShade.glass.rhoIR * RhoShIR); @@ -1594,7 +1593,6 @@ namespace Window { { // Initializes variables used in the window optical and thermal calculation. - int ConstrNum; // Construction number Real64 FrWidth; // Window frame width {m} Real64 FrEdgeWidth; // Frame edge width {m} Real64 DivWidth; // Window divider width {m} @@ -1603,8 +1601,6 @@ namespace Window { Real64 GlWidth; // Width of glazed part of window {m} int NumHorDividers; // Number of horizontal divider elements int NumVertDividers; // Number of vertical divider elements - int BaseSurfNum; // Base surface number - int MatNum; // Material number int DifOverrideCount; // Count the number of SolarDiffusing material overrides auto &s_mat = state.dataMaterial; @@ -1650,7 +1646,6 @@ namespace Window { GlWidth = surf.Width; NumVertDividers = frdiv.VertDividers; NumHorDividers = frdiv.HorDividers; - BaseSurfNum = surf.BaseSurf; s_surf->SurfWinFrameConductance(SurfNum) = frdiv.FrameConductance; s_surf->SurfWinFrameSolAbsorp(SurfNum) = frdiv.FrameSolAbsorp; s_surf->SurfWinFrameVisAbsorp(SurfNum) = frdiv.FrameVisAbsorp; @@ -1694,8 +1689,8 @@ namespace Window { if (surf.Class != SurfaceClass::Window || surf.ExtBoundCond != ExternalEnvironment || s_surf->SurfWinStormWinConstr(SurfNum) != 0) continue; - ConstrNum = surf.Construction; - MatNum = state.dataConstruction->Construct(ConstrNum).LayerPoint(state.dataConstruction->Construct(ConstrNum).TotLayers); + int ConstrNum = surf.Construction; + int MatNum = state.dataConstruction->Construct(ConstrNum).LayerPoint(state.dataConstruction->Construct(ConstrNum).TotLayers); auto const *mat = s_mat->materials(MatNum); if (mat->group != Material::Group::Glass) continue; @@ -1779,7 +1774,7 @@ namespace Window { // back reflectance at angle of incidence std::array, maxGlassLayers> rbadjPhi = {0.0}; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; // For each glass layer find tPhi, rfPhi, and rbPhi at each wavelength for (int in = 1; in <= ngllayer; ++in) { @@ -1920,7 +1915,7 @@ namespace Window { { Real64 num = 0.0; Real64 denom = 0.0; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; for (int i = 1; i <= nume - 1; ++i) { Real64 const esol = (wm->wle[i] - wm->wle[i - 1]) * 0.5 * (wm->e[i - 1] + wm->e[i]); @@ -1944,7 +1939,7 @@ namespace Window { Real64 y30new = 0.0; Real64 y30ils1 = 0.0; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; for (int i = 2; i <= nume; ++i) { // Autodesk:BoundsViolation e|wle|p(i-1) @ i=1: Changed start index from 1 to 2: wle // values prevented this violation from occurring in practice @@ -2010,7 +2005,7 @@ namespace Window { // // PURPOSE OF THIS SUBROUTINE: // Subroutine to direct whether to use exterior or interior window routines - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; if (state.dataGlobal->KickOffSizing || state.dataGlobal->KickOffSimulation) return; @@ -2077,8 +2072,6 @@ namespace Window { // (temperature of innermost face) [C] int SurfNumAdj; // An interzone surface's number in the adjacent zone - int ZoneNumAdj; // An interzone surface's adjacent zone number - int TotLay; // Total number of layers in a construction // (sum of solid layers and gap layers) int TotGlassLay; // Total number of glass layers in a construction int LayPtr; // Material number for a layer @@ -2110,7 +2103,6 @@ namespace Window { Real64 SurfOutsideEmiss; // temporary for result of outside surface emissivity Real64 Tsout; // temporary for result of outside surface temp in Kelvin - int temp; // Shorthand references auto &surf = s_surf->Surface(SurfNum); @@ -2120,14 +2112,13 @@ namespace Window { if (s_surf->SurfWinWindowModelType(SurfNum) == WindowModel::BSDF) { - temp = 0; + int temp = 0; // Simon: Complex fenestration state works only with tarcog CalcComplexWindowThermal( state, SurfNum, temp, HextConvCoeff, SurfInsideTemp, SurfOutsideTemp, SurfOutsideEmiss, DataBSDFWindow::Condition::Invalid); - auto &constr = state.dataConstruction->Construct(ConstrNum); - TotGlassLay = constr.TotGlassLayers; + auto const &constr = state.dataConstruction->Construct(ConstrNum); wm->ngllayer = constr.TotSolidLayers; // Simon: This is necessary to keep for frame calculations // Simon: need to transfer surface temperatures because of frames calculation @@ -2174,7 +2165,7 @@ namespace Window { } else { // regular window, not BSDF, not EQL Window // Added for thermochromic windows - auto &constr = state.dataConstruction->Construct(ConstrNum); + auto const &constr = state.dataConstruction->Construct(ConstrNum); wm->locTCFlag = (constr.isTCWindow); if (wm->locTCFlag) { @@ -2201,7 +2192,6 @@ namespace Window { } // end new TC code - TotLay = constr.TotLayers; TotGlassLay = constr.TotGlassLayers; wm->ngllayer = TotGlassLay; wm->nglface = 2 * wm->ngllayer; @@ -2273,7 +2263,7 @@ namespace Window { if (ANY_SHADE_SCREEN(ShadeFlag) || ANY_BLIND(ShadeFlag)) { IConst = s_surf->SurfWinActiveShadedConstruction(SurfNum); } - TotLay = state.dataConstruction->Construct(IConst).TotLayers; + int TotLay = state.dataConstruction->Construct(IConst).TotLayers; int IGlass = 0; int IGap = 0; @@ -2392,8 +2382,7 @@ namespace Window { if (SurfNumAdj > 0) { // Interzone window - ZoneNumAdj = s_surf->Surface(SurfNumAdj).Zone; - Real64 RefAirTemp = s_surf->Surface(SurfNumAdj).getInsideAirTemperature(state, SurfNumAdj); + RefAirTemp = s_surf->Surface(SurfNumAdj).getInsideAirTemperature(state, SurfNumAdj); state.dataHeatBal->SurfTempEffBulkAir(SurfNumAdj) = RefAirTemp; wm->tout = RefAirTemp + Constant::Kelvin; // outside air temperature @@ -2697,7 +2686,7 @@ namespace Window { Real64 pr; // Gap gas Prandtl number Real64 nu; // Gap gas Nusselt number - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; if (nglasslayer == 1) { Bface(1) = wm->Outir * wm->emis[0] + wm->hcout * wm->tout + wm->AbsRadGlassFace[0]; @@ -3343,7 +3332,6 @@ namespace Window { Real64 TauShIR = 0.0; // Long-wave transmittance of isolated shade/blind Real64 sconsh = 0.0; // shade/blind conductance (W/m2-K) - WinShadingType ShadeFlag = WinShadingType::NoShade; // Shading flag // radiation from lights and zone equipment absorbed by faces of shade/blind (W/m2) Real64 ShadeArea = 0.0; // shade/blind area (m2) // Real64 CondHeatGainGlass = 0.0; // Conduction through inner glass layer, outside to inside (W) @@ -3354,7 +3342,6 @@ namespace Window { Real64 CpAirOutlet = 0.0; // Heat capacity of air from window gap (J/kg-K) Real64 CpAirZone = 0.0; // Heat capacity of zone air (J/kg-K) Real64 InletAirHumRat = 0.0; // Humidity ratio of air from window gap entering fan - int InsideFaceIndex = 0; // intermediate variable for index of inside face in thetas Array1D hr = Array1D(2 * maxGlassLayers); // Radiative conductance (W/m2-K) Array1D AbsRadShadeFace(2); // Solar radiation, short-wave radiation from lights, and long-wave @@ -3370,7 +3357,7 @@ namespace Window { auto &s_surf = state.dataSurface; wm->nglfacep = wm->nglface; - ShadeFlag = s_surf->SurfWinShadingFlag(SurfNum); + WinShadingType ShadeFlag = s_surf->SurfWinShadingFlag(SurfNum); ZoneNum = s_surf->Surface(SurfNum).Zone; AbsRadShadeFace = 0.0; @@ -3420,6 +3407,7 @@ namespace Window { (s_surf->surfIntConv(SurfNum).model == Convect::HcInt::ASHRAETARP)) { // coef model is "detailed" and not prescribed by user // need to find inside face index, varies with shade/blind etc. + int InsideFaceIndex; // intermediate variable for index of inside face in thetas if (ANY_INTERIOR_SHADE_BLIND(ShadeFlag)) { InsideFaceIndex = wm->nglfacep; } else { @@ -3906,7 +3894,6 @@ namespace Window { int ConstrNumSh; // Shaded construction number int MatNumSh; // Material number of shade/blind layer - int nglassfaces; // Number of glass faces in contruction // In the following, "gaps" refer to the gaps on either side of the shade/blind Array1D TGlassFace(2); // Temperature of glass surfaces facing gaps (K) Array1D TShadeFace(2); // Temperature of shade surfaces facing gaps (K) @@ -3954,7 +3941,6 @@ namespace Window { ConstrNumSh = surf.activeShadedConstruction; ShadeFlag = s_surf->SurfWinShadingFlag(SurfNum); - nglassfaces = 2 * state.dataConstruction->Construct(ConstrNumSh).TotGlassLayers; if (state.dataConstruction->Construct(ConstrNumSh).TotGlassLayers == 2) { // Double glazing MatNumSh = state.dataConstruction->Construct(ConstrNumSh).LayerPoint(3); @@ -4130,9 +4116,9 @@ namespace Window { auto &s_mat = state.dataMaterial; auto &s_surf = state.dataSurface; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; - auto &surf = s_surf->Surface(SurfNum); + auto const &surf = s_surf->Surface(SurfNum); ConstrNum = surf.Construction; NGlass = state.dataConstruction->Construct(ConstrNum).TotGlassLayers; @@ -4219,7 +4205,6 @@ namespace Window { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int ConstrNumSh; // Shaded construction number - int MatNumSh; // Material number of shade/blind layer // In the following, "gaps" refer to the gaps on either side of the shade/blind Array1D TGlassFace(2); // Temperature of glass surfaces facing gaps (K) Array1D TShadeFace(2); // Temperature of shade surfaces facing gaps (K) @@ -4244,7 +4229,7 @@ namespace Window { // REAL(r64) :: AirProps(8) ! Air properties auto &s_surf = state.dataSurface; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; // Air properties // Dens dDens/dT Con dCon/dT Vis dVis/dT Prandtl dPrandtl/dT @@ -4254,14 +4239,12 @@ namespace Window { ShadeFlag = s_surf->SurfWinShadingFlag(SurfNum); if (state.dataConstruction->Construct(ConstrNumSh).TotGlassLayers == 2) { // Double glazing - MatNumSh = state.dataConstruction->Construct(ConstrNumSh).LayerPoint(3); IGapInc = 0; for (int IGap = 1; IGap <= 2; ++IGap) { TGlassFace(IGap) = wm->thetas[IGap]; TShadeFace(IGap) = wm->thetas[IGap + 3]; } } else { // Triple glazing - MatNumSh = state.dataConstruction->Construct(ConstrNumSh).LayerPoint(5); IGapInc = 1; for (int IGap = 1; IGap <= 2; ++IGap) { TGlassFace(IGap) = wm->thetas[IGap + 2]; @@ -4328,8 +4311,6 @@ namespace Window { // SUBROUTINE INFORMATION: // AUTHOR F. Winkelmann, adapted from Numerical Recipes // DATE WRITTEN February 2000 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Performs LU decomposition of a matrix. @@ -4341,8 +4322,6 @@ namespace Window { int imax; // Temporary variable // as output: decomposed matrix - Real64 aamax; // Absolute value of largest element of matrix - assert(n <= 10); // vv sizing std::array vv = {0.0}; // Stores the implicit scaling of each row @@ -4363,7 +4342,7 @@ namespace Window { } ajac(j, i) = sum; } - aamax = 0.0; + Real64 aamax = 0.0; for (int i = j; i <= n; ++i) { Real64 sum = ajac(j, i); for (int k = 1; k <= j - 1; ++k) { @@ -4420,13 +4399,11 @@ namespace Window { // b is also output as the solution, x // b is also output as the solution, x - int ii; // Intermediate variables - int ll; Real64 sum; // Summation variable - ii = 0; + int ii = 0; for (int i = 1; i <= n; ++i) { - ll = indx(i); + int ll = indx(i); sum = b(ll); b(ll) = b(i); if (ii != 0) { @@ -4654,7 +4631,7 @@ namespace Window { Array1D fvis(10); // Viscosity of each gas in a mixture (g/m-s) Array1D fdens(10); // Density of each gas in a mixture (kg/m3) - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; NMix = wm->gaps[IGap - 1].numGases; @@ -4746,12 +4723,11 @@ namespace Window { Real64 ressum; // Resistance sum (m2-K/W) int StormWinFlagPrevDay; // Previous time step value (day) of storm window flag int StormWinFlagThisDay; // Current time step value (day) of storm window flag - int nglfacePrevDay; // Previous time step value (dya) of number of glass faces (may differ // current time step value, nglface, if storm window was // added or removed during the current time step). auto &s_surf = state.dataSurface; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; StormWinFlagPrevDay = s_surf->SurfWinStormWinFlagPrevDay(SurfNum); StormWinFlagThisDay = s_surf->SurfWinStormWinFlag(SurfNum); @@ -4806,7 +4782,7 @@ namespace Window { // temperature values, although calculated here, are not used. The shade/blind face numbers // during the previous time step depend on whether a storm window glass layer was added to // or removed from the window during the current time step. - nglfacePrevDay = wm->nglface; + int nglfacePrevDay = wm->nglface; if (StormWinFlagPrevDay == 0 && StormWinFlagThisDay == 1) nglfacePrevDay = wm->nglface - 2; if (StormWinFlagPrevDay == 1 && StormWinFlagThisDay == 0) nglfacePrevDay = wm->nglface + 2; wm->thetas[wm->nglface] = s_surf->SurfaceWindow(SurfNum).thetaFace[nglfacePrevDay + 1]; @@ -4890,10 +4866,10 @@ namespace Window { Real64 g; Real64 ang; - auto &s_surf = state.dataSurface; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; if (SurfNum > 0) { + auto const &s_surf = state.dataSurface; asp = s_surf->Surface(SurfNum).Height / wm->gaps[IGap - 1].width; } else { // SurfNum = 0 when NusseltNumber is called from CalcNominalWindowCond, which applies to a // particular construction. So window height is not known and we assume 5 ft (1.524 m) @@ -5524,7 +5500,6 @@ namespace Window { Array2D D(6, 16); // Powers of independent variable Real64 ACON; // Intermediate variables Real64 SUM; - int KP1; int LP1; int NM1; @@ -5558,7 +5533,7 @@ namespace Window { // Solve the simultaneous equations using Gauss elimination NM1 = N - 1; for (int K = 1; K <= NM1; ++K) { - KP1 = K + 1; + int KP1 = K + 1; for (int i = KP1; i <= N; ++i) { ACON = A(K, i) / A(K, K); B(i) -= B(K) * ACON; @@ -5619,7 +5594,6 @@ namespace Window { Array2D D(6, 16); // Powers of independent variable Real64 ACON; // Intermediate variables Real64 SUM; - int KP1; int LP1; int NM1; @@ -5653,7 +5627,7 @@ namespace Window { // Solve the simultaneous equations using Gauss elimination NM1 = N - 1; for (int K = 1; K <= NM1; ++K) { - KP1 = K + 1; + int KP1 = K + 1; for (int i = KP1; i <= N; ++i) { ACON = A(K, i) / A(K, K); B(i) -= B(K) * ACON; @@ -6441,7 +6415,7 @@ namespace Window { // init the surface convective and radiative adjustment ratio for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { - auto &thisSpace = state.dataHeatBal->space(spaceNum); + auto const &thisSpace = state.dataHeatBal->space(spaceNum); int const firstSurfWin = thisSpace.WindowSurfaceFirst; int const lastSurfWin = thisSpace.WindowSurfaceLast; for (int SurfNum = firstSurfWin; SurfNum <= lastSurfWin; ++SurfNum) { @@ -6466,12 +6440,12 @@ namespace Window { Array1D const hgap, // Conductive gap conductance [W/m2-K] Real64 &NominalConductance, // Nominal center-of-glass conductance, including air films Real64 &SHGC, // Nominal center-of-glass solar heat gain coefficient for - Real64 &TSolNorm // Overall beam solar transmittance at normal incidence + Real64 const TSolNorm // Overall beam solar transmittance at normal incidence ) { Array1D hGapTot(5); // Combined radiative and conductive gap conductance [W/m2-K] - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; Real64 hOutRad = wm->emis[0] * Constant::StefanBoltzmann * 0.5 * pow_3(wm->tout + wm->thetas[0]); Real64 rOut = 1.0 / (hOutRad + wm->hcout); Real64 hInRad = wm->emis[wm->nglface - 1] * Constant::StefanBoltzmann * 0.5 * pow_3(wm->tin + wm->thetas[wm->nglface - 1]); @@ -6721,7 +6695,7 @@ namespace Window { Real64 temdiff; // Inside/outside air temperature difference (K) Real64 ressum; // Resistance sum (m2-K/W) - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; rguess(1) = 1.0 / (wm->hcout + hrad); rguess(wm->nglface + 1) = 1.0 / (hcinStartValue + hrad); @@ -6770,7 +6744,6 @@ namespace Window { Real64 TempVar(0.0); // just temporary usage for complex fenestration - int Layer; Real64 NominalConductanceWinter; // Nominal center-of-glass conductance of a window construction // for ASHRAE winter conditions (W/m2-K): // Inside air temperature = 21.1C (70F) @@ -6786,14 +6759,10 @@ namespace Window { Real64 SHGCWinter(0.0); // Center-of-glass solar heat gain coefficient for ASHRAE Real64 SHGCSummer(0.0); // winter and summer conditions - Real64 TransSolNorm; // Window construction solar transmittance at normal incidence - Real64 TransVisNorm; // Window construction visible transmittance at normal incidence - int errFlag; // Error flag - std::string SolarDiffusing; // 'Yes' if glass is solar diffusing; otherwise 'No' (clear glass) - std::string SpectralDataName; - std::string OpticalDataType; + Real64 TransSolNorm; // Window construction solar transmittance at normal incidence + Real64 TransVisNorm; // Window construction visible transmittance at normal incidence + int errFlag; // Error flag - auto &s_mat = state.dataMaterial; auto &wm = state.dataWindowManager; ScanForReports(state, "Constructions", wm->DoReport, "Constructions"); @@ -6811,6 +6780,7 @@ namespace Window { [](Construction::ConstructionProps const &e) { return e.WindowTypeEQL; })) wm->HasEQLWindows = true; // for reporting purpose only if (wm->DoReport && (wm->HasWindows || wm->HasComplexWindows || wm->HasEQLWindows)) { + auto const &s_mat = state.dataMaterial; // Write Descriptions print(state.files.eio, "{}\n", @@ -6992,8 +6962,9 @@ namespace Window { // Write(OutputFileConstrainParams, 705) TRIM(Construct(ThisNum)%Name), SHGCSummer ,TransVisNorm for (int i = 1; i <= construct.TotLayers; ++i) { - Layer = construct.LayerPoint(i); + int Layer = construct.LayerPoint(i); auto const *mat = s_mat->materials(Layer); + std::string SpectralDataName; switch (mat->group) { @@ -7066,7 +7037,7 @@ namespace Window { case Material::Group::GlassSimple: { auto const *matGlass = dynamic_cast(mat); assert(matGlass != nullptr); - SolarDiffusing = "No"; + std::string SolarDiffusing = "No"; if (matGlass->SolarDiffusing) SolarDiffusing = "Yes"; if (matGlass->windowOpticalData == Window::OpticalDataModel::Spectral) { @@ -7105,7 +7076,7 @@ namespace Window { case Material::Group::GlassEQL: { auto const *matEQL = dynamic_cast(mat); assert(matEQL != nullptr); - OpticalDataType = "SpectralAverage"; + std::string OpticalDataType = "SpectralAverage"; SpectralDataName = ""; static constexpr std::string_view Format_708( " WindowMaterial:Glazing:EquivalentLayer,{},{},{},{:.5R},{:.5R},{:.5R},{:.5R},{:.5R}" @@ -8435,18 +8406,13 @@ namespace Window { int NumAlphas; // Number of Alphas for each GetobjectItem call int NumNumbers; // Number of Numbers for each GetobjectItem call int NumArgs; - int IOStatus; Array1D_string cAlphaArgs; // Alpha input items for object Array1D rNumericArgs; // Numeric input items for object std::string cCurrentModuleObject; - std::string cSolarSpectrum; - std::string cVisibleSpectrum; - int iSolarSpectrum(0); - int iVisibleSpectrum(0); int NumSiteSpectrum(0); - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; if (wm->RunMeOnceFlag) return; @@ -8471,6 +8437,7 @@ namespace Window { rNumericArgs.dimension(NumNumbers, 0.0); if (NumSiteSpectrum == 1) { + int IOStatus; state.dataInputProcessing->inputProcessor->getObjectItem(state, cCurrentModuleObject, 1, @@ -8487,8 +8454,8 @@ namespace Window { } // now read custom solar and visible spectrum data - cSolarSpectrum = state.dataIPShortCut->cAlphaArgs(3); - cVisibleSpectrum = state.dataIPShortCut->cAlphaArgs(4); + std::string cSolarSpectrum = state.dataIPShortCut->cAlphaArgs(3); + std::string cVisibleSpectrum = state.dataIPShortCut->cAlphaArgs(4); cCurrentModuleObject = "Site:SpectrumData"; NumSiteSpectrum = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); @@ -8504,8 +8471,8 @@ namespace Window { cAlphaArgs.allocate(NumAlphas); rNumericArgs.dimension(NumNumbers, 0.0); - iSolarSpectrum = 0; - iVisibleSpectrum = 0; + int iSolarSpectrum = 0; + int iVisibleSpectrum = 0; for (int Loop = 1; Loop <= NumSiteSpectrum; ++Loop) { // Step 2 - read user-defined spectrum data state.dataInputProcessing->inputProcessor->getObjectItem(state, @@ -8578,7 +8545,7 @@ namespace Window { void initWindowModel(EnergyPlusData &state) { const std::string objectName = "WindowsCalculationEngine"; - auto &wm = state.dataWindowManager; + auto const &wm = state.dataWindowManager; wm->inExtWindowModel = CWindowModel::WindowModelFactory(state, objectName); wm->winOpticalModel = CWindowOpticalModel::WindowOpticalModelFactory(state); } // InitWindowModel() diff --git a/src/EnergyPlus/WindowManager.hh b/src/EnergyPlus/WindowManager.hh index 23936c62ea8..e1560589a29 100644 --- a/src/EnergyPlus/WindowManager.hh +++ b/src/EnergyPlus/WindowManager.hh @@ -325,7 +325,7 @@ namespace Window { Array1D hgap, // Conductive gap conductance [W/m2-K] Real64 &NominalConductance, // Nominal center-of-glass conductance, including air films Real64 &SHGC, // Nominal center-of-glass solar heat gain coefficient for - Real64 &TSolNorm // Overall beam solar transmittance at normal incidence + Real64 TSolNorm // Overall beam solar transmittance at normal incidence ); void WindowTempsForNominalCond(EnergyPlusData &state,