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