diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index d3a37c13004..91d406d50e7 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -78,8 +78,6 @@ namespace EnergyPlus::WindowEquivalentLayer { // MODULE INFORMATION // AUTHOR Bereket A. Nigusse, FSEC/UCF // DATE WRITTEN May 2013 -// MODIFIED na -// RE-ENGINEERED na // PURPOSE OF THIS MODULE: // Manages the equivalent layer (ASHWAT) window model optical and thermal @@ -133,8 +131,7 @@ void InitEquivalentLayerWindowCalculations(EnergyPlusData &state) // DATE WRITTEN May 2013 // PURPOSE OF THIS SUBROUTINE: - // Initializes the optical properties for the Equivalent Layer (ASHWAT) Window - // model + // Initializes the optical properties for the Equivalent Layer (ASHWAT) Window model // METHODOLOGY EMPLOYED: // Gets the EquivalentLayer Window Layers Inputs. Fills in the derived data type // based on the inputs specified. @@ -171,8 +168,6 @@ void SetEquivalentLayerWindowProperties(EnergyPlusData &state, int const ConstrN // SUBROUTINE INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Populates the the equivalent layer window model optical and thermal @@ -181,13 +176,6 @@ void SetEquivalentLayerWindowProperties(EnergyPlusData &state, int const ConstrN // METHODOLOGY EMPLOYED: // uses some routine developed for ASHRAE RP-1311 (ASHWAT Model) - int Layer; // layer index - int MaterNum; // material index of a layer in a construction - int gLayer; // gap layer index - int sLayer; // glazing and shade layers (non-gas layers) index - int EQLNum; // equivalent layer window construction index - int NumGLayers; // number of gap layers - int NumSLayers; // number of glazing and shade layers (non-gas layers) Array2D SysAbs1(2, CFSMAXNL + 1); // layers absorptance and system transmittance auto &s_mat = state.dataMaterial; @@ -195,22 +183,22 @@ void SetEquivalentLayerWindowProperties(EnergyPlusData &state, int const ConstrN if (!allocated(state.dataWindowEquivLayer->CFSLayers)) state.dataWindowEquivLayer->CFSLayers.allocate(state.dataConstruction->Construct(ConstrNum).TotLayers); - sLayer = 0; - gLayer = 0; - EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; + int sLayer = 0; // glazing and shade layers (non-gas layers) index + int gLayer = 0; // gap layer index + int EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; auto &CFS = state.dataWindowEquivLayer->CFS; CFS(EQLNum).Name = state.dataConstruction->Construct(ConstrNum).Name; - for (Layer = 1; Layer <= state.dataConstruction->Construct(ConstrNum).TotLayers; ++Layer) { + for (int Layer = 1; Layer <= state.dataConstruction->Construct(ConstrNum).TotLayers; ++Layer) { Material::Group group1 = s_mat->materials(state.dataConstruction->Construct(ConstrNum).LayerPoint(1))->group; if (group1 != Material::Group::GlassEQL && group1 != Material::Group::ShadeEQL && group1 != Material::Group::DrapeEQL && group1 != Material::Group::ScreenEQL && group1 != Material::Group::BlindEQL && group1 != Material::Group::WindowGapEQL) continue; - MaterNum = state.dataConstruction->Construct(ConstrNum).LayerPoint(Layer); + int MaterNum = state.dataConstruction->Construct(ConstrNum).LayerPoint(Layer); auto const *mat = s_mat->materials(MaterNum); if (mat->group == Material::Group::BlindEQL) { @@ -370,8 +358,6 @@ void SetEquivalentLayerWindowProperties(EnergyPlusData &state, int const ConstrN } // beam beam transmittance is the same for front and back side CFS(EQLNum).L(sLayer).SWP_MAT.TAUSBBB = CFS(EQLNum).L(sLayer).SWP_MAT.TAUSFBB; - NumSLayers = sLayer; - NumGLayers = gLayer; CFS(EQLNum).NL = sLayer; // checks optical properties and fill in default values for diffuse optical @@ -413,9 +399,7 @@ void CalcEQLWindowUvalue(EnergyPlusData &state, // AUTHOR JOHN L. WRIGHT/Chip Barnaby // DATE WRITTEN Last Modified February 2008 // MODIFIED Bereket Nigusse, May 2013 - // Replaced inside convection calculation - // with ISO Std 15099 - // RE-ENGINEERED na + // Replaced inside convection calculation with ISO Std 15099 // PURPOSE OF THIS SUBROUTINE: // Calculates U-value of equivalent layer window at standard @@ -447,13 +431,12 @@ void CalcEQLWindowUvalue(EnergyPlusData &state, Real64 TGI; Real64 TGIK; Real64 TIK; - Real64 DT; // temperature difference, K - Real64 EO; // outside face effective emissivity, (-) - Real64 EI; // inside face effective emissivity, (-) - int I; // index - bool CFSURated; // false if U-Value calculation failed + Real64 DT; // temperature difference, K + Real64 EO; // outside face effective emissivity, (-) + Real64 EI; // inside face effective emissivity, (-) + int I; // index - CFSURated = false; + bool CFSURated = false; // false if U-Value calculation failed // Intial guess value for combined conductance HXO = 29.0; // 1/FenROut @@ -506,12 +489,9 @@ void CalcEQLWindowSHGCAndTransNormal(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Calculates SHGC and Normal Transmittance of equivalent layer - // fenestration. + // Calculates SHGC and Normal Transmittance of equivalent layer fenestration. // METHODOLOGY EMPLOYED: // Uses routine developed for ASHRAE RP-1311 (ASHWAT Model) @@ -546,12 +526,10 @@ void CalcEQLWindowSHGCAndTransNormal(EnergyPlusData &state, Real64 HProfA; int NL; int I; - bool CFSSHGC; // Object Data Array1D SWP_ON(CFSMAXNL); - CFSSHGC = true; NL = FS.NL; IncA = 0.0; VProfA = 0.0; @@ -578,27 +556,27 @@ void CalcEQLWindowSHGCAndTransNormal(EnergyPlusData &state, TransNormal = Abs1(1, NL + 1); // Calculate SHGC using net radiation method (ASHWAT Model) - CFSSHGC = ASHWAT_ThermalRatings(state, - FS, - TIN, - TOUT, - HCIN, - HCOUT, - TRMOUT, - TRMIN, - BeamSolarInc, - BeamSolarInc * Abs1(1, {1, NL + 1}), - TOL, - QOCF, - QOCFRoom, - T, - Q, - JF, - JB, - H, - UCG, - SHGC, - true); + bool CFSSHGC = ASHWAT_ThermalRatings(state, + FS, + TIN, + TOUT, + HCIN, + HCOUT, + TRMOUT, + TRMIN, + BeamSolarInc, + BeamSolarInc * Abs1(1, {1, NL + 1}), + TOL, + QOCF, + QOCFRoom, + T, + Q, + JF, + JB, + H, + UCG, + SHGC, + true); if (!CFSSHGC) { ShowWarningMessage(state, format("{}Solar heat gain coefficient calculation failed for {}", RoutineName, FS.Name)); @@ -621,17 +599,14 @@ void CalcEQLWindowOpticalProperty(EnergyPlusData &state, { // SUBROUTINE INFORMATION: // AUTHOR University of WaterLoo - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, May 2013 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates absorptance for each layer, and transmittance of the // fenestration for beam and diffuse solar radiation // METHODOLOGY EMPLOYED: - // uses routine developed for ASHRAE RP-1311 (ASHWAT Model). Uses net radiation - // method. + // uses routine developed for ASHRAE RP-1311 (ASHWAT Model). Uses net radiation method. // Argument array dimensioning Abs1.dim(2, CFSMAXNL + 1); @@ -648,29 +623,24 @@ void CalcEQLWindowOpticalProperty(EnergyPlusData &state, // + = west-of-normal // convect coefficients, W/m2-K - int NL; - int I; - int iL; - bool DoShadeControlR; - // Object Data Array1D SWP_ON(CFSMAXNL); - NL = FS.NL; + int NL = FS.NL; Abs1 = 0.0; if (FS.ISControlled) { // at least 1 controlled layer found - for (iL = 1; iL <= NL; ++iL) { + for (int iL = 1; iL <= NL; ++iL) { // If there is shade control (Venetian Blind Only). if (IsControlledShade(state, FS.L(iL))) { - DoShadeControlR = DoShadeControl(state, FS.L(iL), IncA, VProfA, HProfA); + DoShadeControl(state, FS.L(iL), IncA, VProfA, HProfA); } } } if (DiffBeamFlag != SolarArrays::DIFF) { // Beam: Convert direct-normal solar properties to off-normal properties - for (I = 1; I <= NL; ++I) { + for (int I = 1; I <= NL; ++I) { ASHWAT_OffNormalProperties(state, FS.L(I), IncA, VProfA, HProfA, SWP_ON(I)); } ASHWAT_Solar(FS.NL, SWP_ON, state.dataWindowEquivLayer->SWP_ROOMBLK, 1.0, 0.0, 0.0, Abs1(1, {1, FS.NL + 1}), Abs1(2, {1, FS.NL + 1})); @@ -695,12 +665,9 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // performs surface heat balance and returns in the inside and outside surface - // temperatures + // performs surface heat balance and returns in the inside and outside surface temperatures // METHODOLOGY EMPLOYED: // uses the solar-thermal routine developed for ASHRAE RP-1311 (ASHWAT Model). @@ -727,10 +694,8 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, Array1D QAllSWwinAbs({1, CFSMAXNL + 1}); int EQLNum; // equivalent layer window index - int ZoneNum; // Zone number corresponding to SurfNum int ConstrNum; // Construction number - int SurfNumAdj; // An interzone surface's number in the adjacent zone Real64 LWAbsIn; // effective long wave absorptance/emissivity back side Real64 LWAbsOut; // effective long wave absorptance/emissivity front side Real64 outir(0); @@ -758,8 +723,7 @@ void EQLWindowSurfaceHeatBalance(EnergyPlusData &state, HcIn = state.dataHeatBalSurf->SurfHConvInt(SurfNum); // windows inside surface convective film conductance if (CalcCondition == DataBSDFWindow::Condition::Invalid) { - ZoneNum = state.dataSurface->Surface(SurfNum).Zone; - SurfNumAdj = state.dataSurface->Surface(SurfNum).ExtBoundCond; + int SurfNumAdj = state.dataSurface->Surface(SurfNum).ExtBoundCond; Real64 RefAirTemp = state.dataSurface->Surface(SurfNum).getInsideAirTemperature(state, SurfNum); TaIn = RefAirTemp; TIN = TaIn + Constant::Kelvin; // Inside air temperature, K @@ -890,9 +854,6 @@ void OPENNESS_LW(Real64 const OPENNESS, // shade openness (=tausbb at normal inc // SUBROUTINE INFORMATION: // AUTHOR John L. Wright and Nathan Kotey, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Modifies long wave properties for shade types characterized by openness. @@ -920,17 +881,12 @@ Real64 P01(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, May 2013 // Added error messages - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Constrains property to range 0 - 1 - // Return value - Real64 P01; - static constexpr std::string_view RoutineName("P01: "); if (P < -0.05 || P > 1.05) { @@ -942,9 +898,7 @@ Real64 P01(EnergyPlusData &state, ShowContinueError(state, "property value is reset to 1.0"); } } - P01 = max(0.0, min(1.0, P)); - - return P01; + return max(0.0, min(1.0, P)); } Real64 @@ -955,9 +909,6 @@ HEMINT(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Romberg Integration of Property function over hemispeherical dome @@ -974,26 +925,19 @@ HEMINT(EnergyPlusData &state, Array2D T(KMAX, KMAX); Real64 FX; - Real64 X1; - Real64 X2; Real64 X; Real64 DX; - Real64 SUM; Real64 DIFF; - int nPan; - int I; int K; - int L; - int iPX; - X1 = 0.0; // integration limits - X2 = Constant::PiOvr2; - nPan = 1; - SUM = 0.0; + Real64 X1 = 0.0; // integration limits + Real64 X2 = Constant::PiOvr2; + int nPan = 1; + Real64 SUM = 0.0; for (K = 1; K <= KMAX; ++K) { DX = (X2 - X1) / nPan; - iPX = NPANMAX / nPan; - for (I = 0; I <= nPan; ++I) { + int iPX = NPANMAX / nPan; + for (int I = 0; I <= nPan; ++I) { if (K == 1 || mod(I * iPX, iPX * 2) != 0) { // evaluate integrand function for new X values // 2 * sin( x) * cos( x) covers hemisphere with single integral @@ -1008,7 +952,7 @@ HEMINT(EnergyPlusData &state, // trapezoid result - i.e., first column Romberg entry // Now complete the row if (K > 1) { - for (L = 2; L <= K; ++L) { + for (int L = 2; L <= K; ++L) { Real64 const pow_4_L_1(std::pow(4.0, L - 1)); T(K, L) = (pow_4_L_1 * T(K, L - 1) - T(K - 1, L - 1)) / (pow_4_L_1 - 1.0); } @@ -1038,9 +982,6 @@ void RB_DIFF(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright and Nathan Kotey, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates roller blind diffuse-diffuse solar optical properties by integrating @@ -1076,9 +1017,6 @@ Real64 RB_F(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Roller blind integrand @@ -1115,9 +1053,6 @@ void RB_BEAM(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the roller blind off-normal properties using semi-empirical relations @@ -1178,9 +1113,6 @@ void IS_DIFF(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates insect screen diffuse-diffuse solar optical properties by integrating @@ -1219,16 +1151,10 @@ Real64 IS_F(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Insect screen integrand - // Return value - Real64 IS_F; - // Argument array dimensioning EP_SIZE_CHECK(P, state.dataWindowEquivalentLayer->hipDIM); @@ -1246,13 +1172,12 @@ Real64 IS_F(EnergyPlusData &state, TAU_BD); if (OPT == state.dataWindowEquivalentLayer->hipRHO) { - IS_F = RHO_BD; + return RHO_BD; } else if (OPT == state.dataWindowEquivalentLayer->hipTAU) { - IS_F = TAU_BB + TAU_BD; + return TAU_BB + TAU_BD; } else { - IS_F = -1.0; + return -1.0; } - return IS_F; } void IS_BEAM(EnergyPlusData &state, @@ -1268,9 +1193,6 @@ void IS_BEAM(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates insect screen off-normal solar optical properties @@ -1325,9 +1247,6 @@ Real64 IS_OPENNESS(Real64 const D, // wire diameter ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns openness from wire geometry. @@ -1342,9 +1261,6 @@ Real64 IS_OPENNESS(Real64 const D, // wire diameter Real64 IS_DSRATIO(Real64 const OPENNESS) // openness { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns ratio of diameter to spacing @@ -1367,9 +1283,6 @@ void FM_DIFF(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates drape fabric diffuse-diffuse solar optical properties by integrating @@ -1411,16 +1324,10 @@ Real64 FM_F(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Drape fabric property integrand. - // Return value - Real64 FM_F; - // Argument array dimensioning EP_SIZE_CHECK(P, state.dataWindowEquivalentLayer->hipDIM); @@ -1438,13 +1345,12 @@ Real64 FM_F(EnergyPlusData &state, TAU_BD); if (Opt == state.dataWindowEquivalentLayer->hipRHO) { - FM_F = RHO_BD; + return RHO_BD; } else if (Opt == state.dataWindowEquivalentLayer->hipTAU) { - FM_F = TAU_BB + TAU_BD; + return TAU_BB + TAU_BD; } else { - FM_F = -1.0; + return -1.0; } - return FM_F; } void FM_BEAM(EnergyPlusData &state, @@ -1461,9 +1367,6 @@ void FM_BEAM(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the solar optical properties of a fabric for beam radiation incident @@ -1521,9 +1424,6 @@ void PD_LW(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the effective longwave emittance and transmittance of a drapery layer @@ -1568,9 +1468,6 @@ void PD_DIFF(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the effective diffuse transmittance and reflectance of a drapery layer. @@ -1741,9 +1638,6 @@ void PD_BEAM(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -1992,9 +1886,6 @@ void PD_BEAM_CASE_I(Real64 const S, // pleat spacing (> 0 // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -2418,9 +2309,6 @@ void PD_BEAM_CASE_II(Real64 const S, // pleat spacing (> // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -2750,9 +2638,6 @@ void PD_BEAM_CASE_III(Real64 const S, // pleat spacing (> 0) // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -3082,9 +2967,6 @@ void PD_BEAM_CASE_IV(Real64 const S, // pleat spacing (> // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -3265,9 +3147,6 @@ void PD_BEAM_CASE_V(Real64 const S, // pleat spacing (> 0) // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -3493,9 +3372,6 @@ void PD_BEAM_CASE_VI(Real64 const S, // pleat spacing (> // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // calculates the effective front-side solar optical properties of a drapery layer. @@ -3650,9 +3526,6 @@ void VB_DIFF(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the venetian blind layer effective diffuse transmittance and reflectance. @@ -3660,7 +3533,6 @@ void VB_DIFF(EnergyPlusData &state, // four surface flat-slat model with slat transmittance // SUBROUTINE ARGUMENT DEFINITIONS: - // must be > 0 // must be > 0 // ltyVBHOR: + = front-side slat tip below horizontal // ltyVBVER: + = front-side slat tip is counter- @@ -3715,29 +3587,20 @@ Real64 VB_SLAT_RADIUS_RATIO(Real64 const W, // slat tip-to-tip (chord) width (an ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns curved slat radius ratio (W / R) - // Return value - Real64 VB_SLAT_RADIUS_RATIO; - - Real64 CX; - if (C <= 0.0 || W <= 0.0) { // it is flat - VB_SLAT_RADIUS_RATIO = 0.0; + return 0.0; } else { - CX = min(C, W / 2.001); - VB_SLAT_RADIUS_RATIO = 2.0 * W * CX / (CX * CX + W * W / 4); + Real64 CX = min(C, W / 2.001); + return 2.0 * W * CX / (CX * CX + W * W / 4); } - return VB_SLAT_RADIUS_RATIO; } -void VB_SOL46_CURVE(EnergyPlusData &state, +void VB_SOL46_CURVE(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip (chord) width (any length units; same units as S) Real64 const SL_WR, // slat curvature radius ratio (= W/R) @@ -3754,9 +3617,6 @@ void VB_SOL46_CURVE(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the venetian blind layer effective solar transmittance and reflectance. @@ -3982,7 +3842,7 @@ void VB_SOL46_CURVE(EnergyPlusData &state, } } -void VB_SOL4(EnergyPlusData &state, +void VB_SOL4(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip width (any length units; same units as S) Real64 const OMEGA, // incident beam profile angle (radians) @@ -3998,9 +3858,6 @@ void VB_SOL4(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the venetian blind layer effective solar transmittance and reflectance. @@ -4085,7 +3942,7 @@ void VB_SOL4(EnergyPlusData &state, } // END OF CHECK FOR CLOSED BLIND } -void VB_SOL6(EnergyPlusData &state, +void VB_SOL6(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip width (any length units; same units as S) Real64 const OMEGA, // incident beam profile angle (radians) @@ -4101,9 +3958,6 @@ void VB_SOL6(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the venetian blind layer effective solar transmittance and reflectance. @@ -4259,9 +4113,6 @@ void SOLMATS(int const N, // # of active rows in A // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Matrix solver. @@ -4269,43 +4120,27 @@ void SOLMATS(int const N, // # of active rows in A // Solves matrix by the elimination method supplemented by a search for the // largest pivotal element at each stage - Real64 CMAX; - Real64 TEMP; - Real64 C; - Real64 Y; - Real64 D; - int NM1; - int NP1; - int NP2; - int I; - int J; - int L; - int LP; - int NOS; - int NI; - int NJ; - - NM1 = N - 1; - NP1 = N + 1; - NP2 = N + 2; + int NM1 = N - 1; + int NP1 = N + 1; + int NP2 = N + 2; - for (I = 1; I <= N; ++I) { + for (int I = 1; I <= N; ++I) { A(NP2, I) = 0.0; // DO 1 J=1,NP1 ! TODO ? } - for (I = 1; I <= N; ++I) { - for (J = 1; J <= NP1; ++J) { + for (int I = 1; I <= N; ++I) { + for (int J = 1; J <= NP1; ++J) { A(NP2, I) += A(J, I); } } - for (L = 1; L <= N - 1; ++L) { - CMAX = A(L, L); - LP = L + 1; - NOS = L; + for (int L = 1; L <= N - 1; ++L) { + Real64 CMAX = A(L, L); + int LP = L + 1; + int NOS = L; - for (I = LP; I <= N; ++I) { + for (int I = LP; I <= N; ++I) { if (std::abs(CMAX) < std::abs(A(L, I))) { CMAX = A(L, I); NOS = I; @@ -4314,20 +4149,20 @@ void SOLMATS(int const N, // # of active rows in A // Swap rows if (NOS != L) { - for (J = 1; J <= NP2; ++J) { - TEMP = A(J, L); + for (int J = 1; J <= NP2; ++J) { + Real64 TEMP = A(J, L); A(J, L) = A(J, NOS); A(J, NOS) = TEMP; } } - for (I = LP; I <= N; ++I) { - C = 0.0; - Y = -A(L, I) / A(L, L); - for (J = L; J <= NP2; ++J) { + for (int I = LP; I <= N; ++I) { + Real64 C = 0.0; + Real64 Y = -A(L, I) / A(L, L); + for (int J = L; J <= NP2; ++J) { A(J, I) += Y * A(J, L); } - for (J = L; J <= NP1; ++J) { + for (int J = L; J <= NP1; ++J) { C += A(J, I); } } @@ -4335,11 +4170,11 @@ void SOLMATS(int const N, // # of active rows in A // back-substitute XSOL(N) = A(NP1, N) / A(N, N); - for (I = 1; I <= NM1; ++I) { - NI = N - I; - D = 0.0; - for (J = 1; J <= I; ++J) { - NJ = N + 1 - J; + for (int I = 1; I <= NM1; ++I) { + int NI = N - I; + Real64 D = 0.0; + for (int J = 1; J <= I; ++J) { + int NJ = N + 1 - J; D += A(NJ, NI) * XSOL(NJ); } XSOL(NI) = (A(NP1, NI) - D) / A(NI, NI); @@ -4372,7 +4207,6 @@ void ASHWAT_ThermalCalc(EnergyPlusData &state, // MODIFIED Bereket Nigusse, June 2013 // added standard 155099 inside convection // coefficient calculation for U-Factor - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Subroutine to calculate the glazing temperatures of the @@ -4438,9 +4272,7 @@ void ASHWAT_ThermalCalc(EnergyPlusData &state, int NL; int I; int J; - int L; int ITRY; - int hin_scheme; // flags different schemes for indoor convection coefficients Array1D_int ISDL({0, FS.NL + 1}); // Flag to mark diathermanous layers, 0=opaque Array1D QOCF_F(FS.NL); // heat flux to outdoor-facing surface of layer i, from gap i-1, // due to open channel flow, W/m2 @@ -4562,19 +4394,6 @@ void ASHWAT_ThermalCalc(EnergyPlusData &state, // CALCULATE GAS LAYER CONVECTIVE HEAT TRANSFER COEFFICIENTS - hin_scheme = 3; // different schemes for calculating convection - // coefficients glass-to-air and shade-to-air - // if open channel air flow is allowed - // see the corresponding subroutines for detail - // = 1 gives dependence of height, spacing, delta-T - // = 2 gives dependence of spacing, delta-T but - // returns unrealistic values for large spacing - // = 3 glass-shade spacing dependence only on HCIN - // = negative, applies HCIN without adjusting for - // temperature, height, spacing, slat angle - // Recommended -> hin_scheme=3 for use with HBX, - // simplicity, right trends wrt spacing - // start by assuming no open channel flow on indoor side HC[NL] = HCIN; // default - HC[NL] supplied by calling routine @@ -4590,6 +4409,20 @@ void ASHWAT_ThermalCalc(EnergyPlusData &state, // Check for open channels - only possible with at least two layers if (NL >= 2) { + + int hin_scheme = 3; // different schemes for calculating convection + // coefficients glass-to-air and shade-to-air + // if open channel air flow is allowed + // see the corresponding subroutines for detail + // = 1 gives dependence of height, spacing, delta-T + // = 2 gives dependence of spacing, delta-T but + // returns unrealistic values for large spacing + // = 3 glass-shade spacing dependence only on HCIN + // = negative, applies HCIN without adjusting for + // temperature, height, spacing, slat angle + // Recommended -> hin_scheme=3 for use with HBX, + // simplicity, right trends wrt spacing + for (I = 1; I <= NL - 1; ++I) { // Scan gaps between layers // DEAL WITH INDOOR OPEN CHANNEL FLOW HERE @@ -4660,7 +4493,7 @@ void ASHWAT_ThermalCalc(EnergyPlusData &state, XSOL = 0.0; A = 0.0; - L = 1; + int L = 1; A(1, L) = 1.0; A(2, L) = -1.0 * RHOB(0); // -1.0 * RHOB_OUT A(ADIM + 1, L) = EPSB_OUT * Constant::StefanBoltzmann * TRMOUT_4; @@ -4824,7 +4657,6 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, // MODIFIED Bereket Nigusse, June 2013 // added standard 155099 inside convection // coefficient calculation for U-Factor - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Subroutine to calculate the glazing temperatures of the @@ -4892,9 +4724,7 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, int NL; int I; int J; - int L; int ITRY; - int hin_scheme; // flags different schemes for indoor convection coefficients Array1D_int ISDL({0, FS.NL + 1}); // Flag to mark diathermanous layers, 0=opaque int NDLIAR; // Number of Diathermanous Layers In A Row (i.e., consecutive) int IB; // Counter begin and end limits @@ -5039,19 +4869,6 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, // CALCULATE GAS LAYER CONVECTIVE HEAT TRANSFER COEFFICIENTS - hin_scheme = 3; // different schemes for calculating convection - // coefficients glass-to-air and shade-to-air - // if open channel air flow is allowed - // see the corresponding subroutines for detail - // = 1 gives dependence of height, spacing, delta-T - // = 2 gives dependence of spacing, delta-T but - // returns unrealistic values for large spacing - // = 3 glass-shade spacing dependence only on HCIN - // = negative, applies HCIN without adjusting for - // temperature, height, spacing, slat angle - // Recommended -> hin_scheme=3 for use with HBX, - // simplicity, right trends wrt spacing - // start by assuming no open channel flow on indoor side HC[NL] = HCIN; // default - HC[NL] supplied by calling routine @@ -5065,6 +4882,20 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, // Check for open channels - only possible with at least two layers if (NL >= 2) { + + int hin_scheme = 3; // different schemes for calculating convection + // coefficients glass-to-air and shade-to-air + // if open channel air flow is allowed + // see the corresponding subroutines for detail + // = 1 gives dependence of height, spacing, delta-T + // = 2 gives dependence of spacing, delta-T but + // returns unrealistic values for large spacing + // = 3 glass-shade spacing dependence only on HCIN + // = negative, applies HCIN without adjusting for + // temperature, height, spacing, slat angle + // Recommended -> hin_scheme=3 for use with HBX, + // simplicity, right trends wrt spacing + for (I = 1; I <= NL - 1; ++I) { // Scan gaps between layers // DEAL WITH INDOOR OPEN CHANNEL FLOW HERE @@ -5135,7 +4966,7 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, XSOL = 0.0; A = 0.0; - L = 1; + int L = 1; A(1, L) = 1.0; A(2, L) = -1.0 * RHOB(0); // -1.0 * RHOB_OUT A(ADIM + 1, L) = EPSB_OUT * Constant::StefanBoltzmann * TRMOUT_4; @@ -5386,13 +5217,11 @@ bool ASHWAT_ThermalRatings(EnergyPlusData &state, } // end of IF/ELSE (I .EQ. 0) } // end of IF(ISDL(I) .EQ. 0) .AND. ..... } // end of scan through all layers - } - - // calculate convective OCF/jump heat transfer coefficients - if (NL >= 2) { // no OCF unless at least two layers exist - // It is not possible for both of the following cases to be - // true for the same gap (i.e., for NL=2) + // calculate convective OCF/jump heat transfer coefficients + // no OCF unless at least two layers exist + // It is not possible for both of the following cases to be + // true for the same gap (i.e., for NL=2) if (FS.G(NL - 1).GTYPE == state.dataWindowEquivalentLayer->gtyOPENin) { SaveHCNLm = HC[NL - 1]; @@ -5745,9 +5574,6 @@ void DL_RES_r2(Real64 const Tg, // mean glass layer temperature, {K} // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Returns the radiant heat transfer coefficients between parallel surfaces: @@ -5848,9 +5674,6 @@ void SETUP4x4_A(Real64 const rhog, Real64 const rhodf, Real64 const rhodb, Real6 // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Returns the 4 X 4 matrix for DL_RES_r2 routine: @@ -5889,9 +5712,7 @@ Real64 FRA(Real64 const TM, // mean gas temp, K ) { // AUTHOR (John Wright, University of WaterLoo, ASHRAE 1311-RP) - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, FSEC/UCF, May 2013 - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns Rayleigh number given surface temperatures, and coefficients of @@ -5903,33 +5724,21 @@ Real64 FRA(Real64 const TM, // mean gas temp, K // REFERENCES: // ASHRAE 1311-RP - // Return value - Real64 FRA; - // FUNCTION ARGUMENT DEFINITIONS: // (as adjusted e.g. re VB models) - Real64 Z; - Real64 K; - Real64 CP; - Real64 VISC; - - Z = 1.0; - K = AK + BK * TM + CK * TM * TM; - CP = ACP + BCP * TM + BCP * TM * TM; - VISC = AVISC + BVISC * TM + BVISC * TM * TM; + Real64 Z = 1.0; + Real64 K = AK + BK * TM + CK * TM * TM; + Real64 CP = ACP + BCP * TM + BCP * TM * TM; + Real64 VISC = AVISC + BVISC * TM + BVISC * TM * TM; - FRA = (Constant::GravityConstant * RHOGAS * RHOGAS * DT * T * T * T * CP) / (VISC * K * TM * Z * Z); - - return FRA; + return (Constant::GravityConstant * RHOGAS * RHOGAS * DT * T * T * T * CP) / (VISC * K * TM * Z * Z); } Real64 FNU(Real64 const RA) // Rayleigh number { // AUTHOR (John Wright, University of WaterLoo, ASHRAE 1311-RP) - // DATE WRITTEN // MODIFIED Bereket Nigusse, FSEC/UCF, May 2013 - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns Nusselt number given Rayleigh number @@ -5940,18 +5749,14 @@ Real64 FNU(Real64 const RA) // Rayleigh number // REFERENCES: // ASHRAE 1311-RP - // Return value - Real64 FNU; - Real64 const ARA(std::abs(RA)); if (ARA <= 10000.0) { - FNU = 1.0 + 1.75967e-10 * std::pow(ARA, 2.2984755); + return 1.0 + 1.75967e-10 * std::pow(ARA, 2.2984755); } else if (ARA <= 50000.0) { - FNU = 0.028154 * std::pow(ARA, 0.413993); + return 0.028154 * std::pow(ARA, 0.413993); } else { - FNU = 0.0673838 * std::pow(ARA, 1.0 / 3.0); + return 0.0673838 * std::pow(ARA, 1.0 / 3.0); } - return FNU; } Real64 HConvGap(CFSGAP const &G, // gap @@ -5959,9 +5764,7 @@ Real64 HConvGap(CFSGAP const &G, // gap Real64 const T2) { // AUTHOR (University of WaterLoo, ASHRAE 1311-RP) - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, FSEC/UCF, May 2013 - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns convective coefficient for a gap separated between two surfaces at // temperatures T1 and T2 , W/m2-K @@ -5970,9 +5773,6 @@ Real64 HConvGap(CFSGAP const &G, // gap // REFERENCES: // ASHRAE 1311-RP - // Return value - Real64 HConvGap; - Real64 TM; // Mean temperature, K Real64 DT; // temperature difference, (K) Real64 RA; // Rayleigh Number, (-) @@ -5987,8 +5787,7 @@ Real64 HConvGap(CFSGAP const &G, // gap NU = FNU(RA); KGAS = G.FG.AK + G.FG.BK * TM + G.FG.CK * TM * TM; - HConvGap = NU * KGAS / T; - return HConvGap; + return NU * KGAS / T; } Real64 HRadPar(Real64 const T1, // bounding surface temps [K] @@ -5997,9 +5796,6 @@ Real64 HRadPar(Real64 const T1, // bounding surface temps [K] Real64 const E2) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns radiative coefficient between two surfaces, hr, W/m2-K // METHODOLOGY EMPLOYED: @@ -6030,9 +5826,6 @@ Real64 HIC_ASHRAE(Real64 const L, // glazing height, m ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns inside surface convective coefficient, W/m2-K @@ -6046,7 +5839,7 @@ Real64 HIC_ASHRAE(Real64 const L, // glazing height, m return HIC_ASHRAE; } -void SLtoGL(EnergyPlusData &state, +void SLtoGL(EnergyPlusData const &state, Real64 const breal, // distance from shade to glass (m) Real64 const Ts, // shade temperature (K) Real64 const Tg, // glass temperature (K) @@ -6056,9 +5849,6 @@ void SLtoGL(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Returns the heat transfer coefficient, shade-to-glass @@ -6109,7 +5899,7 @@ void SLtoGL(EnergyPlusData &state, } // end of scheme .eq. 2 } -Real64 SLtoAMB(EnergyPlusData &state, +Real64 SLtoAMB(EnergyPlusData const &state, Real64 const b, // distance from shade to glass (m) where air flow takes place Real64 const L, // window height, m (usually taken as 1 m) Real64 const Ts, // shade temperature, K @@ -6119,9 +5909,6 @@ Real64 SLtoAMB(EnergyPlusData &state, ) { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns shade to room air heat transfer coefficient // METHODOLOGY EMPLOYED: @@ -6223,7 +6010,7 @@ Real64 SLtoAMB(EnergyPlusData &state, return SLtoAMB; } -void GLtoAMB(EnergyPlusData &state, +void GLtoAMB(EnergyPlusData const &state, Real64 const b, // distance from shade to glass {m} Real64 const L, // window height {m}, usually taken as 1 meter Real64 const Tg, // glass temperature {K} @@ -6235,9 +6022,6 @@ void GLtoAMB(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR John L. Wright, University of Waterloo, // Mechanical Engineering, Advanced Glazing System Laboratory - // DATE WRITTEN Unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Returns the glass to room air heat transfer coefficient @@ -6329,25 +6113,16 @@ void GLtoAMB(EnergyPlusData &state, Real64 ConvectionFactor(CFSLAYER const &L) // window layer { // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Modifies convection rate per shade configuration, layer convection enhancement - // Return value - Real64 ConvectionFactor; - - Real64 SlatADeg; - if (L.LTYPE == LayerType::VBHOR) { // horiz VB: enhanced convection at +/- 45 due to "pumping" - SlatADeg = min(90.0, std::abs(L.PHI_DEG)); - ConvectionFactor = 1.0 + 0.2 * std::sin(2.0 * SlatADeg); + Real64 SlatADeg = min(90.0, std::abs(L.PHI_DEG)); + return 1.0 + 0.2 * std::sin(2.0 * SlatADeg); } else { - ConvectionFactor = 1.0; + return 1.0; } - return ConvectionFactor; } bool CFSUFactor(EnergyPlusData &state, @@ -6361,9 +6136,7 @@ bool CFSUFactor(EnergyPlusData &state, { // FUNCTION INFORMATION: // AUTHOR unknown (University of WaterLoo, ASHRAE 1311-RP) - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, FSEC/UCF, June 2013 - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // ! returns .TRUE. if the U-value calculation succeeded, .FALSE. if error @@ -6754,8 +6527,6 @@ void ASHWAT_OffNormalProperties(EnergyPlusData &state, // = wall-solar azimuth angle for a vertical wall // Used for PD and vertical VB - bool OKAY; - LSWP_ON = L.SWP_EL; // init to normal properties // calls below modify in place @@ -6764,15 +6535,15 @@ void ASHWAT_OffNormalProperties(EnergyPlusData &state, // HBX note: ltyGZS here iff modelOption F=x; spectral cases elsewhere Specular_SWP(LSWP_ON, THETA); } else if (L.LTYPE == LayerType::VBHOR) { - OKAY = VB_SWP(state, L, LSWP_ON, OMEGA_V); + VB_SWP(state, L, LSWP_ON, OMEGA_V); } else if (L.LTYPE == LayerType::VBVER) { - OKAY = VB_SWP(state, L, LSWP_ON, OMEGA_H); + VB_SWP(state, L, LSWP_ON, OMEGA_H); } else if (L.LTYPE == LayerType::DRAPE) { - OKAY = PD_SWP(state, L, LSWP_ON, OMEGA_V, OMEGA_H); + PD_SWP(state, L, LSWP_ON, OMEGA_V, OMEGA_H); } else if (L.LTYPE == LayerType::ROLLB) { - OKAY = RB_SWP(state, L, LSWP_ON, THETA); + RB_SWP(state, L, LSWP_ON, THETA); } else if (L.LTYPE == LayerType::INSCRN) { - OKAY = IS_SWP(state, L, LSWP_ON, THETA); + IS_SWP(state, L, LSWP_ON, THETA); } else if (L.LTYPE == LayerType::NONE || L.LTYPE == LayerType::ROOM) { // none or room: do nothing } else { @@ -6925,7 +6696,7 @@ void Specular_RATDiff(EnergyPlusData &state, Real64 &RAT_1MRDiff, Real64 &RAT_TA RAT_1MRDiff = state.dataWindowEquivalentLayer->X1MRDiff; } -Real64 Specular_F(EnergyPlusData &state, +Real64 Specular_F(EnergyPlusData const &state, Real64 const THETA, // incidence angle, radians int const OPT, // options (unused) [[maybe_unused]] const Array1D &P // parameters (none defined) @@ -7401,7 +7172,7 @@ bool VB_LWP(EnergyPlusData &state, return VB_LWP; } -bool VB_SWP(EnergyPlusData &state, +bool VB_SWP(EnergyPlusData const &state, CFSLAYER const &L, // VB layer CFSSWP &LSWP, // returned: equivalent off-normal properties const Real64 OMEGA // incident profile angle (radians) @@ -7486,7 +7257,7 @@ bool VB_SWP(EnergyPlusData &state, return true; } -bool VB_ShadeControl(EnergyPlusData &state, +bool VB_ShadeControl(EnergyPlusData const &state, CFSLAYER &L, // VB layer Real64 const OMEGA_DEG // incident profile angle (degrees) ) @@ -7614,9 +7385,6 @@ void FinalizeCFSLAYER(EnergyPlusData &state, CFSLAYER &L) // layer, input: LTYPE // SUBROUTINE INFORMATION: // AUTHOR JOHN L. WRIGHT, University of Waterloo, Mechanical Engineering // Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Sets equivalent layer properties of a construction. @@ -7629,10 +7397,6 @@ void FinalizeCFSLAYER(EnergyPlusData &state, CFSLAYER &L) // layer, input: LTYPE bool BOK; bool CFSLAYERFlag; - LOK = false; - DOK = false; - BOK = false; - if (IsVBLayer(L)) { LOK = VB_LWP(state, L, L.LWP_EL); DOK = VB_SWP(state, L, L.SWP_EL); // SW diffuse @@ -7681,9 +7445,6 @@ bool IsGZSLayer(CFSLAYER const &L) // FUNCTION INFORMATION: // AUTHOR JOHN L. WRIGHT, University of Waterloo, Mechanical Engineering // Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns .TRUE. if Layer has glazing data from external file or returns .FALSE. @@ -7700,9 +7461,6 @@ bool IsGlazeLayerX(CFSLAYER const &L) // FUNCTION INFORMATION: // AUTHOR JOHN L. WRIGHT, University of Waterloo, Mechanical Engineering // Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns .TRUE. if Layer has glazing (including GZS) or returns .FALSE. @@ -7714,23 +7472,16 @@ bool IsGlazeLayerX(CFSLAYER const &L) return IsGlazeLayerX; } -bool IsControlledShade(EnergyPlusData &state, CFSLAYER const &L) +bool IsControlledShade(EnergyPlusData const &state, CFSLAYER const &L) { // FUNCTION INFORMATION: // AUTHOR JOHN L. WRIGHT, University of Waterloo, Mechanical Engineering // Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns .TRUE. if Layer is Venetian blind and is controlled or returns .FALSE. - // Return value - bool IsControlledShade; - - IsControlledShade = IsVBLayer(L) && L.CNTRL != state.dataWindowEquivalentLayer->lscNONE; - return IsControlledShade; + return IsVBLayer(L) && L.CNTRL != state.dataWindowEquivalentLayer->lscNONE; } bool IsVBLayer(CFSLAYER const &L) @@ -7738,18 +7489,11 @@ bool IsVBLayer(CFSLAYER const &L) // FUNCTION INFORMATION: // AUTHOR JOHN L. WRIGHT, University of Waterloo, Mechanical Engineering // Advanced Glazing System Laboratory - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns .TRUE. if Layer is Venetian blind, or returns .FALSE. - // Return value - bool IsVBLayer; - - IsVBLayer = L.LTYPE == LayerType::VBHOR || L.LTYPE == LayerType::VBVER; - return IsVBLayer; + return L.LTYPE == LayerType::VBHOR || L.LTYPE == LayerType::VBVER; } void BuildGap(EnergyPlusData &state, @@ -7761,9 +7505,7 @@ void BuildGap(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse, June 2013, Jason W. DeGraw 2023 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // fills in the effective gap thickness and calculates the gas density @@ -7797,13 +7539,9 @@ void AdjustVBGap(CFSGAP &G, // gap, returned updated { // SUBROUTINE INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Adjusts thickness of adjacent gaps seperated by - // in between slatted blind. + // Adjusts thickness of adjacent gaps seperated by in between slatted blind. // METHODOLOGY EMPLOYED: // Treat VB layer as if it has 70% of actual thickness @@ -7828,39 +7566,23 @@ float DensityCFSFillGas(CFSFILLGAS const &FG, // gas properties { // FUNCTION INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns gas density at P and T, kg/m3 // METHODOLOGY EMPLOYED: // Uses ideal gas relations - // Return value - float DensityCFSFillGas; - - DensityCFSFillGas = (P * FG.MHAT) / (Constant::UniversalGasConst * max(T, 1.0)); - - return DensityCFSFillGas; + return (P * FG.MHAT) / (Constant::UniversalGasConst * max(T, 1.0)); } int CFSNGlz(CFSTY const &FS) // CFS { // FUNCTION INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns the number of glazing layers - // Return value - int CFSNGlz; - - int iL; - - CFSNGlz = 0; - for (iL = 1; iL <= FS.NL; ++iL) { + int CFSNGlz = 0; + for (int iL = 1; iL <= FS.NL; ++iL) { if (IsGlazeLayerX(FS.L(iL))) { ++CFSNGlz; } @@ -7868,24 +7590,16 @@ int CFSNGlz(CFSTY const &FS) // CFS return CFSNGlz; } -int CFSHasControlledShade(EnergyPlusData &state, CFSTY const &FS) +int CFSHasControlledShade(EnergyPlusData const &state, CFSTY const &FS) { // FUNCTION INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns index of the controlled layer in a fenestratio. If no // controlled layer, then returns zero. - // Return value - int CFSHasControlledShade; - - int iL; - - CFSHasControlledShade = 0; - for (iL = 1; iL <= FS.NL; ++iL) { + int CFSHasControlledShade = 0; + for (int iL = 1; iL <= FS.NL; ++iL) { if (IsControlledShade(state, FS.L(iL))) { CFSHasControlledShade = iL; break; @@ -7898,9 +7612,6 @@ void CheckAndFixCFSLayer(EnergyPlusData &state, CFSLAYER &Layer) { // SUBROUTINE INFORMATION: // AUTHOR ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Verify CFS layer validity, sets bad items to valid defaults if possible @@ -7915,17 +7626,13 @@ void FillDefaultsSWP(EnergyPlusData &state, { // SUBROUTINE INFORMATION: // AUTHOR The University of WaterLoo - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse/FSEC, June 2013 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Fills in defaulted short wave optical properties for equivalent window - // layers + // Fills in defaulted short wave optical properties for equivalent window layers // may be within L static constexpr std::string_view RoutineName("FillDefaultsSWP: "); - bool OK; // default back taus to front (often equal) if (SWP.TAUSBBB < 0.0) SWP.TAUSBBB = SWP.TAUSFBB; @@ -7946,7 +7653,7 @@ void FillDefaultsSWP(EnergyPlusData &state, } else if (L.LTYPE == LayerType::ROLLB) { // estimate diffuse properties if any < 0 if (min(SWP.RHOSBDD, SWP.RHOSFDD, SWP.TAUS_DD) < 0.0) { - OK = RB_SWP(state, L, SWP); // TODO RB + RB_SWP(state, L, SWP); // TODO RB } } else if (L.LTYPE == LayerType::INSCRN) { if (SWP.TAUSFBB < 0.0) { @@ -7954,7 +7661,7 @@ void FillDefaultsSWP(EnergyPlusData &state, if (SWP.TAUSBBB < 0.0) SWP.TAUSBBB = SWP.TAUSFBB; } if (min(SWP.RHOSBDD, SWP.RHOSFDD, SWP.TAUS_DD) < 0.0) { - OK = IS_SWP(state, L, SWP); // TODO IS + IS_SWP(state, L, SWP); // TODO IS } } else if (L.LTYPE == LayerType::NONE || L.LTYPE == LayerType::ROOM) { // none or room: do nothing @@ -7968,28 +7675,19 @@ void FinalizeCFS(EnergyPlusData &state, CFSTY &FS) { // SUBROUTINE INFORMATION: // AUTHOR The University of WaterLoo - // DATE WRITTEN unknown // MODIFIED Bereket Nigusse/FSEC, May 2013 - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Complete CFS after BuildCFS by checking the shade type and - // gap type + // Complete CFS after BuildCFS by checking the shade type and gap type static constexpr std::string_view RoutineName("FinalizeCFS: "); // include trailing blank space - int iL; - int gType; - bool LVBPREV; - std::string CurrentModuleObject; - bool ErrorsFound; + std::string CurrentModuleObject = "WindowConstruction:EquivalentLayer"; + bool ErrorsFound = false; - CurrentModuleObject = "WindowConstruction:EquivalentLayer"; - ErrorsFound = false; + bool LVBPREV = false; // .TRUE. if previous layer is VB - LVBPREV = false; // .TRUE. if previous layer is VB - - for (iL = 1; iL <= FS.NL; ++iL) { + for (int iL = 1; iL <= FS.NL; ++iL) { if (!IsVBLayer(FS.L(iL))) { LVBPREV = false; } else if (LVBPREV) { @@ -8002,7 +7700,7 @@ void FinalizeCFS(EnergyPlusData &state, CFSTY &FS) if (iL < FS.NL) AdjustVBGap(FS.G(iL), FS.L(iL)); } if (iL < FS.NL) { - gType = FS.G(iL).GTYPE; + int gType = FS.G(iL).GTYPE; if (gType == state.dataWindowEquivalentLayer->gtyOPENout && iL != 1) { ShowSevereError(state, format("{}=\"{}", CurrentModuleObject, FS.Name)); ShowContinueError(state, format("...invalid EquivalentLayer window gap type specified ={}.", FS.G(iL).Name)); @@ -8024,15 +7722,8 @@ Real64 EffectiveEPSLF(CFSTY const &FS) // Complex Fenestration { // FUNCTION INFORMATION: // AUTHOR , ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: - // Returns effective outside Longwave emissivity. Handles partially - // transparent layers - - // Return value - Real64 EffectiveEPSLF; + // Returns effective outside Longwave emissivity. Handles partially transparent layers Real64 E; // Effective emissivity Real64 TX; // correction factor @@ -8049,31 +7740,19 @@ Real64 EffectiveEPSLF(CFSTY const &FS) // Complex Fenestration TX *= FS.L(iL).LWP_EL.TAUL; } } - EffectiveEPSLF = E; - return EffectiveEPSLF; + return E; } Real64 EffectiveEPSLB(CFSTY const &FS) // Complex Fenestration { // FUNCTION INFORMATION: // AUTHOR , ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: - // Returns effective inside (room side) Longwave emissivity. Handles partially - // transparent layers + // Returns effective inside (room side) Longwave emissivity. Handles partially transparent layers - // Return value - Real64 EffectiveEPSLB; - - Real64 E; // Effective emissivity - Real64 TX; // correction factor - int iL; // layers index - - E = 0.0; - TX = 1.0; - for (iL = FS.NL; iL >= 0; --iL) { + Real64 E = 0.0; // Effective emissivity + Real64 TX = 1.0; // correction factor + for (int iL = FS.NL; iL >= 0; --iL) { if (iL == 0) { E += 0.9 * TX; } else { @@ -8082,8 +7761,7 @@ Real64 EffectiveEPSLB(CFSTY const &FS) // Complex Fenestration TX *= FS.L(iL).LWP_EL.TAUL; } } - EffectiveEPSLB = E; - return EffectiveEPSLB; + return E; } bool FEQX(Real64 const a, // values to compare, fractional tolerance @@ -8094,28 +7772,18 @@ bool FEQX(Real64 const a, // values to compare, fractional tolerance { // FUNCTION INFORMATION: // AUTHOR , ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns true if the difference between two real numbers is within the // tolerance limit specified. - // Return value - bool FEQX; - - Real64 d; - Real64 tolAbsX; - - tolAbsX = max(tolAbs, 1.e-10); + Real64 tolAbsX = max(tolAbs, 1.e-10); - d = std::abs(a - b); + Real64 d = std::abs(a - b); if (d < tolAbsX) { - FEQX = true; + return true; } else { - FEQX = (2.0 * d / (std::abs(a) + std::abs(b))) < tolF; + return (2.0 * d / (std::abs(a) + std::abs(b))) < tolF; } - return FEQX; } Real64 TRadC(Real64 const J, // radiosity, W/m2 @@ -8124,9 +7792,6 @@ Real64 TRadC(Real64 const J, // radiosity, W/m2 { // FUNCTION INFORMATION: // AUTHOR , ASHRAE 1311-RP - // DATE WRITTEN unknown - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Returns equivalent celsius scale temperature from radiosity @@ -8143,8 +7808,6 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, // SUBROUTINE INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the system optical properties from the individual layers @@ -8155,38 +7818,30 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, // Uses the net radiation method developed for ASHWAT fenestration // model (ASHRAE RP-1311) by John Wright, the University of WaterLoo - using Dayltg::ProfileAngle; - // Argument array dimensioning CFSAbs.dim(2, CFSMAXNL + 1); - Real64 ProfAngVer; // Solar vertical profile angle (radians) for horizontal blind - Real64 ProfAngHor; // Solar horizontal profile angle (radians) for vertical blind - Real64 IncAng; // incident angle degree Array2D Abs1(2, CFSMAXNL + 1); - int Lay; // window layer index - int EQLNum; // equivalent layer window construction index - int ConstrNum; // construction index auto &surf = state.dataSurface->Surface(SurfNum); auto &CFS = state.dataWindowEquivLayer->CFS; - IncAng = 0.0; // Autodesk:Init Added to elim use uninitialized + Real64 IncAng = 0.0; // incident angle degree CFSAbs = 0.0; - ProfAngHor = 0.0; - ProfAngVer = 0.0; - ConstrNum = surf.Construction; - EQLNum = state.dataConstruction->Construct(surf.Construction).EQLConsPtr; + Real64 ProfAngHor = 0.0; + Real64 ProfAngVer = 0.0; + int ConstrNum = surf.Construction; + int EQLNum = state.dataConstruction->Construct(surf.Construction).EQLConsPtr; if (BeamDIffFlag != SolarArrays::DIFF) { if (state.dataHeatBal->SurfCosIncAng(state.dataGlobal->HourOfDay, state.dataGlobal->TimeStep, SurfNum) <= 0.0) return; - for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { + for (int Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { if (IsVBLayer(CFS(EQLNum).L(Lay))) { if (CFS(EQLNum).L(Lay).LTYPE == LayerType::VBHOR) { - ProfAngVer = ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Horizontal); + ProfAngVer = Dayltg::ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Horizontal); } else if (CFS(EQLNum).L(Lay).LTYPE == LayerType::VBVER) { - ProfAngHor = ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Vertical); + ProfAngHor = Dayltg::ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Vertical); } } } @@ -8197,12 +7852,13 @@ void CalcEQLOpticalProperty(EnergyPlusData &state, CFSAbs(2, {1, CFSMAXNL + 1}) = Abs1(2, {1, CFSMAXNL + 1}); } else { if (state.dataWindowEquivalentLayer->EQLDiffPropFlag(EQLNum)) { - for (Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { + for (int Lay = 1; Lay <= CFS(EQLNum).NL; ++Lay) { if (IsVBLayer(CFS(EQLNum).L(Lay))) { if (CFS(EQLNum).L(Lay).LTYPE == LayerType::VBHOR) { - ProfAngVer = ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Horizontal); + ProfAngVer = + Dayltg::ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Horizontal); } else if (CFS(EQLNum).L(Lay).LTYPE == LayerType::VBVER) { - ProfAngHor = ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Vertical); + ProfAngHor = Dayltg::ProfileAngle(state, SurfNum, state.dataEnvrn->SOLCOS, DataWindowEquivalentLayer::Orientation::Vertical); } } } @@ -8235,26 +7891,18 @@ void CalcEQLWindowStandardRatings(EnergyPlusData &state, int const ConstrNum) // // SUBROUTINE INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: - // Calculates the U-value, SHGC and Normal Transmittance of equivalent layer - // fenestration. + // Calculates the U-value, SHGC and Normal Transmittance of equivalent layer fenestration. // METHODOLOGY EMPLOYED: // Uses routine developed for ASHRAE RP-1311 (ASHWAT Model) - Real64 UValue; - int EQLNum; - Real64 SHGCSummer; - Real64 TransNormal; - - UValue = 0.0; - SHGCSummer = 0.0; - TransNormal = 0.0; + Real64 UValue = 0.0; + Real64 SHGCSummer = 0.0; + Real64 TransNormal = 0.0; - EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; + int EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; // calculate fenestration air-to-air U-value CalcEQLWindowUvalue(state, state.dataWindowEquivLayer->CFS(EQLNum), UValue); @@ -8271,8 +7919,6 @@ Real64 EQLWindowInsideEffectiveEmiss(EnergyPlusData &state, int const ConstrNum) // FUNCTION INFORMATION: // AUTHOR Bereket A Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Given the consruction number, returns the equivalent layer inside @@ -8286,22 +7932,13 @@ Real64 EQLWindowOutsideEffectiveEmiss(EnergyPlusData &state, int const ConstrNum // FUNCTION INFORMATION: // AUTHOR Bereket A Nigusse // DATE WRITTEN May 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Given the consruction number, returns the equivalent layer outside // face effective longwave emmisivity. - // Return value - Real64 OutSideLWEmiss; // LW outside emissivity - - int EQLNum; // EQL Window object number - - EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; - OutSideLWEmiss = EffectiveEPSLF(state.dataWindowEquivLayer->CFS(EQLNum)); - - return OutSideLWEmiss; + int EQLNum = state.dataConstruction->Construct(ConstrNum).EQLConsPtr; + return EffectiveEPSLF(state.dataWindowEquivLayer->CFS(EQLNum)); } Real64 HCInWindowStandardRatings(EnergyPlusData &state, @@ -8313,8 +7950,6 @@ Real64 HCInWindowStandardRatings(EnergyPlusData &state, // FUNCTION INFORMATION: // AUTHOR Bereket Nigusse // DATE WRITTEN June 2013 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS FUNCTION: // Return the inside convection coefficient for fenestration ratings. @@ -8325,9 +7960,6 @@ Real64 HCInWindowStandardRatings(EnergyPlusData &state, using Psychrometrics::PsyRhoAirFnPbTdbW; - // Return value - Real64 hcin; // interior surface convection coefficient - static constexpr std::string_view RoutineName("HCInWindowStandardRatings"); Real64 TmeanFilm; // mean film temperature @@ -8360,9 +7992,7 @@ Real64 HCInWindowStandardRatings(EnergyPlusData &state, // eq. 135 in ISO 15099 (only need this one because tilt is 90 deg) Nuint = 0.56 * root_4(RaH * sineTilt); - hcin = Nuint * lambda / Height; - - return hcin; + return Nuint * lambda / Height; } } // namespace EnergyPlus::WindowEquivalentLayer diff --git a/src/EnergyPlus/WindowEquivalentLayer.hh b/src/EnergyPlus/WindowEquivalentLayer.hh index 04bd2232e4c..affd940c6fc 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.hh +++ b/src/EnergyPlus/WindowEquivalentLayer.hh @@ -409,7 +409,7 @@ namespace WindowEquivalentLayer { Real64 const C // slat crown height (any units, same units as W) must be >= 0 ); - void VB_SOL46_CURVE(EnergyPlusData &state, + void VB_SOL46_CURVE(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip (chord) width (any length units; same units as S) Real64 const SL_WR, // slat curvature radius ratio (= W/R) @@ -423,7 +423,7 @@ namespace WindowEquivalentLayer { Real64 &TAU_BD // returned: effective SW (solar) beam-to-diffuse transmittance front side ); - void VB_SOL4(EnergyPlusData &state, + void VB_SOL4(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip width (any length units; same units as S) Real64 const OMEGA, // incident beam profile angle (radians) @@ -436,7 +436,7 @@ namespace WindowEquivalentLayer { Real64 &TAU_BD // returned: solar beam-to-diffuse transmittance of the venetian blind (front side) ); - void VB_SOL6(EnergyPlusData &state, + void VB_SOL6(EnergyPlusData const &state, Real64 const S, // slat spacing (any length units; same units as W) Real64 const W, // slat tip-to-tip width (any length units; same units as S) Real64 const OMEGA, // incident beam profile angle (radians) @@ -542,14 +542,14 @@ namespace WindowEquivalentLayer { Real64 const TI // inside air temp, C or K ); - void SLtoGL(EnergyPlusData &state, + void SLtoGL(EnergyPlusData const &state, Real64 const breal, // distance from shade to glass (m) Real64 const Ts, // shade temperature (K) Real64 const Tg, // glass temperature (K) Real64 &hsg, // the heat transfer coefficient, shade-to-glass, {W/m2K} int const scheme); - Real64 SLtoAMB(EnergyPlusData &state, + Real64 SLtoAMB(EnergyPlusData const &state, Real64 const b, // distance from shade to glass (m) where air flow takes place Real64 const L, // window height, m (usually taken as 1 m) Real64 const Ts, // shade temperature, K @@ -558,7 +558,7 @@ namespace WindowEquivalentLayer { int const scheme // flag to select model, scheme=2 has problems ); - void GLtoAMB(EnergyPlusData &state, + void GLtoAMB(EnergyPlusData const &state, Real64 const b, // distance from shade to glass {m} Real64 const L, // window height {m}, usually taken as 1 meter Real64 const Tg, // glass temperature {K} @@ -628,7 +628,7 @@ namespace WindowEquivalentLayer { void Specular_RATDiff(EnergyPlusData &state, Real64 &RAT_1MRDiff, Real64 &RAT_TAUDiff); - Real64 Specular_F(EnergyPlusData &state, + Real64 Specular_F(EnergyPlusData const &state, Real64 const THETA, // incidence angle, radians int const OPT, // options (unused) const Array1D &P // parameters (none defined) @@ -690,7 +690,7 @@ namespace WindowEquivalentLayer { CFSLWP &LLWP // returned: equivalent layer long wave properties ); - bool VB_SWP(EnergyPlusData &state, + bool VB_SWP(EnergyPlusData const &state, CFSLAYER const &L, // VB layer CFSSWP &LSWP, // returned: equivalent off-normal properties const Real64 OMEGA // incident profile angle (radians) @@ -702,7 +702,7 @@ namespace WindowEquivalentLayer { ); - bool VB_ShadeControl(EnergyPlusData &state, + bool VB_ShadeControl(EnergyPlusData const &state, CFSLAYER &L, // VB layer Real64 const OMEGA_DEG // incident profile angle (degrees) ); @@ -723,7 +723,7 @@ namespace WindowEquivalentLayer { bool IsGlazeLayerX(CFSLAYER const &L); - bool IsControlledShade(EnergyPlusData &state, CFSLAYER const &L); + bool IsControlledShade(EnergyPlusData const &state, CFSLAYER const &L); bool IsVBLayer(CFSLAYER const &L); @@ -744,7 +744,7 @@ namespace WindowEquivalentLayer { int CFSNGlz(CFSTY const &FS); // CFS - int CFSHasControlledShade(EnergyPlusData &state, CFSTY const &FS); + int CFSHasControlledShade(EnergyPlusData const &state, CFSTY const &FS); void CheckAndFixCFSLayer(EnergyPlusData &state, CFSLAYER &Layer);