@@ -203,7 +203,7 @@ namespace Window {
203203 // Glazing system visible transmittance from fit at each incidence angle
204204 std::array<Real64, numPhis> tvisPhiFit;
205205#endif // GET_OUT
206-
206+
207207 // Isolated glass solar transmittance for each incidence angle
208208 std::array<std::array<Real64, numPhis>, maxGlassLayers> tBareSolPhi;
209209 Real64 t1; // = tBareSolPhi(,1)(,2)
@@ -299,22 +299,22 @@ namespace Window {
299299 Real64 rfsh; // Diffuse solar front reflectance of isolated blind
300300 Real64 rfshGnd; // Ground and sky diffuse solar front reflectance of isolated blind
301301 Real64 rfshSky;
302- Real64 rbsh; // Diffuse solar back reflectance of isolated blind
303- Real64 ShadeReflFac; // Shade/blind solar reflection factor
304- Real64 ShadeTransVis; // Visible transmittance of isolated shade/blind
305- Real64 tshv; // = ShadeTransVis
306- Real64 tshv2; // = tshv**2
307- Real64 ShadeReflVis; // Visible reflectance of isolated shade
308- Real64 rshv; // = ShadeReflVis
309- Real64 rfshv; // Diffuse visible front reflectance of isolated blind
310- Real64 rbshv; // Diffuse visible back reflectance of isolated blind
311- Real64 ShadeReflFacVis; // Shade/blind visible reflection factor
312- int SpecDataNum = 0 ; // Spectral data set number
313- int numptDAT; // Number of wavelengths in a spectral data set
314- bool StormWinConst; // True if a construction with a storm window
315- bool Triangle; // True if window is triangular
316- bool Rectangle; // True if window is rectangular
317- Vector3<Real64> W1 = {0.0 , 0.0 , 0.0 }; // Window vertices (m)
302+ Real64 rbsh; // Diffuse solar back reflectance of isolated blind
303+ Real64 ShadeReflFac; // Shade/blind solar reflection factor
304+ Real64 ShadeTransVis; // Visible transmittance of isolated shade/blind
305+ Real64 tshv; // = ShadeTransVis
306+ Real64 tshv2; // = tshv**2
307+ Real64 ShadeReflVis; // Visible reflectance of isolated shade
308+ Real64 rshv; // = ShadeReflVis
309+ Real64 rfshv; // Diffuse visible front reflectance of isolated blind
310+ Real64 rbshv; // Diffuse visible back reflectance of isolated blind
311+ Real64 ShadeReflFacVis; // Shade/blind visible reflection factor
312+ int SpecDataNum = 0 ; // Spectral data set number
313+ int numptDAT; // Number of wavelengths in a spectral data set
314+ bool StormWinConst; // True if a construction with a storm window
315+ bool Triangle; // True if window is triangular
316+ bool Rectangle; // True if window is rectangular
317+ Vector3<Real64> W1 = {0.0 , 0.0 , 0.0 }; // Window vertices (m)
318318 Vector3<Real64> W2 = {0.0 , 0.0 , 0.0 };
319319 Vector3<Real64> W3 = {0.0 , 0.0 , 0.0 };
320320 Vector3<Real64> W21 = {0.0 , 0.0 , 0.0 }; // W1-W2, W3-W2, resp. (m)
@@ -391,11 +391,11 @@ namespace Window {
391391 BGBlind = false ;
392392 ExtScreen = false ;
393393 StormWinConst = false ;
394-
394+
395395 bool lSimpleGlazingSystem = false ;
396396 Real64 SimpleGlazingSHGC = 0.0 ;
397397 Real64 SimpleGlazingU = 0.0 ;
398-
398+
399399 if (mat->group == Material::Group::GlassSimple) {
400400 auto const *matWin = dynamic_cast <Material::MaterialGlass const *>(mat);
401401 assert (matWin != nullptr );
@@ -551,12 +551,13 @@ namespace Window {
551551 numpt[iGlass] = numptDAT;
552552
553553 for (int iLam = 0 ; iLam < numptDAT; ++iLam) {
554- wlt[iGlass][iLam] = specData.WaveLength (iLam+ 1 );
555- t[iGlass][iLam] = specData.Trans (iLam+ 1 );
556- if ((iGlass == 0 || (iGlass == 1 && StormWinConst)) && (!wm->BGFlag ))
554+ wlt[iGlass][iLam] = specData.WaveLength (iLam + 1 );
555+ t[iGlass][iLam] = specData.Trans (iLam + 1 );
556+ if ((iGlass == 0 || (iGlass == 1 && StormWinConst)) && (!wm->BGFlag )) {
557557 t[iGlass][iLam] *= matGlass->GlassTransDirtFactor ;
558- rff[iGlass][iLam] = specData.ReflFront (iLam+1 );
559- rbb[iGlass][iLam] = specData.ReflBack (iLam+1 );
558+ }
559+ rff[iGlass][iLam] = specData.ReflFront (iLam + 1 );
560+ rbb[iGlass][iLam] = specData.ReflBack (iLam + 1 );
560561 }
561562
562563 // If there is spectral data for between-glass shades or blinds, calc the average spectral properties for use.
@@ -580,7 +581,7 @@ namespace Window {
580581 // set this material to average spectral data
581582 matGlass->GlassSpectralDataPtr = 0 ;
582583 matGlass->Trans = solarSpectrumAverage (state, t[0 ]);
583- matGlass->TransVis = visibleSpectrumAverage (state, t[0 ]);
584+ matGlass->TransVis = visibleSpectrumAverage (state, t[0 ]);
584585 matGlass->ReflectSolBeamFront = solarSpectrumAverage (state, rff[0 ]);
585586 matGlass->ReflectSolBeamBack = solarSpectrumAverage (state, rbb[0 ]);
586587 matGlass->ReflectVisBeamFront = visibleSpectrumAverage (state, rff[0 ]);
@@ -638,7 +639,7 @@ namespace Window {
638639 rff[iGlass][iLam] = matGlass->GlassSpecAngFReflCurve ->value (state, 0.0 , lam);
639640 rbb[iGlass][iLam] = matGlass->GlassSpecAngBReflCurve ->value (state, 0.0 , lam);
640641 }
641-
642+
642643 // set this material to average spectral data
643644 matGlass->windowOpticalData = Window::OpticalDataModel::SpectralAverage;
644645 matGlass->Trans = solarSpectrumAverage (state, t[0 ]);
@@ -659,7 +660,7 @@ namespace Window {
659660 // Apparently, using pre-calcaulated and hard-coded cosPhis (e.g., Window::cosPhis) causes a bunch of
660661 // diffs, including some big ones
661662 std::array<Real64, numPhis> cosPhisLocal;
662-
663+
663664 for (int iPhi = 0 ; iPhi < numPhis; ++iPhi) {
664665 cosPhisLocal[iPhi] = std::cos ((double )iPhi * dPhiDeg * Constant::DegToRad);
665666 }
@@ -777,7 +778,7 @@ namespace Window {
777778 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
778779 solabsPhiLay = solabsPhi[iGlass]; // Is this a deep copy?
779780 solabsDiff[iGlass] = DiffuseAverage (solabsPhiLay);
780- thisConstruct.AbsDiff (iGlass+ 1 ) = solabsDiff[iGlass];
781+ thisConstruct.AbsDiff (iGlass + 1 ) = solabsDiff[iGlass];
781782
782783 // For use with between-glass shade/blind, get diffuse properties of isolated glass for case when
783784 // all glass layers were input with spectral-average properties
@@ -840,28 +841,25 @@ namespace Window {
840841 numpt[iGlass] = numptDAT;
841842
842843 for (int iLam = 0 ; iLam < numptDAT; ++iLam) {
843- wlt[iGlass][iLam] = specData.WaveLength (iLam+1 );
844- t[iGlass][iLam] = specData.Trans (iLam+1 );
845- if ((iGlass + 1 ) == NGlass ||
846- ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
844+ wlt[iGlass][iLam] = specData.WaveLength (iLam + 1 );
845+ t[iGlass][iLam] = specData.Trans (iLam + 1 );
846+ if ((iGlass + 1 ) == NGlass || ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
847847 t[iGlass][iLam] *= matGlass->GlassTransDirtFactor ;
848848 }
849- rff[iGlass][iLam] = specData.ReflBack (iLam+ 1 );
850- rbb[iGlass][iLam] = specData.ReflFront (iLam+ 1 );
849+ rff[iGlass][iLam] = specData.ReflBack (iLam + 1 );
850+ rbb[iGlass][iLam] = specData.ReflFront (iLam + 1 );
851851 }
852852
853853 // No spectral data for this layer; use spectral average values
854854 } else if (matGlass->windowOpticalData != Window::OpticalDataModel::SpectralAndAngle) {
855855 lquasi = true ;
856856 numpt[iGlass] = 2 ;
857857 t[iGlass][0 ] = matGlass->Trans ;
858- if ((iGlass + 1 ) == NGlass ||
859- ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
858+ if ((iGlass + 1 ) == NGlass || ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
860859 t[iGlass][0 ] *= matGlass->GlassTransDirtFactor ;
861860 }
862861 t[iGlass][1 ] = matGlass->TransVis ;
863- if ((iGlass + 1 ) == NGlass ||
864- ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
862+ if ((iGlass + 1 ) == NGlass || ((iGlass + 1 ) == (NGlass - 1 ) && StormWinConst)) {
865863 t[iGlass][1 ] *= matGlass->GlassTransDirtFactor ;
866864 }
867865 rff[iGlass][0 ] = matGlass->ReflectSolBeamBack ;
@@ -948,8 +946,8 @@ namespace Window {
948946 } // End of loop over incidence angles for back calculation
949947
950948 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
951- int iGlassBack = NGlass - iGlass - 1 ; // Was NGlass - IGlass + 1 when IGlass was 1-based
952- thisConstruct.AbsDiffBack (iGlass+ 1 ) = DiffuseAverage (solabsBackPhi[iGlassBack]);
949+ int iGlassBack = NGlass - iGlass - 1 ; // Was NGlass - IGlass + 1 when IGlass was 1-based
950+ thisConstruct.AbsDiffBack (iGlass + 1 ) = DiffuseAverage (solabsBackPhi[iGlassBack]);
953951 }
954952
955953 // -----------------------------------------------------------------------
@@ -989,7 +987,7 @@ namespace Window {
989987 // Front incident solar, beam, interior shade
990988 for (int iPhi = 0 ; iPhi < numPhis; ++iPhi) {
991989 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
992- solabsPhi[iGlass][iPhi] += tsolPhi[iPhi] * ShadeRefl * ShadeReflFac * constr.AbsDiffBack (iGlass+ 1 );
990+ solabsPhi[iGlass][iPhi] += tsolPhi[iPhi] * ShadeRefl * ShadeReflFac * constr.AbsDiffBack (iGlass + 1 );
993991 }
994992 solabsShadePhi[iPhi] = tsolPhi[iPhi] * ShadeReflFac * ShadeAbs;
995993 tsolPhi[iPhi] *= ShadeReflFac * ShadeTrans;
@@ -998,7 +996,7 @@ namespace Window {
998996
999997 // Front incident solar, diffuse, interior shade
1000998 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1001- constr.AbsDiff (iGlass+ 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
999+ constr.AbsDiff (iGlass + 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
10021000 }
10031001
10041002 constr.AbsDiffShade = tsolDiff * ShadeReflFac * ShadeAbs;
@@ -1047,7 +1045,7 @@ namespace Window {
10471045
10481046 // Front incident solar, diffuse, exterior shade/screen/blind
10491047 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1050- constr.AbsDiff (iGlass+ 1 ) = ShadeTrans * ShadeReflFac * solabsDiff[iGlass];
1048+ constr.AbsDiff (iGlass + 1 ) = ShadeTrans * ShadeReflFac * solabsDiff[iGlass];
10511049 }
10521050
10531051 // Front incident solar, diffuse, exterior shade/screen
@@ -1059,7 +1057,7 @@ namespace Window {
10591057
10601058 // Back incident solar, diffuse, exterior shade/screen
10611059 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1062- constr.AbsDiffBack (iGlass+ 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
1060+ constr.AbsDiffBack (iGlass + 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
10631061 }
10641062 constr.AbsDiffBackShade = tsolDiff * ShadeReflFac * ShadeAbs;
10651063 constr.ReflectSolDiffBack += tsolDiff_2 * ShadeRefl * ShadeReflFac;
@@ -1264,7 +1262,7 @@ namespace Window {
12641262 ShadeReflFacVis = 1.0 / (1.0 - ShadeReflVis * constr.ReflectVisDiffFront );
12651263
12661264 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1267- auto &dfAbs = constr.layerSlatBlindDfAbs (iGlass+ 1 )[iSlatAng];
1265+ auto &dfAbs = constr.layerSlatBlindDfAbs (iGlass + 1 )[iSlatAng];
12681266 dfAbs.Sol .Ft .Df .Abs = ShadeTrans * ShadeReflFac * solabsDiff[iGlass];
12691267 dfAbs.Sol .Ft .Df .AbsGnd = ShadeTransGnd * ShadeReflFac * solabsDiff[iGlass];
12701268 dfAbs.Sol .Ft .Df .AbsSky = ShadeTransSky * ShadeReflFac * solabsDiff[iGlass];
@@ -1283,8 +1281,8 @@ namespace Window {
12831281
12841282 // Back incident solar, diffuse, exterior shade/blind
12851283 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1286- auto &dfAbs = constr.layerSlatBlindDfAbs (iGlass+ 1 )[iSlatAng];
1287- dfAbs.Sol .Bk .Df .Abs = constr.AbsDiffBack (iGlass+ 1 ) + tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
1284+ auto &dfAbs = constr.layerSlatBlindDfAbs (iGlass + 1 )[iSlatAng];
1285+ dfAbs.Sol .Bk .Df .Abs = constr.AbsDiffBack (iGlass + 1 ) + tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
12881286 }
12891287
12901288 cbtar.Sol .Bk .Df .Abs = tsolDiff * ShadeReflFac * ShadeAbs;
@@ -1445,7 +1443,7 @@ namespace Window {
14451443
14461444 // Front incident solar, diffuse, exterior shade/screen/blind
14471445 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1448- constr.AbsDiff (iGlass+ 1 ) = ShadeTrans * ShadeReflFac * solabsDiff[iGlass];
1446+ constr.AbsDiff (iGlass + 1 ) = ShadeTrans * ShadeReflFac * solabsDiff[iGlass];
14491447 }
14501448
14511449 // Front incident solar, diffuse, exterior shade/screen
@@ -1457,7 +1455,7 @@ namespace Window {
14571455
14581456 // Back incident solar, diffuse, exterior shade/screen
14591457 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
1460- constr.AbsDiffBack (iGlass+ 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
1458+ constr.AbsDiffBack (iGlass + 1 ) += tsolDiff * ShadeRefl * ShadeReflFac * solabsDiff[iGlass];
14611459 }
14621460 constr.AbsDiffBackShade = tsolDiff * ShadeReflFac * ShadeAbs;
14631461 constr.ReflectSolDiffBack += tsolDiff_2 * ShadeRefl * ShadeReflFac;
@@ -1475,14 +1473,14 @@ namespace Window {
14751473
14761474 for (int iGlass = 0 ; iGlass < NGlass; ++iGlass) {
14771475 // Front absorptance coefficients for glass layers
1478- W5LsqFit (cosPhisLocal, solabsPhi[iGlass], thisConstruct.AbsBeamCoef (iGlass+ 1 ));
1476+ W5LsqFit (cosPhisLocal, solabsPhi[iGlass], thisConstruct.AbsBeamCoef (iGlass + 1 ));
14791477
14801478 // Back absorptance coefficients for glass layers
14811479 int iGlassBack = NGlass - iGlass - 1 ; // Was NGlass - IGlass + 1;
1482- W5LsqFit (cosPhisLocal, solabsBackPhi[iGlassBack], thisConstruct.AbsBeamBackCoef (iGlass+ 1 ));
1480+ W5LsqFit (cosPhisLocal, solabsBackPhi[iGlassBack], thisConstruct.AbsBeamBackCoef (iGlass + 1 ));
14831481 }
14841482
1485- #ifdef GET_OUT
1483+ #ifdef GET_OUT
14861484 // To check goodness of fit //Tuned
14871485
14881486 for (int iPhi = 0 ; iPhi < numPhis; ++iPhi) {
@@ -1505,7 +1503,7 @@ namespace Window {
15051503 // >>>>>>> origin/develop
15061504 }
15071505 }
1508- #endif // GET_OUT
1506+ #endif // GET_OUT
15091507 }
15101508
15111509 if (ShadeOn) {
@@ -1840,7 +1838,7 @@ namespace Window {
18401838 std::array<std::array<Real64, maxGlassLayers>, maxGlassLayers> top = {0.0 }; // Transmittance matrix for subr. op
18411839 std::array<std::array<Real64, maxGlassLayers>, maxGlassLayers> rfop = {0.0 }; // Front reflectance matrix for subr. op
18421840 std::array<std::array<Real64, maxGlassLayers>, maxGlassLayers> rbop = {0.0 }; // Back transmittance matrix for subr. op
1843-
1841+
18441842 auto const &wm = state.dataWindowManager ;
18451843 // For each glass layer find tPhi, rfPhi, and rbPhi at each wavelength
18461844
@@ -1988,8 +1986,8 @@ namespace Window {
19881986 auto const &wm = state.dataWindowManager ;
19891987
19901988 for (int i = 0 ; i < nume - 1 ; ++i) {
1991- Real64 const esol = (wm->wle [i+ 1 ] - wm->wle [i]) * 0.5 * (wm->e [i] + wm->e [i+ 1 ]);
1992- num += 0.5 * (p[i] + p[i+ 1 ]) * esol;
1989+ Real64 const esol = (wm->wle [i + 1 ] - wm->wle [i]) * 0.5 * (wm->e [i] + wm->e [i + 1 ]);
1990+ num += 0.5 * (p[i] + p[i + 1 ]) * esol;
19931991 denom += esol;
19941992 }
19951993 return num / denom; // dangerous, doesn't check for zero denominator
@@ -3678,11 +3676,11 @@ namespace Window {
36783676 Real64 AEqOutlet;
36793677 Real64 Zinlet; // Inlet and outlet pressure loss factors
36803678 Real64 Zoutlet;
3681- Real64 AVGap; // Coeff. of VGap**2 term in pressure balance equation
3682- Real64 BVGap; // Coeff. of VGap term in pressure balance equation
3683- Real64 CVGap; // VGap-independent term in pressure balance equation
3684- Real64 GapHeightChar; // Characteristic height of the gap air temperature profile (m)
3685- Real64 TAve; // Average of TGlass and TShade (K)
3679+ Real64 AVGap; // Coeff. of VGap**2 term in pressure balance equation
3680+ Real64 BVGap; // Coeff. of VGap term in pressure balance equation
3681+ Real64 CVGap; // VGap-independent term in pressure balance equation
3682+ Real64 GapHeightChar; // Characteristic height of the gap air temperature profile (m)
3683+ Real64 TAve; // Average of TGlass and TShade (K)
36863684 int TotGaps; // Glass/glass gaps + glass-shade/blind gap
36873685 Real64 con; // Gap conductivity and derivative
36883686 Real64 gr; // glass-shade/blind gap Grashof number
@@ -4053,10 +4051,10 @@ namespace Window {
40534051 // is in horizontal plane normal to window.
40544052 Real64 GapHeightChar; // Characteristic height of the airflow gap air temperature profile (m)
40554053 Real64 TAve; // Average of TGlassFace1 and TGlassFace2 (K)
4056- Real64 con; // Gap conductivity and derivative
4057- Real64 gr; // Gap air Grashof number
4058- Real64 pr; // Gap air Prandtl number
4059- Real64 nu; // Gap air Nusselt number
4054+ Real64 con; // Gap conductivity and derivative
4055+ Real64 gr; // Gap air Grashof number
4056+ Real64 pr; // Gap air Prandtl number
4057+ Real64 nu; // Gap air Nusselt number
40604058
40614059 auto &s_mat = state.dataMaterial ;
40624060 auto &s_surf = state.dataSurface ;
0 commit comments