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 DataSurfaces_hh_INCLUDED
49 : #define DataSurfaces_hh_INCLUDED
50 :
51 : // C++ Headers
52 : #include <cstddef>
53 : #include <unordered_map>
54 : #include <vector>
55 :
56 : // ObjexxFCL Headers
57 : #include <ObjexxFCL/Array1D.hh>
58 : #include <ObjexxFCL/Array2D.hh>
59 : #include <ObjexxFCL/Vector4.hh>
60 :
61 : // EnergyPlus Headers
62 : #include <EnergyPlus/ConvectionConstants.hh>
63 : #include <EnergyPlus/Data/BaseData.hh>
64 : #include <EnergyPlus/DataBSDFWindow.hh>
65 : #include <EnergyPlus/DataGlobals.hh>
66 : #include <EnergyPlus/DataVectorTypes.hh>
67 : #include <EnergyPlus/DataWindowEquivalentLayer.hh>
68 : #include <EnergyPlus/EnergyPlus.hh>
69 : #include <EnergyPlus/Material.hh>
70 : #include <EnergyPlus/Shape.hh>
71 :
72 : namespace EnergyPlus {
73 :
74 : // Forward declarations
75 : struct EnergyPlusData;
76 :
77 : namespace DataSurfaces {
78 :
79 : // Using/Aliasing
80 : using DataBSDFWindow::BSDFWindowDescript;
81 : using DataVectorTypes::Vector;
82 :
83 : // MODULE PARAMETER DEFINITIONS:
84 : constexpr int MaxPolyCoeff(6);
85 :
86 : // Not sure this is the right module for this stuff, may move it later
87 : enum class Compass4
88 : {
89 : Invalid = -1,
90 : North,
91 : East,
92 : South,
93 : West,
94 : Num
95 : };
96 :
97 : constexpr std::array<std::string_view, static_cast<int>(Compass4::Num)> compass4Names = {"North", "East", "South", "West"};
98 :
99 : constexpr std::array<Real64, static_cast<int>(Compass4::Num)> Compass4AzimuthLo = {315.0, 45.0, 135.0, 225.0};
100 : constexpr std::array<Real64, static_cast<int>(Compass4::Num)> Compass4AzimuthHi = {45.0, 135.0, 225.0, 315.0};
101 :
102 : Compass4 AzimuthToCompass4(Real64 azimuth);
103 :
104 : enum class Compass8
105 : {
106 : Invalid = -1,
107 : North,
108 : NorthEast,
109 : East,
110 : SouthEast,
111 : South,
112 : SouthWest,
113 : West,
114 : NorthWest,
115 : Num
116 : };
117 :
118 : constexpr std::array<std::string_view, static_cast<int>(Compass8::Num)> compass8Names = {
119 : "North", "Northeast", "East", "Southeast", "South", "Southwest", "West", "Northwest"};
120 :
121 : // There is a bug here, the azimuth that divides West from
122 : // NorthWest is 292.5 not 287.5. Keeping it like this temporarily
123 : // to minimize diffs.
124 : constexpr std::array<Real64, static_cast<int>(Compass8::Num)> Compass8AzimuthLo = {337.5, 22.5, 67.5, 112.5, 157.5, 202.5, 247.5, 292.5};
125 : constexpr std::array<Real64, static_cast<int>(Compass8::Num)> Compass8AzimuthHi = {22.5, 67.5, 112.5, 157.5, 202.5, 247.5, 292.5, 337.5};
126 :
127 : Compass8 AzimuthToCompass8(Real64 azimuth);
128 :
129 : // Parameters to indicate surface shape for use with the Surface
130 : // derived type (see below):
131 : enum class SurfaceShape : int
132 : {
133 : // TODO: enum check
134 : Invalid = -1,
135 : None,
136 : Triangle,
137 : Quadrilateral,
138 : Rectangle,
139 : RectangularDoorWindow,
140 : RectangularOverhang,
141 : RectangularLeftFin,
142 : RectangularRightFin,
143 : TriangularWindow,
144 : TriangularDoor,
145 : Polygonal,
146 : Num
147 : };
148 :
149 : enum class SurfaceClass : int
150 : {
151 : Invalid = -1, // If any addition classes get added to this list, add appropriate data
152 : None, // to ComputeNominalUwithConvCoeffs in DataHeatBalance.cc and make sure
153 : Wall, // that the data aligns with any revision to this enum.
154 : Floor,
155 : Roof,
156 : IntMass,
157 : Detached_B,
158 : Detached_F,
159 : Window,
160 : GlassDoor,
161 : Door,
162 : Shading,
163 : Overhang,
164 : Fin,
165 : TDD_Dome,
166 : TDD_Diffuser,
167 : Num // The counter representing the total number of surface class, always stays at the bottom
168 : };
169 :
170 : // A coarse grain version of SurfaceClass
171 : enum class FWC
172 : {
173 : Invalid = -1,
174 : Floor,
175 : Wall,
176 : Ceiling,
177 : Num
178 : };
179 :
180 : int constexpr iFWC_Floor = (int)FWC::Floor;
181 : int constexpr iFWC_Wall = (int)FWC::Wall;
182 : int constexpr iFWC_Ceiling = (int)FWC::Ceiling;
183 :
184 : enum class SurfaceFilter
185 : {
186 : Invalid = -1,
187 : AllExteriorSurfaces,
188 : AllExteriorWindows,
189 : AllExteriorWalls,
190 : AllExteriorRoofs,
191 : AllExteriorFloors,
192 : AllInteriorSurfaces,
193 : AllInteriorWindows,
194 : AllInteriorWalls,
195 : AllInteriorRoofs,
196 : AllInteriorCeilings,
197 : AllInteriorFloors,
198 : Num
199 : };
200 :
201 : constexpr std::array<std::string_view, static_cast<int>(SurfaceFilter::Num)> SurfaceFilterNamesUC = {"ALLEXTERIORSURFACES",
202 : "ALLEXTERIORWINDOWS",
203 : "ALLEXTERIORWALLS",
204 : "ALLEXTERIORROOFS",
205 : "ALLEXTERIORFLOORS",
206 : "ALLINTERIORSURFACES",
207 : "ALLINTERIORWINDOWS",
208 : "ALLINTERIORWALLS",
209 : "ALLINTERIORROOFS",
210 : "ALLINTERIORCEILINGS",
211 : "ALLINTERIORFLOORS"};
212 :
213 : enum class WinCover
214 : {
215 : Invalid = -1,
216 : Bare,
217 : Shaded,
218 : Num
219 : };
220 :
221 : constexpr int iWinCover_Bare = (int)WinCover::Bare;
222 : constexpr int iWinCover_Shaded = (int)WinCover::Shaded;
223 :
224 : enum class WinShadingType
225 : {
226 : Invalid = -1,
227 : NoShade,
228 : ShadeOff,
229 : IntShade,
230 : SwitchableGlazing,
231 : ExtShade,
232 : ExtScreen,
233 : IntBlind,
234 : ExtBlind,
235 : BGShade,
236 : BGBlind,
237 : IntShadeConditionallyOff,
238 : GlassConditionallyLightened,
239 : ExtShadeConditionallyOff,
240 : IntBlindConditionallyOff,
241 : ExtBlindConditionallyOff,
242 : BGShadeConditionallyOff,
243 : BGBlindConditionallyOff,
244 : Num
245 : }; // Valid window shading types: IntShade <= Type <= BGBlind; the rest are shading status
246 :
247 : enum class WindowShadingControlType
248 : {
249 : Invalid = -1,
250 : AlwaysOn, // "ALWAYSON",
251 : AlwaysOff, // "ALWAYSOFF",
252 : OnIfScheduled, // "ONIFSCHEDULEALLOWS",
253 : HiSolar, // "ONIFHIGHSOLARONWINDOW",
254 : HiHorzSolar, // "ONIFHIGHHORIZONTALSOLAR",
255 : HiOutAirTemp, // "ONIFHIGHOUTDOORAIRTEMPERATURE",
256 : HiZoneAirTemp, // "ONIFHIGHZONEAIRTEMPERATURE",
257 : HiZoneCooling, // "ONIFHIGHZONECOOLING",
258 : HiGlare, // "ONIFHIGHGLARE",
259 : MeetDaylIlumSetp, // "MEETDAYLIGHTILLUMINANCESETPOINT",
260 : OnNightLoOutTemp_OffDay, // "ONNIGHTIFLOWOUTDOORTEMPANDOFFDAY",
261 : OnNightLoInTemp_OffDay, // "ONNIGHTIFLOWINSIDETEMPANDOFFDAY",
262 : OnNightIfHeating_OffDay, // "ONNIGHTIFHEATINGANDOFFDAY",
263 : OnNightLoOutTemp_OnDayCooling, // "ONNIGHTIFLOWOUTDOORTEMPANDONDAYIFCOOLING",
264 : OnNightIfHeating_OnDayCooling, // "ONNIGHTIFHEATINGANDONDAYIFCOOLING",
265 : OffNight_OnDay_HiSolarWindow, // "OFFNIGHTANDONDAYIFCOOLINGANDHIGHSOLARONWINDOW",
266 : OnNight_OnDay_HiSolarWindow, // "ONNIGHTANDONDAYIFCOOLINGANDHIGHSOLARONWINDOW",
267 : OnHiOutTemp_HiSolarWindow, // "ONIFHIGHOUTDOORAIRTEMPANDHIGHSOLARONWINDOW",
268 : OnHiOutTemp_HiHorzSolar, // "ONIFHIGHOUTDOORAIRTEMPANDHIGHHORIZONTALSOLAR",
269 : OnHiZoneTemp_HiSolarWindow, // "ONIFHIGHZONEAIRTEMPANDHIGHSOLARONWINDOW",
270 : OnHiZoneTemp_HiHorzSolar, // "ONIFHIGHZONEAIRTEMPANDHIGHHORIZONTALSOLAR",
271 : HiSolar_HiLumin_OffMidNight, // "ONIFHIGHSOLARANDHIGHLUMINOFFMIDNIGHT",
272 : HiSolar_HiLumin_OffSunset, // "ONIFHIGHSOLARANDHIGHLUMINOFFSUNSET",
273 : HiSolar_HiLumin_OffNextMorning, // "ONIFHIGHSOLARANDHIGHLUMINOFFNEXTMORNING"};
274 : Num
275 : };
276 :
277 : enum RefAirTemp // Parameters to indicate reference air temperatures for inside surface temperature calculations
278 : {
279 : Invalid = -1,
280 : ZoneMeanAirTemp, // mean air temperature of the zone => MAT
281 : AdjacentAirTemp, // air temperature adjacent to surface => TempEffBulkAir
282 : ZoneSupplyAirTemp, // supply air temperature of the zone
283 : Num
284 : };
285 :
286 : constexpr std::array<int, static_cast<int>(DataSurfaces::RefAirTemp::Num)> SurfTAirRefReportVals = {1, 2, 3};
287 :
288 : // Parameters to indicate exterior boundary conditions for use with
289 : // the Surface derived type (see below):
290 : // Note: Positive values correspond to an interzone adjacent surface
291 : constexpr int ExternalEnvironment(0);
292 : constexpr int Ground(-1);
293 : constexpr int OtherSideCoefNoCalcExt(-2);
294 : constexpr int OtherSideCoefCalcExt(-3);
295 : constexpr int OtherSideCondModeledExt(-4);
296 : constexpr int GroundFCfactorMethod(-5);
297 : constexpr int KivaFoundation(-6);
298 :
299 : extern Array1D_string const cExtBoundCondition;
300 :
301 : // Parameters to indicate the first "corner" of a surface
302 : // Currently, these are used only during input of surfaces
303 : // They are here in order to facilitate later use in shading setup/calculations.
304 : constexpr int UpperLeftCorner(1);
305 : constexpr int LowerLeftCorner(2);
306 : constexpr int LowerRightCorner(3);
307 : constexpr int UpperRightCorner(4);
308 :
309 : constexpr int AltAngStepsForSolReflCalc(10); // Number of steps in altitude angle for solar reflection calc
310 : constexpr int AzimAngStepsForSolReflCalc(9); // Number of steps in azimuth angle of solar reflection calc
311 :
312 : // Parameters to indicate surface classes
313 : // Surface Class (FLOOR, WALL, ROOF (incl's CEILING), WINDOW, DOOR, GLASSDOOR,
314 : // SHADING (includes OVERHANG, WING), DETACHED, INTMASS),
315 : // TDD:DOME, TDD:DIFFUSER (for tubular daylighting device)
316 : // (Note: GLASSDOOR and TDD:DIFFUSER get overwritten as WINDOW
317 : // in SurfaceGeometry.cc, SurfaceWindow%OriginalClass holds the true value)
318 : // why aren't these sequential
319 :
320 : enum class HeatTransferModel
321 : {
322 : Invalid = -1,
323 : None, // shading surfaces
324 : CTF,
325 : EMPD,
326 : CondFD,
327 : HAMT,
328 : Window5, // original detailed layer-by-layer based on window 4 and window 5
329 : ComplexFenestration, // BSDF
330 : TDD, // tubular daylighting device
331 : Kiva, // Kiva ground calculations
332 : AirBoundaryNoHT, // Construction:AirBoundary - not IRT or interior window
333 : Num // count, always the final element
334 : };
335 :
336 : constexpr std::array<std::string_view, static_cast<int>(DataSurfaces::HeatTransferModel::Num)> HeatTransAlgoStrs = {
337 : "None",
338 : "CTF - ConductionTransferFunction",
339 : "EMPD - MoisturePenetrationDepthConductionTransferFunction",
340 : "CondFD - ConductionFiniteDifference",
341 : "HAMT - CombinedHeatAndMoistureFiniteElement",
342 : "Window5 Detailed Fenestration",
343 : "Window7 Complex Fenestration",
344 : "Tubular Daylighting Device",
345 : "KivaFoundation - TwoDimensionalFiniteDifference",
346 : "Air Boundary - No Heat Transfer"};
347 :
348 : // Daylighting illuminance components
349 : enum class Lum
350 : {
351 : Invalid = -1,
352 : Illum,
353 : Back,
354 : Source,
355 : Num
356 : };
357 :
358 : // Trying out this new pattern to make code look less gnarly
359 : constexpr int iLum_Illum = (int)Lum::Illum;
360 : constexpr int iLum_Back = (int)Lum::Back;
361 : constexpr int iLum_Source = (int)Lum::Source;
362 :
363 : // IS_SHADED is the flag to indicate window has no shading device or shading device is off, and no daylight glare control
364 : // original expression: SHADE_FLAG == ShadeOff || SHADE_FLAG == ShadeOff
365 211801559 : constexpr bool NOT_SHADED(WinShadingType const ShadingFlag)
366 : {
367 211801559 : return (ShadingFlag == WinShadingType::NoShade || ShadingFlag == WinShadingType::ShadeOff);
368 : }
369 :
370 : // IS_SHADED is the flag to indicate window has shade on or temporarily off but may be triggered on later to control daylight glare
371 : // original expression: SHADE_FLAG > ShadeOff
372 39140526 : constexpr bool IS_SHADED(WinShadingType const ShadingFlag)
373 : {
374 39140526 : return !NOT_SHADED(ShadingFlag);
375 : }
376 :
377 : // IS_SHADED_NO_GLARE is the flag to indicate window has shade and no daylight glare control
378 : // original expression: IntShade <= SHADE_FLAG <= BGBlind
379 23134110 : constexpr bool IS_SHADED_NO_GLARE_CTRL(WinShadingType const ShadingFlag)
380 : {
381 23058290 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::SwitchableGlazing ||
382 22478600 : ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::ExtScreen || ShadingFlag == WinShadingType::IntBlind ||
383 46192400 : ShadingFlag == WinShadingType::ExtBlind || ShadingFlag == WinShadingType::BGShade || ShadingFlag == WinShadingType::BGBlind);
384 : }
385 :
386 : // ANY_SHADE: if SHADE_FLAG is any of the shading types including interior, exterior or between glass shades
387 28331093 : constexpr bool ANY_SHADE(WinShadingType const ShadingFlag)
388 : {
389 28331093 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::BGShade);
390 : }
391 :
392 102343965 : constexpr bool ANY_SHADE_SCREEN(WinShadingType const ShadingFlag)
393 : {
394 102343965 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::BGShade ||
395 102343965 : ShadingFlag == WinShadingType::ExtScreen);
396 : }
397 :
398 169709852 : constexpr bool ANY_BLIND(WinShadingType const ShadingFlag)
399 : {
400 169709852 : return (ShadingFlag == WinShadingType::IntBlind || ShadingFlag == WinShadingType::ExtBlind || ShadingFlag == WinShadingType::BGBlind);
401 : }
402 :
403 573727635 : constexpr bool ANY_INTERIOR_SHADE_BLIND(WinShadingType const ShadingFlag)
404 : {
405 573727635 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::IntBlind);
406 : }
407 :
408 186027815 : constexpr bool ANY_EXTERIOR_SHADE_BLIND_SCREEN(WinShadingType const ShadingFlag)
409 : {
410 186027815 : return (ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::ExtBlind || ShadingFlag == WinShadingType::ExtScreen);
411 : }
412 :
413 164684961 : constexpr bool ANY_BETWEENGLASS_SHADE_BLIND(WinShadingType const ShadingFlag)
414 : {
415 164684961 : return (ShadingFlag == WinShadingType::BGShade || ShadingFlag == WinShadingType::BGBlind);
416 : }
417 :
418 : // WindowShadingControl Slat Angle Control for Blinds
419 : enum class SlatAngleControl
420 : {
421 : Invalid = -1,
422 : Fixed,
423 : Scheduled,
424 : BlockBeamSolar,
425 : Num
426 : };
427 :
428 : // Parameters for air flow window source
429 : enum class WindowAirFlowSource
430 : {
431 : Invalid = -1,
432 : Indoor,
433 : Outdoor,
434 : Num
435 : };
436 :
437 : // Parameters for air flow window destination
438 : enum class WindowAirFlowDestination
439 : {
440 : Invalid = -1,
441 : Indoor,
442 : Outdoor,
443 : Return,
444 : Num
445 : };
446 :
447 : // Parameters for air flow window control
448 : enum class WindowAirFlowControlType
449 : {
450 : Invalid = -1,
451 : MaxFlow,
452 : AlwaysOff,
453 : Schedule,
454 : Num
455 : };
456 :
457 : // Parameters for window model selection
458 : enum class WindowModel
459 : {
460 : Invalid = -1,
461 : Detailed, // indicates original winkelmann window 5 implementation
462 : BSDF, // indicates complex fenestration window 6 implementation
463 : EQL, // indicates equivalent layer window model implementation
464 : Num
465 : };
466 :
467 : // Parameters for PierceSurface
468 : constexpr std::size_t nVerticesBig(20); // Number of convex surface vertices at which to switch to PierceSurface O( log N ) method
469 :
470 : // Y Slab for Surface2D for PierceSurface support of Nonconvex and Many-Vertex Surfaces
471 : struct Surface2DSlab
472 : {
473 :
474 : public: // Types
475 : using Vertex = ObjexxFCL::Vector2<Real64>;
476 : using Vertices = ObjexxFCL::Array1D<Vertex>;
477 : using Edge = Vertices::size_type; // The Surface2D vertex and edge index
478 : using EdgeXY = Real64; // The edge x/y inverse slope
479 : using Edges = std::vector<Edge>;
480 : using EdgesXY = std::vector<EdgeXY>;
481 :
482 : public: // Creation
483 : // Constructor
484 687 : Surface2DSlab(Real64 const yl, Real64 const yu) : xl(0.0), xu(0.0), yl(yl), yu(yu)
485 : {
486 687 : }
487 :
488 : public: // Data
489 : Real64 xl, xu; // Lower and upper x coordinates of slab bounding box
490 : Real64 yl, yu; // Lower and upper y coordinates of slab
491 : Edges edges; // Left-to-right ordered edges crossing the slab
492 : EdgesXY edgesXY; // Edge x/y inverse slopes
493 :
494 : }; // Surface2DSlab
495 :
496 : // Projected 2D Surface Representation for Fast Computational Geometry Operations
497 : struct Surface2D
498 : {
499 :
500 : public: // Types
501 : using Vector2D = Vector2<Real64>;
502 : using Edge = Vector2D;
503 : using Vertices = Array1D<Vector2D>;
504 : using Vectors = Array1D<Vector2D>;
505 : using Edges = Vectors;
506 : using Slab = Surface2DSlab;
507 : using Slabs = std::vector<Surface2DSlab>;
508 : using SlabYs = std::vector<Real64>;
509 : using size_type = Vertices::size_type;
510 :
511 : public: // Creation
512 : // Default constructor
513 47667 : Surface2D()
514 47667 : {
515 47667 : }
516 :
517 : // Constructor
518 : Surface2D(ShapeCat const shapeCat, int const axis, Vertices const &v, Vector2D const &vl, Vector2D const &vu);
519 :
520 : public: // Predicates
521 : // Bounding box contains a point?
522 : bool bb_contains(Vector2D const &v) const
523 : {
524 : return (vl.x <= v.x) && (v.x <= vu.x) && (vl.y <= v.y) && (v.y <= vu.y);
525 : }
526 :
527 : public: // Comparison
528 : // Equality
529 : friend bool operator==(Surface2D const &a, Surface2D const &b)
530 : {
531 : auto const &v1 = a.vertices;
532 : auto const &v2 = b.vertices;
533 : return eq(v1, v2);
534 : }
535 :
536 : // Inequality
537 : friend bool operator!=(Surface2D const &a, Surface2D const &b)
538 : {
539 : return !(a == b);
540 : }
541 :
542 : public: // Data
543 : int axis = 0; // Axis of projection (0=x, 1=y, 2=z)
544 : Vertices vertices; // Vertices
545 : Vector2D vl = Vector2D(0.0), vu = Vector2D(0.0); // Bounding box lower and upper corner vertices
546 : Vectors edges; // Edge vectors around the vertices
547 : Real64 s1 = 0.0, s3 = 0.0; // Rectangle side widths squared
548 : SlabYs slabYs; // Y coordinates of slabs
549 : Slabs slabs; // Y slice slabs for fast nonconvex and many vertex intersections
550 :
551 : }; // Surface2D
552 :
553 : struct SurfaceCalcHashKey
554 : {
555 : // Values that must be the same in order for surfaces to use a representative calculation
556 :
557 : int Construction = 0; // Pointer to the construction in the Construct derived type
558 : Real64 Azimuth = 0.0; // Direction the surface outward normal faces (degrees) or FACING
559 : Real64 Tilt = 0.0; // Angle (deg) between the ground outward normal and the surface outward normal
560 : Real64 Height = 0.0; // Height of the surface (m)
561 : int Zone = 0; // Interior environment or zone the surface is a part of
562 : int EnclIndex = 0; // Pointer to enclosure this surface belongs to
563 : int TAirRef = 0; // Flag for reference air temperature
564 : int ExtZone = 0; // For an "interzone" surface, this is the adjacent ZONE number (not adjacent SURFACE number).
565 : int ExtCond = 0; // Exterior condition type. Same as ExtBoundCond for non-interzone surfaces. Value = 1 for interzone surfaces.
566 : int ExtEnclIndex = 0; // For an "interzone" surface, this is the adjacent ENCLOSURE number
567 : bool ExtSolar = false; // True if the "outside" of the surface is exposed to solar
568 : bool ExtWind = false; // True if the "outside" of the surface is exposed to wind
569 : Real64 ViewFactorGround = 0.0; // View factor to the ground from the exterior of the surface for diffuse solar radiation
570 : Real64 ViewFactorSky = 0.0; // View factor to the sky from the exterior of the surface for diffuse solar radiation
571 : Real64 ViewFactorSrdSurfs = 0.0; // View factor to the surrounding surfaces seen from the exterior of the surface
572 :
573 : // Special Properties
574 : HeatTransferModel HeatTransferAlgorithm = HeatTransferModel::CTF; // used for surface-specific heat transfer algorithm.
575 : Convect::HcInt intConvModel = Convect::HcInt::Invalid; // Interior convection algorithm
576 : int intConvUserModelNum = 0; // Interior convection user coefficient index
577 : Convect::HcExt extConvModel = Convect::HcExt::Invalid; // Exterior convection algorithm
578 : int extConvUserModelNum = 0; // Exterior convection user coefficient index
579 : int OSCPtr = 0; // Pointer to OSC data structure
580 : int OSCMPtr = 0; // "Pointer" to OSCM data structure (other side conditions from a model)
581 :
582 : // Windows
583 : int FrameDivider = 0; // Pointer to frame and divider information (windows only)
584 : int SurfWinStormWinConstr = 0; // Construction with storm window (windows only)
585 : // Airflow control // Not supported
586 : // Shading Control // Not supported
587 :
588 : // Other special boundary conditions
589 : // SolarIncidentInside // Not supported
590 : int MaterialMovInsulExt = 0; // Pointer to the material used for exterior movable insulation
591 : int MaterialMovInsulInt = 0; // Pointer to the material used for interior movable insulation
592 : int SchedMovInsulExt = 0; // Schedule for exterior movable insulation
593 : int SchedMovInsulInt = 0; // Schedule for interior movable insulation
594 : int ExternalShadingSchInd = 0; // Schedule for a the external shading
595 : int SurroundingSurfacesNum = 0; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces)
596 : int LinkedOutAirNode = 0; // Index of the an OutdoorAir:Node
597 : int OutsideHeatSourceTermSchedule = 0; // Pointer to the schedule of additional source of heat flux rate applied to the outside surface
598 : int InsideHeatSourceTermSchedule = 0; // Pointer to the schedule of additional source of heat flux rate applied to the inside surface
599 :
600 : // based on boost::hash_combine
601 18528 : std::size_t hash_combine(std::size_t current_hash, std::size_t new_hash) const
602 : {
603 18528 : current_hash ^= new_hash + 0x9e3779b9 + (current_hash << 6) + (current_hash >> 2);
604 18528 : return current_hash;
605 : }
606 :
607 579 : std::vector<std::size_t> get_hash_list() const
608 : {
609 : using std::hash;
610 :
611 579 : return {hash<int>()(Construction),
612 0 : hash<Real64>()(Azimuth),
613 0 : hash<Real64>()(Tilt),
614 0 : hash<Real64>()(Height),
615 0 : hash<int>()(Zone),
616 0 : hash<int>()(EnclIndex),
617 0 : hash<int>()(TAirRef),
618 0 : hash<int>()(ExtZone),
619 0 : hash<int>()(ExtCond),
620 0 : hash<int>()(ExtEnclIndex),
621 0 : hash<bool>()(ExtSolar),
622 0 : hash<bool>()(ExtWind),
623 0 : hash<Real64>()(ViewFactorGround),
624 0 : hash<Real64>()(ViewFactorSky),
625 :
626 0 : hash<HeatTransferModel>()(HeatTransferAlgorithm),
627 0 : hash<Convect::HcInt>()(intConvModel),
628 0 : hash<Convect::HcExt>()(extConvModel),
629 0 : hash<int>()(intConvUserModelNum),
630 0 : hash<int>()(extConvUserModelNum),
631 0 : hash<int>()(OSCPtr),
632 0 : hash<int>()(OSCMPtr),
633 :
634 0 : hash<int>()(FrameDivider),
635 0 : hash<int>()(SurfWinStormWinConstr),
636 :
637 0 : hash<int>()(MaterialMovInsulExt),
638 0 : hash<int>()(MaterialMovInsulInt),
639 0 : hash<int>()(SchedMovInsulExt),
640 0 : hash<int>()(SchedMovInsulInt),
641 0 : hash<int>()(ExternalShadingSchInd),
642 0 : hash<int>()(SurroundingSurfacesNum),
643 0 : hash<int>()(LinkedOutAirNode),
644 0 : hash<int>()(OutsideHeatSourceTermSchedule),
645 579 : hash<int>()(InsideHeatSourceTermSchedule)};
646 : }
647 :
648 579 : std::size_t get_hash() const
649 : {
650 579 : auto hash_list = get_hash_list();
651 579 : std::size_t combined_hash = 0u;
652 19107 : for (auto hash : hash_list) {
653 18528 : combined_hash = hash_combine(combined_hash, hash);
654 579 : }
655 579 : return combined_hash;
656 579 : }
657 :
658 131 : bool operator==(const SurfaceCalcHashKey &other) const
659 : {
660 131 : return (Construction == other.Construction && Azimuth == other.Azimuth && Tilt == other.Tilt && Height == other.Height &&
661 131 : Zone == other.Zone && EnclIndex == other.EnclIndex && ExtZone == other.ExtZone && ExtCond == other.ExtCond &&
662 131 : ExtEnclIndex == other.ExtEnclIndex && ExtSolar == other.ExtSolar && ExtWind == other.ExtWind &&
663 131 : ViewFactorGround == other.ViewFactorGround && ViewFactorSky == other.ViewFactorSky &&
664 :
665 131 : HeatTransferAlgorithm == other.HeatTransferAlgorithm && intConvModel == other.intConvModel &&
666 131 : intConvUserModelNum == other.intConvUserModelNum && extConvUserModelNum == other.extConvUserModelNum &&
667 131 : extConvModel == other.extConvModel && OSCPtr == other.OSCPtr && OSCMPtr == other.OSCMPtr &&
668 :
669 131 : FrameDivider == other.FrameDivider && SurfWinStormWinConstr == other.SurfWinStormWinConstr &&
670 :
671 131 : MaterialMovInsulExt == other.MaterialMovInsulExt && MaterialMovInsulInt == other.MaterialMovInsulInt &&
672 131 : SchedMovInsulExt == other.SchedMovInsulExt && SchedMovInsulInt == other.SchedMovInsulInt &&
673 131 : ExternalShadingSchInd == other.ExternalShadingSchInd && SurroundingSurfacesNum == other.SurroundingSurfacesNum &&
674 393 : LinkedOutAirNode == other.LinkedOutAirNode && OutsideHeatSourceTermSchedule == other.OutsideHeatSourceTermSchedule &&
675 262 : InsideHeatSourceTermSchedule == other.InsideHeatSourceTermSchedule);
676 : }
677 : };
678 :
679 : struct SurfaceCalcHasher
680 : {
681 579 : std::size_t operator()(const SurfaceCalcHashKey &key) const
682 : {
683 579 : return key.get_hash();
684 : }
685 : };
686 :
687 : struct SurfaceData
688 : {
689 :
690 : // Types
691 : using Vertices = Array1D<Vector>;
692 : using Plane = Vector4<Real64>;
693 :
694 : // Members
695 : std::string Name; // User supplied name of the surface (must be unique)
696 : int Construction; // Pointer to the construction in the Construct derived type
697 :
698 : int RepresentativeCalcSurfNum; // Index of the surface that is used to calculate the heat balance for this surface. Equal to this surfaces
699 : // index when not using representative surface calculations.
700 :
701 : std::vector<int> ConstituentSurfaceNums; // A vector of surface numbers which reference this surface for representative calculations
702 : int ConstructionStoredInputValue; // holds the original value for Construction per surface input
703 : SurfaceClass Class;
704 : SurfaceClass OriginalClass;
705 :
706 : // Geometry related parameters
707 : SurfaceShape Shape; // Surface shape (Triangle=1,Quadrilateral=2,Rectangle=3,
708 : // Rectangular Window/Door=4,Rectangular Overhang=5,
709 : // Rectangular Left Fin=6,Rectangular Right Fin=7,
710 : // Triangular Window=8)
711 : int Sides; // Number of side/vertices for this surface (based on Shape)
712 : Real64 Area; // Surface area of the surface (less any subsurfaces) {m2}
713 : Real64 GrossArea; // Surface area of the surface (including subsurfaces) {m2}
714 : Real64 NetAreaShadowCalc; // Area of a wall/floor/ceiling less subsurfaces assuming all windows, if present, have unity multiplier.
715 : // Wall/floor/ceiling/roof areas that include windows include frame (unity) areas.
716 : // Areas of Windows including divider (unity) area.
717 : // These areas are used in shadowing / sunlit area calculations.
718 : Real64 Perimeter; // Perimeter length of the surface {m}
719 : Real64 Azimuth; // Direction the surface outward normal faces (degrees) or FACING
720 : Real64 Height; // Height of the surface (m)
721 : Real64 Reveal; // Depth of the window reveal (m) if this surface is a window
722 : Real64 Tilt; // Angle (deg) between the ground outward normal and the surface outward normal
723 : Real64 Width; // Width of the surface (m)
724 :
725 : // Precomputed parameters for PierceSurface performance
726 : ShapeCat shapeCat; // Shape category
727 : Plane plane; // Plane
728 : Surface2D surface2d; // 2D projected surface for efficient intersection testing
729 :
730 : // Vertices
731 : Array1D<Vector> NewVertex;
732 : Vertices Vertex; // Surface Vertices are represented by Number of Sides and Vector (type)
733 : Vector3<Real64> Centroid; // computed centroid (also known as center of mass or surface balance point)
734 : Vector3<Real64> lcsx;
735 : Vector3<Real64> lcsy;
736 : Vector3<Real64> lcsz;
737 : Vector3<Real64> NewellAreaVector;
738 : Vector3<Real64> NewellSurfaceNormalVector; // same as OutNormVec in vector notation
739 : Vector3<Real64> OutNormVec; // Direction cosines (outward normal vector) for surface
740 : Real64 SinAzim; // Sine of surface azimuth angle
741 : Real64 CosAzim; // Cosine of surface azimuth angle
742 : Real64 SinTilt; // Sine of surface tilt angle
743 : Real64 CosTilt; // Cosine of surface tilt angle
744 : bool IsConvex; // true if the surface is convex.
745 : bool IsDegenerate; // true if the surface is degenerate.
746 : bool VerticesProcessed; // true if vertices have been processed (only used for base surfaces)
747 : Real64 XShift; // relative coordinate shift data - used by child subsurfaces
748 : Real64 YShift; // relative coordinate shift data - used by child subsurfaces
749 :
750 : // Boundary conditions and interconnections
751 : bool HeatTransSurf; // True if surface is a heat transfer surface (light shelf can also be IsShadowing)
752 : int OutsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the outside surface
753 : int InsideHeatSourceTermSchedule; // Pointer to the schedule of additional source of heat flux rate applied to the inside surface
754 : // False if a (detached) shadowing (sub)surface
755 : HeatTransferModel HeatTransferAlgorithm; // used for surface-specific heat transfer algorithm.
756 : std::string BaseSurfName; // Name of BaseSurf
757 : int BaseSurf; // "Base surface" for this surface. Applies mainly to subsurfaces in which case it points back to the base surface number.
758 : // Equals 0 for detached shading. BaseSurf equals surface number for all other surfaces.
759 : int NumSubSurfaces; // Number of subsurfaces this surface has (doors/windows)
760 : std::string ZoneName; // User supplied name of the Zone
761 : int Zone; // Interior environment or zone the surface is a part of
762 : // Note that though attached shading surfaces are part of a zone, this
763 : // value is 0 there to facilitate using them as detached surfaces (more accurate shading.
764 : int spaceNum; // Space the surface is part of
765 : std::string ExtBoundCondName; // Name for the Outside Environment Object
766 : int ExtBoundCond; // For an "interzone" surface, this is the adjacent surface number.
767 : // for an internal/adiabatic surface this is the current surface number.
768 : // Otherwise, 0=external environment, -1=ground,
769 : // -2=other side coefficients (OSC--won't always use CTFs)
770 : // -3=other side conditions model
771 : // During input, interim values of UnreconciledZoneSurface ("Surface") and
772 : // UnenteredAdjacentZoneSurface ("Zone") are used until reconciled.
773 : bool ExtSolar; // True if the "outside" of the surface is exposed to solar
774 : bool ExtWind; // True if the "outside" of the surface is exposed to wind Heat transfer coefficients
775 : bool hasIncSolMultiplier; // Whether the surface has a incident solar multiplier
776 : Real64 IncSolMultiplier; // Incident solar multiplier, overwritten by user input in SurfaceProperty:IncidentSolarMultiplier
777 : Real64 ViewFactorGround; // View factor to the ground from the exterior of the surface for diffuse solar radiation
778 : Real64 ViewFactorSky; // View factor to the sky from the exterior of the surface for diffuse solar radiation
779 : Real64 ViewFactorGroundIR; // View factor to the ground and shadowing surfaces from the exterior of the surface for IR radiation
780 : Real64 ViewFactorSkyIR; // View factor to the sky from the exterior of the surface for IR radiation Special/optional other side coefficients
781 : // (OSC)
782 : int OSCPtr; // Pointer to OSC data structure
783 : int OSCMPtr; // "Pointer" to OSCM data structure (other side conditions from a model)
784 : bool MirroredSurf; // True if it is a mirrored surface
785 : bool IsShadowing; // True if a surface is a shadowing surface (light shelf can also be HeatTransSurf)
786 : bool IsShadowPossibleObstruction; // True if a surface can be an exterior obstruction
787 :
788 : // Optional parameters specific to shadowing surfaces and subsurfaces (detached shading, overhangs, wings, etc.)
789 : int SchedShadowSurfIndex; // Schedule for a shadowing (sub)surface
790 : bool IsTransparent; // True if the schedule values are always 1.0 (or the minimum is 1.0)
791 : Real64 SchedMinValue; // Schedule minimum value.
792 :
793 : // Window Parameters (when surface is Window)
794 : int activeWindowShadingControl; // Active window shading control (windows only)
795 : std::vector<int> windowShadingControlList; // List of possible window shading controls
796 : bool HasShadeControl; // True if the surface is listed in a WindowShadingControl object
797 : int activeShadedConstruction; // The currently active shaded construction (windows only)
798 : int activeShadedConstructionPrev; // The currently active shaded construction (windows only)
799 : std::vector<int> shadedConstructionList; // List of shaded constructions that correspond with window shading controls (windows only - same
800 : // indexes as windowShadingControlList)
801 : std::vector<int> shadedStormWinConstructionList; // List of shaded constructions with storm window that correspond with window shading
802 : // controls (windows only - same indexes as windowShadingControlList)
803 : int FrameDivider; // Pointer to frame and divider information (windows only)
804 : Real64 Multiplier; // Multiplies glazed area, frame area and divider area (windows only)
805 :
806 : // Air boundaries and spaces
807 : int RadEnclIndex = 0; // Pointer to raidant enclosure this surface belongs to
808 : int SolarEnclIndex; // Pointer to solar enclosure this surface belongs to
809 : int SolarEnclSurfIndex; // Pointer to solar enclosure surface data, EnclSolInfo(n).SurfacePtr(SolarEnclSurfIndex) points to this surface
810 : bool IsAirBoundarySurf; // True if surface is an air boundary surface (Construction:AirBoundary)
811 :
812 : Convect::SurfOrientation convOrientation = Convect::SurfOrientation::Invalid; // Surface orientation for convection calculations
813 :
814 : SurfaceCalcHashKey calcHashKey; // Hash key used for determining if this surface requires unique calculations.
815 : bool IsSurfPropertyGndSurfacesDefined; // true if ground surfaces properties are listed for an external surface
816 : int SurfPropertyGndSurfIndex; // index to a ground surfaces list (defined in SurfaceProperties::GroundSurfaces)
817 : bool UseSurfPropertyGndSurfTemp; // true if at least one ground surface temperature schedules is specified
818 : bool UseSurfPropertyGndSurfRefl; // true if at least one ground surfaces reflectance schedule is specified
819 : Real64 GndReflSolarRad; // ground surface reflected solar radiation on exterior surfaces
820 : bool SurfHasSurroundingSurfProperty; // true if surrounding surfaces properties are listed for an external surface
821 : bool SurfSchedExternalShadingFrac; // true if the external shading is scheduled or calculated externally to be imported
822 : int SurfSurroundingSurfacesNum; // Index of a surrounding surfaces list (defined in SurfaceProperties::SurroundingSurfaces)
823 : int SurfExternalShadingSchInd; // Schedule for a the external shading
824 : int SurfLinkedOutAirNode; // Index of the an OutdoorAir:Node, zero if none
825 : Real64 AE = 0.0; // Product of area and emissivity for each surface
826 : Real64 enclAESum = 0.0; // Sum of area times emissivity for all other surfaces in enclosure
827 : Real64 SrdSurfTemp; // surrounding surfaces average temperature seen by an exterior surface (C)
828 : Real64 ViewFactorSrdSurfs; // surrounding surfaces view factor sum seen by an exterior surface(-)
829 :
830 : // Default Constructor
831 47667 : SurfaceData()
832 143001 : : Construction(0), RepresentativeCalcSurfNum(-1), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None),
833 47667 : Sides(0), Area(0.0), GrossArea(0.0), NetAreaShadowCalc(0.0), Perimeter(0.0), Azimuth(0.0), Height(0.0), Reveal(0.0), Tilt(0.0),
834 95334 : Width(0.0), shapeCat(ShapeCat::Invalid), plane(0.0, 0.0, 0.0, 0.0), Centroid(0.0, 0.0, 0.0), lcsx(0.0, 0.0, 0.0), lcsy(0.0, 0.0, 0.0),
835 47667 : lcsz(0.0, 0.0, 0.0), NewellAreaVector(0.0, 0.0, 0.0), NewellSurfaceNormalVector(0.0, 0.0, 0.0), OutNormVec(0.0, 0.0, 0.0), SinAzim(0.0),
836 47667 : CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0),
837 47667 : HeatTransSurf(false), OutsideHeatSourceTermSchedule(0), InsideHeatSourceTermSchedule(0),
838 190668 : HeatTransferAlgorithm(HeatTransferModel::Invalid), BaseSurf(0), NumSubSurfaces(0), Zone(0), spaceNum(0), ExtBoundCond(0),
839 47667 : ExtSolar(false), ExtWind(false), hasIncSolMultiplier(false), IncSolMultiplier(1.0), ViewFactorGround(0.0), ViewFactorSky(0.0),
840 47667 : ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), MirroredSurf(false), IsShadowing(false),
841 47667 : IsShadowPossibleObstruction(false), SchedShadowSurfIndex(0), IsTransparent(false), SchedMinValue(0.0), activeWindowShadingControl(0),
842 95334 : HasShadeControl(false), activeShadedConstruction(0), activeShadedConstructionPrev(0), FrameDivider(0), Multiplier(1.0),
843 95334 : SolarEnclIndex(0), SolarEnclSurfIndex(0), IsAirBoundarySurf(false), IsSurfPropertyGndSurfacesDefined(false),
844 47667 : SurfPropertyGndSurfIndex(0), UseSurfPropertyGndSurfTemp(false), UseSurfPropertyGndSurfRefl(false), GndReflSolarRad(0.0),
845 47667 : SurfHasSurroundingSurfProperty(false), SurfSchedExternalShadingFrac(false), SurfSurroundingSurfacesNum(0), SurfExternalShadingSchInd(0),
846 143001 : SurfLinkedOutAirNode(0), SrdSurfTemp(0.0), ViewFactorSrdSurfs(0.0)
847 : {
848 47667 : }
849 :
850 : public: // Methods
851 : // Set Precomputed Parameters
852 : void set_computed_geometry();
853 :
854 : Real64 getInsideAirTemperature(EnergyPlusData &state, const int t_SurfNum) const;
855 :
856 : Real64 getOutsideAirTemperature(EnergyPlusData &state, int t_SurfNum) const;
857 :
858 : Real64 getOutsideIR(EnergyPlusData &state, int t_SurfNum) const;
859 :
860 : static Real64 getSWIncident(EnergyPlusData &state, int t_SurfNum);
861 :
862 : int getTotLayers(EnergyPlusData &state) const;
863 :
864 : Real64 get_average_height(EnergyPlusData &state) const;
865 :
866 : void make_hash_key(EnergyPlusData &state, const int SurfNum);
867 :
868 : void set_representative_surface(EnergyPlusData &state, const int SurfNum);
869 :
870 : private: // Methods
871 : // Computed Shape Category
872 : ShapeCat computed_shapeCat() const;
873 :
874 : // Computed Plane
875 : Plane computed_plane() const;
876 :
877 : // Computed axis-projected 2D surface
878 : Surface2D computed_surface2d() const;
879 : };
880 :
881 : struct SurfaceWindowRefPt
882 : {
883 : Real64 solidAng = 0.0; // Solid angle subtended by window from daylit ref points 1 and 2
884 : Real64 solidAngWtd = 0.0; // Solid angle subtended by window from ref pts weighted by glare pos factor
885 : std::array<std::array<Real64, (int)WinCover::Num>, (int)Lum::Num> lums = {{{0.0, 0.0}}};
886 : Real64 illumFromWinRep = 0.0; // Illuminance from window at reference point N [lux]
887 : Real64 lumWinRep = 0.0; // Window luminance as viewed from reference point N [cd/m2]
888 : };
889 :
890 : struct SurfaceWindowCalc // Calculated window-related values
891 : {
892 : // Members
893 : Array1D<SurfaceWindowRefPt> refPts;
894 :
895 : Vector3<Real64> WinCenter = {0.0, 0.0, 0.0}; // X,Y,Z coordinates of window center point in building coord system
896 :
897 : Real64 theta = 0.0; // Azimuth of window normal (rad)
898 : Real64 phi = 0.0; // Altitude of window normal (rad)
899 : Real64 rhoCeilingWall = 0.0; // Average interior reflectance seen by light moving up across horizontal plane thru center of window
900 : Real64 rhoFloorWall = 0.0; // Same as above, but for light moving down
901 : Real64 fractionUpgoing = 0.0; // Fraction light entering window that goes upward
902 :
903 : Real64 glazedFrac = 1.0; // (Glazed area)/(Glazed area + divider area)
904 : Real64 centerGlassArea = 0.0; // Center of glass area (m2); area of glass where 1-D conduction dominates
905 : Real64 edgeGlassCorrFac = 1.0; // Correction factor to center-of-glass conductance to account for 2-D glass conduction thermal bridging
906 : // effects near frame and divider
907 :
908 : int screenNum = 0; // Screen number for a window with a screen (do not confuse with material number)
909 : Real64 lightWellEff = 1.0; // Light well efficiency (multiplier on exterior window vis trans due to light well losses)
910 :
911 : // What is 10 here?
912 : std::array<Real64, 10 + 1> thetaFace = {296.15}; // Face temperatures of window layers (K)
913 :
914 : // Multiplier on sunlit fraction due to shadowing of glass by
915 : // frame and divider outside projections
916 : std::array<Real64, (int)Constant::HoursInDay + 1> OutProjSLFracMult = {1.0};
917 : // Multiplier on sunlit fraction due to shadowing of glass by
918 : // frame and divider inside and outside projections
919 : std::array<Real64, (int)Constant::HoursInDay + 1> InOutProjSLFracMult = {1.0};
920 : std::array<Real64, Material::MaxSlatAngs + 1> EffShBlindEmiss = {0.0}; // Effective emissivity of interior blind or shade
921 : std::array<Real64, Material::MaxSlatAngs + 1> EffGlassEmiss = {0.0}; // Effective emissivity of glass adjacent to interior blind or shade
922 :
923 : // for shadowing of ground by building and obstructions [W/m2]
924 : // Enclosure inside surface area minus this surface and its
925 : // subsurfaces for floor/wall/ceiling (m2)
926 : std::array<Real64, (int)FWC::Num> EnclAreaMinusThisSurf = {0.0, 0.0, 0.0};
927 : // Enclosure product of inside surface area times vis
928 : // reflectance minus this surface and its subsurfaces, for
929 : // floor/wall/ceiling (m2)
930 : std::array<Real64, (int)FWC::Num> EnclAreaReflProdMinusThisSurf = {0.0, 0.0, 0.0};
931 :
932 : BSDFWindowDescript ComplexFen; // Data for complex fenestration, see DataBSDFWindow.cc for declaration
933 : };
934 :
935 : struct SurfaceWindowFrameDiv
936 : {
937 : };
938 :
939 : enum class NfrcProductOptions : int
940 : {
941 : Invalid = -1,
942 : CasementDouble,
943 : CasementSingle,
944 : DualAction,
945 : Fixed,
946 : Garage,
947 : Greenhouse,
948 : HingedEscape,
949 : HorizontalSlider,
950 : Jal,
951 : Pivoted,
952 : ProjectingSingle,
953 : ProjectingDual,
954 : DoorSidelite,
955 : Skylight,
956 : SlidingPatioDoor,
957 : CurtainWall,
958 : SpandrelPanel,
959 : SideHingedDoor,
960 : DoorTransom,
961 : TropicalAwning,
962 : TubularDaylightingDevice,
963 : VerticalSlider,
964 : Num
965 : };
966 :
967 : enum class NfrcVisionType : int
968 : {
969 : Invalid = -1,
970 : Single,
971 : DualVertical,
972 : DualHorizontal,
973 : Num
974 : };
975 :
976 : enum class FrameDividerType : int
977 : {
978 : Invalid = -1,
979 : DividedLite,
980 : Suspended,
981 : Num
982 : };
983 :
984 : // Type of control order when multiple surfaces are referenced
985 : enum class MultiSurfaceControl
986 : {
987 : Invalid = -1,
988 : Sequential,
989 : Group,
990 : Num
991 : };
992 :
993 : struct FrameDividerProperties
994 : {
995 : // Members
996 : std::string Name; // Name of frame/divider
997 : Real64 FrameWidth; // Average width of frame in plane of window {m}
998 : Real64 FrameProjectionOut; // Distance normal to window between outside face of outer pane
999 : // and outside of frame {m}
1000 : Real64 FrameProjectionIn; // Distance normal to window between inside face of inner pane
1001 : // and inside of frame {m}
1002 : Real64 FrameConductance; // Effective conductance of frame (no air films) {W/m2-K}
1003 : Real64 FrameEdgeWidth; // default 2.5 in ! Width of glass edge region near frame {m}
1004 : Real64 FrEdgeToCenterGlCondRatio; // Ratio of frame edge of glass conductance (without air films) to
1005 : // center of glass conductance (without air films)
1006 : Real64 FrameSolAbsorp; // Solar absorptance of frame corrected for self-shading
1007 : Real64 FrameVisAbsorp; // Visible absorptance of frame corrected for self-shading
1008 : Real64 FrameEmis; // Thermal emissivity of frame
1009 : FrameDividerType DividerType; // Type of divider {DividedLite or Suspended (between-glass}
1010 : Real64 DividerWidth; // Average width of divider in plane of window {m}
1011 : int HorDividers; // Number of horizontal dividers
1012 : int VertDividers; // Number of vertical dividers
1013 : Real64 DividerProjectionOut; // Distance normal to window between outside face of outer pane
1014 : // and outside of divider {m}
1015 : Real64 DividerProjectionIn; // Distance normal to window between inside face of inner pane
1016 : // and inside of divider {m}
1017 : Real64 DividerEdgeWidth; // default 2.5 in ! Width of glass edge region near divider
1018 : Real64 DividerConductance; // Effective conductance of divider (no air films) {W/m2-K}
1019 : Real64 DivEdgeToCenterGlCondRatio; // Ratio of divider edge of glass conductance (without air films) to
1020 : // center of glass conductance (without air films)
1021 : Real64 DividerSolAbsorp; // Solar absorptance of divider corrected for self-shading
1022 : Real64 DividerVisAbsorp; // Visible absorptance of divider corrected for self-shading
1023 : Real64 DividerEmis; // Thermal emissivity of divider
1024 : DataWindowEquivalentLayer::Orientation MullionOrientation; // Horizontal or Vertical; used only for windows with two glazing systems
1025 : // divided by a mullion; obtained from Window5 data file.
1026 : NfrcProductOptions NfrcProductType; // NFRC Product Type for Assembly Calculations
1027 : Real64 OutsideRevealSolAbs; // Solar absorptance of outside reveal
1028 : Real64 InsideSillDepth; // Inside sill depth (m)
1029 : Real64 InsideReveal; // Inside reveal (m)
1030 : Real64 InsideSillSolAbs; // Solar absorptance of inside sill
1031 : Real64 InsideRevealSolAbs; // Solar absorptance of inside reveal
1032 :
1033 : // Default Constructor
1034 801 : FrameDividerProperties()
1035 1602 : : FrameWidth(0.0), FrameProjectionOut(0.0), FrameProjectionIn(0.0), FrameConductance(0.0), FrameEdgeWidth(0.06355),
1036 801 : FrEdgeToCenterGlCondRatio(1.0), FrameSolAbsorp(0.0), FrameVisAbsorp(0.0), FrameEmis(0.9), DividerType(FrameDividerType::DividedLite),
1037 801 : DividerWidth(0.0), HorDividers(0), VertDividers(0), DividerProjectionOut(0.0), DividerProjectionIn(0.0), DividerEdgeWidth(0.06355),
1038 801 : DividerConductance(0.0), DivEdgeToCenterGlCondRatio(1.0), DividerSolAbsorp(0.0), DividerVisAbsorp(0.0), DividerEmis(0.9),
1039 801 : MullionOrientation(DataWindowEquivalentLayer::Orientation::Invalid), NfrcProductType(NfrcProductOptions::CurtainWall),
1040 801 : OutsideRevealSolAbs(0.0), InsideSillDepth(0.0), InsideReveal(0.0), InsideSillSolAbs(0.0), InsideRevealSolAbs(0.0)
1041 : {
1042 801 : }
1043 : };
1044 :
1045 : struct StormWindowData
1046 : {
1047 : // Members
1048 : int BaseWindowNum; // Surface number of associated exterior window
1049 : int StormWinMaterialNum; // Material number of storm window glass
1050 : Real64 StormWinDistance; // Distance between storm window glass and adjacent glass (m)
1051 : int DateOn; // Date (julian) storm window is put on
1052 : int MonthOn; // Month storm window is put on
1053 : int DayOfMonthOn; // Day of month storm window is put on
1054 : int DateOff; // Date (julian) storm window is taken off
1055 : int MonthOff; // Month storm window is taken off
1056 : int DayOfMonthOff; // Day of month storm window is taken off
1057 :
1058 : // Default Constructor
1059 2 : StormWindowData()
1060 2 : : BaseWindowNum(0), StormWinMaterialNum(0), StormWinDistance(0.0), DateOn(0), MonthOn(0), DayOfMonthOn(0), DateOff(0), MonthOff(0),
1061 2 : DayOfMonthOff(0)
1062 : {
1063 2 : }
1064 : };
1065 :
1066 : struct WindowShadingControlData
1067 : {
1068 : // Members
1069 : std::string Name; // User supplied name of this set of shading control data
1070 : int ZoneIndex{0}; // number of the zone referenced
1071 : int SequenceNumber{0}; // Shading control sequence number
1072 : WinShadingType ShadingType{WinShadingType::NoShade}; // Shading type (InteriorShade, SwitchableGlazing,
1073 : // CHARACTER(len=32) :: ShadingType = ' ' ! Shading type (InteriorShade, SwitchableGlazing,
1074 : // ExteriorShade,InteriorBlind,ExteriorBlind,BetweenGlassShade,
1075 : // BetweenGlassBlind, or ExteriorScreen)
1076 : int getInputShadedConstruction{0}; // Pointer to the shaded construction (for ShadingType=ExteriorScreen,InteriorShade,
1077 : // ExteriorShade,BetweenGlassShade,InteriorBlind,ExteriorBlind,BetweenGlassBlind;
1078 : // this must be a window construction with a screen, shade or blind layer)
1079 : // this is only used during GetInput and should not be used during timestep calculations
1080 : int ShadingDevice{0}; // Pointer to the material for the shading device (for ShadingType=InteriorShade,
1081 : // ExteriorShade,BetweenGlassShade,InteriorBlind,ExteriorBlind,BetweenGlassBlind,
1082 : // ExteriorScreen;
1083 : // this must be a Material:WindowShade, Material:WindowScreen, or Material:WindowBlind
1084 : WindowShadingControlType shadingControlType{
1085 : WindowShadingControlType::Invalid}; // Takes one of the following values that specifies type of shading control
1086 : // CHARACTER(len=60) :: ShadingControlType =' ' ! Takes one of the following values that specifies type of shading control
1087 : // (control is active only when schedule value = 1; if no schedule
1088 : // specified, schedule value defaults to 1)
1089 : // AlwaysOn: always shaded; not affected by schedule
1090 : // AlwaysOff: never shaded; not affected by schedule
1091 : // OnIfScheduleAllows: unshaded if sch val = 0, shaded if = 1
1092 : // OnIfHighSolarOnWindow: shaded if incident direct + diffuse > setpoint (W/m2 of window)
1093 : // OnIfHighHorizontalSolar: shaded if direct + diffuse horizontal solar > setpoint
1094 : // (W/m2 of ground)
1095 : // OnIfHighOutsideAirTemp: shaded if outside drybulb > setpoint (C)
1096 : // OnIfHighZoneAirTemp: shaded if previous time step zone temperature > setpoint (C)
1097 : // OnIfHighZoneCooling: shaded if previous time step zone cooling rate > setpoint (W)
1098 : // OnIfHighGlare: shaded if total daylight glare index at first daylighting reference point
1099 : // from all exterior windows in zone > maximum glare specified in daylighting
1100 : // input for zone.
1101 : // MeetDaylightIlluminanceSetpoint: shading is adjusted to just meet illuminance setpoint
1102 : // at first reference point (only for ShadingType=SwitchableGlazing)
1103 : // The following three controls are used primarily to reduce zone heating load. They
1104 : // can be used with any shading type but are most appropriate for opaque interior
1105 : // or exterior shades with a high insulating value ("opaque movable insulation").
1106 : // OnNightIfLowOutsideTemp/OffDay: shaded at night if outside temp < setpoint (C)
1107 : // OnNightIfLowInsideTemp/OffDay: shaded at night if previous time step zone air temp < setpoint (C)
1108 : // OnNightIfHeating/OffDay: shaded at night if previous time step zone heating rate > setpoint (W)
1109 : // The following two controls are used to reduce zone heating and cooling loads.
1110 : // They can be used with any shading type but are most appropriate for translucent
1111 : // interior or exterior shades with a high insulating value ("translucent movable insulation")
1112 : // OnNightIfLowOutsideTemp/OnDayIfCooling: shaded at night if outside temp < setpoint (C);
1113 : // shaded daytime if prev. time step cooling rate > 0
1114 : // OnNightIfHeating/OnDayIfCooling: shaded at night if prev. time step heating rate > setpoint (W);
1115 : // shaded daytime if prev. time step cooling rate > 0
1116 : // The following two controls are used to reduce zone cooling load. They can be used
1117 : // with any shading type but are most appropriate for interior or exterior blinds, interior
1118 : // or exterior shades with low insulating value, or switchable glazing.
1119 : // OffNight/OnDayIfCoolingAndHighSolarOnWindow: shading off at night; shading on daytime if
1120 : // solar on window > setpoint (W/m2 of window) and
1121 : // prev. time step cooling rate > 0
1122 : // OnNight/OnDayIfCoolingAndHighSolarOnWindow: shading on at night; shading on daytime if
1123 : // solar on window > setpoint (W/m2 of window) and
1124 : // prev. time step cooling rate > 0
1125 : int Schedule{0}; // Pointer to schedule of 0 and 1 values: 0 => window is not shaded;
1126 : // 1 => window is shaded if Type=Schedule or Type = ScheduleAnd...
1127 : // and setpoint is exceeded.
1128 : Real64 SetPoint{0.0}; // Control setpoint (dimension depends on Trigger:
1129 : // W/m2 of window area for solar on window,
1130 : // W/m2 of ground area for horizontal solar,
1131 : // deg C for air temp, W for zone heating and
1132 : // cooling rate). Not used for Shading Control Type =
1133 : // MeetDaylightIlluminanceSetpoint or OnIfHighGlare.
1134 : Real64 SetPoint2{0.0}; // Second control setpoint for control types that take two setpoints.
1135 : // Dimension is deg C or W/m2.
1136 : bool ShadingControlIsScheduled{false}; // True if shading control has a schedule
1137 : bool GlareControlIsActive{false}; // True if shading control to reduce daylight glare is active
1138 : int SlatAngleSchedule{0}; // Pointer to schedule of slat angle values between 0.0 and 180.0 degrees
1139 : SlatAngleControl slatAngleControl{
1140 : SlatAngleControl::Invalid}; // Takes one of the following values that specifies
1141 : // CHARACTER(len=32) :: slatAngleControlForBlinds = ' ' ! Takes one of the following values that specifies
1142 : // how slat angle is controled in a blind when ShadingType =
1143 : // InteriorBlind, ExteriorBlind or BetweenGlassBlind.
1144 : // FixedSlatAngle: the slat angle is fixed at the constant value given in the
1145 : // associated Material:WindowBlind
1146 : // ScheduledSlatAngle: the slat angle in degrees between 1 and 180 is given
1147 : // by the schedule with index SlatAngleSchedule
1148 : // BlockBeamSolar: if beam solar is incident on the window, and a blind is on the
1149 : // window, the slat angle is adjusted to just block beam solar; otherwise the
1150 : // slat angle is set to the value given in the associated Material:WindowBlind.
1151 : std::string DaylightingControlName; // string holding the Daylighting Control Object Name string
1152 : int DaylightControlIndex{0}; // Pointer to the array of Daylighting Controls
1153 : MultiSurfaceControl multiSurfaceControl{
1154 : MultiSurfaceControl::Invalid}; // True if Group, False if Sequential - type of control order when multiple surfaces are referenced
1155 : int FenestrationCount{0}; // count of fenestration references
1156 : Array1D<std::string> FenestrationName; // string holding list of fenestration surfaces
1157 : Array1D_int FenestrationIndex; // Pointers to fenestration surfaces
1158 : };
1159 :
1160 : struct OSCData
1161 : {
1162 : // Members
1163 : std::string Name; // Name of OSC
1164 : Real64 ConstTemp; // User selected constant temperature (degrees C)
1165 : Real64 ConstTempCoef; // Coefficient modifying the user selected constant temperature
1166 : Real64 ExtDryBulbCoef; // Coefficient modifying the external dry bulb temperature
1167 : Real64 GroundTempCoef; // Coefficient modifying the ground temperature
1168 : Real64 SurfFilmCoef; // Combined convective/radiative film coefficient if >0, else use other coefficients
1169 : Real64 WindSpeedCoef; // Coefficient modifying the wind speed term (s/m)
1170 : Real64 ZoneAirTempCoef; // Coefficient modifying the zone air temperature part of the equation
1171 : std::string ConstTempScheduleName; // Schedule name for scheduled outside temp
1172 : int ConstTempScheduleIndex; // Index for scheduled outside temp.
1173 : bool SinusoidalConstTempCoef; // If true then ConstTempCoef varies by sine wave
1174 : Real64 SinusoidPeriod; // period of sine wave variation (hr)
1175 : Real64 TPreviousCoef; // Coefficient modifying the OSC temp from the previous timestep (dimensionless)
1176 : Real64 TOutsideSurfPast; // Ouside surface temperature from previous timestep {C}
1177 : Real64 MinTempLimit; // Minimum limit on OSC temp {deg C}
1178 : Real64 MaxTempLimit; // Maximum limit on OSC temp {deg C}
1179 : bool MinLimitPresent; // If TRUE then apply minimum limit on calculated OSC temp
1180 : bool MaxLimitPresent; // If TRUE then apply maximum limit on calculated OSC temp
1181 : Real64 OSCTempCalc; // Result of calculated temperature using OSC (degrees C)
1182 :
1183 : // Default Constructor
1184 817 : OSCData()
1185 1634 : : ConstTemp(0.0), ConstTempCoef(0.0), ExtDryBulbCoef(0.0), GroundTempCoef(0.0), SurfFilmCoef(0.0), WindSpeedCoef(0.0),
1186 1634 : ZoneAirTempCoef(0.0), ConstTempScheduleIndex(0), SinusoidalConstTempCoef(false), SinusoidPeriod(0.0), TPreviousCoef(0.0),
1187 817 : TOutsideSurfPast(0.0), MinTempLimit(0.0), MaxTempLimit(0.0), MinLimitPresent(false), MaxLimitPresent(false), OSCTempCalc(0.0)
1188 : {
1189 817 : }
1190 : };
1191 :
1192 : struct OSCMData
1193 : {
1194 : // Members
1195 : std::string Name; // Name of OSCM
1196 : std::string Class; // type of Model for OSCM
1197 : Real64 TConv; // Temperature of bulk air at other side face (degrees C)
1198 : bool EMSOverrideOnTConv; // if true then EMS calling for convection bulk air temp override
1199 : Real64 EMSOverrideTConvValue; // value for convection air temp when overridden
1200 : Real64 HConv; // Convection coefficient (W/m2-K)
1201 : bool EMSOverrideOnHConv; // if true then EMS calling for convection coef override
1202 : Real64 EMSOverrideHConvValue; // value to use for convection coef when overridden
1203 : Real64 TRad; // Effective temperature of surfaces exposed to other side face (degrees C)
1204 : bool EMSOverrideOnTRad; // if true then EMS calling for radiation temp override
1205 : Real64 EMSOverrideTRadValue; // value to use for rad temp when overridden
1206 : Real64 HRad; // Linearized Radiation coefficient (W/m2-K)
1207 : bool EMSOverrideOnHrad; // if true then EMS calling for radiation coef override
1208 : Real64 EMSOverrideHradValue; // value to use for rad coef when overridden
1209 :
1210 : // Default Constructor
1211 821 : OSCMData()
1212 1642 : : TConv(20.0), EMSOverrideOnTConv(false), EMSOverrideTConvValue(0.0), HConv(4.0), EMSOverrideOnHConv(false), EMSOverrideHConvValue(0.0),
1213 821 : TRad(20.0), EMSOverrideOnTRad(false), EMSOverrideTRadValue(0.0), HRad(4.0), EMSOverrideOnHrad(false), EMSOverrideHradValue(0.0)
1214 : {
1215 821 : }
1216 : };
1217 :
1218 : struct ConvectionCoefficient
1219 : {
1220 : // Members
1221 : int WhichSurface = 0; // Which surface number this is applied to
1222 : std::string SurfaceName = ""; // Which surface (name)
1223 : Convect::OverrideType overrideType = // Override type, 1=value, 2=schedule, 3=model, 4=user curve
1224 : Convect::OverrideType::Invalid;
1225 : Real64 OverrideValue = 0.0; // User specified value
1226 : std::string ScheduleName = ""; // Which surface (name)
1227 : int ScheduleIndex = 0; // if type="schedule" is used
1228 : int UserCurveIndex = 0; // if type=UserCurve is used
1229 : Convect::HcInt HcIntModelEq = Convect::HcInt::Invalid; // if type is one of specific model equations
1230 : Convect::HcExt HcExtModelEq = Convect::HcExt::Invalid;
1231 : };
1232 :
1233 : struct ShadingVertexData
1234 : {
1235 : // Members
1236 : int NVert = 0;
1237 : Array1D<Real64> XV;
1238 : Array1D<Real64> YV;
1239 : Array1D<Real64> ZV;
1240 :
1241 : // Default Constructor
1242 46840 : ShadingVertexData()
1243 46840 : {
1244 46840 : }
1245 : };
1246 :
1247 : struct SurfaceSolarIncident
1248 : {
1249 : // Members
1250 : std::string Name;
1251 : int SurfPtr; // surface pointer
1252 : int ConstrPtr; // construction pointer
1253 : int SchedPtr; // schedule pointer
1254 :
1255 : // Default Constructor
1256 7 : SurfaceSolarIncident() : SurfPtr(0), ConstrPtr(0), SchedPtr(0)
1257 : {
1258 7 : }
1259 : };
1260 :
1261 : struct SurfaceIncidentSolarMultiplier
1262 : {
1263 : // Members
1264 : std::string Name;
1265 : int SurfaceIdx = 0; // surface index
1266 : Real64 Scaler = 1.0; // the constant multiplier constant from user input
1267 : int SchedPtr = 0; // the index of the multiplier schedule
1268 : };
1269 :
1270 : struct FenestrationSolarAbsorbed
1271 : {
1272 : // Members
1273 : std::string Name;
1274 : int SurfPtr; // surface pointer
1275 : int ConstrPtr; // construction pointer
1276 : int NumOfSched; // number of scheduled layers
1277 : Array1D_int SchedPtrs; // pointer to schedules for each layer in construction
1278 :
1279 : // Default Constructor
1280 2 : FenestrationSolarAbsorbed() : SurfPtr(0), ConstrPtr(0), NumOfSched(0)
1281 : {
1282 2 : }
1283 : };
1284 :
1285 : struct GroundSurfacesData
1286 : {
1287 : // Members
1288 : std::string Name; // name of a ground surface
1289 : Real64 ViewFactor = 0.0; // view factor to a ground surface
1290 : int TempSchPtr = 0; // pointer to a ground surface temperature schedule object
1291 : int ReflSchPtr = 0; // pointer to a ground Surface reflectance schedule object
1292 : };
1293 :
1294 : struct GroundSurfacesProperty
1295 : {
1296 : // Members
1297 : std::string Name; // name of multiple ground surfaces object
1298 : int NumGndSurfs = 0; // number of groundSurfaces
1299 : Array1D<GroundSurfacesData> GndSurfs; // ground surfaces data
1300 : Real64 SurfsTempAvg = 0.0; // ground Surfaces average temperature at each time step
1301 : Real64 SurfsReflAvg = 0.0; // ground Surfaces average reflectance at each time step
1302 : Real64 SurfsViewFactorSum = 0.0; // sum of view factors of ground surfaces seen by an exterior surface
1303 : bool IsGroundViewFactorSet = false; // true if the ground view factor field is not blank
1304 : };
1305 :
1306 : struct SurfaceLocalEnvironment
1307 : {
1308 : // Members
1309 : std::string Name;
1310 : int SurfPtr = 0; // surface pointer
1311 : int SunlitFracSchedPtr = 0; // schedule pointer
1312 : int SurroundingSurfsPtr = 0; // schedule pointer
1313 : int OutdoorAirNodePtr = 0; // outdoor air node pointer
1314 : int GroundSurfsPtr = 0; // pointer to multiple ground surfaces object
1315 : };
1316 :
1317 : struct SurroundingSurfProperty
1318 : {
1319 : // Members
1320 : std::string Name;
1321 : Real64 ViewFactor = 0.0; // view factor to surrounding surface
1322 : int TempSchNum = 0; // schedule pointer
1323 : };
1324 :
1325 : struct SurroundingSurfacesProperty
1326 : {
1327 : // Members
1328 : std::string Name;
1329 : Real64 SkyViewFactor = 0.0; // sky view factor
1330 : Real64 GroundViewFactor = 0.0; // ground view factor
1331 : Real64 SurfsViewFactorSum = 0.0; // surrounding surfaces view factor sum
1332 : int SkyTempSchNum = 0; // schedule pointer
1333 : int GroundTempSchNum = 0; // schedule pointer
1334 : int TotSurroundingSurface = 0; // Total number of surrounding surfaces defined for an exterior surface
1335 : bool IsSkyViewFactorSet = false; // false if the sky view factor field is blank
1336 : bool IsGroundViewFactorSet = false; // false if the ground view factor field is blank
1337 : Array1D<SurroundingSurfProperty> SurroundingSurfs;
1338 : };
1339 :
1340 : struct IntMassObject
1341 : {
1342 : // Members
1343 : std::string Name;
1344 : std::string ZoneOrZoneListName; // zone or zone list name
1345 : int ZoneOrZoneListPtr; // pointer to a zone list
1346 : int NumOfZones; // number of zones in a zone list
1347 : int Construction; // pointer to contruction object
1348 : Real64 GrossArea; // internal surface area, [m2]
1349 : bool ZoneListActive; // flag to a list
1350 : std::string spaceOrSpaceListName; // Space or Space list name
1351 : int spaceOrSpaceListPtr; // pointer to a Space list
1352 : int numOfSpaces; // number of Spaces in a Space list
1353 : bool spaceListActive; // flag to a list
1354 :
1355 : // Default Constructor
1356 2555 : IntMassObject()
1357 7665 : : ZoneOrZoneListPtr(0), NumOfZones(0), Construction(0), GrossArea(0.0), ZoneListActive(false), spaceOrSpaceListPtr(0), numOfSpaces(0),
1358 2555 : spaceListActive(false)
1359 : {
1360 2555 : }
1361 : };
1362 :
1363 : // Surface interior convection
1364 : struct SurfIntConv
1365 : {
1366 :
1367 : // convection class determined by surface orientation,
1368 : // heating/cooling system, and temperature regime
1369 : Convect::IntConvClass convClass = Convect::IntConvClass::Invalid;
1370 : int convClassRpt = (int)Convect::IntConvClass::Invalid;
1371 :
1372 : Convect::HcInt model = Convect::HcInt::SetByZone; // convection model
1373 : int userModelNum = 0; // user defined convection model
1374 :
1375 : Convect::HcInt hcModelEq = Convect::HcInt::Invalid; // current convection model
1376 : int hcModelEqRpt = (int)Convect::HcInt::Invalid;
1377 : int hcUserCurveNum = 0;
1378 :
1379 : Real64 zoneWallHeight = 0.0; // geometry parameters
1380 : Real64 zonePerimLength = 0.0;
1381 : Real64 zoneHorizHydrDiam = 0.0;
1382 : Real64 windowWallRatio = 0.0;
1383 : Convect::IntConvWinLoc windowLocation = Convect::IntConvWinLoc::NotSet; // Already has NotSet defined as 0, and uses it in reporting. :(
1384 :
1385 : bool getsRadiantHeat = false;
1386 : bool hasActiveInIt = false;
1387 : };
1388 :
1389 : // Surface exterior convection
1390 : struct SurfExtConv
1391 : {
1392 : // current classification for outside face wind regime and convection orientation
1393 : Convect::ExtConvClass convClass = Convect::ExtConvClass::Invalid;
1394 : int convClassRpt = (int)Convect::ExtConvClass::Invalid;
1395 :
1396 : Convect::HcExt model = Convect::HcExt::SetByZone; // conveciton model
1397 : int userModelNum = 0;
1398 :
1399 : Convect::HcExt hfModelEq = Convect::HcExt::Invalid; // Current forced convection model
1400 : int hfModelEqRpt = (int)Convect::HcExt::Invalid;
1401 : int hfUserCurveNum = 0;
1402 :
1403 : Convect::HcExt hnModelEq = Convect::HcExt::Invalid; // Current natural convection model
1404 : int hnModelEqRpt = (int)Convect::HcExt::Invalid;
1405 : int hnUserCurveNum = 0;
1406 :
1407 : Real64 faceArea = 0.0; // Geometry parameters
1408 : Real64 facePerimeter = 0.0;
1409 : Real64 faceHeight = 0.0;
1410 : };
1411 :
1412 : // Clears the global data in DataSurfaces.
1413 : // Needed for unit tests, should not be normally called.
1414 : // void clear_state() override;
1415 :
1416 : void SetSurfaceOutBulbTempAt(EnergyPlusData &state);
1417 :
1418 : void CheckSurfaceOutBulbTempAt(EnergyPlusData &state);
1419 :
1420 : void SetSurfaceWindSpeedAt(EnergyPlusData &state);
1421 :
1422 : void SetSurfaceWindDirAt(EnergyPlusData &state);
1423 :
1424 : Real64 AbsFrontSide(EnergyPlusData &state, int SurfNum);
1425 :
1426 : Real64 AbsBackSide(EnergyPlusData &state, int SurfNum);
1427 :
1428 : void GetVariableAbsorptanceSurfaceList(EnergyPlusData &state);
1429 :
1430 : std::string cSurfaceClass(SurfaceClass ClassNo);
1431 :
1432 : } // namespace DataSurfaces
1433 :
1434 : struct SurfacesData : BaseGlobalStruct
1435 : {
1436 : int TotSurfaces = 0; // Total number of surfaces (walls, floors, roofs, windows, shading surfaces, etc.--everything)
1437 : int TotWindows = 0; // Total number of windows
1438 : int TotStormWin = 0; // Total number of storm window blocks
1439 : int TotWinShadingControl = 0; // Total number of window shading control blocks
1440 : int TotUserIntConvModels = 0; // Total number of interior convection coefficient (overrides) // TODO: Should just be a local variable I think
1441 : int TotUserExtConvModels = 0; // Total number of exterior convection coefficient (overrides) // TODO: Should just be a local variable I think
1442 : int TotOSC = 0; // Total number of Other Side Coefficient Blocks
1443 : int TotOSCM = 0; // Total number of Other Side Conditions Model Blocks.
1444 : int TotExtVentCav = 0; // Total number of ExteriorNaturalVentedCavity
1445 : int TotSurfIncSolSSG = 0; // Total number of scheduled surface gains for incident solar radiation on surface
1446 : int TotSurfIncSolMultiplier = 0; // Total number of surfaces with incident solar multipliers
1447 : int TotFenLayAbsSSG = 0; // Total number of scheduled surface gains for absorbed solar radiation in window layers
1448 : int TotSurfLocalEnv = 0; // Total number of surface level outdoor air node.
1449 : int TotSurfPropGndSurfs = 0; // Total number of surface property ground surfaces object
1450 : int Corner = 0; // Which corner is specified as the first vertex
1451 : int MaxVerticesPerSurface = 4; // Maximum number of vertices allowed for a single surface (default -- can go higher)
1452 : int BuildingShadingCount = 0; // Total number of Building External Shades
1453 : int FixedShadingCount = 0; // Total number of Fixed External Shades
1454 : int AttachedShadingCount = 0; // Total number of Shades attached to Zones
1455 : int ShadingSurfaceFirst = 0; // Start index of shading surfaces (Building External Shades, Fixed External Shades and Shades attached to Zone)
1456 : int ShadingSurfaceLast = -1; // End index of shading surfaces (Building External Shades, Fixed External Shades and Shades attached to Zone)
1457 : bool AspectTransform = false; // Set to true when GeometryTransform object is used
1458 : bool CalcSolRefl = false; // Set to true when Solar Reflection Calculations object is used
1459 : bool CCW = false; // True if vertices will be entered in CounterClockWise Order
1460 : bool WorldCoordSystem = false; // True if vertices will be "World Coordinates". False means relative coordinates
1461 : bool DaylRefWorldCoordSystem = false; // True if Daylight Reference Point vertices will be "World Coordinates". False means relative coordinates
1462 : int MaxRecPts = 0; // Max number of receiving points on a surface for solar reflection calc
1463 : int MaxReflRays = 0; // Max number of rays from a receiving surface for solar reflection calc
1464 : Real64 GroundLevelZ = 0.0; // Z value of ground level for solar refl calc (m)
1465 : bool AirflowWindows = false; // TRUE if one or more airflow windows
1466 : bool ShadingTransmittanceVaries = false; // overall, shading transmittance varies for the building
1467 : bool UseRepresentativeSurfaceCalculations = false; // Use Representative Surfaces for Calculations
1468 : bool AnyMovableInsulation = false; // True if any movable insulation presents
1469 : bool AnyMovableSlat = false; // True if there are any movable slats for window blinds presented
1470 :
1471 : Array1D_int SurfAdjacentZone; // Array of adjacent zones to each surface
1472 : Array1D<Real64> X0; // X-component of translation vector
1473 : Array1D<Real64> Y0; // Y-component of translation vector
1474 : Array1D<Real64> Z0; // Z-component of translation vector
1475 :
1476 : std::unordered_map<DataSurfaces::SurfaceCalcHashKey, int, DataSurfaces::SurfaceCalcHasher>
1477 : RepresentativeSurfaceMap; // A map that categorizes similar surfaces with
1478 : // a single representative surface index
1479 :
1480 : std::vector<int> AllHTSurfaceList; // List of all heat transfer surfaces
1481 : std::vector<int> AllExtSolarSurfaceList; // List of all exterior solar surfaces, all are heat transfer surfaces
1482 : std::vector<int> AllExtSolAndShadingSurfaceList; // List of all exterior solar surfaces plus all shading surfaces
1483 : std::vector<int> AllShadowPossObstrSurfaceList; // List of all IsShadoPossibleObstuction surfaces
1484 : std::vector<int> AllIZSurfaceList; // List of all interzone heat transfer surfaces
1485 : std::vector<int> AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces
1486 : std::vector<int> AllHTWindowSurfaceList; // List of all window surfaces
1487 : std::vector<int> AllExtSolWindowSurfaceList; // List of all exterior solar window surfaces
1488 : std::vector<int> AllExtSolWinWithFrameSurfaceList; // List of all exterior solar window surfaces with a frame and divider
1489 : std::vector<int> AllHTKivaSurfaceList; // List of all Kiva foundation surfaces
1490 : std::vector<int> AllSurfaceListReportOrder; // List of all surfaces - output reporting order
1491 : std::vector<int> AllVaryAbsOpaqSurfaceList; // List of all opaque exterior surfaces with dynamic coating
1492 : std::vector<int> allInsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for inside face
1493 : std::vector<int> allOutsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for outside face
1494 : std::vector<int> allGetsRadiantHeatSurfaceList; // List of all surfaces that receive radiant HVAC output
1495 :
1496 : std::array<std::vector<int>, static_cast<int>(DataSurfaces::SurfaceFilter::Num)> SurfaceFilterLists;
1497 :
1498 : // Surface HB arrays
1499 : Array1D<Real64> SurfOutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C)
1500 : Array1D<Real64> SurfOutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C)
1501 : Array1D<Real64> SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s)
1502 : Array1D<Real64> SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree)
1503 : Array1D<Real64> SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for
1504 : Array1D<int> SurfLowTempErrCount;
1505 : Array1D<int> SurfHighTempErrCount;
1506 :
1507 : // Surface solar arrays
1508 : Array1D<Real64> SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface
1509 : // Fraction of sky IR coming from sky itself; 1-SurfAirSkyRadSplit comes from the atmosphere.
1510 : Array1D<Vector3<Real64>> SurfSunCosHourly; // Hourly values of SUNCOS (solar direction cosines)
1511 : // Autodesk: Init Zero-initialization added to avoid use uninitialized
1512 : Array1D<Real64> SurfSunlitArea; // Sunlit area by surface number
1513 : Array1D<Real64> SurfSunlitFrac; // Sunlit fraction by surface number
1514 : Array1D<Real64> SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse
1515 : // and beam solar from exterior obstructions [W/m2]
1516 : Array1D<Real64> SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true,
1517 : // accounts for shadowing of ground by building and obstructions [W/m2]
1518 : Array1D<Real64> SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2)
1519 : Array1D<Real64> SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2)
1520 : Array1D<Real64> SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground
1521 : Array1D<Real64> SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground
1522 : Array1D<Real64> SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface
1523 : Array1D<Real64> SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface
1524 : Array1D<int> SurfPenumbraID;
1525 :
1526 : // Surface reflectance
1527 : Array2D<Real64> SurfReflFacBmToDiffSolObs;
1528 : Array2D<Real64> SurfReflFacBmToDiffSolGnd;
1529 : Array2D<Real64> SurfReflFacBmToBmSolObs;
1530 : Array1D<Real64> SurfReflFacSkySolObs;
1531 : Array1D<Real64> SurfReflFacSkySolGnd;
1532 : Array2D<Real64> SurfCosIncAveBmToBmSolObs;
1533 :
1534 : // Surface parameters specific to solar reflection from surfaces
1535 : Array1D<Real64> SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion
1536 : Array1D<Real64> SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion
1537 : Array1D<Real64> SurfShadowGlazingFrac; // Glazing fraction
1538 : Array1D<int> SurfShadowGlazingConstruct; // Glazing construction number
1539 : Array1D<int> SurfShadowRecSurfNum; // Receiving surface number
1540 : Array1D<std::vector<int>>
1541 : SurfShadowDisabledZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model
1542 :
1543 : // Surface movable insulation properties
1544 : Array1D<int> SurfMaterialMovInsulExt; // Pointer to the material used for exterior movable insulation
1545 : Array1D<int> SurfMaterialMovInsulInt; // Pointer to the material used for interior movable insulation
1546 : Array1D<int> SurfSchedMovInsulExt; // Schedule for exterior movable insulation
1547 : Array1D<int> SurfSchedMovInsulInt; // Schedule for interior movable insulation
1548 :
1549 : // Surface EMS
1550 : Array1D<bool> SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value
1551 : Array1D<int> SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden
1552 : Array1D<bool> SurfEMSOverrideIntConvCoef; // if true, EMS is calling to override the interior convection coefficient value
1553 : Array1D<Real64> SurfEMSValueForIntConvCoef; // Value EMS is calling to use for interior convection coefficient [W/m2-K]
1554 : Array1D<bool> SurfEMSOverrideExtConvCoef; // if true, EMS is calling to override the exterior convection coefficient value
1555 : Array1D<Real64> SurfEMSValueForExtConvCoef; // Value EMS is calling to use for exterior convection coefficient [W/m2-K]
1556 : Array1D<bool> SurfOutDryBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor air temp
1557 : Array1D<Real64> SurfOutDryBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air drybulb temp (C)
1558 : Array1D<bool> SurfOutWetBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wetbulb temp
1559 : Array1D<Real64> SurfOutWetBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air wetbulb temp (C)
1560 : Array1D<bool> SurfWindSpeedEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wind speed
1561 : Array1D<Real64> SurfWindSpeedEMSOverrideValue; // value to use for EMS override of outdoor wind speed (m/s)
1562 : Array1D<bool> SurfViewFactorGroundEMSOverrideOn; // if true, EMS is calling to override the surface's view factor to ground
1563 : Array1D<Real64> SurfViewFactorGroundEMSOverrideValue; // value to use for EMS override of surface's view factor to ground
1564 : Array1D<bool> SurfWindDirEMSOverrideOn; // if true, EMS is calling to override the outside wind direction
1565 : Array1D<Real64> SurfWindDirEMSOverrideValue; // value to use for EMS override of outside wind direction (deg)
1566 :
1567 : // Surface Properties
1568 : Array1D<int> SurfDaylightingShelfInd; // Pointer to daylighting shelf
1569 : Array1D<bool> SurfExtEcoRoof; // True if the top outside construction material is of type Eco Roof
1570 : Array1D<bool> SurfExtCavityPresent; // true if there is an exterior vented cavity on surface
1571 : Array1D<int> SurfExtCavNum; // index for this surface in ExtVentedCavity structure (if any)
1572 : Array1D<bool> SurfIsPV; // true if this is a photovoltaic surface (dxf output)
1573 : Array1D<bool> SurfIsICS; // true if this is an ICS collector
1574 : Array1D<bool> SurfIsPool; // true if this is a pool
1575 : Array1D<int> SurfICSPtr; // Index to ICS collector
1576 : Array1D<bool> SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group
1577 :
1578 : // Surface ConvCoeff Properties
1579 : Array1D<int> SurfTAirRef; // Flag for reference air temperature
1580 : Array1D<int> SurfTAirRefRpt; // Flag for reference air temperature for reporting
1581 :
1582 : EPVector<DataSurfaces::SurfIntConv> surfIntConv;
1583 : EPVector<DataSurfaces::SurfExtConv> surfExtConv;
1584 :
1585 : // Surface Window Heat Balance
1586 : Array1D_int SurfWinInsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise
1587 : Array1D_int SurfWinInsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise
1588 : Array1D_int SurfWinInsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise
1589 :
1590 : Array2D<Real64> SurfWinA; // Time step value of factor for beam absorbed in window glass layers
1591 : Array2D<Real64> SurfWinADiffFront; // Time step value of factor for diffuse absorbed in window layers
1592 : Array2D<Real64> SurfWinACFOverlap; // Time step value of factor for beam absorbed in window glass layers which comes from other windows
1593 : // It happens sometimes that beam enters one window and hits back of second window.
1594 : // It is used in complex fenestration only
1595 : Array1D<Real64> SurfWinTransSolar; // Exterior beam plus diffuse solar transmitted through window, or window plus shade/blind, into zone (W)
1596 : Array1D<Real64> SurfWinBmSolar; // Exterior beam solar transmitted through window, or window plus blind, into zone (W)
1597 : Array1D<Real64> SurfWinBmBmSolar; // Exterior beam-to-beam solar transmitted through window, or window plus blind, into zone (W)
1598 : Array1D<Real64> SurfWinBmDifSolar; // Exterior beam-to-diffuse solar transmitted through window, or window plus blind, into zone (W)
1599 : Array1D<Real64> SurfWinDifSolar; // Exterior diffuse solar transmitted through window, or window plus shade/blind, into zone (W)
1600 : Array1D<Real64> SurfWinHeatGain; // Total heat gain from window (W) = WinTransSolar + (IR and convection from glazing, or,
1601 : // if interior shade, IR and convection from zone-side of shade plus gap air convection to zone) +
1602 : // (IR convection from frame) + (IR and convection from divider if no interior shade) (W)
1603 : // minus SurfWinInitialDifSolInTrans minus SurfWinLossSWZoneToOutWinRep
1604 : Array1D<Real64> SurfWinHeatGainRep; // Equals WinHeatGain when WinHeatGain >= 0.0 (W)
1605 : Array1D<Real64> SurfWinHeatLossRep; // Equals -WinHeatGain when WinHeatGain < 0.0 (W)
1606 : Array1D<Real64> SurfWinGainConvGlazToZoneRep; // component of WinHeatGain convect to zone from glazing (W)
1607 : Array1D<Real64> SurfWinGainIRGlazToZoneRep; // component of WinHeatGain net IR to zone from glazing (W)
1608 : Array1D<Real64> SurfWinLossSWZoneToOutWinRep; // component of WinHeatGain shortwave transmit back out (W)
1609 : Array1D<Real64> SurfWinGainFrameDividerToZoneRep; // component of WinHeatGain to zone from frame/divider (W)
1610 : Array1D<Real64> SurfWinGainConvShadeToZoneRep; // component of WinHeatGain convect to zone from front shade (W)
1611 : Array1D<Real64> SurfWinGainIRShadeToZoneRep; // component of WinHeatGain net IR to zone from front shade (W)
1612 : Array1D<Real64> SurfWinGapConvHtFlowRep; // Convective heat flow from gap in airflow window (W)
1613 : Array1D<Real64> SurfWinShadingAbsorbedSolar; // Exterior beam plus diffuse solar absorbed by window shading device (W)
1614 : Array1D<Real64> SurfWinSysSolTransmittance; // Effective solar transmittance of window + shading device, if present
1615 : Array1D<Real64> SurfWinSysSolReflectance; // Effective solar reflectance of window + shading device, if present
1616 : Array1D<Real64> SurfWinSysSolAbsorptance; // Effective solar absorptance of window + shading device, if present
1617 :
1618 : // Surface Window Energy
1619 : Array1D<Real64> SurfWinTransSolarEnergy; // Energy of WinTransSolar [J]
1620 : Array1D<Real64> SurfWinBmSolarEnergy; // Energy of WinBmSolar [J]
1621 : Array1D<Real64> SurfWinBmBmSolarEnergy; // Beam-to-beam energy of WinBmSolar [J]
1622 : Array1D<Real64> SurfWinBmDifSolarEnergy; // Beam-to-diffuse energy of WinBmSolar [J]
1623 : Array1D<Real64> SurfWinDifSolarEnergy; // Energy of WinDifSolar [J]
1624 : Array1D<Real64> SurfWinHeatGainRepEnergy; // Energy of WinHeatGainRep [J]
1625 : Array1D<Real64> SurfWinHeatLossRepEnergy; // Energy of WinHeatLossRep [J]
1626 : Array1D<Real64> SurfWinShadingAbsorbedSolarEnergy; // Energy of WinShadingAbsorbedSolar [J]
1627 : Array1D<Real64> SurfWinGapConvHtFlowRepEnergy; // Energy of WinGapConvHtFlowRep [J]
1628 : Array1D<Real64> SurfWinHeatTransferRepEnergy; // Energy of WinHeatTransfer [J]
1629 : Array1D<Real64> SurfWinIRfromParentZone;
1630 : Array1D<Real64> SurfWinFrameQRadOutAbs;
1631 : Array1D<Real64> SurfWinFrameQRadInAbs;
1632 : Array1D<Real64> SurfWinDividerQRadOutAbs;
1633 : Array1D<Real64> SurfWinDividerQRadInAbs;
1634 : Array1D<Real64> SurfWinExtBeamAbsByShade; // Exterior beam solar absorbed by window shade (W/m2)
1635 : Array1D<Real64> SurfWinExtDiffAbsByShade; // Exterior diffuse solar absorbed by window shade (W/m2)
1636 : Array1D<Real64> SurfWinIntBeamAbsByShade; // Interior beam solar absorbed by window shade (W/m2)
1637 : Array1D<Real64> SurfWinIntSWAbsByShade; // Interior diffuse solar plus short-wave from lights absorbed by window shade (W/m2)
1638 : Array1D<Real64> SurfWinInitialDifSolAbsByShade; // Initial diffuse solar from ext and int windows absorbed by window shade (W/m2)
1639 : Array1D<Real64> SurfWinIntLWAbsByShade; // Interior long-wave from zone lights and equipment absorbed by window shade (W/m2)
1640 : Array1D<Real64> SurfWinConvHeatFlowNatural; // Convective heat flow from gap between glass and interior shade or blind (W)
1641 : Array1D<Real64> SurfWinConvHeatGainToZoneAir; // Convective heat gain to zone air from window gap airflow (W)
1642 : Array1D<Real64> SurfWinRetHeatGainToZoneAir; // Convective heat gain to return air sent to zone [W]
1643 : Array1D<Real64> SurfWinDividerHeatGain;
1644 : Array1D<Real64> SurfWinBlTsolBmBm; // Time-step value of blind beam-beam solar transmittance (-)
1645 : Array1D<Real64> SurfWinBlTsolBmDif; // Time-step value of blind beam-diffuse solar transmittance (-)
1646 : Array1D<Real64> SurfWinBlTsolDifDif; // Time-step value of blind diffuse-diffuse solar transmittance (-)
1647 : Array1D<Real64> SurfWinBlGlSysTsolBmBm; // Time-step value of blind/glass system beam-beam solar transmittance (-)
1648 : Array1D<Real64> SurfWinBlGlSysTsolDifDif; // Time-step value of blind/glass system diffuse-diffuse solar transmittance (-)
1649 : Array1D<Real64> SurfWinScTsolBmBm; // Time-step value of screen beam-beam solar transmittance (-)
1650 : Array1D<Real64> SurfWinScTsolBmDif; // Time-step value of screen beam-diffuse solar transmittance (-)
1651 : Array1D<Real64> SurfWinScTsolDifDif; // Time-step value of screen diffuse-diffuse solar transmittance (-)
1652 : Array1D<Real64> SurfWinScGlSysTsolBmBm; // Time-step value of screen/glass system beam-beam solar transmittance (-)
1653 : Array1D<Real64> SurfWinScGlSysTsolDifDif; // Time-step value of screen/glass system diffuse-diffuse solar transmittance (-)
1654 : Array1D<Real64> SurfWinGlTsolBmBm; // Time-step value of glass beam-beam solar transmittance (-)
1655 : Array1D<Real64> SurfWinGlTsolBmDif; // Time-step value of glass beam-diffuse solar transmittance (-)
1656 : Array1D<Real64> SurfWinGlTsolDifDif; // Time-step value of glass diffuse-diffuse solar transmittance (-)
1657 : Array1D<Real64> SurfWinBmSolTransThruIntWinRep; // Beam solar transmitted through interior window [W]
1658 : Array1D<Real64> SurfWinBmSolAbsdOutsReveal; // Multiplied by BeamSolarRad, gives beam solar absorbed by outside reveal surfaces (m2)
1659 : Array1D<Real64> SurfWinBmSolRefldOutsRevealReport; // Beam solar reflected by outside reveal surfaces, for reporting (m2)
1660 : Array1D<Real64> SurfWinBmSolAbsdInsReveal; // Multiplied by BeamSolarRad, gives beam solar absorbed by inside reveal surfaces (m2)
1661 : Array1D<Real64> SurfWinBmSolRefldInsReveal; // Multiplied by BeamSolarRad, gives beam solar reflected by inside reveal surfaces (m2)
1662 : Array1D<Real64> SurfWinBmSolRefldInsRevealReport; // Beam solar reflected by inside reveal surfaces, for reporting (W)
1663 : Array1D<Real64> SurfWinOutsRevealDiffOntoGlazing; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from outside reveal that is
1664 : // incident on the glazing per m2 of glazing (-)
1665 : Array1D<Real64> SurfWinInsRevealDiffOntoGlazing; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that is
1666 : // incident on the glazing per m2 of glazing (-)
1667 : Array1D<Real64> SurfWinInsRevealDiffIntoZone; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that goes into
1668 : // zone directly or reflected from glazing (m2)
1669 : Array1D<Real64> SurfWinOutsRevealDiffOntoFrame; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from outside reveal that is
1670 : // incident on the outside of the frame per m2 of frame (-)
1671 : Array1D<Real64> SurfWinInsRevealDiffOntoFrame; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that is
1672 : // incident on the outside of the frame per m2 of frame (-) for debugging CR 7596. TH 5/26/2009
1673 : Array1D<Real64> SurfWinInsRevealDiffOntoGlazingReport; // Diffuse solar from beam reflection from inside reveal that is incident
1674 : // on the glazing (W)
1675 : Array1D<Real64> SurfWinInsRevealDiffIntoZoneReport; // Diffuse from beam reflection from inside reveal that goes into zone directly or reflected
1676 : // from glazing (W)
1677 : Array1D<Real64> SurfWinInsRevealDiffOntoFrameReport; // Diffuse from beam reflection from inside reveal that is incident on the frame (W)
1678 : Array1D<Real64> SurfWinBmSolAbsdInsRevealReport; // Beam solar absorbed by inside reveal (W) energy
1679 : Array1D<Real64> SurfWinBmSolTransThruIntWinRepEnergy; // energy of BmSolTransThruIntWinRep [J]
1680 : Array1D<Real64> SurfWinBmSolRefldOutsRevealRepEnergy; // energy of BmSolRefldOutsRevealReport [J]
1681 : Array1D<Real64> SurfWinBmSolRefldInsRevealRepEnergy; // energy of BmSolRefldInsRevealReport [J]
1682 : Array1D<Real64> SurfWinProfileAngHor; // Horizontal beam solar profile angle (degrees)
1683 : Array1D<Real64> SurfWinProfileAngVert; // Vertical beam solar profile angle (degrees)
1684 :
1685 : EPVector<DataSurfaces::WinShadingType> SurfWinShadingFlag; // -1: window has no shading device
1686 : Array1D<bool> SurfWinShadingFlagEMSOn; // EMS control flag, true if EMS is controlling ShadingFlag with ShadingFlagEMSValue
1687 : Array1D<int> SurfWinShadingFlagEMSValue; // EMS control value for Shading Flag
1688 : Array1D<int> SurfWinStormWinFlag; // -1: Storm window not applicable;
1689 : // 0: Window has storm window but it is off
1690 : // 1: Window has storm window and it is on
1691 : Array1D<int> SurfWinStormWinFlagPrevDay; // Previous time step value of StormWinFlag
1692 : Array1D<Real64> SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0
1693 : // if no shading device or shading device is off = 1.0 if shading device is on;
1694 : // For time intervals longer than a time step, = fraction of time that shading device is on.
1695 : EPVector<DataSurfaces::WinShadingType> SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step;
1696 : // 0 otherwise
1697 : Array1D<bool> SurfWinHasShadeOrBlindLayer; // mark as true if the window construction has a shade or a blind layer
1698 : Array1D<bool> SurfWinSurfDayLightInit; // surface has been initialized for following 5 arrays
1699 : Array1D<int> SurfWinDaylFacPoint; // Pointer to daylight factors for the window
1700 : Array1D<Real64> SurfWinVisTransSelected; // Window vis trans at normal incidence selected for use in dayltg calculation
1701 : Array1D<Real64> SurfWinSwitchingFactor; // Window switching factor (0.0 = unswitched; 1.0 = fully switched)
1702 : Array1D<Real64> SurfWinVisTransRatio; // For windows with switchable glazing,
1703 : // ratio of normal transmittance in switched state to that in unswitched state
1704 : Array1D<Real64> SurfWinFrameArea; // Frame projected area (m2)
1705 : Array1D<Real64> SurfWinFrameConductance; // Frame conductance [no air films] (W/m2-K)
1706 : Array1D<Real64> SurfWinFrameSolAbsorp; // Frame solar absorptance (assumed same inside and outside)
1707 : Array1D<Real64> SurfWinFrameVisAbsorp; // Frame visible absorptance (assumed same inside and outside)
1708 : Array1D<Real64> SurfWinFrameEmis; // Frame thermal emissivity (thermal absorptance) (assumed same inside and outside)
1709 : Array1D<Real64> SurfWinFrEdgeToCenterGlCondRatio; // Ratio of frame edge of glass conductance (without air films) to center of glass conductance
1710 : // (without air films)
1711 : Array1D<Real64> SurfWinFrameEdgeArea; // Area of glass near frame (m2)
1712 : Array1D<Real64> SurfWinFrameTempIn; // Frame inside surface temperature (C)
1713 : Array1D<Real64> SurfWinFrameTempInOld; // Previous value of frame inside surface temperature (C)
1714 : Array1D<Real64> SurfWinFrameTempSurfOut; // Frame outside surface temperature (C)
1715 : Array1D<Real64> SurfWinProjCorrFrOut; // Correction factor to absorbed radiation due to frame outside projection
1716 : Array1D<Real64> SurfWinProjCorrFrIn; // Correction factor to absorbed radiation due to frame inside projection
1717 : Array1D<DataSurfaces::FrameDividerType> SurfWinDividerType; // Divider type (1=DividedLite, 2=Suspended (between-pane))
1718 : Array1D<Real64> SurfWinDividerArea; // Divider projected area (m2)
1719 : Array1D<Real64> SurfWinDividerConductance; // Divider conductance [no air films] (W/m2-K)
1720 : Array1D<Real64> SurfWinDividerSolAbsorp; // Divider solar absorptance (assumed same inside and outside)
1721 : Array1D<Real64> SurfWinDividerVisAbsorp; // Divider visible absorptance (assumed same inside and outside)
1722 : Array1D<Real64> SurfWinDividerEmis; // Divider thermal emissivity (thermal absorptance) (assumed same inside and outside)
1723 : Array1D<Real64> SurfWinDivEdgeToCenterGlCondRatio; // Ratio of divider edge of glass conductance (without air films) to center of glass
1724 : // conductance (without air films)
1725 : Array1D<Real64> SurfWinDividerEdgeArea; // Area of glass near dividers (m2)
1726 : Array1D<Real64> SurfWinDividerTempIn; // Divider inside surface temperature (C)
1727 : Array1D<Real64> SurfWinDividerTempInOld; // Previous value of divider inside surface temperature (C)
1728 : Array1D<Real64> SurfWinDividerTempSurfOut; // Divider outside surface temperature (C)
1729 : Array1D<Real64> SurfWinProjCorrDivOut; // Correction factor to absorbed radiation due to divider outside projection
1730 : Array1D<Real64> SurfWinProjCorrDivIn; // Correction factor to absorbed radiation due to divider inside projection
1731 : Array1D<Real64> SurfWinShadeAbsFacFace1; // Fraction of short-wave radiation incident that is absorbed by face 1 when total absorbed radiation is
1732 : // apportioned to the two faces
1733 : Array1D<Real64> SurfWinShadeAbsFacFace2; // Fraction of short-wave radiation incident that is absorbed by face 2 when total absorbed radiation is
1734 : // apportioned to the two faces
1735 : Array1D<Real64> SurfWinConvCoeffWithShade; // Convection coefficient from glass or shade to gap air when interior
1736 : // or exterior shade is present (W/m2-K)
1737 : Array1D<Real64> SurfWinOtherConvHeatGain; // other convective = total conv - standard model prediction for EQL window model (W)
1738 : Array1D<int> SurfWinBlindNumber; // Blind number for a window with a blind
1739 : Array1D<Real64> SurfWinEffInsSurfTemp; // Effective inside surface temperature for window with interior blind or shade; combination of shade/blind
1740 : // and glass temperatures (C)
1741 : Array1D<bool> SurfWinMovableSlats; // True if window has a blind with movable slats
1742 : Array1D<Real64> SurfWinSlatAngThisTS; // Slat angle this time step for window with blind on (radians)
1743 : Array1D<Real64> SurfWinSlatAngThisTSDeg; // Slat angle this time step for window with blind on (deg)
1744 : Array1D<bool> SurfWinSlatAngThisTSDegEMSon; // flag that indicate EMS system is actuating SlatAngThisTSDeg
1745 : Array1D<Real64> SurfWinSlatAngThisTSDegEMSValue; // value that EMS sets for slat angle in degrees
1746 : Array1D<bool> SurfWinSlatsBlockBeam; // True if blind slats block incident beam solar
1747 : Array1D<int> SurfWinSlatsAngIndex;
1748 : Array1D<Real64> SurfWinSlatsAngInterpFac;
1749 : Array1D<Real64> SurfWinProfileAng;
1750 : Array1D<int> SurfWinProfAngIndex;
1751 : Array1D<Real64> SurfWinProfAngInterpFac;
1752 : Array1D<Real64> SurfWinBlindBmBmTrans;
1753 : Array1D<Real64> SurfWinBlindAirFlowPermeability; // Blind air-flow permeability for calculation of convective flow in gap between blind and glass
1754 : Array1D<Real64> SurfWinTotGlazingThickness; // Total glazing thickness from outside of outer glass to inside of inner glass (m)
1755 : Array1D<Real64> SurfWinTanProfileAngHor; // Tangent of horizontal profile angle
1756 : Array1D<Real64> SurfWinTanProfileAngVert; // Tangent of vertical profile angle
1757 : Array1D<Real64> SurfWinInsideSillDepth; // Depth of inside sill (m)
1758 : Array1D<Real64> SurfWinInsideReveal; // Depth of inside reveal (m)
1759 : Array1D<Real64> SurfWinInsideSillSolAbs; // Solar absorptance of inside sill
1760 : Array1D<Real64> SurfWinInsideRevealSolAbs; // Solar absorptance of inside reveal
1761 : Array1D<Real64> SurfWinOutsideRevealSolAbs; // Solar absorptance of outside reveal
1762 : Array1D<DataSurfaces::WindowAirFlowSource> SurfWinAirflowSource; // Source of gap airflow (INSIDEAIR, OUTSIDEAIR, etc.)
1763 : Array1D<DataSurfaces::WindowAirFlowDestination> SurfWinAirflowDestination; // Destination of gap airflow (INSIDEAIR, OUTSIDEAIR, etc.)
1764 : Array1D<int> SurfWinAirflowReturnNodePtr; // Return node pointer for destination = ReturnAir
1765 : Array1D<Real64> SurfWinMaxAirflow; // Maximum gap airflow (m3/s per m of glazing width)
1766 : Array1D<DataSurfaces::WindowAirFlowControlType> SurfWinAirflowControlType; // Gap airflow control type (ALWAYSONATMAXFLOW, etc.)
1767 : Array1D<bool> SurfWinAirflowHasSchedule; // True if gap airflow is scheduled
1768 : Array1D<int> SurfWinAirflowSchedulePtr; // Gap airflow schedule pointer
1769 : Array1D<Real64> SurfWinAirflowThisTS; // Gap airflow this timestep (m3/s per m of glazing width)
1770 : Array1D<Real64> SurfWinTAirflowGapOutlet; // Temperature of air leaving airflow gap between glass panes (C)
1771 : Array1D<int> SurfWinWindowCalcIterationsRep; // Number of iterations in window heat balance calculation
1772 : Array1D<Real64> SurfWinVentingOpenFactorMultRep; // Window/door opening modulation multiplier on venting open factor, for reporting
1773 : Array1D<Real64> SurfWinInsideTempForVentingRep; // Inside air temp used to control window/door venting, for reporting (C)
1774 : Array1D<Real64> SurfWinVentingAvailabilityRep; // Venting availability schedule value (0.0/1.0 = no venting allowed/not allowed)
1775 : Array1D<Real64> SurfWinSkyGndSolarInc; // Incident diffuse solar from ground-reflected sky radiation; used for Complex Fen; if CalcSolRefl is
1776 : // true, accounts for shadowing of ground by building and obstructions [W/m2]
1777 : Array1D<Real64> SurfWinBmGndSolarInc; // Incident diffuse solar from ground-reflected beam radiation; used for Complex Fen; if CalcSolRefl is
1778 : // true, accounts for shadowing of ground by building and obstructions [W/m2]
1779 : Array1D<bool> SurfWinSolarDiffusing; // True if exterior window with a construction that contains a diffusing glass layer
1780 : Array1D<Real64> SurfWinFrameHeatGain;
1781 : Array1D<Real64> SurfWinFrameHeatLoss;
1782 : Array1D<Real64> SurfWinDividerHeatLoss;
1783 : Array1D<Real64> SurfWinTCLayerTemp; // The temperature of the thermochromic layer of the window
1784 : Array1D<Real64> SurfWinSpecTemp; // The specification temperature of the TC layer glass Added for W6 integration June 2010
1785 : Array1D<DataSurfaces::WindowModel> SurfWinWindowModelType; // if set to WindowBSDFModel, then uses BSDF methods
1786 : Array1D<Real64> SurfWinTDDPipeNum; // Tubular daylighting device pipe number for TDD domes and diffusers
1787 : Array1D<int> SurfWinStormWinConstr; // Construction with storm window (windows only)
1788 : Array1D<int> SurfActiveConstruction; // The currently active construction with or without storm window
1789 : Array1D<int> SurfWinActiveShadedConstruction; // The currently active shaded construction with or without storm window (windows only)
1790 :
1791 : EPVector<DataSurfaces::SurfaceData> Surface;
1792 : EPVector<DataSurfaces::SurfaceWindowCalc> SurfaceWindow;
1793 : Array1D<DataSurfaces::FrameDividerProperties> FrameDivider;
1794 : EPVector<DataSurfaces::StormWindowData> StormWindow;
1795 : EPVector<DataSurfaces::WindowShadingControlData> WindowShadingControl;
1796 : EPVector<DataSurfaces::OSCData> OSC;
1797 : EPVector<DataSurfaces::OSCMData> OSCM;
1798 : EPVector<DataSurfaces::ConvectionCoefficient> userIntConvModels;
1799 : EPVector<DataSurfaces::ConvectionCoefficient> userExtConvModels;
1800 : EPVector<DataSurfaces::ShadingVertexData> ShadeV;
1801 : EPVector<DataSurfaces::SurfaceSolarIncident> SurfIncSolSSG;
1802 : EPVector<DataSurfaces::SurfaceIncidentSolarMultiplier> SurfIncSolMultiplier;
1803 : EPVector<DataSurfaces::FenestrationSolarAbsorbed> FenLayAbsSSG;
1804 : EPVector<DataSurfaces::SurfaceLocalEnvironment> SurfLocalEnvironment;
1805 : EPVector<DataSurfaces::SurroundingSurfacesProperty> SurroundingSurfsProperty;
1806 : EPVector<DataSurfaces::IntMassObject> IntMassObjects;
1807 : EPVector<DataSurfaces::GroundSurfacesProperty> GroundSurfsProperty;
1808 :
1809 : int actualMaxSlatAngs = Material::MaxSlatAngs; // If there are no blinds in the model, then this is changed to 1 (used for shades)
1810 :
1811 796 : void init_state([[maybe_unused]] EnergyPlusData &state) override
1812 : {
1813 796 : }
1814 :
1815 0 : void clear_state() override
1816 : {
1817 0 : new (this) SurfacesData();
1818 0 : }
1819 : };
1820 :
1821 : } // namespace EnergyPlus
1822 :
1823 : #endif
|