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 DataWindowEquivalentLayer_hh_INCLUDED
49 : #define DataWindowEquivalentLayer_hh_INCLUDED
50 :
51 : // ObjexxFCL Headers
52 : #include <ObjexxFCL/Array1D.hh>
53 :
54 : // EnergyPlus Headers
55 : #include <EnergyPlus/Data/BaseData.hh>
56 : #include <EnergyPlus/DataGlobals.hh>
57 : #include <EnergyPlus/EnergyPlus.hh>
58 :
59 : namespace EnergyPlus {
60 :
61 : namespace DataWindowEquivalentLayer {
62 :
63 : // Using/Aliasing
64 :
65 : // Data
66 : // CFSTY: Complex Fenestration System
67 : int constexpr CFSMAXNL = 6; // max # of glaze or shade layers
68 : // Long-wave (aka LW or thermal) layer properties
69 : // Short wave (aka SW or solar) layer properties
70 : // "black" room (no reflection)
71 : // Layer information
72 :
73 : // Gap Gas Properties
74 : // Gap information
75 : // Equivalent Layer Window Constructon
76 : // CFSLAYER: layer types
77 : enum class LayerType
78 : {
79 : Invalid = -1,
80 : NONE, // unused / empty layer
81 : GLAZE, // glazing layer i.e, purely specular
82 : DRAPE, // pleated drapes/curtains
83 : ROLLB, // roller blind
84 : VBHOR, // venetian blinds - horizontal
85 : VBVER, // venetian blinds - vertical
86 : INSCRN, // insect screen
87 : ROOM, // indoor space and/or make no adjustment
88 : GZS, // glazing with spectral data (read from aux file)
89 : Num
90 : };
91 :
92 : // index for solar arrays
93 : enum class SolarArrays
94 : {
95 : Invalid = -1,
96 : DIFF,
97 : BEAM,
98 : Num
99 : };
100 :
101 : // Parameters to indicate blind orientation for use with the Material
102 : // derived type (see below):
103 : enum class Orientation
104 : {
105 : Invalid = -1,
106 : Horizontal,
107 : Vertical,
108 : Num
109 : };
110 :
111 : static constexpr std::array<std::string_view, (int)Orientation::Num> orientationNames = {"Horizontal", "Vertical"};
112 : static constexpr std::array<std::string_view, (int)Orientation::Num> orientationNamesUC = {"HORIZONTAL", "VERTICAL"};
113 :
114 : enum class AngleType
115 : {
116 : Invalid = -1,
117 : Fixed,
118 : Variable,
119 : Num
120 : };
121 :
122 : struct CFSLWP
123 : {
124 : // Members
125 : Real64 EPSLF; // thermal emittance, front (outside) side
126 : Real64 EPSLB; // thermal emittance, back (inside) side
127 : Real64 TAUL; // thermal transmittance (same value for front or back)
128 :
129 : // Default Constructor
130 142 : CFSLWP() : EPSLF(0.0), EPSLB(0.0), TAUL(0.0)
131 : {
132 142 : }
133 : };
134 :
135 : struct CFSSWP
136 : {
137 : // Members
138 : Real64 RHOSFBB; // Solar reflectance, BEAM-BEAM, front (outside) side (any angle of incidence)
139 : Real64 RHOSBBB; // Solar reflectance, BEAM-BEAM, back (inside) side (any angle of incidence)
140 : Real64 TAUSFBB; // Solar transmittance, BEAM-BEAM, any angle of incidence
141 : // radiation incident from front (outside)
142 : Real64 TAUSBBB; // Solar transmittance, BEAM-BEAM, any angle of incidence
143 : // radiation incident from back (inside)
144 : Real64 RHOSFBD; // Solar reflectance, BEAM-DIFFUSE, front (outside) side
145 : // BEAM-DIFFUSE, any angle of incidence
146 : Real64 RHOSBBD; // Solar reflectance, BEAM-DIFFUSE, back (inside) side
147 : // any angle of incidence
148 : Real64 TAUSFBD; // Solar transmittance, BEAM-DIFFUSE, front (outside) side
149 : // any angle of incidence
150 : Real64 TAUSBBD; // Solar transmittance, BEAM-DIFFUSE, any angle of incidence
151 : Real64 RHOSFDD; // Solar reflectance, DIFFUSE-DIFFUSE, front (outside) side
152 : Real64 RHOSBDD; // Solar reflectance, DIFFUSE-DIFFUSE, back (inside) side
153 : Real64 TAUS_DD; // Solar transmittance, DIFFUSE-DIFFUSE
154 : // (same value for radiation incident from front or back)
155 :
156 : // Default Constructor
157 11103 : CFSSWP()
158 11103 : : RHOSFBB(0.0), RHOSBBB(0.0), TAUSFBB(0.0), TAUSBBB(0.0), RHOSFBD(0.0), RHOSBBD(0.0), TAUSFBD(0.0), TAUSBBD(0.0), RHOSFDD(0.0),
159 11103 : RHOSBDD(0.0), TAUS_DD(0.0)
160 : {
161 11103 : }
162 : };
163 :
164 : struct CFSLAYER
165 : {
166 : // Members
167 : std::string Name; // ID of layer
168 : LayerType LTYPE; // layer type (see ltyXXX above)
169 : int iGZS; // re spectral glazing
170 : // = GZSTbl idx of LTYPE=ltyGZS (spectral glazing)
171 : // else 0
172 : // material properties
173 : // ltyGLAZE, ltyROLLB: as measured
174 : CFSSWP SWP_MAT; // ltyGZS: derived from GSZ file data
175 : CFSLWP LWP_MAT; // ltyVBxxx = slat properties (diffuse only)
176 : // short wave (solar)
177 : // long wave (thermal)
178 : // equivalent layer properties (see FinalizeCFSLAYER())
179 : // = diff + direct-normal properties for pseudo flat layer
180 : CFSSWP SWP_EL; // ltyGLAZE, ltyGZS, ltyROLLB: same as _MAT
181 : CFSLWP LWP_EL; // ltyVBxxx: see VB_xxx()
182 : // short wave (solar)
183 : // long wave (thermal)
184 : // Shade Geometry (Slat, Drape, Insect Screen)
185 : Real64 S; // spacing
186 : // VB: slat spacing, m, >0
187 : // PD: rectangular pleat spacing, m >0
188 : // IS: wire center-to-center spacing (pitch), m, >0
189 : // else unused
190 : Real64 W; // width
191 : // VB: slat tip-to-tip (chord width), m, >0
192 : // if crown > 0, W < slat flattened width
193 : // PD: pleat depth, m >= 0
194 : // IS: wire diameter, m, >0, <S
195 : Real64 C; // crown
196 : // VB: slat crown, m >=0 if used
197 : // crown assume upward for ltyVBHOR else unused
198 : Real64 PHI_DEG; // Angle
199 : // VB: slat angle, degrees (-90 <= PHI_DEG <= 90)
200 : // ltyVBHOR: + = front-side slat tip below horizontal
201 : // ltyVBVER: + = front-side slat tip is counter-
202 : // clockwise from normal (viewed from above)
203 : // else unused
204 : // shade control method
205 : int CNTRL; // VB: lscNONE: PHI_DEG not changed
206 : // lscVBPROF: PHI_DEG = profile angle (max gain)
207 : // lscVBNOBM: exclude beam (max visibility w/o beam)
208 : // PHI_DEG altered to just exclude beam
209 : // PHI_DEG = 20 if diffuse only
210 :
211 : // Default Constructor
212 71 : CFSLAYER() : LTYPE(LayerType::Invalid), iGZS(0), S(0.0), W(0.0), C(0.0), PHI_DEG(0.0), CNTRL(0)
213 : {
214 71 : }
215 : };
216 :
217 : struct CFSFILLGAS
218 : {
219 : // Members
220 : std::string Name; // Gas Type (AIR, ARGON, XENON, KRYPTON, CUSTOM)
221 : // Gas Conductivity: K = AK + BK*T + CK*T*T
222 : Real64 AK; // conductivity coeff constant term, (W/m-K)
223 : Real64 BK; // conductivity coeff of T term, (W/m-K2)
224 : Real64 CK; // conductivity coeff of T^2 term, (W/m-K^3)
225 : // Gas Specific heat: CP = ACP + BCP*T + CCP*T*T
226 : Real64 ACP; // specific heat constant term, (J/kg-K)
227 : Real64 BCP; // specific heat coeff of T term, (J/kg-K^2)
228 : Real64 CCP; // specific heat coeff of T^2 term, (J/kg-K^3)
229 : // Gas Viscosity: Visc = AVISC + BVISC*T + CVISC*T*T
230 : Real64 AVISC; // viscosity constant term, (N-sec/m2)
231 : Real64 BVISC; // viscosity coeff of T term, (N-sec/m2-K)
232 : Real64 CVISC; // viscosity coeff of T^2 term, (N-sec/m2-K^2)
233 : Real64 MHAT; // apparent molecular weight of gas
234 :
235 : // Default Constructor
236 35 : CFSFILLGAS() : AK(0.0), BK(0.0), CK(0.0), ACP(0.0), BCP(0.0), CCP(0.0), AVISC(0.0), BVISC(0.0), CVISC(0.0), MHAT(0.0)
237 : {
238 35 : }
239 : };
240 :
241 : struct CFSGAP
242 : {
243 : // Members
244 : std::string Name; // Gap layer name
245 : int GTYPE; // gap type (gtyXXX above)
246 : Real64 TAS; // actual surface-surface gap thickness, mm (always > 0)
247 : // VB: minimum tip-surface distance (slats normal to CFS plane)
248 : Real64 TAS_EFF; // effective gap thickness, mm (always > 0)
249 : // if either adjacent layer is VB adjusted
250 : // slat angle and convective behavior
251 : // else = TAS
252 : CFSFILLGAS FG; // fill gas properties (see above)
253 : Real64 RHOGAS; // fill gas density (kg/m3)
254 :
255 : // Default Constructor
256 35 : CFSGAP() : GTYPE(0), TAS(0.0), TAS_EFF(0.0), RHOGAS(0.0)
257 : {
258 35 : }
259 : };
260 :
261 : struct CFSTY
262 : {
263 : // Members
264 : std::string Name; // ID (Fenestration Name)
265 : int NL; // number of layers
266 : Array1D<CFSLAYER> L; // layer array, L(1) is outside layer
267 : Array1D<CFSGAP> G; // gap array, G(1) is outside-most, betw L(1) and L(2)
268 : bool ISControlled; // CFS is not controlled, or has no controlled VB layer
269 : int VBLayerPtr; // Venetian blind layer pointer
270 : int WEQLSolverErrorIndex; // recurring error index
271 :
272 : // Default Constructor
273 7 : CFSTY() : NL(0), L(CFSMAXNL), G(CFSMAXNL - 1), ISControlled(false), VBLayerPtr(0), WEQLSolverErrorIndex(0)
274 : {
275 7 : }
276 : };
277 :
278 : } // namespace DataWindowEquivalentLayer
279 :
280 : struct WindowEquivLayerData : BaseGlobalStruct
281 : {
282 :
283 : // Defined CFSLayers and CFSs
284 : int TotWinEquivLayerConstructs = 0; // Number of constructions with Window equivalent Layer
285 :
286 : DataWindowEquivalentLayer::CFSSWP
287 : SWP_ROOMBLK; // Solar reflectance, BEAM-BEAM, front | Solar reflectance, BEAM-BEAM, back | Solar transmittance, BEAM-BEAM, front | Solar
288 : // transmittance, BEAM-BEAM, back | Solar reflectance, BEAM-DIFFUSE, front | Solar reflectance, BEAM-DIFFUSE, back | Solar
289 : // transmittance, BEAM-DIFFUSE, front | Solar transmittance, BEAM-DIFFUSE, back | Solar reflectance, DIFFUSE-DIFFUSE, front |
290 : // Solar reflectance, DIFFUSE-DIFFUSE, back | Solar transmittance, DIFFUSE-DIFFUSE
291 : Array1D<DataWindowEquivalentLayer::CFSLAYER> CFSLayers;
292 : Array1D<DataWindowEquivalentLayer::CFSTY> CFS;
293 : Array1D<DataWindowEquivalentLayer::CFSGAP> CFSGaps;
294 :
295 2126 : void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
296 : {
297 2126 : }
298 :
299 1152 : void init_state([[maybe_unused]] EnergyPlusData &state) override
300 : {
301 1152 : }
302 :
303 2100 : void clear_state() override
304 : {
305 2100 : this->TotWinEquivLayerConstructs = 0;
306 2100 : this->SWP_ROOMBLK = {};
307 2100 : this->CFSLayers.clear();
308 2100 : this->CFS.clear();
309 2100 : this->CFSGaps.clear();
310 2100 : }
311 : };
312 :
313 : } // namespace EnergyPlus
314 :
315 : #endif
|