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 WindowEquivalentLayer_hh_INCLUDED
49 : #define WindowEquivalentLayer_hh_INCLUDED
50 :
51 : // C++ Headers
52 : #include <functional>
53 :
54 : // ObjexxFCL Headers
55 : #include <ObjexxFCL/Array1S.hh>
56 : #include <ObjexxFCL/Array2A.hh>
57 : #include <ObjexxFCL/Array2S.hh>
58 : #include <ObjexxFCL/Array3D.hh>
59 : #include <ObjexxFCL/Optional.hh>
60 :
61 : // EnergyPlus Headers
62 : #include <EnergyPlus/Data/BaseData.hh>
63 : #include <EnergyPlus/DataWindowEquivalentLayer.hh>
64 : #include <EnergyPlus/EnergyPlus.hh>
65 :
66 : namespace EnergyPlus {
67 :
68 : // Forward declarations
69 : struct EnergyPlusData;
70 :
71 : namespace WindowEquivalentLayer {
72 :
73 : // Using/Aliasing
74 : using namespace DataWindowEquivalentLayer;
75 :
76 : void InitEquivalentLayerWindowCalculations(EnergyPlusData &state);
77 :
78 : void SetEquivalentLayerWindowProperties(EnergyPlusData &state, int const ConstrNum);
79 :
80 : void CalcEQLWindowUvalue(EnergyPlusData &state,
81 : CFSTY const &FS, // CFS to be calculated
82 : Real64 &UNFRC // NFRC U-factor, W/m2-K
83 : );
84 :
85 : void CalcEQLWindowSHGCAndTransNormal(EnergyPlusData &state,
86 : CFSTY const &FS, // fenestration system
87 : Real64 &SHGCSummer, // solar heat gain coefficient
88 : Real64 &TransNormal // transmittance at normal incidence
89 : );
90 :
91 : void CalcEQLWindowOpticalProperty(EnergyPlusData &state,
92 : CFSTY &FS, // fenestration system
93 : SolarArrays const DiffBeamFlag, // isDIFF: calc diffuse properties
94 : Array2A<Real64> Abs1,
95 : Real64 const IncA, // angle of incidence, radians
96 : Real64 const VProfA, // inc solar vertical profile angle, radians
97 : Real64 const HProfA // inc solar horizontal profile angle, radians
98 : );
99 :
100 : void EQLWindowSurfaceHeatBalance(EnergyPlusData &state,
101 : int const SurfNum, // Surface number
102 : Real64 const HcOut, // outside convection coeficient at this timestep, W/m2K
103 : Real64 &SurfInsideTemp, // Inside window surface temperature (innermost face) [C]
104 : Real64 &SurfOutsideTemp, // Outside surface temperature (C)
105 : Real64 &SurfOutsideEmiss,
106 : DataBSDFWindow::Condition const CalcCondition // Calucation condition (summer, winter or no condition)
107 : );
108 :
109 : void OPENNESS_LW(Real64 const OPENNESS, // shade openness (=tausbb at normal incidence)
110 : Real64 const EPSLW0, // apparent LW emittance of shade at 0 openness
111 : Real64 const TAULW0, // apparent LW transmittance of shade at 0 openness
112 : Real64 &EPSLW, // returned: effective LW emittance of shade
113 : Real64 &TAULW // returned: effective LW transmittance of shade
114 : );
115 :
116 : Real64 P01(EnergyPlusData &state,
117 : Real64 const P, // property
118 : std::string_view const WHAT // identifier for err msg
119 : );
120 :
121 : Real64
122 : HEMINT(EnergyPlusData &state,
123 : std::function<Real64(EnergyPlusData &state, Real64 const THETA, int const OPT, const Array1D<Real64> &)> F, // property integrand function
124 : int const F_Opt, // options passed to F() (hipRHO, hipTAU)
125 : const Array1D<Real64> &F_P // parameters passed to F()
126 : );
127 :
128 : void RB_DIFF(EnergyPlusData &state,
129 : Real64 const RHO_BT0, // normal incidence beam-total reflectance
130 : Real64 const TAU_BT0, // normal incidence beam-total transmittance
131 : Real64 const TAU_BB0, // normal incidence beam-beam transmittance
132 : Real64 &RHO_DD, // returned: diffuse-diffuse reflectance
133 : Real64 &TAU_DD // returned: diffuse-diffuse transmittance
134 : );
135 :
136 : Real64 RB_F(EnergyPlusData &state,
137 : Real64 const THETA, // incidence angle, radians
138 : int const OPT, // options (unused)
139 : const Array1D<Real64> &P // parameters
140 : );
141 :
142 : void RB_BEAM(EnergyPlusData &state,
143 : Real64 const xTHETA, // angle of incidence, radians (0 - PI/2)
144 : Real64 const RHO_BT0, // normal incidence beam-total front reflectance
145 : Real64 const TAU_BT0, // normal incidence beam-total transmittance
146 : Real64 const TAU_BB0, // normal incidence beam-beam transmittance
147 : Real64 &RHO_BD, // returned: beam-diffuse front reflectance
148 : Real64 &TAU_BB, // returned: beam-beam transmittance
149 : Real64 &TAU_BD // returned: beam-diffuse transmittance
150 : );
151 :
152 : void IS_DIFF(EnergyPlusData &state,
153 : Real64 const RHO_BT0, // normal incidence beam-total reflectance
154 : Real64 const TAU_BT0, // normal incidence beam-total transmittance
155 : Real64 const TAU_BB0, // normal incidence beam-beam transmittance
156 : Real64 &RHO_DD, // returned: diffuse-diffuse reflectance
157 : Real64 &TAU_DD // returned: diffuse-diffuse transmittance
158 : );
159 :
160 : Real64 IS_F(EnergyPlusData &state,
161 : Real64 const THETA, // incidence angle, radians
162 : int const OPT, // options (1=reflectance, 2=transmittance)
163 : const Array1D<Real64> &P // parameters
164 : );
165 :
166 : void IS_BEAM(EnergyPlusData &state,
167 : Real64 const xTHETA, // incidence angle, radians (0 - PI/2)
168 : Real64 const RHO_BT0, // beam-total reflectance
169 : Real64 const TAU_BT0, // beam-total transmittance at normal incidence
170 : Real64 const TAU_BB0, // beam-beam transmittance at normal incidence
171 : Real64 &RHO_BD, // returned: beam-diffuse reflectance
172 : Real64 &TAU_BB, // returned: beam-beam transmittance
173 : Real64 &TAU_BD // returned: beam-diffuse transmittance
174 : );
175 :
176 : Real64 IS_OPENNESS(Real64 const D, // wire diameter
177 : Real64 const S // wire spacing
178 : );
179 :
180 : Real64 IS_DSRATIO(Real64 const OPENNESS); // openness
181 :
182 : void FM_DIFF(EnergyPlusData &state,
183 : Real64 const RHO_BT0, // fabric beam-total reflectance at normal incidence
184 : Real64 const TAU_BT0, // fabric beam-total transmittance at normal incidence
185 : Real64 const TAU_BB0, // forward facing fabric beam-beam transmittance at normal incidence
186 : Real64 &RHO_DD, // returned: fabric diffuse-diffuse reflectance
187 : Real64 &TAU_DD // returned: fabric diffuse-diffuse transmittance
188 : );
189 :
190 : Real64 FM_F(EnergyPlusData &state,
191 : Real64 const THETA, // incidence angle, radians
192 : int const Opt, // options (hipRHO, hipTAU)
193 : const Array1D<Real64> &P // parameters
194 : );
195 :
196 : void FM_BEAM(EnergyPlusData &state,
197 : Real64 const xTHETA, // incidence angle, radians (0 - PI/2)
198 : Real64 const RHO_BT0, // fabric beam-total reflectance
199 : Real64 const TAU_BT0, // fabric beam-total transmittance at normal incidence
200 : Real64 const TAU_BB0, // fabric beam-beam transmittance at normal incidence
201 : Real64 &RHO_BD, // returned: fabric beam-diffuse reflectance
202 : Real64 &TAU_BB, // returned: fabric beam-beam transmittance
203 : Real64 &TAU_BD // returned: fabric beam-diffuse transmittance
204 : );
205 :
206 : void PD_LW(EnergyPlusData &state,
207 : Real64 const S, // pleat spacing (> 0)
208 : Real64 const W, // pleat depth (>=0, same units as S)
209 : Real64 const OPENNESS_FABRIC, // fabric openness, 0-1 (=tausbb at normal incidence)
210 : Real64 const EPSLWF0_FABRIC, // fabric LW front emittance at 0 openness
211 : Real64 const EPSLWB0_FABRIC, // fabric LW back emittance at 0 openness
212 : Real64 const TAULW0_FABRIC, // fabric LW transmittance at 0 openness
213 : Real64 &EPSLWF_PD, // returned: drape front effective LW emittance
214 : Real64 &TAULW_PD // returned: drape effective LW transmittance
215 : );
216 :
217 : void PD_DIFF(EnergyPlusData &state,
218 : Real64 const S, // pleat spacing (> 0)
219 : Real64 const W, // pleat depth (>=0, same units as S)
220 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
221 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
222 : Real64 const TAUF_DD, // fabric diffuse-diffuse transmittance
223 : Real64 &RHOFDD, // returned: drape diffuse-diffuse reflectance
224 : Real64 &TAUFDD // returned: drape diffuse-diffuse transmittance
225 : );
226 :
227 : void PD_BEAM(EnergyPlusData &state,
228 : Real64 const S, // pleat spacing (> 0)
229 : Real64 const W, // pleat depth (>=0, same units as S)
230 : Real64 const OHM_V_RAD, // vertical profile angle, radians +=above horiz
231 : Real64 const OHM_H_RAD, // horizontal profile angle, radians=clockwise when viewed from above
232 : Real64 const RHOFF_BT0, // beam total reflectance front (outside)
233 : Real64 const TAUFF_BB0, // beam beam transmittance front (outside)
234 : Real64 const TAUFF_BD0, // beam diffuse transmittance front (outside)
235 : Real64 const RHOFF_DD, // diffuse-diffuse reflectance front (outside)
236 : Real64 const TAUFF_DD, // diffuse-diffuse transmittance front (outside)
237 : Real64 const RHOBF_BT0, // beam total reflectance back (inside)
238 : Real64 const TAUBF_BB0, // beam beam total transmittance back (inside)
239 : Real64 const TAUBF_BD0, // beam diffuse transmittance back (inside)
240 : Real64 const RHOBF_DD, // diffuse-diffuse reflectance front (outside)
241 : Real64 const TAUBF_DD, // diffuse-diffuse transmittance front (outside)
242 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
243 : Real64 &TAU_BB, // returned: drape beam-beam transmittance
244 : Real64 &TAU_BD // returned: drape beam-diffuse transmittance
245 : );
246 :
247 : void PD_BEAM_CASE_I(Real64 const S, // pleat spacing (> 0)
248 : Real64 const W, // pleat depth (>=0, same units as S)
249 : Real64 const OMEGA_H, // horizontal profile angle, radians
250 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
251 : Real64 const RHOFF_BT_PARL,
252 : Real64 const TAUFF_BB_PARL,
253 : Real64 const TAUFF_BD_PARL,
254 : Real64 const RHOBF_BT_PARL,
255 : Real64 const TAUBF_BB_PARL,
256 : Real64 const TAUBF_BD_PARL,
257 : Real64 const RHOFF_BT_PERP,
258 : Real64 const TAUFF_BB_PERP,
259 : Real64 const TAUFF_BD_PERP,
260 : Real64 const RHOBF_BT_PERP,
261 : Real64 const TAUBF_BB_PERP,
262 : Real64 const TAUBF_BD_PERP,
263 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
264 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
265 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
266 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
267 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
268 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
269 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
270 : );
271 :
272 : void PD_BEAM_CASE_II(Real64 const S, // pleat spacing (> 0)
273 : Real64 const W, // pleat depth (>=0, same units as S)
274 : Real64 const OMEGA_H, // horizontal profile angle, radians
275 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
276 : Real64 const RHOFF_BT_PARL,
277 : Real64 const TAUFF_BB_PARL,
278 : Real64 const TAUFF_BD_PARL,
279 : Real64 const RHOBF_BT_PARL,
280 : Real64 const TAUBF_BB_PARL,
281 : Real64 const TAUBF_BD_PARL,
282 : Real64 const RHOFF_BT_PERP,
283 : Real64 const TAUFF_BB_PERP,
284 : Real64 const TAUFF_BD_PERP,
285 : Real64 const RHOBF_BT_PERP,
286 : Real64 const TAUBF_BB_PERP,
287 : Real64 const TAUBF_BD_PERP,
288 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
289 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
290 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
291 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
292 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
293 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
294 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
295 : );
296 :
297 : void PD_BEAM_CASE_III(Real64 const S, // pleat spacing (> 0)
298 : Real64 const W, // pleat depth (>=0, same units as S)
299 : Real64 const OMEGA_H, // horizontal profile angle, radians
300 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
301 : Real64 const RHOFF_BT_PARL,
302 : Real64 const TAUFF_BB_PARL,
303 : Real64 const TAUFF_BD_PARL,
304 : Real64 const RHOBF_BT_PARL,
305 : Real64 const TAUBF_BB_PARL,
306 : Real64 const TAUBF_BD_PARL,
307 : Real64 const RHOFF_BT_PERP,
308 : Real64 const TAUFF_BB_PERP,
309 : Real64 const TAUFF_BD_PERP,
310 : Real64 const RHOBF_BT_PERP,
311 : Real64 const TAUBF_BB_PERP,
312 : Real64 const TAUBF_BD_PERP,
313 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
314 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
315 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
316 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
317 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
318 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
319 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
320 : );
321 :
322 : void PD_BEAM_CASE_IV(Real64 const S, // pleat spacing (> 0)
323 : Real64 const W, // pleat depth (>=0, same units as S)
324 : Real64 const OMEGA_H, // horizontal profile angle, radians
325 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
326 : Real64 const RHOFF_BT_PARL,
327 : Real64 const TAUFF_BB_PARL,
328 : Real64 const TAUFF_BD_PARL,
329 : Real64 const RHOBF_BT_PARL,
330 : Real64 const TAUBF_BB_PARL,
331 : Real64 const TAUBF_BD_PARL,
332 : Real64 const RHOFF_BT_PERP,
333 : Real64 const TAUFF_BB_PERP,
334 : Real64 const TAUFF_BD_PERP,
335 : Real64 const RHOBF_BT_PERP,
336 : Real64 const TAUBF_BB_PERP,
337 : Real64 const TAUBF_BD_PERP,
338 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
339 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
340 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
341 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
342 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
343 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
344 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
345 : );
346 :
347 : void PD_BEAM_CASE_V(Real64 const S, // pleat spacing (> 0)
348 : Real64 const W, // pleat depth (>=0, same units as S)
349 : Real64 const OMEGA_H, // horizontal profile angle, radians
350 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
351 : Real64 const RHOFF_BT_PARL,
352 : Real64 const TAUFF_BB_PARL,
353 : Real64 const TAUFF_BD_PARL,
354 : Real64 const RHOBF_BT_PARL,
355 : Real64 const TAUBF_BB_PARL,
356 : Real64 const TAUBF_BD_PARL,
357 : Real64 const RHOFF_BT_PERP,
358 : Real64 const TAUFF_BB_PERP,
359 : Real64 const TAUFF_BD_PERP,
360 : Real64 const RHOBF_BT_PERP,
361 : Real64 const TAUBF_BB_PERP,
362 : Real64 const TAUBF_BD_PERP,
363 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
364 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
365 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
366 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
367 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
368 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
369 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
370 : );
371 :
372 : void PD_BEAM_CASE_VI(Real64 const S, // pleat spacing (> 0)
373 : Real64 const W, // pleat depth (>=0, same units as S)
374 : Real64 const OMEGA_H, // horizontal profile angle, radians
375 : Real64 const DE, // width of illumination on pleat bottom (same units as S)
376 : Real64 const RHOFF_BT_PARL,
377 : Real64 const TAUFF_BB_PARL,
378 : Real64 const TAUFF_BD_PARL,
379 : Real64 const RHOBF_BT_PARL,
380 : Real64 const TAUBF_BB_PARL,
381 : Real64 const TAUBF_BD_PARL,
382 : Real64 const RHOFF_BT_PERP,
383 : Real64 const TAUFF_BB_PERP,
384 : Real64 const TAUFF_BD_PERP,
385 : Real64 const RHOBF_BT_PERP,
386 : Real64 const TAUBF_BB_PERP,
387 : Real64 const TAUBF_BD_PERP,
388 : Real64 const RHOBF_DD, // fabric back diffuse-diffuse reflectance
389 : Real64 const RHOFF_DD, // fabric front diffuse-diffuse reflectance
390 : Real64 const TAUFF_DD, // fabric front diffuse-diffuse transmittance
391 : Real64 const TAUBF_DD, // fabric back diffuse-diffuse transmittance
392 : Real64 &RHO_BD, // returned: drape front beam-diffuse reflectance
393 : Real64 &TAU_BD, // returned: drape front beam-diffuse transmittance
394 : Real64 &TAU_BB // returned: drape front beam-beam transmittance
395 : );
396 :
397 : void VB_DIFF(EnergyPlusData &state,
398 : Real64 const S, // slat spacing (any length units; same units as W)
399 : Real64 const W, // slat tip-to-tip width (any length units; same units as S)
400 : Real64 const PHI, // slat angle, radians (-PI/2 <= PHI <= PI/2)
401 : Real64 const RHODFS_SLAT, // reflectance of downward-facing slat surfaces (concave?)
402 : Real64 const RHOUFS_SLAT, // reflectance of upward-facing slat surfaces (convex?)
403 : Real64 const TAU_SLAT, // diffuse transmitance of slats
404 : Real64 &RHOFVB, // returned: front side effective diffuse reflectance of venetian blind
405 : Real64 &TAUVB // returned: effective diffuse transmittance of venetian blind
406 : );
407 :
408 : Real64 VB_SLAT_RADIUS_RATIO(Real64 const W, // slat tip-to-tip (chord) width (any units; same units as C) must be > 0
409 : Real64 const C // slat crown height (any units, same units as W) must be >= 0
410 : );
411 :
412 : void VB_SOL46_CURVE(EnergyPlusData &state,
413 : Real64 const S, // slat spacing (any length units; same units as W)
414 : Real64 const W, // slat tip-to-tip (chord) width (any length units; same units as S)
415 : Real64 const SL_WR, // slat curvature radius ratio (= W/R)
416 : Real64 const PHIx, // slat angle, radians (-PI/2 <= PHI <= PI/2)
417 : Real64 const OMEGAx, // incident beam profile angle (radians)
418 : Real64 const RHODFS_SLAT, // SW (solar) reflectance downward-facing slat surfaces (concave?)
419 : Real64 const RHOUFS_SLAT, // SW (solar) reflectance upward-facing slat surfaces (convex?)
420 : Real64 const TAU_SLAT, // SW (solar) transmittance of slats
421 : Real64 &RHO_BD, // returned: effective SW (solar) beam-to-diffuse reflectance front side
422 : Real64 &TAU_BB, // returned: effective SW (solar) beam-to-beam transmittance front side
423 : Real64 &TAU_BD // returned: effective SW (solar) beam-to-diffuse transmittance front side
424 : );
425 :
426 : void VB_SOL4(EnergyPlusData &state,
427 : Real64 const S, // slat spacing (any length units; same units as W)
428 : Real64 const W, // slat tip-to-tip width (any length units; same units as S)
429 : Real64 const OMEGA, // incident beam profile angle (radians)
430 : Real64 const DE, // distance from front tip of any slat to shadow (caused by the adjacent slat) on
431 : Real64 const PHI, // slat angle, radians (-PI/2 <= PHI <= PI/2)
432 : Real64 const RHODFS_SLAT, // solar reflectance downward-facing slat surfaces (concave?)
433 : Real64 const RHOUFS_SLAT, // solar reflectance upward-facing slat surfaces (convex?)
434 : Real64 const TAU_SLAT, // solar transmittance of slat
435 : Real64 &RHO_BD, // returned: solar beam-to-diffuse reflectance the venetian blind (front side)
436 : Real64 &TAU_BD // returned: solar beam-to-diffuse transmittance of the venetian blind (front side)
437 : );
438 :
439 : void VB_SOL6(EnergyPlusData &state,
440 : Real64 const S, // slat spacing (any length units; same units as W)
441 : Real64 const W, // slat tip-to-tip width (any length units; same units as S)
442 : Real64 const OMEGA, // incident beam profile angle (radians)
443 : Real64 const DE, // distance from front tip of any slat to shadow (caused by the adjacent slat) on
444 : Real64 const PHI, // slat angle, radians (-PI/2 <= PHI <= PI/2)
445 : Real64 const RHODFS_SLAT, // solar reflectance downward-facing slat surfaces (concave)
446 : Real64 const RHOUFS_SLAT, // solar reflectance upward-facing slat surfaces (convex)
447 : Real64 const TAU_SLAT, // solar transmittance of slat
448 : Real64 &RHO_BD, // returned: solar beam-to-diffuse reflectance the venetian blind (front side)
449 : Real64 &TAU_BD // returned: solar beam-to-diffuse transmittance of the venetian blind (front side)
450 : );
451 :
452 : void SOLMATS(int const N, // # of active rows in A
453 : Array2S<Real64> A, // matrix, minimum required dimensions: A( N, N+2)
454 : Array1D<Real64> &XSOL // returned: solution vector, min req dimension: XSOL( N)
455 : );
456 :
457 : void ASHWAT_ThermalCalc(EnergyPlusData &state,
458 : CFSTY &FS, // fenestration system
459 : Real64 const TIN, // indoor air temperature, K
460 : Real64 const TOUT, // outdoor air temperature, K
461 : Real64 const HCIN, // indoor convective heat transfer
462 : Real64 const HCOUT, // outdoor convective heat transfer
463 : Real64 const TRMOUT,
464 : Real64 const TRMIN, // indoor / outdoor mean radiant temp, K
465 : Array1S<Real64> const SOURCE, // absorbed solar by layer, W/m2
466 : Real64 const TOL, // convergence tolerance, usually
467 : Array1D<Real64> &QOCF, // returned: heat flux to layer i from gaps i-1 and i
468 : Real64 &QOCFRoom, // returned: open channel heat gain to room, W/m2
469 : Array1D<Real64> &T, // returned: layer temperatures, 1=outside-most layer, K
470 : Array1D<Real64> &Q, // returned: heat flux at ith gap (betw layers i and i+1), W/m2
471 : Array1D<Real64> &JF, // returned: front (outside facing) radiosity of surfaces, W/m2
472 : Array1D<Real64> &JB, // returned: back (inside facing) radiosity, W/m2
473 : Array1D<Real64> &HC // returned: gap convective heat transfer coefficient, W/m2K
474 : );
475 :
476 : bool ASHWAT_ThermalRatings(EnergyPlusData &state,
477 : CFSTY const &FS, // fenestration system
478 : Real64 const TIN, // indoor air temperature, K
479 : Real64 const TOUT, // outdoor air temperature, K
480 : Real64 const HCIN, // indoor convective heat transfer
481 : Real64 const HCOUT, // outdoor convective heat transfer
482 : Real64 const TRMOUT,
483 : Real64 const TRMIN, // indoor / outdoor mean radiant temp, K
484 : Real64 const ISOL, // total incident solar, W/m2 (values used for SOURCE derivation)
485 : Array1S<Real64> const SOURCE, // absorbed solar by layer, W/m2
486 : Real64 const TOL, // convergence tolerance, usually
487 : Array1D<Real64> &QOCF, // returned: heat flux to layer i from gaps i-1 and i
488 : Real64 &QOCFRoom, // returned: open channel heat gain to room, W/m2
489 : Array1D<Real64> &T, // returned: layer temperatures, 1=outside-most layer, K
490 : Array1D<Real64> &Q, // returned: heat flux at ith gap (betw layers i and i+1), W/m2
491 : Array1D<Real64> &JF, // returned: front (outside facing) radiosity of surfaces, W/m2
492 : Array1D<Real64> &JB, // returned: back (inside facing) radiosity, W/m2
493 : Array1D<Real64> &HC, // returned: gap convective heat transfer coefficient, W/m2K
494 : Real64 &UCG, // returned: center-glass U-factor, W/m2-K
495 : Real64 &SHGC, // returned: center-glass SHGC (Solar Heat Gain Coefficient)
496 : bool const HCInFlag // If true uses ISO Std 150099 routine for HCIn calc
497 : );
498 :
499 : void DL_RES_r2(Real64 const Tg, // mean glass layer temperature, {K}
500 : Real64 const Td, // mean diathermanous layer temperature, {K}
501 : Real64 const Tm, // mean radiant room temperature, {K}
502 : Real64 const rhog, // reflectance of glass layer, {-}
503 : Real64 const rhodf, // front reflectance of diathermanous layer, {-}
504 : Real64 const rhodb, // back reflectance of diathermanous layer, {-}
505 : Real64 const taud, // transmittance of diathermanous layer, {-}
506 : Real64 const rhom, // reflectance of the room, {-}
507 : Real64 &hr_gm, // heat transfer coefficient between left and right surface {W/m2K}
508 : Real64 &hr_gd, // heat transfer coefficient between left and middle surface {W/m2K}
509 : Real64 &hr_md // heat transfer coefficient between right and middle surface {W/m2K}
510 : );
511 :
512 : void SETUP4x4_A(Real64 const rhog, Real64 const rhodf, Real64 const rhodb, Real64 const taud, Real64 const rhom, Array2A<Real64> A);
513 :
514 : Real64 FRA(Real64 const TM, // mean gas temp, K
515 : Real64 const T, // gas layer thickness, m
516 : Real64 const DT, // temp difference across layer, K
517 : Real64 const AK, // gas conductance coeffs, K = AK + BK*TM + CK*TM*TM
518 : Real64 const BK,
519 : Real64 const CK,
520 : Real64 const ACP, // gas specific heat coeffs, CP = ACP + BCP*TM + CCP*TM*TM
521 : Real64 const BCP,
522 : Real64 const CCP,
523 : Real64 const AVISC, // gas viscosity coeffs, VISC = AVISC + BVISC*TM + CVISC*TM*TM
524 : Real64 const BVISC,
525 : Real64 const CVISC,
526 : Real64 const RHOGAS // gas density, kg/m3
527 : );
528 :
529 : Real64 FNU(Real64 const RA); // Rayleigh number
530 :
531 : Real64 HConvGap(CFSGAP const &G, // gap
532 : Real64 const T1, // bounding surface temps (K)
533 : Real64 const T2);
534 :
535 : Real64 HRadPar(Real64 const T1, // bounding surface temps [K]
536 : Real64 const T2,
537 : Real64 const E1, // bounding surface emissivities
538 : Real64 const E2);
539 :
540 : Real64 HIC_ASHRAE(Real64 const L, // glazing height, m
541 : Real64 const TG, // glazing inside surf temp, C or K
542 : Real64 const TI // inside air temp, C or K
543 : );
544 :
545 : void SLtoGL(EnergyPlusData &state,
546 : Real64 const breal, // distance from shade to glass (m)
547 : Real64 const Ts, // shade temperature (K)
548 : Real64 const Tg, // glass temperature (K)
549 : Real64 &hsg, // the heat transfer coefficient, shade-to-glass, {W/m2K}
550 : int const scheme);
551 :
552 : Real64 SLtoAMB(EnergyPlusData &state,
553 : Real64 const b, // distance from shade to glass (m) where air flow takes place
554 : Real64 const L, // window height, m (usually taken as 1 m)
555 : Real64 const Ts, // shade temperature, K
556 : Real64 const Tamb, // room air temperature, K
557 : Real64 const hc_in, // indoor (room) convective transfer coeff, W/m2K)
558 : int const scheme // flag to select model, scheme=2 has problems
559 : );
560 :
561 : void GLtoAMB(EnergyPlusData &state,
562 : Real64 const b, // distance from shade to glass {m}
563 : Real64 const L, // window height {m}, usually taken as 1 meter
564 : Real64 const Tg, // glass temperature {K}
565 : Real64 const Tamb, // room air temperature, {K}
566 : Real64 const hc_in, // inside convection coefficient, {W/m2K}
567 : Real64 &hgamb, // glass to room air heat transfer coefficient
568 : int const scheme);
569 :
570 : Real64 ConvectionFactor(CFSLAYER const &L); // window layer
571 :
572 : bool CFSUFactor(EnergyPlusData &state,
573 : CFSTY const &FS, // fenestration system
574 : Real64 const TOUT, // outdoor temperature, C (air and MRT)
575 : Real64 const HCOUT, // outdoor convective coefficient, W/m2-K
576 : Real64 const TIN, // indoor air temperature, C
577 : Real64 const HCIN, // indoor convective coefficient, W/m2-K
578 : Real64 &U // returned: U factor, W/m2-K
579 : );
580 :
581 : void ASHWAT_Solar(int const NL, // # of layers
582 : Array1S<CFSSWP> const LSWP_ON, // layer SW (solar) properties (off-normal adjusted)
583 : CFSSWP const &SWP_ROOM, // effective SW (solar) properties of room
584 : Real64 const IBEAM, // incident beam insolation (W/m2 aperture)
585 : Real64 const IDIFF, // incident diffuse insolation (W/m2 aperture)
586 : Real64 const ILIGHTS, // incident diffuse insolation (W/m2 aperture)
587 : Array1S<Real64> SOURCE, // returned: layer-by-layer flux of absorbed
588 : ObjexxFCL::Optional<Array1S<Real64>> SourceBD = _ // returned: layer-by-layer flux of absorbed
589 : );
590 :
591 : void NETRAD(int const NL, // # of layers, 1=outside .. NL=inside
592 : Array1S<CFSSWP> const LSWP_ON, // layer SW (solar) properties (off-normal adjusted)
593 : Real64 const RHO_room, // effective solar reflectance of room (at inside)
594 : Real64 const ISOL, // incident flux (W/m2)
595 : Array1D<Real64> &QPLUS, // returned: see Edwards paper
596 : Array1D<Real64> &QMINUS // returned: see Edwards paper
597 : );
598 :
599 : void TDMA_R(
600 : Array1D<Real64> &X, const Array1D<Real64> &AP, const Array1D<Real64> &AE, const Array1D<Real64> &AW, const Array1D<Real64> &BP, int const N);
601 :
602 : void
603 : TDMA(Array1D<Real64> &X, const Array1D<Real64> &AP, const Array1D<Real64> &AE, const Array1D<Real64> &AW, const Array1D<Real64> &BP, int const N);
604 :
605 : void AUTOTDMA(Array1D<Real64> &X, Array1D<Real64> &AP, const Array1D<Real64> &AE, const Array1D<Real64> &AW, const Array1D<Real64> &BP, int &N);
606 :
607 : void ASHWAT_OffNormalProperties(EnergyPlusData &state,
608 : CFSLAYER const &L, // layer for which to derive off-normal properties
609 : Real64 const THETA, // solar beam angle of incidence, from normal, radians
610 : Real64 const OMEGA_V, // solar beam vertical profile angle, +=above horizontal, radians
611 : Real64 const OMEGA_H, // solar beam horizontal profile angle, +=clockwise when viewed
612 : CFSSWP &LSWP_ON // returned: off-normal properties
613 : );
614 :
615 : bool Specular_OffNormal(Real64 const THETA, // solar beam angle of incidence, from normal radians
616 : Real64 &RAT_1MR, // returned: ratio of off-normal to normal solar (1-reflectance)
617 : Real64 &RAT_TAU // returned: ratio of off-normal to normal solar transmittance
618 : );
619 :
620 : void Specular_SWP(CFSSWP &SWP, // short wave properties (adjusted in place)
621 : Real64 const OMEGA // incident angle, radians
622 : );
623 :
624 : void Specular_Adjust(CFSSWP &SWP, // short wave properties (adjusted in place)
625 : Real64 const RAT_1MR, // adjustment factors, see Specular_OffNormal()
626 : Real64 const RAT_TAU // adjustment factors, see Specular_OffNormal()
627 : );
628 :
629 : void Specular_RATDiff(EnergyPlusData &state, Real64 &RAT_1MRDiff, Real64 &RAT_TAUDiff);
630 :
631 : Real64 Specular_F(EnergyPlusData &state,
632 : Real64 const THETA, // incidence angle, radians
633 : int const OPT, // options (unused)
634 : const Array1D<Real64> &P // parameters (none defined)
635 : );
636 :
637 : void Specular_EstimateDiffuseProps(EnergyPlusData &state, CFSSWP &SWP); // short wave properties
638 :
639 : bool RB_LWP(CFSLAYER const &L, // RB layer
640 : CFSLWP &LLWP // returned: equivalent layer long wave properties
641 : );
642 :
643 : bool RB_SWP(EnergyPlusData &state,
644 : CFSLAYER const &L, // RB layer
645 : CFSSWP &LSWP, // returned: equivalent layer properties set
646 : const Real64 THETA // incident angle, 0 <= theta <= PI/2
647 : );
648 :
649 : bool RB_SWP(EnergyPlusData &state,
650 : CFSLAYER const &L, // RB layer
651 : CFSSWP &LSWP // returned: equivalent layer properties set
652 : );
653 :
654 : bool IS_LWP(CFSLAYER const &L, // IS layer
655 : CFSLWP &LLWP // returned: equivalent layer long wave properties
656 : );
657 :
658 : bool IS_SWP(EnergyPlusData &state,
659 : CFSLAYER const &L, // PD layer
660 : CFSSWP &LSWP, // returned: equivalent layer properties set
661 : const Real64 THETA // incident angle, 0 <= theta <= PI/2
662 : );
663 :
664 : bool IS_SWP(EnergyPlusData &state,
665 : CFSLAYER const &L, // PD layer
666 : CFSSWP &LSWP // returned: equivalent layer properties set
667 : );
668 :
669 : void Fabric_EstimateDiffuseProps(EnergyPlusData &state, CFSSWP &SWP); // fabric short wave properties
670 :
671 : bool PD_LWP(EnergyPlusData &state,
672 : CFSLAYER const &L, // PD layer
673 : CFSLWP &LLWP // returned: equivalent layer long wave properties
674 : );
675 :
676 : bool PD_SWP(EnergyPlusData &state,
677 : CFSLAYER const &L, // PD layer
678 : CFSSWP &LSWP, // returned: equivalent layer properties set
679 : const Real64 OHM_V_RAD, // vertical VB profile angles, radians
680 : const Real64 OHM_H_RAD // horizontal VB profile angles, radians
681 : );
682 :
683 : bool PD_SWP(EnergyPlusData &state,
684 : CFSLAYER const &L, // PD layer
685 : CFSSWP &LSWP // returned: equivalent layer properties set
686 : );
687 :
688 : bool VB_LWP(EnergyPlusData &state,
689 : CFSLAYER const &L, // VB layer
690 : CFSLWP &LLWP // returned: equivalent layer long wave properties
691 : );
692 :
693 : bool VB_SWP(EnergyPlusData &state,
694 : CFSLAYER const &L, // VB layer
695 : CFSSWP &LSWP, // returned: equivalent off-normal properties
696 : const Real64 OMEGA // incident profile angle (radians)
697 : );
698 :
699 : bool VB_SWP(EnergyPlusData &state,
700 : CFSLAYER const &L, // VB layer
701 : CFSSWP &LSWP // returned: equivalent off-normal properties
702 :
703 : );
704 :
705 : bool VB_ShadeControl(EnergyPlusData &state,
706 : CFSLAYER &L, // VB layer
707 : Real64 const OMEGA_DEG // incident profile angle (degrees)
708 : );
709 :
710 : Real64 VB_CriticalSlatAngle(Real64 const OMEGA_DEG // incident profile angle (degrees)
711 : );
712 :
713 : bool DoShadeControl(EnergyPlusData &state,
714 : CFSLAYER &L, // layer (returned updated)
715 : Real64 const THETA, // solar beam angle of incidence, from normal, (radians)
716 : Real64 const OMEGA_V, // solar beam vertical profile angle, +=above horizontal (radians)
717 : Real64 const OMEGA_H // solar beam horizontal profile angle, +=clockwise when viewed
718 : );
719 :
720 : void FinalizeCFSLAYER(EnergyPlusData &state, CFSLAYER &L); // layer, input: LTYPE, LWP_MAT, SWP_MAT
721 :
722 : bool IsGZSLayer(CFSLAYER const &L);
723 :
724 : bool IsGlazeLayerX(CFSLAYER const &L);
725 :
726 : bool IsControlledShade(EnergyPlusData &state, CFSLAYER const &L);
727 :
728 : bool IsVBLayer(CFSLAYER const &L);
729 :
730 : void BuildGap(EnergyPlusData &state,
731 : CFSGAP &G, // returned
732 : int const GType, // gap type (gtyOPENin, gtyOPENout or gtySEALED)
733 : Real64 &TAS // gap thickness, m
734 : );
735 :
736 : void AdjustVBGap(CFSGAP &G, // gap, returned updated
737 : CFSLAYER const &L // adjacent layer
738 : );
739 :
740 : float DensityCFSFillGas(CFSFILLGAS const &FG, // gas properties
741 : Real64 const P, // pressure, Pa
742 : Real64 const T // temperature, K
743 : );
744 :
745 : int CFSNGlz(CFSTY const &FS); // CFS
746 :
747 : int CFSHasControlledShade(EnergyPlusData &state, CFSTY const &FS);
748 :
749 : void CheckAndFixCFSLayer(EnergyPlusData &state, CFSLAYER &Layer);
750 :
751 : void FillDefaultsSWP(EnergyPlusData &state,
752 : CFSLAYER const &L, // CFSLayer (input properties must be set)
753 : CFSSWP &SWP // properties to fill
754 : );
755 :
756 : void FinalizeCFS(EnergyPlusData &state, CFSTY &FS);
757 :
758 : Real64 EffectiveEPSLF(CFSTY const &FS); // Complex Fenestration
759 :
760 : Real64 EffectiveEPSLB(CFSTY const &FS); // Complex Fenestration
761 :
762 : bool FEQX(Real64 const a, // values to compare, fractional tolerance
763 : Real64 const b,
764 : Real64 const tolF,
765 : const Real64 tolAbs = 1.0e-10 // absolute tolerance
766 : );
767 :
768 : Real64 TRadC(Real64 const J, // radiosity, W/m2
769 : Real64 const Emiss // surface emissivity
770 : );
771 :
772 : void CalcEQLOpticalProperty(EnergyPlusData &state,
773 : int const SurfNum,
774 : SolarArrays const BeamDIffFlag, // identifier index of diffuse and beam SW radiation
775 : Array2A<Real64> CFSAbs // absorbed beam solar radiation by layers fraction
776 : );
777 :
778 : void CalcEQLWindowStandardRatings(EnergyPlusData &state, int const ConstrNum); // construction index
779 :
780 : Real64 EQLWindowInsideEffectiveEmiss(EnergyPlusData &state, int const ConstrNum);
781 :
782 : Real64 EQLWindowOutsideEffectiveEmiss(EnergyPlusData &state, int const ConstrNum);
783 :
784 : Real64 HCInWindowStandardRatings(EnergyPlusData &state,
785 : Real64 const Height, // Window height, 1.0 m
786 : Real64 const TSurfIn, // Inside surface temperature
787 : Real64 const TAirIn // Zone Air Temperature
788 : );
789 :
790 : } // namespace WindowEquivalentLayer
791 :
792 : struct WindowEquivalentLayerData : BaseGlobalStruct
793 : {
794 :
795 : // Data
796 : Real64 const RadiansToDeg; // Conversion for Radians to Degrees: Not using Constant::Pi() to avoid initialization order bug
797 : Real64 const PAtmSeaLevel; // Standard atmospheric pressure at sea level (Pa)
798 : int const hipRHO; // return reflectance
799 : int const hipTAU; // return transmittance
800 : Real64 const SMALL_ERROR; // small number
801 : // CFSGAP: space between layers (gap types)
802 : int const gtySEALED; // sealed
803 : int const gtyOPENin; // open to indoor air (re Open Channel Flow (OCF))
804 : int const gtyOPENout; // open to outdoor air (re Open Channel Flow (OCF))
805 : // shade control options
806 : int const lscNONE; // no control
807 : int const lscVBPROF; // VB slatA = ProfA (max gain)
808 : int const lscVBNOBM; // VB slatA just exclude beam
809 : // Constants
810 : int const hipRHO_BT0;
811 : int const hipTAU_BT0;
812 : int const hipTAU_BB0;
813 : int const hipDIM; // dimension of parameter array
814 :
815 : Array3D<Real64> CFSDiffAbsTrans;
816 : Array1D_bool EQLDiffPropFlag;
817 :
818 : Real64 X1MRDiff = -1.0;
819 : Real64 XTAUDiff = -1.0;
820 :
821 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
822 : {
823 796 : }
824 :
825 0 : void clear_state()
826 : {
827 0 : this->CFSDiffAbsTrans.deallocate();
828 0 : this->EQLDiffPropFlag.deallocate();
829 0 : this->X1MRDiff = -1.0;
830 0 : this->XTAUDiff = -1.0;
831 0 : }
832 : // Default Constructor
833 796 : WindowEquivalentLayerData()
834 1592 : : RadiansToDeg(180.0 / 3.141592653589793), PAtmSeaLevel(101325.0), hipRHO(1), hipTAU(2), SMALL_ERROR(0.000001), gtySEALED(1), gtyOPENin(2),
835 796 : gtyOPENout(3), lscNONE(0), lscVBPROF(1), lscVBNOBM(2), hipRHO_BT0(1), hipTAU_BT0(2), hipTAU_BB0(3), hipDIM(3)
836 : {
837 796 : }
838 : };
839 :
840 : } // namespace EnergyPlus
841 :
842 : #endif
|