Line data Source code
1 : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
2 : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
3 : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
4 : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
5 : // contributors. All rights reserved.
6 : //
7 : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
8 : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
9 : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
10 : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
11 : // derivative works, and perform publicly and display publicly, and to permit others to do so.
12 : //
13 : // Redistribution and use in source and binary forms, with or without modification, are permitted
14 : // provided that the following conditions are met:
15 : //
16 : // (1) Redistributions of source code must retain the above copyright notice, this list of
17 : // conditions and the following disclaimer.
18 : //
19 : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
20 : // conditions and the following disclaimer in the documentation and/or other materials
21 : // provided with the distribution.
22 : //
23 : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
24 : // the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
25 : // used to endorse or promote products derived from this software without specific prior
26 : // written permission.
27 : //
28 : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
29 : // without changes from the version obtained under this License, or (ii) Licensee makes a
30 : // reference solely to the software portion of its product, Licensee must refer to the
31 : // software as "EnergyPlus version X" software, where "X" is the version number Licensee
32 : // obtained under this License and may not use a different name for the software. Except as
33 : // specifically required in this Section (4), Licensee shall not use in a company name, a
34 : // product name, in advertising, publicity, or other promotional activities any name, trade
35 : // name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
36 : // similar designation, without the U.S. Department of Energy's prior written consent.
37 : //
38 : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
39 : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
40 : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41 : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42 : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
43 : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44 : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
45 : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 : // POSSIBILITY OF SUCH DAMAGE.
47 :
48 : #ifndef 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.fwd.hh>
60 :
61 : using ObjexxFCL::Vector4;
62 :
63 : // EnergyPlus Headers
64 : #include <EnergyPlus/ConvectionConstants.hh>
65 : #include <EnergyPlus/Data/BaseData.hh>
66 : #include <EnergyPlus/DataBSDFWindow.hh>
67 : #include <EnergyPlus/DataGlobals.hh>
68 : #include <EnergyPlus/DataVectorTypes.hh>
69 : #include <EnergyPlus/DataWindowEquivalentLayer.hh>
70 : #include <EnergyPlus/EnergyPlus.hh>
71 : #include <EnergyPlus/Material.hh>
72 : #include <EnergyPlus/ScheduleManager.hh>
73 : #include <EnergyPlus/Shape.hh>
74 :
75 : namespace EnergyPlus {
76 :
77 : // Forward declarations
78 : struct EnergyPlusData;
79 :
80 : namespace DataSurfaces {
81 :
82 : // Using/Aliasing
83 : using DataBSDFWindow::BSDFWindowDescript;
84 : using DataVectorTypes::Vector;
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 867424 : constexpr bool NOT_SHADED(WinShadingType const ShadingFlag)
366 : {
367 867424 : 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 182050 : constexpr bool IS_SHADED(WinShadingType const ShadingFlag)
373 : {
374 182050 : 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 84986 : constexpr bool IS_SHADED_NO_GLARE_CTRL(WinShadingType const ShadingFlag)
380 : {
381 84985 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::SwitchableGlazing ||
382 84985 : ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::ExtScreen || ShadingFlag == WinShadingType::IntBlind ||
383 169971 : 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 16102 : constexpr bool ANY_SHADE(WinShadingType const ShadingFlag)
388 : {
389 16102 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::BGShade);
390 : }
391 :
392 273979 : constexpr bool ANY_SHADE_SCREEN(WinShadingType const ShadingFlag)
393 : {
394 273979 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::BGShade ||
395 273979 : ShadingFlag == WinShadingType::ExtScreen);
396 : }
397 :
398 481353 : constexpr bool ANY_BLIND(WinShadingType const ShadingFlag)
399 : {
400 481353 : return (ShadingFlag == WinShadingType::IntBlind || ShadingFlag == WinShadingType::ExtBlind || ShadingFlag == WinShadingType::BGBlind);
401 : }
402 :
403 1991935 : constexpr bool ANY_INTERIOR_SHADE_BLIND(WinShadingType const ShadingFlag)
404 : {
405 1991935 : return (ShadingFlag == WinShadingType::IntShade || ShadingFlag == WinShadingType::IntBlind);
406 : }
407 :
408 644996 : constexpr bool ANY_EXTERIOR_SHADE_BLIND_SCREEN(WinShadingType const ShadingFlag)
409 : {
410 644996 : return (ShadingFlag == WinShadingType::ExtShade || ShadingFlag == WinShadingType::ExtBlind || ShadingFlag == WinShadingType::ExtScreen);
411 : }
412 :
413 551148 : constexpr bool ANY_BETWEENGLASS_SHADE_BLIND(WinShadingType const ShadingFlag)
414 : {
415 551148 : 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 70 : Surface2DSlab(Real64 const yl, Real64 const yu) : xl(0.0), xu(0.0), yl(yl), yu(yu)
485 : {
486 70 : }
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 5546 : Surface2D()
514 5546 : {
515 5546 : }
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 movInsulExtSchedNum = Sched::SchedNum_Invalid; // Schedule for exterior movable insulation
593 : int movInsulIntSchedNum = Sched::SchedNum_Invalid; // Schedule for interior movable insulation
594 : int externalShadingSchedNum = Sched::SchedNum_Invalid; // 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 outsideHeatSourceTermSchedNum = Sched::SchedNum_Invalid; // schedule of additional source of heat flux rate applied to the outside surface
598 : int insideHeatSourceTermSchedNum = Sched::SchedNum_Invalid; // schedule of additional source of heat flux rate applied to the inside surface
599 :
600 : // based on boost::hash_combine
601 384 : std::size_t hash_combine(std::size_t current_hash, std::size_t new_hash) const
602 : {
603 384 : current_hash ^= new_hash + 0x9e3779b9 + (current_hash << 6) + (current_hash >> 2);
604 384 : return current_hash;
605 : }
606 :
607 12 : std::vector<std::size_t> get_hash_list() const
608 : {
609 : using std::hash;
610 :
611 12 : 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>()(movInsulExtSchedNum),
640 0 : hash<int>()(movInsulIntSchedNum),
641 0 : hash<int>()(externalShadingSchedNum),
642 0 : hash<int>()(SurroundingSurfacesNum),
643 0 : hash<int>()(LinkedOutAirNode),
644 0 : hash<int>()(outsideHeatSourceTermSchedNum),
645 36 : hash<int>()(insideHeatSourceTermSchedNum)};
646 : }
647 :
648 12 : std::size_t get_hash() const
649 : {
650 12 : auto hash_list = get_hash_list();
651 12 : std::size_t combined_hash = 0u;
652 396 : for (auto hash : hash_list) {
653 384 : combined_hash = hash_combine(combined_hash, hash);
654 : }
655 12 : return combined_hash;
656 12 : }
657 :
658 6 : bool operator==(const SurfaceCalcHashKey &other) const
659 : {
660 6 : return (Construction == other.Construction && Azimuth == other.Azimuth && Tilt == other.Tilt && Height == other.Height &&
661 6 : Zone == other.Zone && EnclIndex == other.EnclIndex && ExtZone == other.ExtZone && ExtCond == other.ExtCond &&
662 6 : ExtEnclIndex == other.ExtEnclIndex && ExtSolar == other.ExtSolar && ExtWind == other.ExtWind &&
663 6 : ViewFactorGround == other.ViewFactorGround && ViewFactorSky == other.ViewFactorSky &&
664 :
665 6 : HeatTransferAlgorithm == other.HeatTransferAlgorithm && intConvModel == other.intConvModel &&
666 6 : intConvUserModelNum == other.intConvUserModelNum && extConvUserModelNum == other.extConvUserModelNum &&
667 6 : extConvModel == other.extConvModel && OSCPtr == other.OSCPtr && OSCMPtr == other.OSCMPtr &&
668 :
669 6 : FrameDivider == other.FrameDivider && SurfWinStormWinConstr == other.SurfWinStormWinConstr &&
670 :
671 6 : MaterialMovInsulExt == other.MaterialMovInsulExt && MaterialMovInsulInt == other.MaterialMovInsulInt &&
672 6 : movInsulExtSchedNum == other.movInsulExtSchedNum && movInsulIntSchedNum == other.movInsulIntSchedNum &&
673 6 : externalShadingSchedNum == other.externalShadingSchedNum && SurroundingSurfacesNum == other.SurroundingSurfacesNum &&
674 18 : LinkedOutAirNode == other.LinkedOutAirNode && outsideHeatSourceTermSchedNum == other.outsideHeatSourceTermSchedNum &&
675 12 : insideHeatSourceTermSchedNum == other.insideHeatSourceTermSchedNum);
676 : }
677 : };
678 :
679 : struct SurfaceCalcHasher
680 : {
681 12 : std::size_t operator()(const SurfaceCalcHashKey &key) const
682 : {
683 12 : 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 : Sched::Schedule *outsideHeatSourceTermSched = nullptr; // Schedule of additional source of heat flux rate applied to the outside surface
753 : Sched::Schedule *insideHeatSourceTermSched = nullptr; // 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 : Sched::Schedule *shadowSurfSched = nullptr; // 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 : Sched::Schedule *surfExternalShadingSched = nullptr; // 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 5546 : SurfaceData()
832 16638 : : Construction(0), RepresentativeCalcSurfNum(-1), ConstructionStoredInputValue(0), Class(SurfaceClass::None), Shape(SurfaceShape::None),
833 5546 : 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 11092 : 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 5546 : 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 5546 : CosAzim(0.0), SinTilt(0.0), CosTilt(0.0), IsConvex(true), IsDegenerate(false), VerticesProcessed(false), XShift(0.0), YShift(0.0),
837 16638 : HeatTransSurf(false), HeatTransferAlgorithm(HeatTransferModel::Invalid), BaseSurf(0), NumSubSurfaces(0), Zone(0), spaceNum(0),
838 5546 : ExtBoundCond(0), ExtSolar(false), ExtWind(false), hasIncSolMultiplier(false), IncSolMultiplier(1.0), ViewFactorGround(0.0),
839 5546 : ViewFactorSky(0.0), ViewFactorGroundIR(0.0), ViewFactorSkyIR(0.0), OSCPtr(0), OSCMPtr(0), MirroredSurf(false), IsShadowing(false),
840 11092 : IsShadowPossibleObstruction(false), IsTransparent(false), SchedMinValue(0.0), activeWindowShadingControl(0), HasShadeControl(false),
841 11092 : activeShadedConstruction(0), activeShadedConstructionPrev(0), FrameDivider(0), Multiplier(1.0), SolarEnclIndex(0),
842 11092 : SolarEnclSurfIndex(0), IsAirBoundarySurf(false), IsSurfPropertyGndSurfacesDefined(false), SurfPropertyGndSurfIndex(0),
843 5546 : UseSurfPropertyGndSurfTemp(false), UseSurfPropertyGndSurfRefl(false), GndReflSolarRad(0.0), SurfHasSurroundingSurfProperty(false),
844 16638 : SurfSchedExternalShadingFrac(false), SurfSurroundingSurfacesNum(0), SurfLinkedOutAirNode(0), SrdSurfTemp(0.0), ViewFactorSrdSurfs(0.0)
845 : {
846 5546 : }
847 :
848 : public: // Methods
849 : // Set Precomputed Parameters
850 : void set_computed_geometry();
851 :
852 : Real64 getInsideAirTemperature(EnergyPlusData &state, const int t_SurfNum) const;
853 :
854 : Real64 getOutsideAirTemperature(EnergyPlusData &state, int t_SurfNum) const;
855 :
856 : Real64 getOutsideIR(EnergyPlusData &state, int t_SurfNum) const;
857 :
858 : static Real64 getSWIncident(EnergyPlusData &state, int t_SurfNum);
859 :
860 : int getTotLayers(EnergyPlusData &state) const;
861 :
862 : Real64 get_average_height(EnergyPlusData &state) const;
863 :
864 : void make_hash_key(EnergyPlusData &state, const int SurfNum);
865 :
866 : void set_representative_surface(EnergyPlusData &state, const int SurfNum);
867 :
868 : private: // Methods
869 : // Computed Shape Category
870 : ShapeCat computed_shapeCat() const;
871 :
872 : // Computed Plane
873 : Plane computed_plane() const;
874 :
875 : // Computed axis-projected 2D surface
876 : Surface2D computed_surface2d() const;
877 : };
878 :
879 : struct SurfaceWindowRefPt
880 : {
881 : Real64 solidAng = 0.0; // Solid angle subtended by window from daylit ref points 1 and 2
882 : Real64 solidAngWtd = 0.0; // Solid angle subtended by window from ref pts weighted by glare pos factor
883 : std::array<std::array<Real64, (int)WinCover::Num>, (int)Lum::Num> lums = {{{0.0, 0.0}}};
884 : Real64 illumFromWinRep = 0.0; // Illuminance from window at reference point N [lux]
885 : Real64 lumWinRep = 0.0; // Window luminance as viewed from reference point N [cd/m2]
886 : };
887 :
888 : struct SurfaceWindowCalc // Calculated window-related values
889 : {
890 : // Members
891 : Array1D<SurfaceWindowRefPt> refPts;
892 :
893 : Vector3<Real64> WinCenter = {0.0, 0.0, 0.0}; // X,Y,Z coordinates of window center point in building coord system
894 :
895 : Real64 theta = 0.0; // Azimuth of window normal (rad)
896 : Real64 phi = 0.0; // Altitude of window normal (rad)
897 : Real64 rhoCeilingWall = 0.0; // Average interior reflectance seen by light moving up across horizontal plane thru center of window
898 : Real64 rhoFloorWall = 0.0; // Same as above, but for light moving down
899 : Real64 fractionUpgoing = 0.0; // Fraction light entering window that goes upward
900 :
901 : Real64 glazedFrac = 1.0; // (Glazed area)/(Glazed area + divider area)
902 : Real64 centerGlassArea = 0.0; // Center of glass area (m2); area of glass where 1-D conduction dominates
903 : Real64 edgeGlassCorrFac = 1.0; // Correction factor to center-of-glass conductance to account for 2-D glass conduction thermal bridging
904 : // effects near frame and divider
905 :
906 : int screenNum = 0; // Screen material number for a window with a screen
907 : Real64 lightWellEff = 1.0; // Light well efficiency (multiplier on exterior window vis trans due to light well losses)
908 :
909 : // What is 10 here?
910 : std::array<Real64, 10 + 1> thetaFace = {296.15}; // Face temperatures of window layers (K)
911 :
912 : // Multiplier on sunlit fraction due to shadowing of glass by
913 : // frame and divider outside projections
914 : std::array<Real64, (int)Constant::iHoursInDay + 1> OutProjSLFracMult = {1.0};
915 : // Multiplier on sunlit fraction due to shadowing of glass by
916 : // frame and divider inside and outside projections
917 : std::array<Real64, (int)Constant::iHoursInDay + 1> InOutProjSLFracMult = {1.0};
918 :
919 : // for shadowing of ground by building and obstructions [W/m2]
920 : // Enclosure inside surface area minus this surface and its
921 : // subsurfaces for floor/wall/ceiling (m2)
922 : std::array<Real64, (int)FWC::Num> EnclAreaMinusThisSurf = {0.0, 0.0, 0.0};
923 : // Enclosure product of inside surface area times vis
924 : // reflectance minus this surface and its subsurfaces, for
925 : // floor/wall/ceiling (m2)
926 : std::array<Real64, (int)FWC::Num> EnclAreaReflProdMinusThisSurf = {0.0, 0.0, 0.0};
927 :
928 : BSDFWindowDescript ComplexFen; // Data for complex fenestration, see DataBSDFWindow.cc for declaration
929 : bool hasShade = false;
930 : bool hasBlind = false;
931 : bool hasScreen = false;
932 : };
933 :
934 : struct SurfaceShade
935 : {
936 : struct
937 : {
938 : int matNum = 0;
939 : bool movableSlats = false; // True if window has a blind with movable slats
940 : Real64 slatAng = 0.0; // Slat angle this time step for window with blind on (radians)
941 : Real64 slatAngDeg = 0.0; // Slat angle this time step for window with blind on (deg)
942 : bool slatAngDegEMSon = false; // flag that indicate EMS system is actuating SlatAngThisTSDeg
943 : Real64 slatAngDegEMSValue = 0.0; // value that EMS sets for slat angle in degrees
944 : bool slatBlockBeam = false; // True if blind slats block incident beam solar
945 : int slatAngIdxLo = -1;
946 : int slatAngIdxHi = -1;
947 : Real64 slatAngInterpFac = 0.0;
948 : Real64 profAng = 0.0;
949 : int profAngIdxLo = 0;
950 : int profAngIdxHi = 0;
951 : Real64 profAngInterpFac = 0.0;
952 : Real64 bmBmTrans = 0.0;
953 : Real64 airFlowPermeability = 0.0; // Blind air-flow permeability for calculation of convective flow in gap between blind and glass
954 :
955 : // Properties are profile-angle dependent
956 : Material::BlindTraAbsRef<Material::MaxProfAngs + 1> TAR;
957 : } blind;
958 :
959 : // Save these from the glass in case we need to recalculate blind properties
960 : struct
961 : {
962 : Real64 epsIR = 0.0;
963 : Real64 rhoIR = 0.0;
964 : } glass;
965 :
966 : Real64 effShadeEmi = 0.0; // Effective emissivity of interior blind or shade
967 : Real64 effGlassEmi = 0.0; // Effective emissivity of glass adjacent to interior blind or shade
968 : };
969 :
970 : struct SurfaceWindowFrameDiv
971 : {
972 : };
973 :
974 : enum class NfrcProductOptions : int
975 : {
976 : Invalid = -1,
977 : CasementDouble,
978 : CasementSingle,
979 : DualAction,
980 : Fixed,
981 : Garage,
982 : Greenhouse,
983 : HingedEscape,
984 : HorizontalSlider,
985 : Jal,
986 : Pivoted,
987 : ProjectingSingle,
988 : ProjectingDual,
989 : DoorSidelite,
990 : Skylight,
991 : SlidingPatioDoor,
992 : CurtainWall,
993 : SpandrelPanel,
994 : SideHingedDoor,
995 : DoorTransom,
996 : TropicalAwning,
997 : TubularDaylightingDevice,
998 : VerticalSlider,
999 : Num
1000 : };
1001 :
1002 : enum class NfrcVisionType : int
1003 : {
1004 : Invalid = -1,
1005 : Single,
1006 : DualVertical,
1007 : DualHorizontal,
1008 : Num
1009 : };
1010 :
1011 : enum class FrameDividerType : int
1012 : {
1013 : Invalid = -1,
1014 : DividedLite,
1015 : Suspended,
1016 : Num
1017 : };
1018 :
1019 : // Type of control order when multiple surfaces are referenced
1020 : enum class MultiSurfaceControl
1021 : {
1022 : Invalid = -1,
1023 : Sequential,
1024 : Group,
1025 : Num
1026 : };
1027 :
1028 : struct FrameDividerProperties
1029 : {
1030 : // Members
1031 : std::string Name; // Name of frame/divider
1032 : Real64 FrameWidth; // Average width of frame in plane of window {m}
1033 : Real64 FrameProjectionOut; // Distance normal to window between outside face of outer pane
1034 : // and outside of frame {m}
1035 : Real64 FrameProjectionIn; // Distance normal to window between inside face of inner pane
1036 : // and inside of frame {m}
1037 : Real64 FrameConductance; // Effective conductance of frame (no air films) {W/m2-K}
1038 : Real64 FrameEdgeWidth; // default 2.5 in ! Width of glass edge region near frame {m}
1039 : Real64 FrEdgeToCenterGlCondRatio; // Ratio of frame edge of glass conductance (without air films) to
1040 : // center of glass conductance (without air films)
1041 : Real64 FrameSolAbsorp; // Solar absorptance of frame corrected for self-shading
1042 : Real64 FrameVisAbsorp; // Visible absorptance of frame corrected for self-shading
1043 : Real64 FrameEmis; // Thermal emissivity of frame
1044 : FrameDividerType DividerType; // Type of divider {DividedLite or Suspended (between-glass}
1045 : Real64 DividerWidth; // Average width of divider in plane of window {m}
1046 : int HorDividers; // Number of horizontal dividers
1047 : int VertDividers; // Number of vertical dividers
1048 : Real64 DividerProjectionOut; // Distance normal to window between outside face of outer pane
1049 : // and outside of divider {m}
1050 : Real64 DividerProjectionIn; // Distance normal to window between inside face of inner pane
1051 : // and inside of divider {m}
1052 : Real64 DividerEdgeWidth; // default 2.5 in ! Width of glass edge region near divider
1053 : Real64 DividerConductance; // Effective conductance of divider (no air films) {W/m2-K}
1054 : Real64 DivEdgeToCenterGlCondRatio; // Ratio of divider edge of glass conductance (without air films) to
1055 : // center of glass conductance (without air films)
1056 : Real64 DividerSolAbsorp; // Solar absorptance of divider corrected for self-shading
1057 : Real64 DividerVisAbsorp; // Visible absorptance of divider corrected for self-shading
1058 : Real64 DividerEmis; // Thermal emissivity of divider
1059 : DataWindowEquivalentLayer::Orientation MullionOrientation; // Horizontal or Vertical; used only for windows with two glazing systems
1060 : // divided by a mullion; obtained from Window5 data file.
1061 : NfrcProductOptions NfrcProductType; // NFRC Product Type for Assembly Calculations
1062 : Real64 OutsideRevealSolAbs; // Solar absorptance of outside reveal
1063 : Real64 InsideSillDepth; // Inside sill depth (m)
1064 : Real64 InsideReveal; // Inside reveal (m)
1065 : Real64 InsideSillSolAbs; // Solar absorptance of inside sill
1066 : Real64 InsideRevealSolAbs; // Solar absorptance of inside reveal
1067 :
1068 : // Default Constructor
1069 31 : FrameDividerProperties()
1070 62 : : FrameWidth(0.0), FrameProjectionOut(0.0), FrameProjectionIn(0.0), FrameConductance(0.0), FrameEdgeWidth(0.06355),
1071 31 : FrEdgeToCenterGlCondRatio(1.0), FrameSolAbsorp(0.0), FrameVisAbsorp(0.0), FrameEmis(0.9), DividerType(FrameDividerType::DividedLite),
1072 31 : DividerWidth(0.0), HorDividers(0), VertDividers(0), DividerProjectionOut(0.0), DividerProjectionIn(0.0), DividerEdgeWidth(0.06355),
1073 31 : DividerConductance(0.0), DivEdgeToCenterGlCondRatio(1.0), DividerSolAbsorp(0.0), DividerVisAbsorp(0.0), DividerEmis(0.9),
1074 31 : MullionOrientation(DataWindowEquivalentLayer::Orientation::Invalid), NfrcProductType(NfrcProductOptions::CurtainWall),
1075 31 : OutsideRevealSolAbs(0.0), InsideSillDepth(0.0), InsideReveal(0.0), InsideSillSolAbs(0.0), InsideRevealSolAbs(0.0)
1076 : {
1077 31 : }
1078 : };
1079 :
1080 : struct StormWindowData
1081 : {
1082 : // Members
1083 : int BaseWindowNum; // Surface number of associated exterior window
1084 : int StormWinMaterialNum; // Material number of storm window glass
1085 : Real64 StormWinDistance; // Distance between storm window glass and adjacent glass (m)
1086 : int DateOn; // Date (julian) storm window is put on
1087 : int MonthOn; // Month storm window is put on
1088 : int DayOfMonthOn; // Day of month storm window is put on
1089 : int DateOff; // Date (julian) storm window is taken off
1090 : int MonthOff; // Month storm window is taken off
1091 : int DayOfMonthOff; // Day of month storm window is taken off
1092 :
1093 : // Default Constructor
1094 0 : StormWindowData()
1095 0 : : BaseWindowNum(0), StormWinMaterialNum(0), StormWinDistance(0.0), DateOn(0), MonthOn(0), DayOfMonthOn(0), DateOff(0), MonthOff(0),
1096 0 : DayOfMonthOff(0)
1097 : {
1098 0 : }
1099 : };
1100 :
1101 : struct WindowShadingControlData
1102 : {
1103 : // Members
1104 : std::string Name; // User supplied name of this set of shading control data
1105 : int ZoneIndex{0}; // number of the zone referenced
1106 : int SequenceNumber{0}; // Shading control sequence number
1107 : WinShadingType ShadingType{WinShadingType::NoShade}; // Shading type (InteriorShade, SwitchableGlazing,
1108 : // CHARACTER(len=32) :: ShadingType = ' ' ! Shading type (InteriorShade, SwitchableGlazing,
1109 : // ExteriorShade,InteriorBlind,ExteriorBlind,BetweenGlassShade,
1110 : // BetweenGlassBlind, or ExteriorScreen)
1111 : int getInputShadedConstruction{0}; // Pointer to the shaded construction (for ShadingType=ExteriorScreen,InteriorShade,
1112 : // ExteriorShade,BetweenGlassShade,InteriorBlind,ExteriorBlind,BetweenGlassBlind;
1113 : // this must be a window construction with a screen, shade or blind layer)
1114 : // this is only used during GetInput and should not be used during timestep calculations
1115 : int ShadingDevice{0}; // Pointer to the material for the shading device (for ShadingType=InteriorShade,
1116 : // ExteriorShade,BetweenGlassShade,InteriorBlind,ExteriorBlind,BetweenGlassBlind,
1117 : // ExteriorScreen;
1118 : // this must be a Material:WindowShade, Material:WindowScreen, or Material:WindowBlind
1119 : WindowShadingControlType shadingControlType{
1120 : WindowShadingControlType::Invalid}; // Takes one of the following values that specifies type of shading control
1121 : // CHARACTER(len=60) :: ShadingControlType =' ' ! Takes one of the following values that specifies type of shading control
1122 : // (control is active only when schedule value = 1; if no schedule
1123 : // specified, schedule value defaults to 1)
1124 : // AlwaysOn: always shaded; not affected by schedule
1125 : // AlwaysOff: never shaded; not affected by schedule
1126 : // OnIfScheduleAllows: unshaded if sch val = 0, shaded if = 1
1127 : // OnIfHighSolarOnWindow: shaded if incident direct + diffuse > setpoint (W/m2 of window)
1128 : // OnIfHighHorizontalSolar: shaded if direct + diffuse horizontal solar > setpoint
1129 : // (W/m2 of ground)
1130 : // OnIfHighOutsideAirTemp: shaded if outside drybulb > setpoint (C)
1131 : // OnIfHighZoneAirTemp: shaded if previous time step zone temperature > setpoint (C)
1132 : // OnIfHighZoneCooling: shaded if previous time step zone cooling rate > setpoint (W)
1133 : // OnIfHighGlare: shaded if total daylight glare index at first daylighting reference point
1134 : // from all exterior windows in zone > maximum glare specified in daylighting
1135 : // input for zone.
1136 : // MeetDaylightIlluminanceSetpoint: shading is adjusted to just meet illuminance setpoint
1137 : // at first reference point (only for ShadingType=SwitchableGlazing)
1138 : // The following three controls are used primarily to reduce zone heating load. They
1139 : // can be used with any shading type but are most appropriate for opaque interior
1140 : // or exterior shades with a high insulating value ("opaque movable insulation").
1141 : // OnNightIfLowOutsideTemp/OffDay: shaded at night if outside temp < setpoint (C)
1142 : // OnNightIfLowInsideTemp/OffDay: shaded at night if previous time step zone air temp < setpoint (C)
1143 : // OnNightIfHeating/OffDay: shaded at night if previous time step zone heating rate > setpoint (W)
1144 : // The following two controls are used to reduce zone heating and cooling loads.
1145 : // They can be used with any shading type but are most appropriate for translucent
1146 : // interior or exterior shades with a high insulating value ("translucent movable insulation")
1147 : // OnNightIfLowOutsideTemp/OnDayIfCooling: shaded at night if outside temp < setpoint (C);
1148 : // shaded daytime if prev. time step cooling rate > 0
1149 : // OnNightIfHeating/OnDayIfCooling: shaded at night if prev. time step heating rate > setpoint (W);
1150 : // shaded daytime if prev. time step cooling rate > 0
1151 : // The following two controls are used to reduce zone cooling load. They can be used
1152 : // with any shading type but are most appropriate for interior or exterior blinds, interior
1153 : // or exterior shades with low insulating value, or switchable glazing.
1154 : // OffNight/OnDayIfCoolingAndHighSolarOnWindow: shading off at night; shading on daytime if
1155 : // solar on window > setpoint (W/m2 of window) and
1156 : // prev. time step cooling rate > 0
1157 : // OnNight/OnDayIfCoolingAndHighSolarOnWindow: shading on at night; shading on daytime if
1158 : // solar on window > setpoint (W/m2 of window) and
1159 : // prev. time step cooling rate > 0
1160 : Sched::Schedule *sched = nullptr; // schedule of 0 and 1 values: 0 => window is not shaded;
1161 : // 1 => window is shaded if Type=Schedule or Type = ScheduleAnd...
1162 : // and setpoint is exceeded.
1163 : Real64 SetPoint{0.0}; // Control setpoint (dimension depends on Trigger:
1164 : // W/m2 of window area for solar on window,
1165 : // W/m2 of ground area for horizontal solar,
1166 : // deg C for air temp, W for zone heating and
1167 : // cooling rate). Not used for Shading Control Type =
1168 : // MeetDaylightIlluminanceSetpoint or OnIfHighGlare.
1169 : Real64 SetPoint2{0.0}; // Second control setpoint for control types that take two setpoints.
1170 : // Dimension is deg C or W/m2.
1171 : bool ShadingControlIsScheduled{false}; // True if shading control has a schedule
1172 : bool GlareControlIsActive{false}; // True if shading control to reduce daylight glare is active
1173 : Sched::Schedule *slatAngleSched = nullptr; // schedule of slat angle values between 0.0 and 180.0 degrees
1174 : SlatAngleControl slatAngleControl{
1175 : SlatAngleControl::Invalid}; // Takes one of the following values that specifies
1176 : // CHARACTER(len=32) :: slatAngleControlForBlinds = ' ' ! Takes one of the following values that specifies
1177 : // how slat angle is controled in a blind when ShadingType =
1178 : // InteriorBlind, ExteriorBlind or BetweenGlassBlind.
1179 : // FixedSlatAngle: the slat angle is fixed at the constant value given in the
1180 : // associated Material:WindowBlind
1181 : // ScheduledSlatAngle: the slat angle in degrees between 1 and 180 is given
1182 : // by the schedule with index SlatAngleSchedule
1183 : // BlockBeamSolar: if beam solar is incident on the window, and a blind is on the
1184 : // window, the slat angle is adjusted to just block beam solar; otherwise the
1185 : // slat angle is set to the value given in the associated Material:WindowBlind.
1186 : std::string DaylightingControlName; // string holding the Daylighting Control Object Name string
1187 : int DaylightControlIndex{0}; // Pointer to the array of Daylighting Controls
1188 : MultiSurfaceControl multiSurfaceControl{
1189 : MultiSurfaceControl::Invalid}; // True if Group, False if Sequential - type of control order when multiple surfaces are referenced
1190 : int FenestrationCount{0}; // count of fenestration references
1191 : Array1D<std::string> FenestrationName; // string holding list of fenestration surfaces
1192 : Array1D_int FenestrationIndex; // Pointers to fenestration surfaces
1193 : };
1194 :
1195 : struct OSCData
1196 : {
1197 : // Members
1198 : std::string Name; // Name of OSC
1199 : Real64 ConstTemp; // User selected constant temperature (degrees C)
1200 : Real64 ConstTempCoef; // Coefficient modifying the user selected constant temperature
1201 : Real64 ExtDryBulbCoef; // Coefficient modifying the external dry bulb temperature
1202 : Real64 GroundTempCoef; // Coefficient modifying the ground temperature
1203 : Real64 SurfFilmCoef; // Combined convective/radiative film coefficient if >0, else use other coefficients
1204 : Real64 WindSpeedCoef; // Coefficient modifying the wind speed term (s/m)
1205 : Real64 ZoneAirTempCoef; // Coefficient modifying the zone air temperature part of the equation
1206 : std::string ConstTempScheduleName; // Schedule name for scheduled outside temp
1207 : Sched::Schedule *constTempSched = nullptr; // Index for scheduled outside temp.
1208 : bool SinusoidalConstTempCoef; // If true then ConstTempCoef varies by sine wave
1209 : Real64 SinusoidPeriod; // period of sine wave variation (hr)
1210 : Real64 TPreviousCoef; // Coefficient modifying the OSC temp from the previous timestep (dimensionless)
1211 : Real64 TOutsideSurfPast; // Ouside surface temperature from previous timestep {C}
1212 : Real64 MinTempLimit; // Minimum limit on OSC temp {deg C}
1213 : Real64 MaxTempLimit; // Maximum limit on OSC temp {deg C}
1214 : bool MinLimitPresent; // If TRUE then apply minimum limit on calculated OSC temp
1215 : bool MaxLimitPresent; // If TRUE then apply maximum limit on calculated OSC temp
1216 : Real64 OSCTempCalc; // Result of calculated temperature using OSC (degrees C)
1217 :
1218 : // Default Constructor
1219 233 : OSCData()
1220 466 : : ConstTemp(0.0), ConstTempCoef(0.0), ExtDryBulbCoef(0.0), GroundTempCoef(0.0), SurfFilmCoef(0.0), WindSpeedCoef(0.0),
1221 466 : ZoneAirTempCoef(0.0), SinusoidalConstTempCoef(false), SinusoidPeriod(0.0), TPreviousCoef(0.0), TOutsideSurfPast(0.0), MinTempLimit(0.0),
1222 233 : MaxTempLimit(0.0), MinLimitPresent(false), MaxLimitPresent(false), OSCTempCalc(0.0)
1223 : {
1224 233 : }
1225 : };
1226 :
1227 : struct OSCMData
1228 : {
1229 : // Members
1230 : std::string Name; // Name of OSCM
1231 : std::string Class; // type of Model for OSCM
1232 : Real64 TConv; // Temperature of bulk air at other side face (degrees C)
1233 : bool EMSOverrideOnTConv; // if true then EMS calling for convection bulk air temp override
1234 : Real64 EMSOverrideTConvValue; // value for convection air temp when overridden
1235 : Real64 HConv; // Convection coefficient (W/m2-K)
1236 : bool EMSOverrideOnHConv; // if true then EMS calling for convection coef override
1237 : Real64 EMSOverrideHConvValue; // value to use for convection coef when overridden
1238 : Real64 TRad; // Effective temperature of surfaces exposed to other side face (degrees C)
1239 : bool EMSOverrideOnTRad; // if true then EMS calling for radiation temp override
1240 : Real64 EMSOverrideTRadValue; // value to use for rad temp when overridden
1241 : Real64 HRad; // Linearized Radiation coefficient (W/m2-K)
1242 : bool EMSOverrideOnHrad; // if true then EMS calling for radiation coef override
1243 : Real64 EMSOverrideHradValue; // value to use for rad coef when overridden
1244 :
1245 : // Default Constructor
1246 285 : OSCMData()
1247 570 : : TConv(20.0), EMSOverrideOnTConv(false), EMSOverrideTConvValue(0.0), HConv(4.0), EMSOverrideOnHConv(false), EMSOverrideHConvValue(0.0),
1248 285 : TRad(20.0), EMSOverrideOnTRad(false), EMSOverrideTRadValue(0.0), HRad(4.0), EMSOverrideOnHrad(false), EMSOverrideHradValue(0.0)
1249 : {
1250 285 : }
1251 : };
1252 :
1253 : struct ConvectionCoefficient
1254 : {
1255 : // Members
1256 : int WhichSurface = 0; // Which surface number this is applied to
1257 : std::string SurfaceName = ""; // Which surface (name)
1258 : Convect::OverrideType overrideType = // Override type, 1=value, 2=schedule, 3=model, 4=user curve
1259 : Convect::OverrideType::Invalid;
1260 : Real64 OverrideValue = 0.0; // User specified value
1261 : Sched::Schedule *sched = nullptr; // if type="schedule" is used
1262 : int UserCurveIndex = 0; // if type=UserCurve is used
1263 : Convect::HcInt HcIntModelEq = Convect::HcInt::Invalid; // if type is one of specific model equations
1264 : Convect::HcExt HcExtModelEq = Convect::HcExt::Invalid;
1265 : };
1266 :
1267 : struct ShadingVertexData
1268 : {
1269 : // Members
1270 : int NVert = 0;
1271 : Array1D<Real64> XV;
1272 : Array1D<Real64> YV;
1273 : Array1D<Real64> ZV;
1274 :
1275 : // Default Constructor
1276 2502 : ShadingVertexData()
1277 2502 : {
1278 2502 : }
1279 : };
1280 :
1281 : struct SurfaceSolarIncident
1282 : {
1283 : // Members
1284 : std::string Name;
1285 : int SurfPtr = 0; // surface pointer
1286 : int ConstrPtr = 0; // construction pointer
1287 : Sched::Schedule *sched = nullptr; // schedule
1288 : };
1289 :
1290 : struct SurfaceIncidentSolarMultiplier
1291 : {
1292 : // Members
1293 : std::string Name;
1294 : int SurfaceIdx = 0; // surface index
1295 : Real64 Scaler = 1.0; // the constant multiplier constant from user input
1296 : Sched::Schedule *sched = nullptr; // multiplier schedule
1297 : };
1298 :
1299 : struct FenestrationSolarAbsorbed
1300 : {
1301 : // Members
1302 : std::string Name;
1303 : int SurfPtr; // surface pointer
1304 : int ConstrPtr; // construction pointer
1305 : int NumOfSched; // number of scheduled layers
1306 : Array1D<Sched::Schedule *> scheds; // pointer to schedules for each layer in construction
1307 :
1308 : // Default Constructor
1309 0 : FenestrationSolarAbsorbed() : SurfPtr(0), ConstrPtr(0), NumOfSched(0)
1310 : {
1311 0 : }
1312 : };
1313 :
1314 : struct GroundSurfacesData
1315 : {
1316 : // Members
1317 : std::string Name; // name of a ground surface
1318 : Real64 ViewFactor = 0.0; // view factor to a ground surface
1319 : Sched::Schedule *tempSched = nullptr; // pointer to a ground surface temperature schedule object
1320 : Sched::Schedule *reflSched = nullptr; // pointer to a ground Surface reflectance schedule object
1321 : };
1322 :
1323 : struct GroundSurfacesProperty
1324 : {
1325 : // Members
1326 : std::string Name; // name of multiple ground surfaces object
1327 : int NumGndSurfs = 0; // number of groundSurfaces
1328 : Array1D<GroundSurfacesData> GndSurfs; // ground surfaces data
1329 : Real64 SurfsTempAvg = 0.0; // ground Surfaces average temperature at each time step
1330 : Real64 SurfsReflAvg = 0.0; // ground Surfaces average reflectance at each time step
1331 : Real64 SurfsViewFactorSum = 0.0; // sum of view factors of ground surfaces seen by an exterior surface
1332 : bool IsGroundViewFactorSet = false; // true if the ground view factor field is not blank
1333 : };
1334 :
1335 : struct SurfaceLocalEnvironment
1336 : {
1337 : // Members
1338 : std::string Name;
1339 : int SurfPtr = 0; // surface pointer
1340 : Sched::Schedule *sunlitFracSched = nullptr; // schedule
1341 : int SurroundingSurfsPtr = 0; // schedule pointer
1342 : int OutdoorAirNodePtr = 0; // outdoor air node pointer
1343 : int GroundSurfsPtr = 0; // pointer to multiple ground surfaces object
1344 : };
1345 :
1346 : struct SurroundingSurfProperty
1347 : {
1348 : // Members
1349 : std::string Name;
1350 : Real64 ViewFactor = 0.0; // view factor to surrounding surface
1351 : Sched::Schedule *tempSched = nullptr; // temperature schedule
1352 : };
1353 :
1354 : struct SurroundingSurfacesProperty
1355 : {
1356 : // Members
1357 : std::string Name;
1358 : Real64 SkyViewFactor = 0.0; // sky view factor
1359 : Real64 GroundViewFactor = 0.0; // ground view factor
1360 : Real64 SurfsViewFactorSum = 0.0; // surrounding surfaces view factor sum
1361 : Sched::Schedule *skyTempSched = nullptr; // schedule
1362 : Sched::Schedule *groundTempSched = nullptr; // schedule
1363 : int TotSurroundingSurface = 0; // Total number of surrounding surfaces defined for an exterior surface
1364 : bool IsSkyViewFactorSet = false; // false if the sky view factor field is blank
1365 : bool IsGroundViewFactorSet = false; // false if the ground view factor field is blank
1366 : Array1D<SurroundingSurfProperty> SurroundingSurfs;
1367 : };
1368 :
1369 : struct IntMassObject
1370 : {
1371 : // Members
1372 : std::string Name;
1373 : std::string ZoneOrZoneListName; // zone or zone list name
1374 : int ZoneOrZoneListPtr; // pointer to a zone list
1375 : int NumOfZones; // number of zones in a zone list
1376 : int Construction; // pointer to contruction object
1377 : Real64 GrossArea; // internal surface area, [m2]
1378 : bool ZoneListActive; // flag to a list
1379 : std::string spaceOrSpaceListName; // Space or Space list name
1380 : int spaceOrSpaceListPtr; // pointer to a Space list
1381 : int numOfSpaces; // number of Spaces in a Space list
1382 : bool spaceListActive; // flag to a list
1383 :
1384 : // Default Constructor
1385 28 : IntMassObject()
1386 84 : : ZoneOrZoneListPtr(0), NumOfZones(0), Construction(0), GrossArea(0.0), ZoneListActive(false), spaceOrSpaceListPtr(0), numOfSpaces(0),
1387 28 : spaceListActive(false)
1388 : {
1389 28 : }
1390 : };
1391 :
1392 : // Surface interior convection
1393 : struct SurfIntConv
1394 : {
1395 :
1396 : // convection class determined by surface orientation,
1397 : // heating/cooling system, and temperature regime
1398 : Convect::IntConvClass convClass = Convect::IntConvClass::Invalid;
1399 : int convClassRpt = (int)Convect::IntConvClass::Invalid;
1400 :
1401 : Convect::HcInt model = Convect::HcInt::SetByZone; // convection model
1402 : int userModelNum = 0; // user defined convection model
1403 :
1404 : Convect::HcInt hcModelEq = Convect::HcInt::Invalid; // current convection model
1405 : int hcModelEqRpt = (int)Convect::HcInt::Invalid;
1406 : int hcUserCurveNum = 0;
1407 :
1408 : Real64 zoneWallHeight = 0.0; // geometry parameters
1409 : Real64 zonePerimLength = 0.0;
1410 : Real64 zoneHorizHydrDiam = 0.0;
1411 : Real64 windowWallRatio = 0.0;
1412 : Convect::IntConvWinLoc windowLocation = Convect::IntConvWinLoc::NotSet; // Already has NotSet defined as 0, and uses it in reporting. :(
1413 :
1414 : bool getsRadiantHeat = false;
1415 : bool hasActiveInIt = false;
1416 : };
1417 :
1418 : // Surface exterior convection
1419 : struct SurfExtConv
1420 : {
1421 : // current classification for outside face wind regime and convection orientation
1422 : Convect::ExtConvClass convClass = Convect::ExtConvClass::Invalid;
1423 : int convClassRpt = (int)Convect::ExtConvClass::Invalid;
1424 :
1425 : Convect::HcExt model = Convect::HcExt::SetByZone; // conveciton model
1426 : int userModelNum = 0;
1427 :
1428 : Convect::HcExt hfModelEq = Convect::HcExt::Invalid; // Current forced convection model
1429 : int hfModelEqRpt = (int)Convect::HcExt::Invalid;
1430 : int hfUserCurveNum = 0;
1431 :
1432 : Convect::HcExt hnModelEq = Convect::HcExt::Invalid; // Current natural convection model
1433 : int hnModelEqRpt = (int)Convect::HcExt::Invalid;
1434 : int hnUserCurveNum = 0;
1435 :
1436 : Real64 faceArea = 0.0; // Geometry parameters
1437 : Real64 facePerimeter = 0.0;
1438 : Real64 faceHeight = 0.0;
1439 : };
1440 :
1441 : // Clears the global data in DataSurfaces.
1442 : // Needed for unit tests, should not be normally called.
1443 : // void clear_state() override;
1444 :
1445 : void SetSurfaceOutBulbTempAt(EnergyPlusData &state);
1446 :
1447 : void CheckSurfaceOutBulbTempAt(EnergyPlusData &state);
1448 :
1449 : void SetSurfaceWindSpeedAt(EnergyPlusData &state);
1450 :
1451 : void SetSurfaceWindDirAt(EnergyPlusData &state);
1452 :
1453 : Real64 AbsFrontSide(EnergyPlusData &state, int SurfNum);
1454 :
1455 : Real64 AbsBackSide(EnergyPlusData &state, int SurfNum);
1456 :
1457 : void GetVariableAbsorptanceSurfaceList(EnergyPlusData &state);
1458 :
1459 : std::string cSurfaceClass(SurfaceClass ClassNo);
1460 :
1461 : struct MovInsul
1462 : {
1463 : bool present = false;
1464 : bool presentPrevTS = false;
1465 : Real64 H = 0.0;
1466 : int matNum = 0; // Material number
1467 : Sched::Schedule *sched = nullptr;
1468 : };
1469 :
1470 : } // namespace DataSurfaces
1471 :
1472 : struct SurfacesData : BaseGlobalStruct
1473 : {
1474 : int TotSurfaces = 0; // Total number of surfaces (walls, floors, roofs, windows, shading surfaces, etc.--everything)
1475 : int TotWindows = 0; // Total number of windows
1476 : int TotStormWin = 0; // Total number of storm window blocks
1477 : int TotWinShadingControl = 0; // Total number of window shading control blocks
1478 : int TotUserIntConvModels = 0; // Total number of interior convection coefficient (overrides) // TODO: Should just be a local variable I think
1479 : int TotUserExtConvModels = 0; // Total number of exterior convection coefficient (overrides) // TODO: Should just be a local variable I think
1480 : int TotOSC = 0; // Total number of Other Side Coefficient Blocks
1481 : int TotOSCM = 0; // Total number of Other Side Conditions Model Blocks.
1482 : int TotExtVentCav = 0; // Total number of ExteriorNaturalVentedCavity
1483 : int TotSurfIncSolSSG = 0; // Total number of scheduled surface gains for incident solar radiation on surface
1484 : int TotSurfIncSolMultiplier = 0; // Total number of surfaces with incident solar multipliers
1485 : int TotFenLayAbsSSG = 0; // Total number of scheduled surface gains for absorbed solar radiation in window layers
1486 : int TotSurfLocalEnv = 0; // Total number of surface level outdoor air node.
1487 : int TotSurfPropGndSurfs = 0; // Total number of surface property ground surfaces object
1488 : int Corner = 0; // Which corner is specified as the first vertex
1489 : int MaxVerticesPerSurface = 4; // Maximum number of vertices allowed for a single surface (default -- can go higher)
1490 : int BuildingShadingCount = 0; // Total number of Building External Shades
1491 : int FixedShadingCount = 0; // Total number of Fixed External Shades
1492 : int AttachedShadingCount = 0; // Total number of Shades attached to Zones
1493 : int ShadingSurfaceFirst = 0; // Start index of shading surfaces (Building External Shades, Fixed External Shades and Shades attached to Zone)
1494 : int ShadingSurfaceLast = -1; // End index of shading surfaces (Building External Shades, Fixed External Shades and Shades attached to Zone)
1495 : bool AspectTransform = false; // Set to true when GeometryTransform object is used
1496 : bool CalcSolRefl = false; // Set to true when Solar Reflection Calculations object is used
1497 : bool CCW = false; // True if vertices will be entered in CounterClockWise Order
1498 : bool WorldCoordSystem = false; // True if vertices will be "World Coordinates". False means relative coordinates
1499 : bool DaylRefWorldCoordSystem = false; // True if Daylight Reference Point vertices will be "World Coordinates". False means relative coordinates
1500 : int MaxRecPts = 0; // Max number of receiving points on a surface for solar reflection calc
1501 : int MaxReflRays = 0; // Max number of rays from a receiving surface for solar reflection calc
1502 : Real64 GroundLevelZ = 0.0; // Z value of ground level for solar refl calc (m)
1503 : bool AirflowWindows = false; // TRUE if one or more airflow windows
1504 : bool ShadingTransmittanceVaries = false; // overall, shading transmittance varies for the building
1505 : bool UseRepresentativeSurfaceCalculations = false; // Use Representative Surfaces for Calculations
1506 : bool AnyMovableInsulation = false; // True if any movable insulation presents
1507 : bool AnyMovableSlat = false; // True if there are any movable slats for window blinds presented
1508 :
1509 : Array1D_int SurfAdjacentZone; // Array of adjacent zones to each surface
1510 : Array1D<Real64> X0; // X-component of translation vector
1511 : Array1D<Real64> Y0; // Y-component of translation vector
1512 : Array1D<Real64> Z0; // Z-component of translation vector
1513 :
1514 : std::unordered_map<DataSurfaces::SurfaceCalcHashKey, int, DataSurfaces::SurfaceCalcHasher>
1515 : RepresentativeSurfaceMap; // A map that categorizes similar surfaces with
1516 : // a single representative surface index
1517 :
1518 : std::vector<int> AllHTSurfaceList; // List of all heat transfer surfaces
1519 : std::vector<int> AllExtSolarSurfaceList; // List of all exterior solar surfaces, all are heat transfer surfaces
1520 : std::vector<int> AllExtSolAndShadingSurfaceList; // List of all exterior solar surfaces plus all shading surfaces
1521 : std::vector<int> AllShadowPossObstrSurfaceList; // List of all IsShadoPossibleObstuction surfaces
1522 : std::vector<int> AllIZSurfaceList; // List of all interzone heat transfer surfaces
1523 : std::vector<int> AllHTNonWindowSurfaceList; // List of all non-window heat transfer surfaces
1524 : std::vector<int> AllHTWindowSurfaceList; // List of all window surfaces
1525 : std::vector<int> AllExtSolWindowSurfaceList; // List of all exterior solar window surfaces
1526 : std::vector<int> AllExtSolWinWithFrameSurfaceList; // List of all exterior solar window surfaces with a frame and divider
1527 : std::vector<int> AllHTKivaSurfaceList; // List of all Kiva foundation surfaces
1528 : std::vector<int> AllSurfaceListReportOrder; // List of all surfaces - output reporting order
1529 : std::vector<int> AllVaryAbsOpaqSurfaceList; // List of all opaque exterior surfaces with dynamic coating
1530 : std::vector<int> allInsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for inside face
1531 : std::vector<int> allOutsideSourceSurfaceList; // List of all surfaces with SurfaceProperty:HeatBalanceSourceTerm for outside face
1532 : std::vector<int> allGetsRadiantHeatSurfaceList; // List of all surfaces that receive radiant HVAC output
1533 : std::vector<int> intMovInsulSurfNums;
1534 : std::vector<int> extMovInsulSurfNums;
1535 :
1536 : std::array<std::vector<int>, static_cast<int>(DataSurfaces::SurfaceFilter::Num)> SurfaceFilterLists;
1537 :
1538 : // Surface HB arrays
1539 : Array1D<Real64> SurfOutDryBulbTemp; // Surface outside dry bulb air temperature, for surface heat balance (C)
1540 : Array1D<Real64> SurfOutWetBulbTemp; // Surface outside wet bulb air temperature, for surface heat balance (C)
1541 : Array1D<Real64> SurfOutWindSpeed; // Surface outside wind speed, for surface heat balance (m/s)
1542 : Array1D<Real64> SurfOutWindDir; // Surface outside wind direction, for surface heat balance and ventilation(degree)
1543 : Array1D<Real64> SurfGenericContam; // [ppm] Surface generic contaminant as a storage term for
1544 : Array1D<int> SurfLowTempErrCount;
1545 : Array1D<int> SurfHighTempErrCount;
1546 :
1547 : // Surface solar arrays
1548 : Array1D<Real64> SurfAirSkyRadSplit; // Fractional split between the air and the sky for radiation from the surface
1549 : // Fraction of sky IR coming from sky itself; 1-SurfAirSkyRadSplit comes from the atmosphere.
1550 : Array1D<Vector3<Real64>> SurfSunCosHourly; // Hourly values of SUNCOS (solar direction cosines)
1551 : // Autodesk: Init Zero-initialization added to avoid use uninitialized
1552 : Array1D<Real64> SurfSunlitArea; // Sunlit area by surface number
1553 : Array1D<Real64> SurfSunlitFrac; // Sunlit fraction by surface number
1554 : Array1D<Real64> SurfSkySolarInc; // Incident diffuse solar from sky; if CalcSolRefl is true, includes reflection of sky diffuse
1555 : // and beam solar from exterior obstructions [W/m2]
1556 : Array1D<Real64> SurfGndSolarInc; // Incident diffuse solar from ground; if CalcSolRefl is true,
1557 : // accounts for shadowing of ground by building and obstructions [W/m2]
1558 : Array1D<Real64> SurfBmToBmReflFacObs; // Factor for incident solar from specular beam refl from obstructions (W/m2)/(W/m2)
1559 : Array1D<Real64> SurfBmToDiffReflFacObs; // Factor for incident solar from diffuse beam refl from obstructions (W/m2)/(W/m2)
1560 : Array1D<Real64> SurfBmToDiffReflFacGnd; // Factor for incident solar from diffuse beam refl from ground
1561 : Array1D<Real64> SurfSkyDiffReflFacGnd; // sky diffuse reflection view factors from ground
1562 : Array1D<Real64> SurfOpaqAI; // Time step value of factor for beam absorbed on inside of opaque surface
1563 : Array1D<Real64> SurfOpaqAO; // Time step value of factor for beam absorbed on outside of opaque surface
1564 : Array1D<int> SurfPenumbraID;
1565 :
1566 : // Surface reflectance
1567 : Array2D<Real64> SurfReflFacBmToDiffSolObs;
1568 : Array2D<Real64> SurfReflFacBmToDiffSolGnd;
1569 : Array2D<Real64> SurfReflFacBmToBmSolObs;
1570 : Array1D<Real64> SurfReflFacSkySolObs;
1571 : Array1D<Real64> SurfReflFacSkySolGnd;
1572 : Array2D<Real64> SurfCosIncAveBmToBmSolObs;
1573 :
1574 : // Surface parameters specific to solar reflection from surfaces
1575 : Array1D<Real64> SurfShadowDiffuseSolRefl; // Diffuse solar reflectance of opaque portion
1576 : Array1D<Real64> SurfShadowDiffuseVisRefl; // Diffuse visible reflectance of opaque portion
1577 : Array1D<Real64> SurfShadowGlazingFrac; // Glazing fraction
1578 : Array1D<int> SurfShadowGlazingConstruct; // Glazing construction number
1579 : Array1D<int> SurfShadowRecSurfNum; // Receiving surface number
1580 : Array1D<std::vector<int>>
1581 : SurfShadowDisabledZoneList; // Array of all disabled shadowing zone number to the current surface the surface diffusion model
1582 :
1583 : // Surface EMS
1584 : Array1D<bool> SurfEMSConstructionOverrideON; // if true, EMS is calling to override the construction value
1585 : Array1D<int> SurfEMSConstructionOverrideValue; // pointer value to use for Construction when overridden
1586 : Array1D<bool> SurfEMSOverrideIntConvCoef; // if true, EMS is calling to override the interior convection coefficient value
1587 : Array1D<Real64> SurfEMSValueForIntConvCoef; // Value EMS is calling to use for interior convection coefficient [W/m2-K]
1588 : Array1D<bool> SurfEMSOverrideExtConvCoef; // if true, EMS is calling to override the exterior convection coefficient value
1589 : Array1D<Real64> SurfEMSValueForExtConvCoef; // Value EMS is calling to use for exterior convection coefficient [W/m2-K]
1590 : Array1D<bool> SurfOutDryBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor air temp
1591 : Array1D<Real64> SurfOutDryBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air drybulb temp (C)
1592 : Array1D<bool> SurfOutWetBulbTempEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wetbulb temp
1593 : Array1D<Real64> SurfOutWetBulbTempEMSOverrideValue; // value to use for EMS override of outdoor air wetbulb temp (C)
1594 : Array1D<bool> SurfWindSpeedEMSOverrideOn; // if true, EMS is calling to override the surface's outdoor wind speed
1595 : Array1D<Real64> SurfWindSpeedEMSOverrideValue; // value to use for EMS override of outdoor wind speed (m/s)
1596 : Array1D<bool> SurfViewFactorGroundEMSOverrideOn; // if true, EMS is calling to override the surface's view factor to ground
1597 : Array1D<Real64> SurfViewFactorGroundEMSOverrideValue; // value to use for EMS override of surface's view factor to ground
1598 : Array1D<bool> SurfWindDirEMSOverrideOn; // if true, EMS is calling to override the outside wind direction
1599 : Array1D<Real64> SurfWindDirEMSOverrideValue; // value to use for EMS override of outside wind direction (deg)
1600 :
1601 : // Surface Properties
1602 : Array1D<int> SurfDaylightingShelfInd; // Pointer to daylighting shelf
1603 : Array1D<bool> SurfExtEcoRoof; // True if the top outside construction material is of type Eco Roof
1604 : Array1D<bool> SurfExtCavityPresent; // true if there is an exterior vented cavity on surface
1605 : Array1D<int> SurfExtCavNum; // index for this surface in ExtVentedCavity structure (if any)
1606 : Array1D<bool> SurfIsPV; // true if this is a photovoltaic surface (dxf output)
1607 : Array1D<bool> SurfIsICS; // true if this is an ICS collector
1608 : Array1D<bool> SurfIsPool; // true if this is a pool
1609 : Array1D<int> SurfICSPtr; // Index to ICS collector
1610 : Array1D<bool> SurfIsRadSurfOrVentSlabOrPool; // surface cannot be part of both a radiant surface & ventilated slab group
1611 :
1612 : // Surface ConvCoeff Properties
1613 : Array1D<int> SurfTAirRef; // Flag for reference air temperature
1614 : Array1D<int> SurfTAirRefRpt; // Flag for reference air temperature for reporting
1615 :
1616 : EPVector<DataSurfaces::SurfIntConv> surfIntConv;
1617 : EPVector<DataSurfaces::SurfExtConv> surfExtConv;
1618 :
1619 : // Surface Window Heat Balance
1620 : Array1D_int SurfWinInsideGlassCondensationFlag; // 1 if innermost glass inside surface temp < zone air dew point; 0 otherwise
1621 : Array1D_int SurfWinInsideFrameCondensationFlag; // 1 if frame inside surface temp < zone air dew point; 0 otherwise
1622 : Array1D_int SurfWinInsideDividerCondensationFlag; // 1 if divider inside surface temp < zone air dew point; 0 otherwise
1623 :
1624 : Array2D<Real64> SurfWinA; // Time step value of factor for beam absorbed in window glass layers
1625 : Array2D<Real64> SurfWinADiffFront; // Time step value of factor for diffuse absorbed in window layers
1626 : Array2D<Real64> SurfWinACFOverlap; // Time step value of factor for beam absorbed in window glass layers which comes from other windows
1627 : // It happens sometimes that beam enters one window and hits back of second window.
1628 : // It is used in complex fenestration only
1629 : Array1D<Real64> SurfWinTransSolar; // Exterior beam plus diffuse solar transmitted through window, or window plus shade/blind, into zone (W)
1630 : Array1D<Real64> SurfWinBmSolar; // Exterior beam solar transmitted through window, or window plus blind, into zone (W)
1631 : Array1D<Real64> SurfWinBmBmSolar; // Exterior beam-to-beam solar transmitted through window, or window plus blind, into zone (W)
1632 : Array1D<Real64> SurfWinBmDifSolar; // Exterior beam-to-diffuse solar transmitted through window, or window plus blind, into zone (W)
1633 : Array1D<Real64> SurfWinDifSolar; // Exterior diffuse solar transmitted through window, or window plus shade/blind, into zone (W)
1634 : Array1D<Real64> SurfWinHeatGain; // Total heat gain from window (W) = WinTransSolar + (IR and convection from glazing, or,
1635 : // if interior shade, IR and convection from zone-side of shade plus gap air convection to zone) +
1636 : // (IR convection from frame) + (IR and convection from divider if no interior shade) (W)
1637 : // minus SurfWinInitialDifSolInTrans minus SurfWinLossSWZoneToOutWinRep
1638 : Array1D<Real64> SurfWinHeatGainRep; // Equals WinHeatGain when WinHeatGain >= 0.0 (W)
1639 : Array1D<Real64> SurfWinHeatLossRep; // Equals -WinHeatGain when WinHeatGain < 0.0 (W)
1640 : Array1D<Real64> SurfWinGainConvGlazToZoneRep; // component of WinHeatGain convect to zone from glazing (W)
1641 : Array1D<Real64> SurfWinGainIRGlazToZoneRep; // component of WinHeatGain net IR to zone from glazing (W)
1642 : Array1D<Real64> SurfWinLossSWZoneToOutWinRep; // component of WinHeatGain shortwave transmit back out (W)
1643 : Array1D<Real64> SurfWinGainFrameDividerToZoneRep; // component of WinHeatGain to zone from frame/divider (W)
1644 : Array1D<Real64> SurfWinGainConvShadeToZoneRep; // component of WinHeatGain convect to zone from front shade (W)
1645 : Array1D<Real64> SurfWinGainIRShadeToZoneRep; // component of WinHeatGain net IR to zone from front shade (W)
1646 : Array1D<Real64> SurfWinGapConvHtFlowRep; // Convective heat flow from gap in airflow window (W)
1647 : Array1D<Real64> SurfWinShadingAbsorbedSolar; // Exterior beam plus diffuse solar absorbed by window shading device (W)
1648 : Array1D<Real64> SurfWinSysSolTransmittance; // Effective solar transmittance of window + shading device, if present
1649 : Array1D<Real64> SurfWinSysSolReflectance; // Effective solar reflectance of window + shading device, if present
1650 : Array1D<Real64> SurfWinSysSolAbsorptance; // Effective solar absorptance of window + shading device, if present
1651 :
1652 : // Surface Window Energy
1653 : Array1D<Real64> SurfWinTransSolarEnergy; // Energy of WinTransSolar [J]
1654 : Array1D<Real64> SurfWinBmSolarEnergy; // Energy of WinBmSolar [J]
1655 : Array1D<Real64> SurfWinBmBmSolarEnergy; // Beam-to-beam energy of WinBmSolar [J]
1656 : Array1D<Real64> SurfWinBmDifSolarEnergy; // Beam-to-diffuse energy of WinBmSolar [J]
1657 : Array1D<Real64> SurfWinDifSolarEnergy; // Energy of WinDifSolar [J]
1658 : Array1D<Real64> SurfWinHeatGainRepEnergy; // Energy of WinHeatGainRep [J]
1659 : Array1D<Real64> SurfWinHeatLossRepEnergy; // Energy of WinHeatLossRep [J]
1660 : Array1D<Real64> SurfWinShadingAbsorbedSolarEnergy; // Energy of WinShadingAbsorbedSolar [J]
1661 : Array1D<Real64> SurfWinGapConvHtFlowRepEnergy; // Energy of WinGapConvHtFlowRep [J]
1662 : Array1D<Real64> SurfWinHeatTransferRepEnergy; // Energy of WinHeatTransfer [J]
1663 : Array1D<Real64> SurfWinIRfromParentZone;
1664 : Array1D<Real64> SurfWinFrameQRadOutAbs;
1665 : Array1D<Real64> SurfWinFrameQRadInAbs;
1666 : Array1D<Real64> SurfWinDividerQRadOutAbs;
1667 : Array1D<Real64> SurfWinDividerQRadInAbs;
1668 : Array1D<Real64> SurfWinExtBeamAbsByShade; // Exterior beam solar absorbed by window shade (W/m2)
1669 : Array1D<Real64> SurfWinExtDiffAbsByShade; // Exterior diffuse solar absorbed by window shade (W/m2)
1670 : Array1D<Real64> SurfWinIntBeamAbsByShade; // Interior beam solar absorbed by window shade (W/m2)
1671 : Array1D<Real64> SurfWinIntSWAbsByShade; // Interior diffuse solar plus short-wave from lights absorbed by window shade (W/m2)
1672 : Array1D<Real64> SurfWinInitialDifSolAbsByShade; // Initial diffuse solar from ext and int windows absorbed by window shade (W/m2)
1673 : Array1D<Real64> SurfWinIntLWAbsByShade; // Interior long-wave from zone lights and equipment absorbed by window shade (W/m2)
1674 : Array1D<Real64> SurfWinConvHeatFlowNatural; // Convective heat flow from gap between glass and interior shade or blind (W)
1675 : Array1D<Real64> SurfWinConvHeatGainToZoneAir; // Convective heat gain to zone air from window gap airflow (W)
1676 : Array1D<Real64> SurfWinRetHeatGainToZoneAir; // Convective heat gain to return air sent to zone [W]
1677 : Array1D<Real64> SurfWinDividerHeatGain;
1678 : Array1D<Real64> SurfWinBlTsolBmBm; // Time-step value of blind beam-beam solar transmittance (-)
1679 : Array1D<Real64> SurfWinBlTsolBmDif; // Time-step value of blind beam-diffuse solar transmittance (-)
1680 : Array1D<Real64> SurfWinBlTsolDifDif; // Time-step value of blind diffuse-diffuse solar transmittance (-)
1681 : Array1D<Real64> SurfWinBlGlSysTsolBmBm; // Time-step value of blind/glass system beam-beam solar transmittance (-)
1682 : Array1D<Real64> SurfWinBlGlSysTsolDifDif; // Time-step value of blind/glass system diffuse-diffuse solar transmittance (-)
1683 : Array1D<Real64> SurfWinScTsolBmBm; // Time-step value of screen beam-beam solar transmittance (-)
1684 : Array1D<Real64> SurfWinScTsolBmDif; // Time-step value of screen beam-diffuse solar transmittance (-)
1685 : Array1D<Real64> SurfWinScTsolDifDif; // Time-step value of screen diffuse-diffuse solar transmittance (-)
1686 : Array1D<Real64> SurfWinScGlSysTsolBmBm; // Time-step value of screen/glass system beam-beam solar transmittance (-)
1687 : Array1D<Real64> SurfWinScGlSysTsolDifDif; // Time-step value of screen/glass system diffuse-diffuse solar transmittance (-)
1688 : Array1D<Real64> SurfWinGlTsolBmBm; // Time-step value of glass beam-beam solar transmittance (-)
1689 : Array1D<Real64> SurfWinGlTsolBmDif; // Time-step value of glass beam-diffuse solar transmittance (-)
1690 : Array1D<Real64> SurfWinGlTsolDifDif; // Time-step value of glass diffuse-diffuse solar transmittance (-)
1691 : Array1D<Real64> SurfWinBmSolTransThruIntWinRep; // Beam solar transmitted through interior window [W]
1692 : Array1D<Real64> SurfWinBmSolAbsdOutsReveal; // Multiplied by BeamSolarRad, gives beam solar absorbed by outside reveal surfaces (m2)
1693 : Array1D<Real64> SurfWinBmSolRefldOutsRevealReport; // Beam solar reflected by outside reveal surfaces, for reporting (m2)
1694 : Array1D<Real64> SurfWinBmSolAbsdInsReveal; // Multiplied by BeamSolarRad, gives beam solar absorbed by inside reveal surfaces (m2)
1695 : Array1D<Real64> SurfWinBmSolRefldInsReveal; // Multiplied by BeamSolarRad, gives beam solar reflected by inside reveal surfaces (m2)
1696 : Array1D<Real64> SurfWinBmSolRefldInsRevealReport; // Beam solar reflected by inside reveal surfaces, for reporting (W)
1697 : Array1D<Real64> SurfWinOutsRevealDiffOntoGlazing; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from outside reveal that is
1698 : // incident on the glazing per m2 of glazing (-)
1699 : Array1D<Real64> SurfWinInsRevealDiffOntoGlazing; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that is
1700 : // incident on the glazing per m2 of glazing (-)
1701 : Array1D<Real64> SurfWinInsRevealDiffIntoZone; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that goes into
1702 : // zone directly or reflected from glazing (m2)
1703 : Array1D<Real64> SurfWinOutsRevealDiffOntoFrame; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from outside reveal that is
1704 : // incident on the outside of the frame per m2 of frame (-)
1705 : Array1D<Real64> SurfWinInsRevealDiffOntoFrame; // Multiplied by BeamSolarRad, gives diffuse from beam reflection from inside reveal that is
1706 : // incident on the outside of the frame per m2 of frame (-) for debugging CR 7596. TH 5/26/2009
1707 : Array1D<Real64> SurfWinInsRevealDiffOntoGlazingReport; // Diffuse solar from beam reflection from inside reveal that is incident
1708 : // on the glazing (W)
1709 : Array1D<Real64> SurfWinInsRevealDiffIntoZoneReport; // Diffuse from beam reflection from inside reveal that goes into zone directly or reflected
1710 : // from glazing (W)
1711 : Array1D<Real64> SurfWinInsRevealDiffOntoFrameReport; // Diffuse from beam reflection from inside reveal that is incident on the frame (W)
1712 : Array1D<Real64> SurfWinBmSolAbsdInsRevealReport; // Beam solar absorbed by inside reveal (W) energy
1713 : Array1D<Real64> SurfWinBmSolTransThruIntWinRepEnergy; // energy of BmSolTransThruIntWinRep [J]
1714 : Array1D<Real64> SurfWinBmSolRefldOutsRevealRepEnergy; // energy of BmSolRefldOutsRevealReport [J]
1715 : Array1D<Real64> SurfWinBmSolRefldInsRevealRepEnergy; // energy of BmSolRefldInsRevealReport [J]
1716 : Array1D<Real64> SurfWinProfileAngHor; // Horizontal beam solar profile angle (degrees)
1717 : Array1D<Real64> SurfWinProfileAngVert; // Vertical beam solar profile angle (degrees)
1718 :
1719 : EPVector<DataSurfaces::WinShadingType> SurfWinShadingFlag; // -1: window has no shading device
1720 : Array1D<bool> SurfWinShadingFlagEMSOn; // EMS control flag, true if EMS is controlling ShadingFlag with ShadingFlagEMSValue
1721 : Array1D<int> SurfWinShadingFlagEMSValue; // EMS control value for Shading Flag
1722 : Array1D<int> SurfWinStormWinFlag; // -1: Storm window not applicable;
1723 : // 0: Window has storm window but it is off
1724 : // 1: Window has storm window and it is on
1725 : Array1D<int> SurfWinStormWinFlagPrevDay; // Previous time step value of StormWinFlag
1726 : Array1D<Real64> SurfWinFracTimeShadingDeviceOn; // For a single time step, = 0.0
1727 : // if no shading device or shading device is off = 1.0 if shading device is on;
1728 : // For time intervals longer than a time step, = fraction of time that shading device is on.
1729 : EPVector<DataSurfaces::WinShadingType> SurfWinExtIntShadePrevTS; // 1 if exterior or interior blind or shade in place previous time step;
1730 : // 0 otherwise
1731 : Array1D<bool> SurfWinHasShadeOrBlindLayer; // mark as true if the window construction has a shade or a blind layer
1732 : Array1D<bool> SurfWinSurfDayLightInit; // surface has been initialized for following 5 arrays
1733 : Array1D<int> SurfWinDaylFacPoint; // Pointer to daylight factors for the window
1734 : Array1D<Real64> SurfWinVisTransSelected; // Window vis trans at normal incidence selected for use in dayltg calculation
1735 : Array1D<Real64> SurfWinSwitchingFactor; // Window switching factor (0.0 = unswitched; 1.0 = fully switched)
1736 : Array1D<Real64> SurfWinVisTransRatio; // For windows with switchable glazing,
1737 : // ratio of normal transmittance in switched state to that in unswitched state
1738 : Array1D<Real64> SurfWinFrameArea; // Frame projected area (m2)
1739 : Array1D<Real64> SurfWinFrameConductance; // Frame conductance [no air films] (W/m2-K)
1740 : Array1D<Real64> SurfWinFrameSolAbsorp; // Frame solar absorptance (assumed same inside and outside)
1741 : Array1D<Real64> SurfWinFrameVisAbsorp; // Frame visible absorptance (assumed same inside and outside)
1742 : Array1D<Real64> SurfWinFrameEmis; // Frame thermal emissivity (thermal absorptance) (assumed same inside and outside)
1743 : Array1D<Real64> SurfWinFrEdgeToCenterGlCondRatio; // Ratio of frame edge of glass conductance (without air films) to center of glass conductance
1744 : // (without air films)
1745 : Array1D<Real64> SurfWinFrameEdgeArea; // Area of glass near frame (m2)
1746 : Array1D<Real64> SurfWinFrameTempIn; // Frame inside surface temperature (C)
1747 : Array1D<Real64> SurfWinFrameTempInOld; // Previous value of frame inside surface temperature (C)
1748 : Array1D<Real64> SurfWinFrameTempSurfOut; // Frame outside surface temperature (C)
1749 : Array1D<Real64> SurfWinProjCorrFrOut; // Correction factor to absorbed radiation due to frame outside projection
1750 : Array1D<Real64> SurfWinProjCorrFrIn; // Correction factor to absorbed radiation due to frame inside projection
1751 : Array1D<DataSurfaces::FrameDividerType> SurfWinDividerType; // Divider type (1=DividedLite, 2=Suspended (between-pane))
1752 : Array1D<Real64> SurfWinDividerArea; // Divider projected area (m2)
1753 : Array1D<Real64> SurfWinDividerConductance; // Divider conductance [no air films] (W/m2-K)
1754 : Array1D<Real64> SurfWinDividerSolAbsorp; // Divider solar absorptance (assumed same inside and outside)
1755 : Array1D<Real64> SurfWinDividerVisAbsorp; // Divider visible absorptance (assumed same inside and outside)
1756 : Array1D<Real64> SurfWinDividerEmis; // Divider thermal emissivity (thermal absorptance) (assumed same inside and outside)
1757 : Array1D<Real64> SurfWinDivEdgeToCenterGlCondRatio; // Ratio of divider edge of glass conductance (without air films) to center of glass
1758 : // conductance (without air films)
1759 : Array1D<Real64> SurfWinDividerEdgeArea; // Area of glass near dividers (m2)
1760 : Array1D<Real64> SurfWinDividerTempIn; // Divider inside surface temperature (C)
1761 : Array1D<Real64> SurfWinDividerTempInOld; // Previous value of divider inside surface temperature (C)
1762 : Array1D<Real64> SurfWinDividerTempSurfOut; // Divider outside surface temperature (C)
1763 : Array1D<Real64> SurfWinProjCorrDivOut; // Correction factor to absorbed radiation due to divider outside projection
1764 : Array1D<Real64> SurfWinProjCorrDivIn; // Correction factor to absorbed radiation due to divider inside projection
1765 : Array1D<Real64> SurfWinShadeAbsFacFace1; // Fraction of short-wave radiation incident that is absorbed by face 1 when total absorbed radiation is
1766 : // apportioned to the two faces
1767 : Array1D<Real64> SurfWinShadeAbsFacFace2; // Fraction of short-wave radiation incident that is absorbed by face 2 when total absorbed radiation is
1768 : // apportioned to the two faces
1769 : Array1D<Real64> SurfWinConvCoeffWithShade; // Convection coefficient from glass or shade to gap air when interior
1770 : // or exterior shade is present (W/m2-K)
1771 : Array1D<Real64> SurfWinOtherConvHeatGain; // other convective = total conv - standard model prediction for EQL window model (W)
1772 : Array1D<Real64> SurfWinEffInsSurfTemp; // Effective inside surface temperature for window with interior blind or shade; combination of shade/blind
1773 : // and glass temperatures (C)
1774 : Array1D<Real64> SurfWinTotGlazingThickness; // Total glazing thickness from outside of outer glass to inside of inner glass (m)
1775 : Array1D<Real64> SurfWinTanProfileAngHor; // Tangent of horizontal profile angle
1776 : Array1D<Real64> SurfWinTanProfileAngVert; // Tangent of vertical profile angle
1777 : Array1D<Real64> SurfWinInsideSillDepth; // Depth of inside sill (m)
1778 : Array1D<Real64> SurfWinInsideReveal; // Depth of inside reveal (m)
1779 : Array1D<Real64> SurfWinInsideSillSolAbs; // Solar absorptance of inside sill
1780 : Array1D<Real64> SurfWinInsideRevealSolAbs; // Solar absorptance of inside reveal
1781 : Array1D<Real64> SurfWinOutsideRevealSolAbs; // Solar absorptance of outside reveal
1782 : Array1D<DataSurfaces::WindowAirFlowSource> SurfWinAirflowSource; // Source of gap airflow (INSIDEAIR, OUTSIDEAIR, etc.)
1783 : Array1D<DataSurfaces::WindowAirFlowDestination> SurfWinAirflowDestination; // Destination of gap airflow (INSIDEAIR, OUTSIDEAIR, etc.)
1784 : Array1D<int> SurfWinAirflowReturnNodePtr; // Return node pointer for destination = ReturnAir
1785 : Array1D<Real64> SurfWinMaxAirflow; // Maximum gap airflow (m3/s per m of glazing width)
1786 : Array1D<DataSurfaces::WindowAirFlowControlType> SurfWinAirflowControlType; // Gap airflow control type (ALWAYSONATMAXFLOW, etc.)
1787 : Array1D<bool> SurfWinAirflowHasSchedule; // True if gap airflow is scheduled
1788 : Array1D<Sched::Schedule *> SurfWinAirflowScheds; // Gap airflow schedule
1789 : Array1D<Real64> SurfWinAirflowThisTS; // Gap airflow this timestep (m3/s per m of glazing width)
1790 : Array1D<Real64> SurfWinTAirflowGapOutlet; // Temperature of air leaving airflow gap between glass panes (C)
1791 : Array1D<int> SurfWinWindowCalcIterationsRep; // Number of iterations in window heat balance calculation
1792 : Array1D<Real64> SurfWinVentingOpenFactorMultRep; // Window/door opening modulation multiplier on venting open factor, for reporting
1793 : Array1D<Real64> SurfWinInsideTempForVentingRep; // Inside air temp used to control window/door venting, for reporting (C)
1794 : Array1D<Real64> SurfWinVentingAvailabilityRep; // Venting availability schedule value (0.0/1.0 = no venting allowed/not allowed)
1795 : Array1D<Real64> SurfWinSkyGndSolarInc; // Incident diffuse solar from ground-reflected sky radiation; used for Complex Fen; if CalcSolRefl is
1796 : // true, accounts for shadowing of ground by building and obstructions [W/m2]
1797 : Array1D<Real64> SurfWinBmGndSolarInc; // Incident diffuse solar from ground-reflected beam radiation; used for Complex Fen; if CalcSolRefl is
1798 : // true, accounts for shadowing of ground by building and obstructions [W/m2]
1799 : Array1D<bool> SurfWinSolarDiffusing; // True if exterior window with a construction that contains a diffusing glass layer
1800 : Array1D<Real64> SurfWinFrameHeatGain;
1801 : Array1D<Real64> SurfWinFrameHeatLoss;
1802 : Array1D<Real64> SurfWinDividerHeatLoss;
1803 : Array1D<Real64> SurfWinTCLayerTemp; // The temperature of the thermochromic layer of the window
1804 : Array1D<Real64> SurfWinSpecTemp; // The specification temperature of the TC layer glass Added for W6 integration June 2010
1805 : Array1D<DataSurfaces::WindowModel> SurfWinWindowModelType; // if set to WindowBSDFModel, then uses BSDF methods
1806 : Array1D<Real64> SurfWinTDDPipeNum; // Tubular daylighting device pipe number for TDD domes and diffusers
1807 : Array1D<int> SurfWinStormWinConstr; // Construction with storm window (windows only)
1808 : Array1D<int> SurfActiveConstruction; // The currently active construction with or without storm window
1809 : Array1D<int> SurfWinActiveShadedConstruction; // The currently active shaded construction with or without storm window (windows only)
1810 :
1811 : Array1D<DataSurfaces::MovInsul> intMovInsuls;
1812 : Array1D<DataSurfaces::MovInsul> extMovInsuls;
1813 :
1814 : EPVector<DataSurfaces::SurfaceData> Surface;
1815 : EPVector<DataSurfaces::SurfaceWindowCalc> SurfaceWindow;
1816 : EPVector<DataSurfaces::SurfaceShade> surfShades;
1817 : Array1D<DataSurfaces::FrameDividerProperties> FrameDivider;
1818 : EPVector<DataSurfaces::StormWindowData> StormWindow;
1819 : EPVector<DataSurfaces::WindowShadingControlData> WindowShadingControl;
1820 : EPVector<DataSurfaces::OSCData> OSC;
1821 : EPVector<DataSurfaces::OSCMData> OSCM;
1822 : EPVector<DataSurfaces::ConvectionCoefficient> userIntConvModels;
1823 : EPVector<DataSurfaces::ConvectionCoefficient> userExtConvModels;
1824 : EPVector<DataSurfaces::ShadingVertexData> ShadeV;
1825 : EPVector<DataSurfaces::SurfaceSolarIncident> SurfIncSolSSG;
1826 : EPVector<DataSurfaces::SurfaceIncidentSolarMultiplier> SurfIncSolMultiplier;
1827 : EPVector<DataSurfaces::FenestrationSolarAbsorbed> FenLayAbsSSG;
1828 : EPVector<DataSurfaces::SurfaceLocalEnvironment> SurfLocalEnvironment;
1829 : EPVector<DataSurfaces::SurroundingSurfacesProperty> SurroundingSurfsProperty;
1830 : EPVector<DataSurfaces::IntMassObject> IntMassObjects;
1831 : EPVector<DataSurfaces::GroundSurfacesProperty> GroundSurfsProperty;
1832 :
1833 2126 : void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
1834 : {
1835 2126 : }
1836 :
1837 1152 : void init_state([[maybe_unused]] EnergyPlusData &state) override
1838 : {
1839 1152 : }
1840 :
1841 2100 : void clear_state() override
1842 : {
1843 2100 : new (this) SurfacesData();
1844 2100 : }
1845 : };
1846 :
1847 : } // namespace EnergyPlus
1848 :
1849 : #endif
|