LCOV - code coverage report
Current view: top level - EnergyPlus - SolarShading.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 5 134 3.7 %
Date: 2023-01-17 19:17:23 Functions: 2 4 50.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, 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 SolarShading_hh_INCLUDED
      49             : #define SolarShading_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <fstream>
      53             : #include <memory>
      54             : 
      55             : // ObjexxFCL Headers
      56             : #include <ObjexxFCL/Array2D.hh>
      57             : #include <ObjexxFCL/Array3D.hh>
      58             : 
      59             : // Penumbra Headers
      60             : #ifndef EP_NO_OPENGL
      61             : #include <penumbra/penumbra.h>
      62             : #endif
      63             : 
      64             : // EnergyPlus Headers
      65             : #include <EnergyPlus/DataBSDFWindow.hh>
      66             : #include <EnergyPlus/DataSurfaces.hh>
      67             : #include <EnergyPlus/DataVectorTypes.hh>
      68             : #include <EnergyPlus/EnergyPlus.hh>
      69             : #include <EnergyPlus/WindowEquivalentLayer.hh>
      70             : 
      71             : namespace EnergyPlus {
      72             : 
      73             : // Forward declarations
      74             : struct EnergyPlusData;
      75             : 
      76             : namespace SolarShading {
      77             : 
      78             :     // Using/Aliasing
      79             :     using DataBSDFWindow::BSDFGeomDescr;
      80             :     using DataBSDFWindow::BSDFWindowGeomDescr;
      81             :     using DataVectorTypes::Vector;
      82             : 
      83             :     struct SurfaceErrorTracking
      84             :     {
      85             :         // Members
      86             :         int SurfIndex1; // Tracking for main error message
      87             :         int SurfIndex2; // Tracking for Overlapping Figure Name or Surface # 1
      88             :         int MiscIndex;  // Used for other pertinent information to be stored
      89             : 
      90             :         // Default Constructor
      91           0 :         SurfaceErrorTracking() : SurfIndex1(0), SurfIndex2(0), MiscIndex(0)
      92             :         {
      93           0 :         }
      94             :     };
      95             : 
      96             :     void InitSolarCalculations(EnergyPlusData &state);
      97             : 
      98             :     void GetShadowingInput(EnergyPlusData &state);
      99             : 
     100             :     void AllocateModuleArrays(EnergyPlusData &state);
     101             : 
     102             :     void AnisoSkyViewFactors(EnergyPlusData &state);
     103             : 
     104             :     void CHKBKS(EnergyPlusData &state,
     105             :                 int const NBS, // Surface Number of the potential back surface
     106             :                 int const NRS  // Surface Number of the potential shadow receiving surface
     107             :     );
     108             : 
     109             :     void CHKGSS(EnergyPlusData &state,
     110             :                 int const NRS,     // Surface number of the potential shadow receiving surface
     111             :                 int const NSS,     // Surface number of the potential shadow casting surface
     112             :                 Real64 const ZMIN, // Lowest point of the receiving surface
     113             :                 bool &CannotShade  // TRUE if shadow casting surface cannot shade receiving surface.
     114             :     );
     115             : 
     116             :     void CHKSBS(EnergyPlusData &state,
     117             :                 int const HTS,   // Heat transfer surface number of the general receiving surf
     118             :                 int const GRSNR, // Surface number of general receiving surface
     119             :                 int const SBSNR  // Surface number of subsurface
     120             :     );
     121             : 
     122             :     bool polygon_contains_point(int const nsides,            // number of sides (vertices)
     123             :                                 Array1D<Vector> &polygon_3d, // points of polygon
     124             :                                 Vector const &point_3d,      // point to be tested
     125             :                                 bool const ignorex,
     126             :                                 bool const ignorey,
     127             :                                 bool const ignorez);
     128             : 
     129             :     void ComputeIntSolarAbsorpFactors(EnergyPlusData &state);
     130             : 
     131             :     void CLIP(EnergyPlusData &state, int const NVT, Array1D<Real64> &XVT, Array1D<Real64> &YVT, Array1D<Real64> &ZVT);
     132             : 
     133             :     void CTRANS(EnergyPlusData &state,
     134             :                 int const NS,         // Surface number whose vertex coordinates are being transformed
     135             :                 int const NGRS,       // Base surface number for surface NS
     136             :                 int &NVT,             // Number of vertices for surface NS
     137             :                 Array1D<Real64> &XVT, // XYZ coordinates of vertices of NS in plane of NGRS
     138             :                 Array1D<Real64> &YVT,
     139             :                 Array1D<Real64> &ZVT);
     140             : 
     141             :     void HTRANS(EnergyPlusData &state,
     142             :                 int const I,          // Mode selector: 0 - Compute H.C. of sides
     143             :                 int const NS,         // Figure Number
     144             :                 int const NumVertices // Number of vertices
     145             :     );
     146             : 
     147             :     void HTRANS0(EnergyPlusData &state,
     148             :                  int const NS,         // Figure Number
     149             :                  int const NumVertices // Number of vertices
     150             :     );
     151             : 
     152             :     void HTRANS1(EnergyPlusData &state,
     153             :                  int const NS,         // Figure Number
     154             :                  int const NumVertices // Number of vertices
     155             :     );
     156             : 
     157             :     void INCLOS(EnergyPlusData &state,
     158             :                 int const N1,            // Figure number of figure 1
     159             :                 int const N1NumVert,     // Number of vertices of figure 1
     160             :                 int const N2,            // Figure number of figure 2
     161             :                 int const N2NumVert,     // Number of vertices of figure 2
     162             :                 int &NumVerticesOverlap, // Number of vertices which overlap
     163             :                 int &NIN                 // Number of vertices of figure 1 within figure 2
     164             :     );
     165             : 
     166             :     void INTCPT(EnergyPlusData &state,
     167             :                 int const NV1, // Number of vertices of figure NS1
     168             :                 int const NV2, // Number of vertices of figure NS2
     169             :                 int &NV3,      // Number of vertices of figure NS3
     170             :                 int const NS1, // Number of the figure being overlapped
     171             :                 int const NS2  // Number of the figure doing overlapping
     172             :     );
     173             : 
     174             :     void CLIPPOLY(EnergyPlusData &state,
     175             :                   int const NS1, // Figure number of figure 1 (The subject polygon)
     176             :                   int const NS2, // Figure number of figure 2 (The clipping polygon)
     177             :                   int const NV1, // Number of vertices of figure 1
     178             :                   int const NV2, // Number of vertices of figure 2
     179             :                   int &NV3       // Number of vertices of figure 3
     180             :     );
     181             : 
     182             :     void MULTOL(EnergyPlusData &state,
     183             :                 int const NNN,   // argument
     184             :                 int const LOC0,  // Location in the homogeneous coordinate array
     185             :                 int const NRFIGS // Number of figures overlapped
     186             :     );
     187             : 
     188             :     void ORDER(EnergyPlusData &state,
     189             :                int const NV3, // Number of vertices of figure NS3
     190             :                int const NS3  // Location to place results of overlap
     191             :     );
     192             : 
     193             :     void DeterminePolygonOverlap(EnergyPlusData &state,
     194             :                                  int const NS1, // Number of the figure being overlapped
     195             :                                  int const NS2, // Number of the figure doing overlapping
     196             :                                  int const NS3  // Location to place results of overlap
     197             :     );
     198             : 
     199             :     void CalcPerSolarBeam(EnergyPlusData &state,
     200             :                           Real64 const AvgEqOfTime,       // Average value of Equation of Time for period
     201             :                           Real64 const AvgSinSolarDeclin, // Average value of Sine of Solar Declination for period
     202             :                           Real64 const AvgCosSolarDeclin  // Average value of Cosine of Solar Declination for period
     203             :     );
     204             : 
     205             :     void FigureSunCosines(EnergyPlusData &state,
     206             :                           int const iHour,
     207             :                           int const iTimeStep,
     208             :                           Real64 const EqOfTime,       // value of Equation of Time for period
     209             :                           Real64 const SinSolarDeclin, // value of Sine of Solar Declination for period
     210             :                           Real64 const CosSolarDeclin  // value of Cosine of Solar Declination for period
     211             :     );
     212             : 
     213             :     void FigureSolarBeamAtTimestep(EnergyPlusData &state, int const iHour, int const iTimeStep);
     214             : 
     215             :     void DetermineShadowingCombinations(EnergyPlusData &state);
     216             : 
     217             :     void SHADOW(EnergyPlusData &state,
     218             :                 int const iHour, // Hour index
     219             :                 int const TS     // Time Step
     220             :     );
     221             : 
     222             :     void SHDBKS(EnergyPlusData &state,
     223             :                 int const NGRS, // Number of the general receiving surface
     224             :                 int const CurSurf,
     225             :                 int const NBKS, // Number of back surfaces
     226             :                 int const HTS   // Heat transfer surface number of the general receiving surf
     227             :     );
     228             : 
     229             :     void SHDGSS(EnergyPlusData &state,
     230             :                 int const NGRS,
     231             :                 int const iHour,   // Hour Counter
     232             :                 int const TS,      // TimeStep
     233             :                 int const CurSurf, // Current Surface
     234             :                 int const NGSS,    // Number of general shadowing surfaces
     235             :                 int const HTS      // Heat transfer surface number of the general receiving surf
     236             :     );
     237             : 
     238             :     void CalcInteriorSolarOverlaps(EnergyPlusData &state,
     239             :                                    int const iHour, // Hour Index
     240             :                                    int const NBKS,  // Number of back surfaces associated with this GRSNR (in general, only
     241             :                                    int const HTSS,  // Surface number of the subsurface (exterior window)
     242             :                                    int const GRSNR, // General receiving surface number (base surface of the exterior window)
     243             :                                    int const TS     // Time step Index
     244             :     );
     245             : 
     246             :     void CalcInteriorSolarDistribution(EnergyPlusData &state);
     247             : 
     248             :     void CalcAbsorbedOnExteriorOpaqueSurfaces(EnergyPlusData &state);
     249             : 
     250             :     void CalcInteriorSolarDistributionWCESimple(EnergyPlusData &state);
     251             : 
     252             :     int WindowScheduledSolarAbs(EnergyPlusData &state,
     253             :                                 int const SurfNum, // Surface number
     254             :                                 int const ConstNum // Construction number
     255             :     );
     256             : 
     257             :     int SurfaceScheduledSolarInc(EnergyPlusData &state,
     258             :                                  int const SurfNum, // Surface number
     259             :                                  int const ConstNum // Construction number
     260             :     );
     261             : 
     262             :     void PerformSolarCalculations(EnergyPlusData &state);
     263             : 
     264             :     void SHDRVL(EnergyPlusData &state,
     265             :                 int const HTSS,  // Heat transfer surface number of the subsurface
     266             :                 int const SBSNR, // Subsurface number
     267             :                 int const Hour,
     268             :                 int const TS);
     269             : 
     270             :     void SHDSBS(EnergyPlusData &state,
     271             :                 int const iHour, // Hour Index
     272             :                 int const CurSurf,
     273             :                 int const NBKS, // Number of back surfaces
     274             :                 int const NSBS, // Number of subsurfaces
     275             :                 int const HTS,  // Heat transfer surface number of the general receiving surf
     276             :                 int const TS    // Time step Index
     277             :     );
     278             : 
     279             :     void SUN3(int const JulianDayOfYear,      // Julian Day Of Year
     280             :               Real64 &SineOfSolarDeclination, // Sine of Solar Declination
     281             :               Real64 &EquationOfTime          // Equation of Time (Degrees)
     282             :     );
     283             : 
     284             :     void SUN4(EnergyPlusData &state,
     285             :               Real64 const CurrentTime,    // Time to use in shadowing calculations
     286             :               Real64 const EqOfTime,       // Equation of time for current day
     287             :               Real64 const SinSolarDeclin, // Sine of the Solar declination (current day)
     288             :               Real64 const CosSolarDeclin  // Cosine of the Solar declination (current day)
     289             :     );
     290             : 
     291             :     void WindowShadingManager(EnergyPlusData &state);
     292             : 
     293             :     void CheckGlazingShadingStatusChange(EnergyPlusData &state);
     294             : 
     295             :     DataSurfaces::WinShadingType findValueInEnumeration(Real64 controlValue);
     296             : 
     297             :     int selectActiveWindowShadingControlIndex(EnergyPlusData &state, int curSurface);
     298             : 
     299             :     void WindowGapAirflowControl(EnergyPlusData &state);
     300             : 
     301             :     void SkyDifSolarShading(EnergyPlusData &state);
     302             : 
     303             :     void CalcWindowProfileAngles(EnergyPlusData &state);
     304             : 
     305             :     void CalcFrameDividerShadow(EnergyPlusData &state,
     306             :                                 int const SurfNum,  // Surface number
     307             :                                 int const FrDivNum, // Frame/divider number
     308             :                                 int const HourNum   // Hour number
     309             :     );
     310             : 
     311             :     void CalcBeamSolarOnWinRevealSurface(EnergyPlusData &state);
     312             : 
     313             :     void ReportSurfaceShading(EnergyPlusData &state);
     314             : 
     315             :     void ReportSurfaceErrors(EnergyPlusData &state);
     316             : 
     317             :     void ComputeWinShadeAbsorpFactors(EnergyPlusData &state);
     318             : 
     319             :     void CalcWinTransDifSolInitialDistribution(EnergyPlusData &state);
     320             : 
     321             :     void CalcInteriorWinTransDifSolInitialDistribution(
     322             :         EnergyPlusData &state,
     323             :         int const IntWinEnclosureNum,     // Interior Window Enclosure index number
     324             :         int const IntWinSurfNum,          // Interior Window Surface number
     325             :         Real64 const IntWinDifSolarTransW // Diffuse Solar transmitted through Interior Window IntWinSurfNum from adjacent enclosure [W]
     326             :     );
     327             : 
     328             :     void CalcComplexWindowOverlap(EnergyPlusData &state,
     329             :                                   BSDFGeomDescr &Geom,               // State Geometry
     330             :                                   BSDFWindowGeomDescr const &Window, // Window Geometry
     331             :                                   int const ISurf                    // Surface number of the complex fenestration
     332             :     );
     333             : 
     334             :     void TimestepInitComplexFenestration(EnergyPlusData &state);
     335             : 
     336             : } // namespace SolarShading
     337             : 
     338         771 : struct SolarShadingData : BaseGlobalStruct
     339             : {
     340             :     Array1D_string const cOverLapStatus;
     341             :     int MaxHCV = 15;             // Maximum number of HC vertices
     342             :                                  // (needs to be based on maxnumvertices)
     343             :     int MaxHCS = 15000;          // 200      ! Maximum number of HC surfaces (was 56)
     344             :                                  // Following are initially set in AllocateModuleArrays
     345             :     int MAXHCArrayBounds = 0;    // Bounds based on Max Number of Vertices in surfaces
     346             :     int MAXHCArrayIncrement = 0; // Increment based on Max Number of Vertices in surfaces
     347             :                                  // The following variable should be re-engineered to lower in module hierarchy but need more analysis
     348             :     int NVS;                     // Number of vertices of the shadow/clipped surface
     349             :     int NumVertInShadowOrClippedSurface;
     350             :     int CurrentSurfaceBeingShadowed;
     351             :     int CurrentShadowingSurface;
     352             :     int OverlapStatus; // Results of overlap calculation:
     353             :                        // 1=No overlap; 2=NS1 completely within NS2
     354             :                        // 3=NS2 completely within NS1; 4=Partial overlap
     355             : 
     356             :     Array1D<Real64> SurfSunCosTheta;            // Cosine of angle of incidence of sun's rays on surface NS
     357             :     Array1D<Real64> SurfAnisoSkyMult;           // Multiplier on exterior-surface sky view factor to account for
     358             :                                                 // anisotropy of sky radiance; = 1.0 for for isotropic sky
     359             :     Array1D<Real64> SurfDifShdgRatioIsoSky;     // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky)
     360             :     Array3D<Real64> SurfDifShdgRatioIsoSkyHRTS; // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky)
     361             :     Array1D<Real64> SurfCurDifShdgRatioIsoSky;  // Diffuse shading ratio (WithShdgIsoSky/WoShdgIsoSky)
     362             :     Array1D<Real64> SurfDifShdgRatioHoriz;      // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz)
     363             :     Array3D<Real64> SurfDifShdgRatioHorizHRTS;  // Horizon shading ratio (WithShdgHoriz/WoShdgHoriz)
     364             :     Array1D<Real64> SurfWithShdgIsoSky;         // Diffuse solar irradiance from sky on surface, with shading
     365             :     Array1D<Real64> SurfWoShdgIsoSky;           // Diffuse solar from sky on surface, without shading
     366             :     Array1D<Real64> SurfWithShdgHoriz;          // Diffuse solar irradiance from horizon portion of sky on surface, with shading
     367             :     Array1D<Real64> SurfWoShdgHoriz;            // Diffuse solar irradiance from horizon portion of sky on surface, without shading
     368             :     Array1D<Real64> SurfMultIsoSky;             // Contribution to eff sky view factor from isotropic sky
     369             :     Array1D<Real64> SurfMultCircumSolar;        // Contribution to eff sky view factor from circumsolar brightening
     370             :     Array1D<Real64> SurfMultHorizonZenith;      // Contribution to eff sky view factor from horizon or zenith brightening
     371             : 
     372             :     int FBKSHC;                     // HC location of first back surface
     373             :     int FGSSHC;                     // HC location of first general shadowing surface
     374             :     int FINSHC;                     // HC location of first back surface overlap
     375             :     int FRVLHC;                     // HC location of first reveal surface
     376             :     int FSBSHC;                     // HC location of first subsurface
     377             :     int LOCHCA = 0;                 // Location of highest data in the HC arrays
     378             :     int NBKSHC;                     // Number of back surfaces in the HC arrays
     379             :     int NGSSHC;                     // Number of general shadowing surfaces in the HC arrays
     380             :     int NINSHC;                     // Number of back surface overlaps in the HC arrays
     381             :     int NRVLHC;                     // Number of reveal surfaces in HC array
     382             :     int NSBSHC;                     // Number of subsurfaces in the HC arrays
     383             :     bool CalcSkyDifShading;         // True when sky diffuse solar shading is
     384             :     int ShadowingCalcFrequency = 0; // Frequency for Shadowing Calculations
     385             :     int ShadowingDaysLeft = 0;      // Days left in current shadowing period
     386             : 
     387             :     Array1D_int HCNS;   // Surface number of back surface HC figures
     388             :     Array1D_int HCNV;   // Number of vertices of each HC figure
     389             :     Array2D<Int64> HCA; // 'A' homogeneous coordinates of sides
     390             :     Array2D<Int64> HCB; // 'B' homogeneous coordinates of sides
     391             :     Array2D<Int64> HCC; // 'C' homogeneous coordinates of sides
     392             :     Array2D<Int64> HCX; // 'X' homogeneous coordinates of vertices of figure.
     393             :     Array2D<Int64> HCY; // 'Y' homogeneous coordinates of vertices of figure.
     394             :     Array3D_int SurfWinRevealStatus;
     395             :     Array1D<Real64> HCAREA;         // Area of each HC figure.  Sign Convention:  Base Surface
     396             :                                     // - Positive, Shadow - Negative, Overlap between two shadows
     397             :                                     // - positive, etc., so that sum of HC areas=base sunlit area
     398             :     Array1D<Real64> HCT;            // Transmittance of each HC figure
     399             :     Array1D<Real64> SurfIntAbsFac;  // For simple interior solar distribution (in which all beam
     400             :                                     // radiation entering zone is assumed to strike the floor),
     401             :                                     // fraction of beam radiation absorbed by each floor surface
     402             :     Array1D<Real64> SurfSunlitArea; // Sunlit area of heat transfer surface HTS
     403             :                                     // Excludes multiplier for windows
     404             :                                     // Shadowing combinations data structure...See ShadowingCombinations type
     405             :     int NumTooManyFigures = 0;
     406             :     int NumTooManyVertices = 0;
     407             :     int NumBaseSubSurround = 0;
     408             :     Vector3<Real64> SUNCOS;   // Direction cosines of solar position
     409             :     Real64 XShadowProjection; // X projection of a shadow (formerly called C)
     410             :     Real64 YShadowProjection; // Y projection of a shadow (formerly called S)
     411             :     Array1D<Real64> XTEMP;    // Temporary 'X' values for HC vertices of the overlap
     412             :     Array1D<Real64> XVC;      // X-vertices of the clipped figure
     413             :     Array1D<Real64> XVS;      // X-vertices of the shadow
     414             :     Array1D<Real64> YTEMP;    // Temporary 'Y' values for HC vertices of the overlap
     415             :     Array1D<Real64> YVC;      // Y-vertices of the clipped figure
     416             :     Array1D<Real64> YVS;      // Y-vertices of the shadow
     417             :     Array1D<Real64> ZVC;      // Z-vertices of the clipped figure
     418             :                               // Used in Sutherland Hodman poly clipping
     419             :     Array1D<Real64> ATEMP;    // Temporary 'A' values for HC vertices of the overlap
     420             :     Array1D<Real64> BTEMP;    // Temporary 'B' values for HC vertices of the overlap
     421             :     Array1D<Real64> CTEMP;    // Temporary 'C' values for HC vertices of the overlap
     422             :     Array1D<Real64> XTEMP1;   // Temporary 'X' values for HC vertices of the overlap
     423             :     Array1D<Real64> YTEMP1;   // Temporary 'Y' values for HC vertices of the overlap
     424             :     int maxNumberOfFigures = 0;
     425             : 
     426             : #ifdef EP_NO_OPENGL
     427             :     bool penumbra = false;
     428             : #else
     429             :     std::unique_ptr<Pumbra::Penumbra> penumbra = nullptr;
     430             : #endif
     431             : 
     432             :     bool GetInputFlag = true;
     433             :     bool anyScheduledShadingSurface = false;
     434             :     bool firstTime = true;
     435             :     bool debugging = false;
     436             :     std::vector<unsigned> penumbraIDs;
     437             : 
     438             :     bool InitComplexOnce = true;
     439             :     bool ShadowOneTimeFlag = true;
     440             :     bool CHKSBSOneTimeFlag = true;
     441             :     bool ORDERFirstTimeFlag = true;
     442             :     bool TooManyFiguresMessage = false;
     443             :     bool TooManyVerticesMessage = false;
     444             :     bool SHDBKSOneTimeFlag = true;
     445             :     bool SHDGSSOneTimeFlag = true;
     446             : 
     447             :     Array1D<SolarShading::SurfaceErrorTracking> TrackTooManyFigures;
     448             :     Array1D<SolarShading::SurfaceErrorTracking> TrackTooManyVertices;
     449             :     Array1D<SolarShading::SurfaceErrorTracking> TrackBaseSubSurround;
     450             : 
     451             :     Real64 TolValue = 0.0003;
     452             :     Array1D<Real64> XVT;   // X Vertices of
     453             :     Array1D<Real64> YVT;   // Y vertices of
     454             :     Array1D<Real64> ZVT;   // Z vertices of
     455             :     Array1D<Real64> SLOPE; // Slopes from left-most vertex to others.
     456             :     int MaxGSS = 50;       // Current Max for GSS array
     457             :     int MaxBKS = 50;       // Current Max for BKS array
     458             :     int MaxSBS = 50;       // Current Max for SBS array
     459             :     int MaxDim = 0;
     460             :     Array1D<Real64> XVrt;  // X Vertices of Shadows
     461             :     Array1D<Real64> YVrt;  // Y vertices of Shadows
     462             :     Array1D<Real64> ZVrt;  // Z vertices of Shadows
     463             :     Array1D<Real64> XVrtx; // X,Y,Z coordinates of vertices of
     464             :     Array1D<Real64> YVrtx; // back surfaces projected into system
     465             :     Array1D<Real64> ZVrtx; // relative to receiving surface
     466             :     Array1D<Real64> XVert;
     467             :     Array1D<Real64> YVert;
     468             :     Array1D<Real64> ZVert;
     469             :     Array1D<Real64> SurfWinAbsBeam;                                                               // Glass layer beam solar absorptance of a window
     470             :     Array1D<Real64> SurfWinAbsBeamEQL = Array1D<Real64>(DataWindowEquivalentLayer::CFSMAXNL + 1); // layers beam solar absorptance of a window
     471             :     Array1D<Real64> SurfWinExtBeamAbsByShadFac; // Factor for exterior beam radiation absorbed by shade (1/m2) (absorbed radation = beam incident *
     472             :                                                 // ExtBeamAbsByShad
     473             :     Array1D<Real64> SurfWinIntBeamAbsByShadFac; // Like SurfWinExtBeamAbsByShadFac, but for interior beam radiation.
     474             :     Array1D<Real64>
     475             :         SurfWinTransBmSolar; // Factor for exterior beam solar transmitted through window, or window plus shade, into zone at current time (m2)
     476             :     Array1D<Real64>
     477             :         SurfWinTransDifSolar; // Factor for exterior diffuse solar transmitted through window, or window plus shade, into zone at current time (m2)
     478             :     Array1D<Real64> SurfWinTransDifSolarGnd; // Factor for exterior ground diffuse solar transmitted through window with horizontally-slatted blind
     479             :                                              // into zone at current time (m2)
     480             :     Array1D<Real64> SurfWinTransDifSolarSky; // Factor for exterior sky diffuse solar transmitted through window with horizontally-slatted blind into
     481             :                                              // zone at current time (m2)
     482             :     Array2D<Real64> SurfWinAbsSolBeamEQL =
     483             :         Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed exterior beam radiation by layers fraction
     484             :     Array2D<Real64> SurfWinAbsSolDiffEQL =
     485             :         Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed exterior diffuse radiation by layers fraction
     486             :     Array2D<Real64> SurfWinAbsSolBeamBackEQL =
     487             :         Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1); // absorbed interior beam radiation by layers fraction from back
     488             :     Array1D<Real64> SurfWinTransBmBmSolar;  // Factor for exterior beam to beam solar transmitted through window, or window plus shade, into zone at
     489             :                                             // current time (m2)
     490             :     Array1D<Real64> SurfWinTransBmDifSolar; // Factor for exterior beam to diffuse solar transmitted through window, or window plus shade, into zone
     491             :                                             // at current time (m2)
     492             :     Real64 ThetaBig = 0.0;                  // Larger of ThetaBlock1 and ThetaBlock2     //Autodesk Used uninitialized in some runs
     493             :     Real64 ThetaSmall = 0.0;                // Smaller of ThetaBlock1 and ThetaBlock2 //Autodesk Used uninitialized in some runs
     494             :     Real64 ThetaMin = 0.0;                  // Minimum allowed slat angle, resp. (rad)  //Autodesk Used uninitialized in some runs
     495             :     Real64 ThetaMax = 0.0;                  // Maximum allowed slat angle, resp. (rad)  //Autodesk Used uninitialized in some runs
     496             :     Array1D<Real64> XVertex;                // X,Y,Z coordinates of vertices of
     497             :     Array1D<Real64> YVertex;                // back surfaces projected into system
     498             :     Array1D<Real64> ZVertex;                // relative to receiving surface
     499             :     std::vector<Real64> sin_Phi;
     500             :     std::vector<Real64> cos_Phi;
     501             :     std::vector<Real64> sin_Theta;
     502             :     std::vector<Real64> cos_Theta;
     503             :     std::unique_ptr<std::iostream> shd_stream; // Shading file stream
     504             : 
     505           0 :     void clear_state() override
     506             :     {
     507           0 :         this->MaxHCV = 15;
     508           0 :         this->MaxHCS = 1500;
     509           0 :         this->MAXHCArrayBounds = 0;
     510           0 :         this->MAXHCArrayIncrement = 0;
     511           0 :         this->NVS = 0;
     512           0 :         this->NumVertInShadowOrClippedSurface = 0;
     513           0 :         this->CurrentSurfaceBeingShadowed = 0;
     514           0 :         this->CurrentShadowingSurface = 0;
     515           0 :         this->OverlapStatus = 0;
     516           0 :         this->SurfSunCosTheta.deallocate();
     517           0 :         this->SurfAnisoSkyMult.deallocate();
     518           0 :         this->SurfDifShdgRatioIsoSky.deallocate();
     519           0 :         this->SurfDifShdgRatioIsoSkyHRTS.deallocate();
     520           0 :         this->SurfCurDifShdgRatioIsoSky.deallocate();
     521           0 :         this->SurfDifShdgRatioHoriz.deallocate();
     522           0 :         this->SurfDifShdgRatioHorizHRTS.deallocate();
     523           0 :         this->SurfWithShdgIsoSky.deallocate();
     524           0 :         this->SurfWoShdgIsoSky.deallocate();
     525           0 :         this->SurfWithShdgHoriz.deallocate();
     526           0 :         this->SurfWoShdgHoriz.deallocate();
     527           0 :         this->SurfMultIsoSky.deallocate();
     528           0 :         this->SurfMultCircumSolar.deallocate();
     529           0 :         this->SurfMultHorizonZenith.deallocate();
     530           0 :         this->FBKSHC = 0;
     531           0 :         this->FGSSHC = 0;
     532           0 :         this->FINSHC = 0;
     533           0 :         this->FRVLHC = 0;
     534           0 :         this->FSBSHC = 0;
     535           0 :         this->LOCHCA = 0;
     536           0 :         this->NBKSHC = 0;
     537           0 :         this->NGSSHC = 0;
     538           0 :         this->NINSHC = 0;
     539           0 :         this->NRVLHC = 0;
     540           0 :         this->NSBSHC = 0;
     541           0 :         this->CalcSkyDifShading = false;
     542           0 :         this->ShadowingCalcFrequency = 0; // Frequency for Shadowing Calculations
     543           0 :         this->ShadowingDaysLeft = 0;      // Days left in current shadowing period
     544           0 :         this->debugging = false;
     545           0 :         this->GetInputFlag = true;
     546           0 :         this->anyScheduledShadingSurface = false;
     547           0 :         this->firstTime = true;
     548           0 :         this->HCNS.deallocate();
     549           0 :         this->HCNV.deallocate();
     550           0 :         this->HCA.deallocate();
     551           0 :         this->HCB.deallocate();
     552           0 :         this->HCC.deallocate();
     553           0 :         this->HCX.deallocate();
     554           0 :         this->HCY.deallocate();
     555           0 :         this->SurfWinRevealStatus.deallocate();
     556           0 :         this->HCAREA.deallocate();
     557           0 :         this->HCT.deallocate();
     558           0 :         this->SurfIntAbsFac.deallocate();
     559           0 :         this->SurfSunlitArea.deallocate();
     560           0 :         this->NumTooManyFigures = 0;
     561           0 :         this->NumTooManyVertices = 0;
     562           0 :         this->NumBaseSubSurround = 0;
     563           0 :         this->XShadowProjection = 0.0;
     564           0 :         this->YShadowProjection = 0.0;
     565           0 :         this->XTEMP.deallocate();
     566           0 :         this->XVC.deallocate();
     567           0 :         this->XVS.deallocate();
     568           0 :         this->YTEMP.deallocate();
     569           0 :         this->YVC.deallocate();
     570           0 :         this->YVS.deallocate();
     571           0 :         this->ZVC.deallocate();
     572           0 :         this->ATEMP.deallocate();
     573           0 :         this->BTEMP.deallocate();
     574           0 :         this->CTEMP.deallocate();
     575           0 :         this->XTEMP1.deallocate();
     576           0 :         this->YTEMP1.deallocate();
     577           0 :         this->maxNumberOfFigures = 0;
     578           0 :         this->TrackTooManyFigures.deallocate();
     579           0 :         this->TrackTooManyVertices.deallocate();
     580           0 :         this->TrackBaseSubSurround.deallocate();
     581           0 :         this->InitComplexOnce = true;
     582           0 :         this->ShadowOneTimeFlag = true;
     583           0 :         this->CHKSBSOneTimeFlag = true;
     584           0 :         this->ORDERFirstTimeFlag = true;
     585           0 :         this->TooManyFiguresMessage = false;
     586           0 :         this->TooManyVerticesMessage = false;
     587           0 :         this->SHDBKSOneTimeFlag = true;
     588           0 :         this->SHDGSSOneTimeFlag = true;
     589           0 :         this->TolValue = 0.0003;
     590           0 :         this->XVT.deallocate();
     591           0 :         this->YVT.deallocate();
     592           0 :         this->ZVT.deallocate();
     593           0 :         this->SLOPE.deallocate();
     594           0 :         this->MaxGSS = 50;
     595           0 :         this->MaxBKS = 50;
     596           0 :         this->MaxSBS = 50;
     597           0 :         this->MaxDim = 0;
     598           0 :         this->XVrt.deallocate();
     599           0 :         this->YVrt.deallocate();
     600           0 :         this->ZVrt.deallocate();
     601           0 :         this->XVrtx.deallocate();
     602           0 :         this->YVrtx.deallocate();
     603           0 :         this->ZVrtx.deallocate();
     604           0 :         this->XVert.deallocate();
     605           0 :         this->YVert.deallocate();
     606           0 :         this->ZVert.deallocate();
     607           0 :         this->SurfWinAbsBeam.deallocate();
     608           0 :         this->SurfWinAbsBeamEQL = Array1D<Real64>(DataWindowEquivalentLayer::CFSMAXNL + 1);
     609           0 :         this->SurfWinExtBeamAbsByShadFac.deallocate();
     610           0 :         this->SurfWinIntBeamAbsByShadFac.deallocate();
     611           0 :         this->SurfWinTransBmSolar.deallocate();
     612           0 :         this->SurfWinTransDifSolar.deallocate();
     613           0 :         this->SurfWinTransDifSolarGnd.deallocate();
     614           0 :         this->SurfWinTransDifSolarSky.deallocate();
     615           0 :         this->SurfWinAbsSolBeamEQL = Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1);
     616           0 :         this->SurfWinAbsSolDiffEQL = Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1);
     617           0 :         this->SurfWinAbsSolBeamBackEQL = Array2D<Real64>(2, DataWindowEquivalentLayer::CFSMAXNL + 1);
     618           0 :         this->SurfWinTransBmBmSolar.deallocate();
     619           0 :         this->SurfWinTransBmDifSolar.deallocate();
     620           0 :         this->ThetaBig = 0.0;
     621           0 :         this->ThetaSmall = 0.0;
     622           0 :         this->ThetaMin = 0.0;
     623           0 :         this->ThetaMax = 0.0;
     624           0 :         this->XVertex.deallocate();
     625           0 :         this->YVertex.deallocate();
     626           0 :         this->ZVertex.deallocate();
     627           0 :         this->sin_Phi.clear();
     628           0 :         this->cos_Phi.clear();
     629           0 :         this->sin_Theta.clear();
     630           0 :         this->cos_Theta.clear();
     631           0 :         this->shd_stream.reset();
     632           0 :     }
     633             : 
     634             :     // Default Constructor
     635         771 :     SolarShadingData()
     636         771 :         : cOverLapStatus(6, {"No-Overlap", "1st-Surf-within-2nd", "2nd-Surf-within-1st", "Partial-Overlap", "Too-Many-Vertices", "Too-Many-Figures"}),
     637         771 :           SUNCOS(3)
     638             :     {
     639         771 :     }
     640             : };
     641             : } // namespace EnergyPlus
     642             : 
     643             : #endif

Generated by: LCOV version 1.13