Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2024, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : #ifndef WindowManager_hh_INCLUDED
49 : #define WindowManager_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1A.hh>
53 : #include <ObjexxFCL/Array1D.hh>
54 : #include <ObjexxFCL/Array2A.hh>
55 : #include <ObjexxFCL/Array3D.hh>
56 :
57 : // EnergyPlus Headers
58 : #include <EnergyPlus/Data/BaseData.hh>
59 : #include <EnergyPlus/DataGlobals.hh>
60 : #include <EnergyPlus/DataHeatBalance.hh>
61 : #include <EnergyPlus/EnergyPlus.hh>
62 : #include <EnergyPlus/WindowEquivalentLayer.hh>
63 : #include <EnergyPlus/WindowManagerExteriorData.hh>
64 : #include <EnergyPlus/WindowModel.hh>
65 :
66 : namespace EnergyPlus {
67 :
68 : // Forward declarations
69 : struct EnergyPlusData;
70 :
71 : namespace Window {
72 :
73 : int constexpr nume = 107; // Number of wavelength values in solar spectrum
74 : int constexpr numt3 = 81; // Number of wavelength values in the photopic response
75 :
76 : int constexpr maxGlassLayers = 5;
77 : int constexpr maxGapLayers = 5;
78 : int constexpr maxIncidentAngles = 20;
79 : int constexpr maxSpectralDataElements = 800; // Maximum number in Spectral Data arrays.
80 :
81 : class CWindowModel;
82 : class CWindowOpticalModel;
83 : class CWindowConstructionsSimplified;
84 :
85 : void InitWindowOpticalCalculations(EnergyPlusData &state);
86 :
87 : void InitGlassOpticalCalculations(EnergyPlusData &state);
88 :
89 : void W5InitGlassParameters(EnergyPlusData &state);
90 :
91 : //****************************************************************************
92 : // WINDOW 5 Optical Calculation Subroutines
93 : //****************************************************************************
94 :
95 : void SystemSpectralPropertiesAtPhi(EnergyPlusData &state,
96 : int iquasi, // When there is no spectral data, this is the wavelength
97 : int ngllayer, // Number of glass layers in construction
98 : Real64 wlbot, // Lowest and highest wavelength considered
99 : Real64 wltop,
100 : std::array<int, maxGlassLayers> const &numpt,
101 : std::array<std::array<Real64, maxSpectralDataElements>, maxGlassLayers> const &wlt,
102 : std::array<std::array<Real64, maxSpectralDataElements>, maxGlassLayers> const &tPhi,
103 : std::array<std::array<Real64, maxSpectralDataElements>, maxGlassLayers> const &rfPhi,
104 : std::array<std::array<Real64, maxSpectralDataElements>, maxGlassLayers> const &rbPhi,
105 : std::array<Real64, nume> &stPhi,
106 : std::array<Real64, nume> &srfPhi,
107 : std::array<Real64, nume> &srbPhi,
108 : Array2D<Real64> &saPhi);
109 :
110 : void SystemPropertiesAtLambdaAndPhi(EnergyPlusData &state,
111 : int n, // Number of glass layers
112 : Real64 &tt, // System transmittance
113 : Real64 &rft, // System front and back reflectance
114 : Real64 &rbt,
115 : Array1A<Real64> aft // System absorptance of each glass layer
116 : );
117 :
118 : Real64 solarSpectrumAverage(EnergyPlusData &state, gsl::span<Real64 const> p);
119 :
120 : Real64 visibleSpectrumAverage(EnergyPlusData &state, gsl::span<Real64 const> p);
121 :
122 : Real64 Interpolate(gsl::span<Real64 const> x, // Array of data points for independent variable
123 : gsl::span<Real64 const> y, // Array of data points for dependent variable
124 : int npts, // Number of data pairs
125 : Real64 xin // Given value of x
126 : );
127 :
128 : void CalcWindowHeatBalance(EnergyPlusData &state,
129 : int SurfNum, // Surface number
130 : Real64 HextConvCoeff, // Outside air film conductance coefficient
131 : Real64 &SurfInsideTemp, // Inside window surface temperature
132 : Real64 &SurfOutsideTemp // Outside surface temperature (C)
133 : );
134 :
135 : void CalcWindowHeatBalanceInternalRoutines(EnergyPlusData &state,
136 : int SurfNum, // Surface number
137 : Real64 HextConvCoeff, // Outside air film conductance coefficient
138 : Real64 &SurfInsideTemp, // Inside window surface temperature
139 : Real64 &SurfOutsideTemp // Outside surface temperature (C)
140 : );
141 :
142 : void WindowHeatBalanceEquations(EnergyPlusData &state, int SurfNum); // Surface number
143 :
144 : void GetHeatBalanceEqCoefMatrixSimple(EnergyPlusData &state,
145 : int nglasslayer, // Number of glass layers
146 : Array1D<Real64> const &hr, // Radiative conductance (W/m2-K)
147 : Array1A<Real64> &hgap, // Gap gas conductive conductance (W/m2-K)
148 : Array2D<Real64> &Aface, // Coefficient in equation Aface*thetas = Bface
149 : Array1D<Real64> &Bface // Coefficient in equation Aface*thetas = Bface
150 : );
151 :
152 : void GetHeatBalanceEqCoefMatrix(EnergyPlusData &state,
153 : int SurfNum,
154 : int nglasslayer,
155 : DataSurfaces::WinShadingType ShadeFlag,
156 : Real64 sconsh,
157 : Real64 TauShIR,
158 : Real64 EpsShIR1,
159 : Real64 EpsShIR2,
160 : Real64 RhoShIR1,
161 : Real64 RhoShIR2,
162 : Real64 ShGlReflFacIR,
163 : Real64 RhoGlIR1,
164 : Real64 RhoGlIR2,
165 : Real64 hcv, // Convection coefficient from gap glass or shade/blind to gap air (W/m2-K)
166 : Real64 TGapNew, // Current-iteration average air temp in airflow gap (K)
167 : Real64 TAirflowGapNew, // Average air temp in airflow gap between glass panes (K)
168 : Real64 hcvAirflowGap, // Convection coefficient from airflow gap glass to airflow gap air (W/m2-K)
169 : Array1A<Real64> const &hcvBG, // Convection coefficient from gap glass or shade to gap gas (W/m2-K)
170 : Array1A<Real64> const &TGapNewBG,
171 : Array1A<Real64> const &AbsRadShadeFace,
172 : Array1D<Real64> const &hr,
173 : Array2D<Real64> &Aface,
174 : Array1D<Real64> &Bface);
175 :
176 : void SolveForWindowTemperatures(EnergyPlusData &state, int SurfNum); // Surface number
177 :
178 : void ExtOrIntShadeNaturalFlow(EnergyPlusData &state,
179 : int SurfNum, // Surface number
180 : int iter, // Iteration number for glass heat balance calculation
181 : Real64 &VGap, // Air velocity in glass-shade/blind gap (m/s)
182 : Real64 &TGapNew, // Current-iteration average air temp in glass-shade/blind gap (K)
183 : Real64 &TGapOutlet, // Temperature of air leaving glass-shade/blind gap at top for upward
184 : Real64 &hcv, // Convection coefficient from gap glass or shade to gap air (W/m2-K)
185 : Real64 &QConvGap // Convective heat gain from glass-shade/blind gap for interior shade (W)
186 : );
187 :
188 : void BetweenGlassShadeNaturalFlow(EnergyPlusData &state,
189 : int SurfNum, // Surface number
190 : int iter, // Iteration number for glass heat balance calculation
191 : Real64 &VGap, // Gas velocity in gaps (m/s)
192 : Array1A<Real64> TGapNew, // Current-iteration average gas temp in gaps (K)
193 : Array1A<Real64> hcv // Convection coefficient from gap glass or shade to gap gas (W/m2-K)
194 : );
195 :
196 : void BetweenGlassForcedFlow(EnergyPlusData &state,
197 : int SurfNum, // Surface number
198 : int iter, // Iteration number for glass heat balance calculation
199 : Real64 &VGap, // Air velocity in airflow gap (m/s)
200 : Real64 &TGapNew, // Current-iteration average air temp in airflow gap (K)
201 : Real64 &TGapOutlet, // Temperature of air leaving glass-shade/blind gap at top for upward
202 : Real64 &hcv, // Convection coefficient from gap glass faces to gap air (W/m2-K)
203 : Real64 &QConvGap // Convective heat gain from air flow gap (W)
204 : );
205 :
206 : void BetweenGlassShadeForcedFlow(EnergyPlusData &state,
207 : int SurfNum, // Surface number
208 : int iter, // Iteration number for glass heat balance calculation
209 : Real64 &VGap, // Air velocity in each gap (m/s)
210 : Array1A<Real64> TGapNew, // Current-iteration average gas temp in gaps (K)
211 : Real64 &TGapOutletAve, // Average of TGapOutlet(1) and TGapOutlet(2) (K)
212 : Array1A<Real64> hcv, // Convection coefficient from gap glass or shade to gap gas (W/m2-K)
213 : Real64 &QConvTot // Sum of convective heat flow from gaps (W)
214 : );
215 :
216 : void LUdecomposition(EnergyPlusData &state,
217 : Array2<Real64> &ajac, // As input: matrix to be decomposed;
218 : int n, // Dimension of matrix
219 : Array1D_int &indx, // Vector of row permutations
220 : int &d // +1 if even number of row interchange is even, -1
221 : );
222 :
223 : void LUsolution(EnergyPlusData &state,
224 : Array2<Real64> const &a, // Matrix and vector in a.x = b;
225 : int n, // Dimension of a and b
226 : Array1D_int const &indx, // Vector of row permutations
227 : Array1D<Real64> &b // Matrix and vector in a.x = b;
228 : );
229 :
230 : void WindowGasConductance(EnergyPlusData &state,
231 : Real64 tleft, // Temperature of gap surface closest to outside (K)
232 : Real64 tright, // Temperature of gap surface closest to zone (K)
233 : int IGap, // Gap number
234 : Real64 &con, // Gap gas conductance (W/m2-K)
235 : Real64 &pr, // Gap gas Prandtl number
236 : Real64 &gr // Gap gas Grashof number
237 : );
238 :
239 : void WindowGasPropertiesAtTemp(EnergyPlusData &state,
240 : Real64 tmean, // Temperature of gas in gap (K)
241 : int IGap, // Gap number
242 : Real64 &dens, // Gap gas density at tmean (kg/m3)
243 : Real64 &visc // Gap gas dynamic viscosity at tmean (g/m-s)
244 : );
245 :
246 : void StartingWindowTemps(EnergyPlusData &state,
247 : int SurfNum, // Surface number
248 : Array1A<Real64> AbsRadShade // Short-wave radiation absorbed by shade/blind faces
249 : );
250 :
251 : void NusseltNumber(EnergyPlusData &state,
252 : int SurfNum, // Surface number
253 : Real64 tso, // Temperature of gap surface closest to outside (K)
254 : Real64 tsi, // Temperature of gap surface closest to zone (K)
255 : int IGap, // Gap number
256 : Real64 gr, // Gap gas Grashof number
257 : Real64 pr, // Gap gas Prandtl number
258 : Real64 &gnu // Gap gas Nusselt number
259 : );
260 :
261 : void TransAndReflAtPhi(Real64 cs, // Cosine of incidence angle
262 : Real64 tf0, // Transmittance at zero incidence angle
263 : Real64 rf0, // Front reflectance at zero incidence angle
264 : Real64 rb0, // Back reflectance at zero incidence angle
265 : Real64 &tfp, // Transmittance at cs
266 : Real64 &rfp, // Front reflectance at cs
267 : Real64 &rbp, // Back reflectance at cs
268 : bool SimpleGlazingSystem, // .TRUE. if simple block model being used
269 : Real64 SimpleGlazingSHGC, // SHGC value to use in alternate model for simple glazing system
270 : Real64 SimpleGlazingU // U-factor value to use in alternate model for simple glazing system
271 : );
272 :
273 : Real64 InterpolateBetweenTwoValues(Real64 X, Real64 X0, Real64 X1, Real64 F0, Real64 F1);
274 :
275 : Real64 InterpolateBetweenFourValues(
276 : Real64 X, Real64 Y, Real64 X1, Real64 X2, Real64 Y1, Real64 Y2, Real64 Fx1y1, Real64 Fx1y2, Real64 Fx2y1, Real64 Fx2y2);
277 :
278 : void W5LsqFit(Array1S<Real64> IndepVar, // Independent variables
279 : Array1S<Real64> DepVar, // Dependent variables
280 : int N, // Order of polynomial
281 : int N1, // First and last data points used
282 : int N2,
283 : Array1S<Real64> CoeffsCurve // Polynomial coeffients from fit
284 : );
285 :
286 : void W5LsqFit2(Array1A<Real64> IndepVar, // Independent variables
287 : Array1A<Real64> DepVar, // Dependent variables
288 : int N, // Order of polynomial
289 : int N1, // First and last data points used
290 : int N2,
291 : Array1A<Real64> CoeffsCurve // Polynomial coeffients from fit
292 : );
293 :
294 : Real64 DiffuseAverage(Array1S<Real64> PropertyValue); // Property value at angles of incidence
295 :
296 : Real64 DiffuseAverageProfAngGnd(Array1S<Real64> Property); // Property value vs. profile angle
297 :
298 : Real64 DiffuseAverageProfAngSky(Array1S<Real64> Property); // Property value vs. profile angle
299 :
300 : void CalcWinFrameAndDividerTemps(EnergyPlusData &state,
301 : int SurfNum, // Surface number
302 : Real64 tout, // Outside air temperature (K)
303 : Real64 tin, // Inside air temperature (K)
304 : Real64 HOutConv, // Outside convective air film conductance (W/m2-K)
305 : Real64 HInConv, // Inside convective air film conductance (W/m2-K)
306 : Real64 Outir, // Exterior IR irradiance from sky and ground
307 : int ConstrNum // Construction number of window
308 : );
309 :
310 : void CalcNominalWindowCond(EnergyPlusData &state,
311 : int ConstrNum, // Construction number
312 : int WinterSummerFlag, // 1=winter, 2=summer
313 : Real64 &NominalConductance, // Nominal center-of-glass conductance, including air films
314 : Real64 &SHGC, // Nominal center-of-glass solar heat gain coefficient for
315 : Real64 &TSolNorm, // Overall beam solar transmittance at normal incidence
316 : Real64 &TVisNorm, // Overall beam visible transmittance at normal incidence
317 : int &errFlag // Error flag
318 : );
319 :
320 : void EvalNominalWindowCond(EnergyPlusData &state,
321 : Real64 AbsBeamShadeNorm, // Shade solar absorptance at normal incidence
322 : Array1D<Real64> AbsBeamNorm, // Beam absorptance at normal incidence for each glass layer
323 : Array1D<Real64> hgap, // Conductive gap conductance [W/m2-K]
324 : Real64 &NominalConductance, // Nominal center-of-glass conductance, including air films
325 : Real64 &SHGC, // Nominal center-of-glass solar heat gain coefficient for
326 : Real64 &TSolNorm // Overall beam solar transmittance at normal incidence
327 : );
328 :
329 : void WindowTempsForNominalCond(EnergyPlusData &state,
330 : int ConstrNum, // Construction number
331 : Array1A<Real64> hgap, // Gap gas conductive conductance (W/m2-K)
332 : Real64 adjRatio // adjusment Ratio to hcin
333 : );
334 :
335 : void StartingWinTempsForNominalCond(EnergyPlusData &state);
336 :
337 : void ReportGlass(EnergyPlusData &state);
338 :
339 : void CalcWindowBlindProperties(EnergyPlusData &state);
340 :
341 : void CalcWindowScreenProperties(EnergyPlusData &state);
342 :
343 : void BlindOpticsDiffuse(EnergyPlusData &state,
344 : int BlindNum, // Blind number
345 : int ISolVis, // 1 = solar and IR calculation; 2 = visible calculation
346 : Array1A<Real64> c, // Slat properties
347 : Real64 b_el, // Slat elevation (radians)
348 : Array1A<Real64> p // Blind properties
349 : );
350 :
351 : void BlindOpticsBeam(EnergyPlusData &state,
352 : int BlindNum, // Blind number
353 : Array1A<Real64> c, // Slat properties (equivalent to BLD_PR)
354 : Real64 b_el, // Slat elevation (radians)
355 : Real64 s_el, // Solar profile angle (radians)
356 : Array1A<Real64> p // Blind properties (equivalent to ST_LAY)
357 : );
358 :
359 : Real64 InterpProfAng(Real64 ProfAng, // Profile angle (rad)
360 : Array1S<Real64> PropArray // Array of blind properties
361 : );
362 :
363 : Real64 InterpSlatAng(Real64 SlatAng, // Slat angle (rad)
364 : bool VarSlats, // True if slat angle is variable
365 : Array1S<Real64> PropArray // Array of blind properties as function of slat angle
366 : );
367 :
368 : Real64 InterpProfSlatAng(Real64 ProfAng, // Profile angle (rad)
369 : Real64 SlatAng, // Slat angle (rad)
370 : bool VarSlats, // True if variable-angle slats
371 : Array2A<Real64> PropArray // Array of blind properties
372 : );
373 :
374 : Real64 BlindBeamBeamTrans(Real64 ProfAng, // Solar profile angle (rad)
375 : Real64 SlatAng, // Slat angle (rad)
376 : Real64 SlatWidth, // Slat width (m)
377 : Real64 SlatSeparation, // Slat separation (distance between surfaces of adjacent slats) (m)
378 : Real64 SlatThickness // Slat thickness (m)
379 : );
380 :
381 4004 : constexpr Real64 InterpProfSlat(Real64 const SlatLower,
382 : Real64 const SlatUpper,
383 : Real64 const ProfLower,
384 : Real64 const ProfUpper,
385 : Real64 const SlatInterpFac,
386 : Real64 const ProfInterpFac)
387 : {
388 4004 : Real64 ValA = SlatLower + SlatInterpFac * (SlatUpper - SlatLower);
389 4004 : Real64 ValB = ProfLower + SlatInterpFac * (ProfUpper - ProfLower);
390 4004 : return ValA + ProfInterpFac * (ValB - ValA);
391 : }
392 :
393 1142046 : inline Real64 InterpSw(Real64 const SwitchFac, // Switching factor: 0.0 if glazing is unswitched, = 1.0 if fully switched
394 : Real64 const A, // Glazing property in unswitched state
395 : Real64 const B // Glazing property in fully switched state
396 : )
397 : {
398 : // FUNCTION INFORMATION:
399 : // AUTHOR Fred Winkelmann
400 : // DATE WRITTEN February 1999
401 :
402 : // PURPOSE OF THIS FUNCTION:
403 : // For switchable glazing, calculates a weighted average of properties
404 : // A and B
405 :
406 1142046 : Real64 locSwitchFac = std::clamp(SwitchFac, 0.0, 1.0);
407 :
408 1142046 : return (1.0 - locSwitchFac) * A + locSwitchFac * B;
409 : }
410 :
411 : void ViewFac(Real64 s, // Slat width (m)
412 : Real64 h, // Distance between faces of adjacent slats (m)
413 : Real64 phib, // Elevation angle of normal to slat (radians)
414 : Real64 phis, // Profile angle of radiation source (radians)
415 : Array2A<Real64> F // View factor array
416 : );
417 :
418 : void InvertMatrix(EnergyPlusData &state,
419 : Array2D<Real64> &a, // Matrix to be inverted
420 : Array2D<Real64> &y, // Inverse of matrix a
421 : Array1D_int &indx, // Index vector for LU decomposition
422 : int n);
423 :
424 : // added for custom solar or visible spectrum
425 : void CheckAndReadCustomSprectrumData(EnergyPlusData &state);
426 :
427 : void initWindowModel(EnergyPlusData &state);
428 :
429 : struct WindowGap
430 : {
431 : int numGases = 0;
432 : std::array<Material::Gas, Material::maxMixGases> gases = {Material::Gas()};
433 : std::array<Real64, Material::maxMixGases> gasFracts = {0.0};
434 : Real64 width = 0.0;
435 : };
436 :
437 : } // namespace Window
438 :
439 : struct WindowManagerData : BaseGlobalStruct
440 : {
441 :
442 : // Dens dDens/dT Con dCon/dT Vis dVis/dT Prandtl dPrandtl/dT
443 : std::array<Real64, 8> const AirProps = {1.29, -0.4e-2, 2.41e-2, 7.6e-5, 1.73e-5, 1.0e-7, 0.72, 1.8e-3};
444 :
445 : // Air mass 1.5 terrestrial solar global spectral irradiance (W/m2-micron)
446 : // on a 37 degree tilted surface; corresponds
447 : // to wavelengths (microns) in following data block (ISO 9845-1 and ASTM E 892;
448 : // derived from Optics5 data file ISO-9845GlobalNorm.std, 10-14-99)
449 :
450 : // Solar spectrum wavelength values (microns)
451 : std::array<Real64, Window::nume> wle = {
452 : 0.3000, 0.3050, 0.3100, 0.3150, 0.3200, 0.3250, 0.3300, 0.3350, 0.3400, 0.3450, 0.3500, 0.3600, 0.3700, 0.3800, 0.3900, 0.4000,
453 : 0.4100, 0.4200, 0.4300, 0.4400, 0.4500, 0.4600, 0.4700, 0.4800, 0.4900, 0.5000, 0.5100, 0.5200, 0.5300, 0.5400, 0.5500, 0.5700,
454 : 0.5900, 0.6100, 0.6300, 0.6500, 0.6700, 0.6900, 0.7100, 0.7180, 0.7244, 0.7400, 0.7525, 0.7575, 0.7625, 0.7675, 0.7800, 0.8000,
455 : 0.8160, 0.8237, 0.8315, 0.8400, 0.8600, 0.8800, 0.9050, 0.9150, 0.9250, 0.9300, 0.9370, 0.9480, 0.9650, 0.9800, 0.9935, 1.0400,
456 : 1.0700, 1.1000, 1.1200, 1.1300, 1.1370, 1.1610, 1.1800, 1.2000, 1.2350, 1.2900, 1.3200, 1.3500, 1.3950, 1.4425, 1.4625, 1.4770,
457 : 1.4970, 1.5200, 1.5390, 1.5580, 1.5780, 1.5920, 1.6100, 1.6300, 1.6460, 1.6780, 1.7400, 1.8000, 1.8600, 1.9200, 1.9600, 1.9850,
458 : 2.0050, 2.0350, 2.0650, 2.1000, 2.1480, 2.1980, 2.2700, 2.3600, 2.4500, 2.4940, 2.5370};
459 :
460 : // Solar spectrum values corresponding to wle
461 : std::array<Real64, Window::nume> e = {
462 : 0.0, 9.5, 42.3, 107.8, 181.0, 246.0, 395.3, 390.1, 435.3, 438.9, 483.7, 520.3, 666.2, 712.5, 720.7, 1013.1,
463 : 1158.2, 1184.0, 1071.9, 1302.0, 1526.0, 1599.6, 1581.0, 1628.3, 1539.2, 1548.7, 1586.5, 1484.9, 1572.4, 1550.7, 1561.5, 1501.5,
464 : 1395.5, 1485.3, 1434.1, 1419.9, 1392.3, 1130.0, 1316.7, 1010.3, 1043.2, 1211.2, 1193.9, 1175.5, 643.1, 1030.7, 1131.1, 1081.6,
465 : 849.2, 785.0, 916.4, 959.9, 978.9, 933.2, 748.5, 667.5, 690.3, 403.6, 258.3, 313.6, 526.8, 646.4, 746.8, 690.5,
466 : 637.5, 412.6, 108.9, 189.1, 132.2, 339.0, 460.0, 423.6, 480.5, 413.1, 250.2, 32.5, 1.6, 55.7, 105.1, 105.5,
467 : 182.1, 262.2, 274.2, 275.0, 244.6, 247.4, 228.7, 244.5, 234.8, 220.5, 171.5, 30.7, 2.0, 1.2, 21.2, 91.1,
468 : 26.8, 99.5, 60.4, 89.1, 82.2, 71.5, 70.2, 62.0, 21.2, 18.5, 3.2};
469 :
470 : // Phototopic response function and corresponding wavelengths (microns)
471 : // (CIE 1931 observer; ISO/CIE 10527, CIE Standard Calorimetric Observers;
472 : // derived from Optics5 data file "CIE 1931 Color Match from E308.txt", which is
473 : // the same as WINDOW4 file Cie31t.dat)
474 : // Wavelength values for photopic response
475 : std::array<Real64, Window::numt3> wlt3 = {0.380, 0.385, 0.390, 0.395, 0.400, 0.405, 0.410, 0.415, 0.420, 0.425, 0.430, 0.435, 0.440, 0.445,
476 : 0.450, 0.455, 0.460, 0.465, 0.470, 0.475, 0.480, 0.485, 0.490, 0.495, 0.500, 0.505, 0.510, 0.515,
477 : 0.520, 0.525, 0.530, 0.535, 0.540, 0.545, 0.550, 0.555, 0.560, 0.565, 0.570, 0.575, 0.580, 0.585,
478 : 0.590, 0.595, 0.600, 0.605, 0.610, 0.615, 0.620, 0.625, 0.630, 0.635, 0.640, 0.645, 0.650, 0.655,
479 : 0.660, 0.665, 0.670, 0.675, 0.680, 0.685, 0.690, 0.695, 0.700, 0.705, 0.710, 0.715, 0.720, 0.725,
480 : 0.730, 0.735, 0.740, 0.745, 0.750, 0.755, 0.760, 0.765, 0.770, 0.775, 0.780};
481 :
482 : // Photopic response corresponding to wavelengths in wlt3
483 : std::array<Real64, Window::numt3> y30 = {
484 : 0.0000, 0.0001, 0.0001, 0.0002, 0.0004, 0.0006, 0.0012, 0.0022, 0.0040, 0.0073, 0.0116, 0.0168, 0.0230, 0.0298, 0.0380, 0.0480, 0.0600,
485 : 0.0739, 0.0910, 0.1126, 0.1390, 0.1693, 0.2080, 0.2586, 0.3230, 0.4073, 0.5030, 0.6082, 0.7100, 0.7932, 0.8620, 0.9149, 0.9540, 0.9803,
486 : 0.9950, 1.0000, 0.9950, 0.9786, 0.9520, 0.9154, 0.8700, 0.8163, 0.7570, 0.6949, 0.6310, 0.5668, 0.5030, 0.4412, 0.3810, 0.3210, 0.2650,
487 : 0.2170, 0.1750, 0.1382, 0.1070, 0.0816, 0.0610, 0.0446, 0.0320, 0.0232, 0.0170, 0.0119, 0.0082, 0.0158, 0.0041, 0.0029, 0.0021, 0.0015,
488 : 0.0010, 0.0007, 0.0005, 0.0004, 0.0002, 0.0002, 0.0001, 0.0001, 0.0001, 0.0000, 0.0000, 0.0000, 0.0000};
489 :
490 : int ngllayer = 0; // Number of glass layers
491 : int nglface = 0; // Number of glass faces
492 : int nglfacep = 0; // Number of glass faces, + 2 if shade layer present
493 : Real64 tout = 0.0; // Outside air temperature (K)
494 : Real64 tin = 0.0; // Inside air temperature (previous timestep) (K)
495 : Real64 tilt = 0.0; // Window tilt (deg)
496 : Real64 tiltr = 0.0; // Window tilt (radians)
497 : Real64 hcin = 0.0; // Convective inside air film conductance (W/m2-K)
498 : Real64 hcout = 0.0; // Convective outside air film conductance (W/m2-K)
499 : Real64 Ebout = 0.0; // Sigma*(outside air temp)**4 (W/m2)
500 : Real64 Outir = 0.0; // IR radiance of window's exterior surround (W/m2)
501 : Real64 Rmir = 0.0; // IR radiance of window's interior surround (W/m2)
502 : Real64 Rtot = 0.0; // Total thermal resistance of window (m2-K/W)
503 : std::array<Window::WindowGap, Window::maxGlassLayers> gaps = {Window::WindowGap()}; // Gas thermal conductivity coefficients for each gap
504 : std::array<Real64, Window::maxGlassLayers> thick = {0.0}; // Glass layer thickness (m)
505 : std::array<Real64, Window::maxGlassLayers> scon = {0.0}; // Glass layer conductance--conductivity/thickness (W/m2-K)
506 :
507 : std::array<Real64, 2 *Window::maxGlassLayers> tir = {0.0}; // Front and back IR transmittance for each glass layer
508 : std::array<Real64, 2 *Window::maxGlassLayers> emis = {0.0}; // Front and back IR emissivity for each glass layer
509 : std::array<Real64, 2 *Window::maxGlassLayers> rir = {0.0}; // Front and back IR reflectance for each glass layer
510 : // (program calculates from tir and emis)
511 : std::array<Real64, 2 *Window::maxGlassLayers> AbsRadGlassFace = {
512 : 0.0}; // Solar radiation and IR radiation from internal gains absorbed by glass face
513 : std::array<Real64, 2 *Window::maxGlassLayers> thetas = {0.0}; // Glass surface temperatures (K)
514 : std::array<Real64, 2 *Window::maxGlassLayers> thetasPrev = {0.0}; // Previous-iteration glass surface temperatures (K)
515 : std::array<Real64, 2 *Window::maxGlassLayers> fvec = {0.0}; // Glass face heat balance function
516 :
517 : std::array<Real64, Window::maxGlassLayers> hrgap = {0.0}; // Radiative gap conductance
518 :
519 : Real64 A23P = 0.0; // Intermediate variables in glass face
520 : Real64 A32P = 0.0;
521 : Real64 A45P = 0.0;
522 : Real64 A54P = 0.0;
523 : Real64 A67P = 0.0;
524 : Real64 A76P = 0.0;
525 : Real64 A23 = 0.0; // heat balance equations
526 : Real64 A45 = 0.0;
527 : Real64 A67 = 0.0;
528 :
529 : // TEMP MOVED FROM DataHeatBalance.hh -BLB
530 :
531 : // for each wavelenth in wle
532 : std::array<std::array<Real64, Window::maxGlassLayers>, Window::maxGlassLayers> top = {0.0}; // Transmittance matrix for subr. op
533 : std::array<std::array<Real64, Window::maxGlassLayers>, Window::maxGlassLayers> rfop = {0.0}; // Front reflectance matrix for subr. op
534 : std::array<std::array<Real64, Window::maxGlassLayers>, Window::maxGlassLayers> rbop = {0.0}; // Back transmittance matrix for subr. op
535 :
536 : std::unique_ptr<Window::CWindowModel> inExtWindowModel; // Information about windows model (interior or exterior)
537 : std::unique_ptr<Window::CWindowOpticalModel> winOpticalModel; // Information about windows optical model (Simplified or BSDF)
538 :
539 : bool RunMeOnceFlag = false;
540 : bool lSimpleGlazingSystem = false; // true if using simple glazing system block model
541 : bool BGFlag = false; // True if between-glass shade or blind
542 : bool locTCFlag = false; // True if this surface is a TC window
543 : bool DoReport = false;
544 : bool HasWindows = false;
545 : bool HasComplexWindows = false;
546 : bool HasEQLWindows = false; // equivalent layer window defined
547 : Real64 SimpleGlazingSHGC = 0.0; // value of SHGC for simple glazing system block model
548 : Real64 SimpleGlazingU = 0.0; // value of U-factor for simple glazing system block model
549 : Real64 tmpTrans = 0.0; // solar transmittance calculated from spectral data
550 : Real64 tmpTransVis = 0.0; // visible transmittance calculated from spectral data
551 : Real64 tmpReflectSolBeamFront = 0.0;
552 : Real64 tmpReflectSolBeamBack = 0.0;
553 : Real64 tmpReflectVisBeamFront = 0.0;
554 : Real64 tmpReflectVisBeamBack = 0.0;
555 :
556 : std::array<int, Window::maxGlassLayers> LayerNum = {0}; // Glass layer number
557 :
558 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
559 : {
560 796 : }
561 :
562 0 : void clear_state() override
563 : {
564 0 : this->ngllayer = 0;
565 0 : this->nglface = 0;
566 0 : this->nglfacep = 0;
567 0 : this->tout = 0.0;
568 0 : this->tin = 0.0;
569 0 : this->tilt = 0.0;
570 0 : this->tiltr = 0.0;
571 0 : this->hcin = 0.0;
572 0 : this->hcout = 0.0;
573 0 : this->Ebout = 0.0;
574 0 : this->Outir = 0.0;
575 0 : this->Rmir = 0.0;
576 0 : this->Rtot = 0.0;
577 0 : this->gaps = {Window::WindowGap()};
578 0 : this->thick = {0.0};
579 0 : this->scon = {0.0};
580 0 : this->tir = {0.0};
581 0 : this->emis = {0.0};
582 0 : this->rir = {0.0};
583 0 : this->AbsRadGlassFace = {0.0};
584 0 : this->thetas = {0.0};
585 0 : this->thetasPrev = {0.0};
586 0 : this->fvec = {0.0};
587 0 : this->hrgap = {0.0};
588 0 : this->A23P = 0.0;
589 0 : this->A32P = 0.0;
590 0 : this->A45P = 0.0;
591 0 : this->A54P = 0.0;
592 0 : this->A67P = 0.0;
593 0 : this->A76P = 0.0;
594 0 : this->A23 = 0.0;
595 0 : this->A45 = 0.0;
596 0 : this->A67 = 0.0;
597 0 : this->top = {0.0};
598 0 : this->rfop = {0.0};
599 0 : this->rbop = {0.0};
600 0 : Window::CWindowConstructionsSimplified::clearState();
601 0 : this->RunMeOnceFlag = false;
602 0 : this->lSimpleGlazingSystem = false; // true if using simple glazing system block model
603 0 : this->BGFlag = false; // True if between-glass shade or blind
604 0 : this->locTCFlag = false; // True if this surface is a TC window
605 0 : this->DoReport = false;
606 0 : this->HasWindows = false;
607 0 : this->HasComplexWindows = false;
608 0 : this->HasEQLWindows = false; // equivalent layer window defined
609 0 : this->SimpleGlazingSHGC = 0.0;
610 0 : this->SimpleGlazingU = 0.0;
611 0 : this->tmpTrans = 0.0; // solar transmittance calculated from spectral data
612 0 : this->tmpTransVis = 0.0; // visible transmittance calculated from spectral data
613 0 : this->tmpReflectSolBeamFront = 0.0;
614 0 : this->tmpReflectSolBeamBack = 0.0;
615 0 : this->tmpReflectVisBeamFront = 0.0;
616 0 : this->tmpReflectVisBeamBack = 0.0;
617 0 : }
618 :
619 : // Default Constructor
620 796 : WindowManagerData()
621 796 : {
622 796 : SimpleGlazingSHGC = 0.0;
623 796 : SimpleGlazingU = 0.0;
624 796 : tmpReflectSolBeamFront = 0.0;
625 796 : tmpReflectSolBeamBack = 0.0;
626 796 : tmpReflectVisBeamFront = 0.0;
627 796 : tmpReflectVisBeamBack = 0.0;
628 796 : }
629 : };
630 :
631 : } // namespace EnergyPlus
632 :
633 : #endif
|