LCOV - code coverage report
Current view: top level - EnergyPlus - SurfaceGeometry.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 46 46
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 5 5

            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 SurfaceGeometry_hh_INCLUDED
      49              : #define SurfaceGeometry_hh_INCLUDED
      50              : 
      51              : // ObjexxFCL Headers
      52              : #include <ObjexxFCL/Array1S.hh>
      53              : 
      54              : // EnergyPlus Headers
      55              : #include <EnergyPlus/DataSurfaces.hh>
      56              : #include <EnergyPlus/DataVectorTypes.hh>
      57              : #include <EnergyPlus/DataViewFactorInformation.hh>
      58              : #include <EnergyPlus/EnergyPlus.hh>
      59              : #include <EnergyPlus/HeatBalanceKivaManager.hh>
      60              : #include <EnergyPlus/Vectors.hh>
      61              : 
      62              : // C++ Headers
      63              : #include <map>
      64              : 
      65              : namespace EnergyPlus {
      66              : 
      67              : // Forward declarations
      68              : struct EnergyPlusData;
      69              : 
      70              : namespace SurfaceGeometry {
      71              : 
      72              :     // Using/Aliasing
      73              :     using DataSurfaces::SurfaceClass;
      74              :     using DataSurfaces::SurfaceData;
      75              :     using DataVectorTypes::Vector;
      76              : 
      77              :     enum enclosureType
      78              :     {
      79              :         RadiantEnclosures,
      80              :         SolarEnclosures
      81              :     };
      82              : 
      83              :     void SetupZoneGeometry(EnergyPlusData &state, bool &ErrorsFound);
      84              : 
      85              :     void AllocateSurfaceArrays(EnergyPlusData &state);
      86              : 
      87              :     void AllocateSurfaceWindows(EnergyPlusData &state, int NumSurfaces);
      88              : 
      89              :     void GetSurfaceData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
      90              : 
      91              :     void CreateMissingSpaces(EnergyPlusData &state, Array1D<SurfaceGeometry::SurfaceData> &Surfaces);
      92              : 
      93              :     void createSpaceSurfaceLists(EnergyPlusData &state);
      94              : 
      95              :     void setSurfaceFirstLast(EnergyPlusData &state);
      96              : 
      97              :     void checkSubSurfAzTiltNorm(EnergyPlusData &state,
      98              :                                 SurfaceData &baseSurface, // Base surface data (in)
      99              :                                 SurfaceData &subSurface,  // Subsurface data (in)
     100              :                                 bool &surfaceError        // True if there is subsurface error that requires a fatal
     101              :     );
     102              : 
     103              :     void GetGeometryParameters(EnergyPlusData &state, bool &ErrorsFound); // set to true if errors found during input
     104              : 
     105              :     void GetDetShdSurfaceData(EnergyPlusData &state,
     106              :                               bool &ErrorsFound,          // Error flag indicator (true if errors found)
     107              :                               int &SurfNum,               // Count of Current SurfaceNumber
     108              :                               int const TotDetachedFixed, // Number of Fixed Detached Shading Surfaces to obtain
     109              :                               int const TotDetachedBldg   // Number of Building Detached Shading Surfaces to obtain
     110              :     );
     111              : 
     112              :     void GetRectDetShdSurfaceData(EnergyPlusData &state,
     113              :                                   bool &ErrorsFound,              // Error flag indicator (true if errors found)
     114              :                                   int &SurfNum,                   // Count of Current SurfaceNumber
     115              :                                   int const TotRectDetachedFixed, // Number of Fixed Detached Shading Surfaces to obtain
     116              :                                   int const TotRectDetachedBldg   // Number of Building Detached Shading Surfaces to obtain
     117              :     );
     118              : 
     119              :     void GetHTSurfaceData(EnergyPlusData &state,
     120              :                           bool &ErrorsFound,                 // Error flag indicator (true if errors found)
     121              :                           int &SurfNum,                      // Count of Current SurfaceNumber
     122              :                           int const TotHTSurfs,              // Number of Heat Transfer Base Surfaces to obtain
     123              :                           int const TotDetailedWalls,        // Number of Wall:Detailed items to obtain
     124              :                           int const TotDetailedRoofs,        // Number of RoofCeiling:Detailed items to obtain
     125              :                           int const TotDetailedFloors,       // Number of Floor:Detailed items to obtain
     126              :                           const Array1D_string &BaseSurfCls, // Valid Classes for Base Surfaces
     127              :                           const Array1D<SurfaceClass> &BaseSurfIDs,
     128              :                           int &NeedToAddSurfaces // Number of surfaces to add, based on unentered IZ surfaces
     129              :     );
     130              : 
     131              :     void GetRectSurfaces(EnergyPlusData &state,
     132              :                          bool &ErrorsFound,                        // Error flag indicator (true if errors found)
     133              :                          int &SurfNum,                             // Count of Current SurfaceNumber
     134              :                          int const TotRectExtWalls,                // Number of Exterior Walls to obtain
     135              :                          int const TotRectIntWalls,                // Number of Adiabatic Walls to obtain
     136              :                          int const TotRectIZWalls,                 // Number of Interzone Walls to obtain
     137              :                          int const TotRectUGWalls,                 // Number of Underground to obtain
     138              :                          int const TotRectRoofs,                   // Number of Roofs to obtain
     139              :                          int const TotRectCeilings,                // Number of Adiabatic Ceilings to obtain
     140              :                          int const TotRectIZCeilings,              // Number of Interzone Ceilings to obtain
     141              :                          int const TotRectGCFloors,                // Number of Floors with Ground Contact to obtain
     142              :                          int const TotRectIntFloors,               // Number of Adiabatic Walls to obtain
     143              :                          int const TotRectIZFloors,                // Number of Interzone Floors to obtain
     144              :                          const Array1D<SurfaceClass> &BaseSurfIDs, // ID Assignments for valid surface classes
     145              :                          int &NeedToAddSurfaces                    // Number of surfaces to add, based on unentered IZ surfaces
     146              :     );
     147              : 
     148              :     void MakeRectangularVertices(EnergyPlusData &state,
     149              :                                  int const SurfNum,
     150              :                                  Real64 const XCoord,
     151              :                                  Real64 const YCoord,
     152              :                                  Real64 const ZCoord,
     153              :                                  Real64 const Length,
     154              :                                  Real64 const Height,
     155              :                                  bool const SurfWorldCoordSystem);
     156              : 
     157              :     void GetHTSubSurfaceData(EnergyPlusData &state,
     158              :                              bool &ErrorsFound,                       // Error flag indicator (true if errors found)
     159              :                              int &SurfNum,                            // Count of Current SurfaceNumber
     160              :                              int const TotHTSubs,                     // Number of Heat Transfer SubSurfaces to obtain
     161              :                              const Array1D_string &SubSurfCls,        // Valid Classes for Sub Surfaces
     162              :                              const Array1D<SurfaceClass> &SubSurfIDs, // ID Assignments for valid sub surface classes
     163              :                              int &AddedSubSurfaces,                   // Subsurfaces added when windows reference Window5
     164              :                              int &NeedToAddSurfaces                   // Number of surfaces to add, based on unentered IZ surfaces
     165              :     );
     166              : 
     167              :     void GetRectSubSurfaces(EnergyPlusData &state,
     168              :                             bool &ErrorsFound,                       // Error flag indicator (true if errors found)
     169              :                             int &SurfNum,                            // Count of Current SurfaceNumber
     170              :                             int const TotWindows,                    // Number of Window SubSurfaces to obtain
     171              :                             int const TotDoors,                      // Number of Door SubSurfaces to obtain
     172              :                             int const TotGlazedDoors,                // Number of Glass Door SubSurfaces to obtain
     173              :                             int const TotIZWindows,                  // Number of Interzone Window SubSurfaces to obtain
     174              :                             int const TotIZDoors,                    // Number of Interzone Door SubSurfaces to obtain
     175              :                             int const TotIZGlazedDoors,              // Number of Interzone Glass Door SubSurfaces to obtain
     176              :                             const Array1D<SurfaceClass> &SubSurfIDs, // ID Assignments for valid sub surface classes
     177              :                             int &AddedSubSurfaces,                   // Subsurfaces added when windows reference Window5
     178              :                             int &NeedToAddSubSurfaces                // Number of surfaces to add, based on unentered IZ surfaces
     179              :     );
     180              : 
     181              :     void CheckWindowShadingControlFrameDivider(EnergyPlusData &state,
     182              :                                                std::string_view const cRoutineName, // routine name calling this one (for error messages)
     183              :                                                bool &ErrorsFound,                   // true if errors have been found or are found here
     184              :                                                int const SurfNum,                   // current surface number
     185              :                                                int const FrameField                 // field number for frame/divider
     186              :     );
     187              : 
     188              :     void CheckSubSurfaceMiscellaneous(EnergyPlusData &state,
     189              :                                       std::string_view const cRoutineName,       // routine name calling this one (for error messages)
     190              :                                       bool &ErrorsFound,                         // true if errors have been found or are found here
     191              :                                       int const SurfNum,                         // current surface number
     192              :                                       std::string const &SubSurfaceName,         // name of the surface
     193              :                                       std::string const &SubSurfaceConstruction, // name of the construction
     194              :                                       int &AddedSubSurfaces);
     195              : 
     196              :     void MakeRelativeRectangularVertices(EnergyPlusData &state,
     197              :                                          int const BaseSurfNum, // Base surface
     198              :                                          int const SurfNum,
     199              :                                          Real64 const XCoord,
     200              :                                          Real64 const ZCoord,
     201              :                                          Real64 const Length,
     202              :                                          Real64 const Height);
     203              : 
     204              :     void MakeEquivalentRectangle(EnergyPlusData &state,
     205              :                                  int const SurfNum, // Surface number
     206              :                                  bool &ErrorsFound  // Error flag indicator (true if errors found)
     207              :     );
     208              : 
     209              :     void GetAttShdSurfaceData(EnergyPlusData &state,
     210              :                               bool &ErrorsFound,   // Error flag indicator (true if errors found)
     211              :                               int &SurfNum,        // Count of Current SurfaceNumber
     212              :                               int const TotShdSubs // Number of Attached Shading SubSurfaces to obtain
     213              :     );
     214              : 
     215              :     void GetSimpleShdSurfaceData(EnergyPlusData &state,
     216              :                                  bool &ErrorsFound,                // Error flag indicator (true if errors found)
     217              :                                  int &SurfNum,                     // Count of Current SurfaceNumber
     218              :                                  int const TotOverhangs,           // Number of Overhangs to obtain
     219              :                                  int const TotOverhangsProjection, // Number of Overhangs (projection) to obtain
     220              :                                  int const TotFins,                // Number of Fins to obtain
     221              :                                  int const TotFinsProjection       // Number of Fins (projection) to obtain
     222              :     );
     223              : 
     224              :     void GetIntMassSurfaceData(EnergyPlusData &state,
     225              :                                bool &ErrorsFound, // Error flag indicator (true if errors found)
     226              :                                int &SurfNum       // Count of Current SurfaceNumber
     227              :     );
     228              : 
     229              :     int GetNumIntMassSurfaces(EnergyPlusData &state); // Number of Internal Mass Surfaces to obtain
     230              : 
     231              :     void GetShadingSurfReflectanceData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     232              : 
     233              :     void GetSurfaceSrdSurfsData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     234              : 
     235              :     void GetSurfaceLocalEnvData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     236              : 
     237              :     void GetHTSurfExtVentedCavityData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     238              : 
     239              :     void GetSurfaceHeatTransferAlgorithmOverrides(EnergyPlusData &state, bool &ErrorsFound);
     240              : 
     241              :     void GetSurfaceGroundSurfsData(EnergyPlusData &state, bool &ErrorsFound); // Error flag indicator (true if errors found)
     242              : 
     243              :     // Roof perimeter, Area, weighted-by-area average height azimuth
     244              :     struct GeoSummary
     245              :     {
     246              :         // Members
     247              :         Real64 Area = 0.0;      // Sum of all roof surface areas
     248              :         Real64 Perimeter = 0.0; // Actual perimeter of all roof surfaces, after removing all edges that are used twice (and inserting vertices
     249              :                                 // to split surfaces as needed)
     250              :         Real64 Height = 0.0;    // Weighted average mean vertical height: for each surface, take max - Zmin value,
     251              :                                 // then do a weighted average by surface area
     252              :         Real64 Azimuth = 0.0;   // Weighted average azimuth
     253              :         Real64 Tilt = 0.0;      // Weighted average tilt
     254              : 
     255              :         Real64 Zmax = 0;
     256              :         Real64 Zmin = 0;
     257              :         Real64 Ymax = 0;
     258              :         Real64 Ymin = 0;
     259              :         Real64 Xmax = 0;
     260              :         Real64 Xmin = 0;
     261              :     };
     262              : 
     263              :     void GetGeoSummaryRoof(EnergyPlusData const &state, GeoSummary &geoSumRoof);
     264              : 
     265              :     class ExposedFoundationPerimeter
     266              :     {
     267              :     public:
     268              :         void getData(EnergyPlusData &state, bool &ErrorsFound);
     269              :         struct Data
     270              :         {
     271              :             double exposedFraction = -1; // hush up cppcheck
     272              :             std::vector<bool> isExposedPerimeter;
     273              :             bool useDetailedExposedPerimeter;
     274              :         };
     275              :         std::map<int, Data> surfaceMap;
     276              :     };
     277              : 
     278              :     void GetVertices(EnergyPlusData &state,
     279              :                      int const SurfNum,             // Current surface number
     280              :                      int const NSides,              // Number of sides to figure
     281              :                      Array1S<Real64> const Vertices // Vertices, in specified order
     282              :     );
     283              : 
     284              :     void ReverseAndRecalculate(EnergyPlusData &state,
     285              :                                int const SurfNum,   // Surface number for the surface
     286              :                                int const NSides,    // number of sides to surface
     287              :                                Real64 &SurfAzimuth, // Surface Facing angle (will be 0 for roofs/floors)
     288              :                                Real64 &SurfTilt     // Surface tilt (
     289              :     );
     290              : 
     291              :     void MakeMirrorSurface(EnergyPlusData &state, int &SurfNum); // In=>Surface to Mirror, Out=>new Surface index
     292              : 
     293              :     void GetWindowShadingControlData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     294              : 
     295              :     void InitialAssociateWindowShadingControlFenestration(EnergyPlusData &state, bool &ErrorsFound, int SurfNum);
     296              : 
     297              :     void FinalAssociateWindowShadingControlFenestration(EnergyPlusData &state, bool &ErrorsFound);
     298              : 
     299              :     void CheckWindowShadingControlSimilarForWindow(EnergyPlusData &state, bool &ErrorsFound);
     300              : 
     301              :     bool isWindowShadingControlSimilar(EnergyPlusData &state, int a, int b);
     302              : 
     303              :     void GetStormWindowData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     304              : 
     305              :     void GetWindowGapAirflowControlData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     306              : 
     307              :     void GetOSCData(EnergyPlusData &state, bool &ErrorsFound);
     308              : 
     309              :     void GetOSCMData(EnergyPlusData &state, bool &ErrorsFound);
     310              : 
     311              :     void GetFoundationData(EnergyPlusData &state, bool &ErrorsFound);
     312              : 
     313              :     void GetMovableInsulationData(EnergyPlusData &state, bool &ErrorsFound); // If errors found in input
     314              : 
     315              :     void CalculateZoneVolume(EnergyPlusData &state);
     316              : 
     317              :     struct EdgeOfSurf
     318              :     {
     319              :         int surfNum = 0;
     320              :         Vector start;
     321              :         Vector end;
     322              :         std::vector<int> otherSurfNums;
     323              :         int count = 0;
     324         1759 :         EdgeOfSurf() : start(Vector(0., 0., 0.)), end(Vector(0., 0., 0.))
     325              :         {
     326         1759 :         }
     327              : 
     328              :         bool operator==(const EdgeOfSurf &other) const;
     329              :         bool operator!=(const EdgeOfSurf &other) const;
     330              :         bool containsPoints(const Vector &vertex) const;
     331              :         double length() const;
     332              :     };
     333              : 
     334              :     bool isEnclosedVolume(DataVectorTypes::Polyhedron const &zonePoly, std::vector<EdgeOfSurf> &edgeNot2);
     335              : 
     336              :     std::vector<EdgeOfSurf> edgesInBoth(std::vector<EdgeOfSurf> const &edges1, std::vector<EdgeOfSurf> const &edges2);
     337              : 
     338              :     bool edgesEqualOnSameSurface(EdgeOfSurf a, EdgeOfSurf b);
     339              : 
     340              :     std::vector<EdgeOfSurf> edgesNotTwoForEnclosedVolumeTest(DataVectorTypes::Polyhedron const &zonePoly, std::vector<Vector> const &uniqueVertices);
     341              : 
     342              :     std::vector<Vector> makeListOfUniqueVertices(DataVectorTypes::Polyhedron const &zonePoly);
     343              : 
     344              :     DataVectorTypes::Polyhedron updateZonePolygonsForMissingColinearPoints(DataVectorTypes::Polyhedron const &zonePoly,
     345              :                                                                            std::vector<Vector> const &uniqVertices);
     346              : 
     347              :     bool areFloorAndCeilingSame(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     348              : 
     349              :     bool areWallHeightSame(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     350              : 
     351              :     std::tuple<bool, bool, bool> areSurfaceHorizAndVert(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly);
     352              : 
     353              :     bool areOppositeWallsSame(EnergyPlusData &state,
     354              :                               DataVectorTypes::Polyhedron const &zonePoly,
     355              :                               Real64 &oppositeWallArea,
     356              :                               Real64 &distanceBetweenOppositeWalls);
     357              : 
     358              :     std::vector<int> listOfFacesFacingAzimuth(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly, Real64 azimuth);
     359              : 
     360              :     int findPossibleOppositeFace(EnergyPlusData &state, DataVectorTypes::Polyhedron const &zonePoly, int faceIndex);
     361              : 
     362              :     bool areCornersEquidistant(DataVectorTypes::Polyhedron const &zonePoly, int faceIndex, int opFaceIndex, Real64 &distanceBetween);
     363              : 
     364              :     bool isAlmostEqual3dPt(DataVectorTypes::Vector v1, DataVectorTypes::Vector v2);
     365              : 
     366              :     bool isAlmostEqual2dPt(DataVectorTypes::Vector_2d v1, DataVectorTypes::Vector_2d v2);
     367              : 
     368              :     int findIndexOfVertex(DataVectorTypes::Vector vertexToFind, std::vector<DataVectorTypes::Vector> const &listOfVertices);
     369              : 
     370              :     Real64 distance(DataVectorTypes::Vector v1, DataVectorTypes::Vector v2);
     371              : 
     372              :     Real64 distanceFromPointToLine(DataVectorTypes::Vector start, DataVectorTypes::Vector end, DataVectorTypes::Vector test);
     373              : 
     374              :     bool isPointOnLineBetweenPoints(DataVectorTypes::Vector start, DataVectorTypes::Vector end, DataVectorTypes::Vector test);
     375              : 
     376              :     void ProcessSurfaceVertices(EnergyPlusData &state, int const ThisSurf, bool &ErrorsFound);
     377              : 
     378              :     void CalcCoordinateTransformation(EnergyPlusData &state,
     379              :                                       int const SurfNum,            // Surface Number
     380              :                                       Vector &CompCoordTranslVector // Coordinate Translation Vector
     381              :     );
     382              : 
     383              :     void CreateShadedWindowConstruction(EnergyPlusData &state,
     384              :                                         int const SurfNum,          // Surface number
     385              :                                         int const WSCPtr,           // Pointer to WindowShadingControl for SurfNum
     386              :                                         int const ShDevNum,         // Shading device material number for WSCptr
     387              :                                         int const shadeControlIndex // index to the Surface().windowShadingControlList,
     388              :                                                                     // Surface().shadedConstructionList, and Surface().shadedStormWinConstructionList
     389              :     );
     390              : 
     391              :     void CreateStormWindowConstructions(EnergyPlusData &state);
     392              : 
     393              :     int createAirMaterialFromDistance(EnergyPlusData &state, Real64 distance, std::string_view namePrefix); // return new material number
     394              : 
     395              :     // create a new construction with storm based on an old construction and storm and gap materials
     396              :     int createConstructionWithStorm(EnergyPlusData &state, int oldConstruction, std::string name, int stormMaterial, int gapMaterial);
     397              : 
     398              :     void ModifyWindow(EnergyPlusData &state,
     399              :                       int const SurfNum,    // SurfNum has construction of glazing system from Window5 Data File;
     400              :                       bool &ErrorsFound,    // Set to true if errors found
     401              :                       int &AddedSubSurfaces // Subsurfaces added when window references a
     402              :     );
     403              : 
     404              :     void AddWindow(EnergyPlusData &state,
     405              :                    int const SurfNum,    // SurfNum has construction of glazing system from Window5 Data File;
     406              :                    bool &ErrorsFound,    // Set to true if errors found
     407              :                    int &AddedSubSurfaces // Subsurfaces added when window references a
     408              :     );
     409              : 
     410              :     void TransformVertsByAspect(EnergyPlusData &state,
     411              :                                 int const SurfNum, // Current surface number
     412              :                                 int const NSides   // Number of sides to figure
     413              :     );
     414              : 
     415              :     void CalcSurfaceCentroid(EnergyPlusData &state);
     416              : 
     417              :     void SetupShadeSurfacesForSolarCalcs(EnergyPlusData &state);
     418              : 
     419              :     void
     420              :     SetupEnclosuresAndAirBoundaries(EnergyPlusData &state,
     421              :                                     EPVector<DataViewFactorInformation::EnclosureViewFactorInformation> &Enclosures, // Radiant or Solar Enclosures
     422              :                                     SurfaceGeometry::enclosureType EnclosureType,                                    // Radiant or Solar
     423              :                                     bool &ErrorsFound);                                                              // Set to true if errors found
     424              : 
     425              :     void CheckConvexity(EnergyPlusData &state,
     426              :                         int const SurfNum, // Current surface number
     427              :                         int const NSides   // Number of sides to figure
     428              :     );
     429              : 
     430              :     bool isRectangle(EnergyPlusData &state, int const ThisSurf // Current surface number
     431              :     );
     432              : 
     433              :     void CheckForReversedLayers(EnergyPlusData &state,
     434              :                                 bool &RevLayerDiffs,    // true when differences are discovered in interzone constructions
     435              :                                 int const ConstrNum,    // construction index
     436              :                                 int const ConstrNumRev, // construction index for reversed construction
     437              :                                 int const TotalLayers   // total layers for construction definition
     438              :     );
     439              : 
     440              : } // namespace SurfaceGeometry
     441              : 
     442              : struct SurfaceGeometryData : BaseGlobalStruct
     443              : {
     444              : 
     445              :     Real64 CosBldgRelNorth = 0.0;    // Cosine of the building rotation (relative north) (includes appendix G rotation)
     446              :     Real64 SinBldgRelNorth = 0.0;    // Sine of the building rotation (relative north)   (includes appendix G rotation)
     447              :     Real64 CosBldgRotAppGonly = 0.0; // Cosine of the building rotation for appendix G only(relative north)
     448              :     Real64 SinBldgRotAppGonly = 0.0; // Sine of the building rotation for appendix G only (relative north)
     449              :     Array1D<Real64> CosZoneRelNorth; // Cosine of the zone rotation (relative north)
     450              :     Array1D<Real64> SinZoneRelNorth; // Sine of the zone rotation (relative north)
     451              : 
     452              :     bool NoGroundTempObjWarning = true;   // This will cause a warning to be issued if surfaces with "Ground"
     453              :                                           // outside environment are used but no ground temperature object was input.
     454              :     bool NoFCGroundTempObjWarning = true; // This will cause a warning to be issued if surfaces with "GroundFCfactorMethod"
     455              :                                           // outside environment are used but no FC ground temperatures was input.
     456              :     bool RectSurfRefWorldCoordSystem =
     457              :         false;             // GlobalGeometryRules:Field Rectangular Surface Coordinate System (A5) = World (true) or Relative (false)
     458              :     int Warning1Count = 0; // counts of Modify Window 5/6 windows
     459              :     int Warning2Count = 0; // counts of overriding exterior windows with Window 5/6 glazing systems
     460              :     int Warning3Count = 0; // counts of overriding interior windows with Window 5/6 glazing systems
     461              : 
     462              :     bool ProcessSurfaceVerticesOneTimeFlag = true;
     463              :     int checkSubSurfAzTiltNormErrCount = 0;
     464              :     Array1D<Real64> Xpsv;
     465              :     Array1D<Real64> Ypsv;
     466              :     Array1D<Real64> Zpsv;
     467              : 
     468              :     bool GetSurfaceDataOneTimeFlag = false;
     469              :     std::unordered_map<std::string, std::string> UniqueSurfaceNames;
     470              :     bool firstTime = true;
     471              :     bool noTransform = true;
     472              :     bool CheckConvexityFirstTime = true;
     473              : 
     474              :     Array1D_string const BaseSurfCls;
     475              :     Array1D_string const SubSurfCls;
     476              :     Array1D<DataSurfaces::SurfaceClass> const BaseSurfIDs;
     477              :     Array1D<DataSurfaces::SurfaceClass> const SubSurfIDs;
     478              :     Array1D<SurfaceGeometry::SurfaceData> SurfaceTmp; // Allocated/Deallocated during input processing
     479              :     HeatBalanceKivaManager::KivaManager kivaManager;
     480              :     SurfaceGeometry::ExposedFoundationPerimeter exposedFoundationPerimeter;
     481              : 
     482              :     int ErrCount = 0;
     483              :     bool WarningDisplayed = false;
     484              :     int ErrCount2 = 0;
     485              :     int ErrCount3 = 0;
     486              :     int ErrCount4 = 0; // counts of interzone area mismatches.
     487              :     bool ShowZoneSurfaceHeaders = true;
     488              :     int ErrCount5 = 0;
     489              :     Real64 OldAspectRatio = 0.0;
     490              :     Real64 NewAspectRatio = 0.0;
     491              :     std::string transformPlane;
     492              :     Array1D<Vectors::Vector> Triangle1 = Array1D<Vectors::Vector>(3); // working struct for a 3-sided surface
     493              :     Array1D<Vectors::Vector> Triangle2 = Array1D<Vectors::Vector>(3); // working struct for a 3-sided surface
     494              :     Array1D<Real64> X;                                                // containers for x,y,z vertices of the surface
     495              :     Array1D<Real64> Y;
     496              :     Array1D<Real64> Z;
     497              :     Array1D<Real64> A; // containers for convexity test
     498              :     Array1D<Real64> B;
     499              :     int VertSize = 0; // size of X,Y,Z,A,B arrays
     500              : 
     501         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     502              :     {
     503         2126 :     }
     504              : 
     505         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     506              :     {
     507         1152 :     }
     508              : 
     509         2100 :     void clear_state() override
     510              :     {
     511         2100 :         ProcessSurfaceVerticesOneTimeFlag = true;
     512         2100 :         checkSubSurfAzTiltNormErrCount = 0;
     513         2100 :         Xpsv.deallocate();
     514         2100 :         Ypsv.deallocate();
     515         2100 :         Zpsv.deallocate();
     516              :         // Following are used only during getting vertices, so are module variables here.
     517         2100 :         CosBldgRelNorth = 0.0;
     518         2100 :         SinBldgRelNorth = 0.0;
     519         2100 :         CosBldgRotAppGonly = 0.0;
     520         2100 :         SinBldgRotAppGonly = 0.0;
     521         2100 :         CosZoneRelNorth.deallocate();
     522         2100 :         SinZoneRelNorth.deallocate();
     523         2100 :         NoGroundTempObjWarning = true;
     524         2100 :         NoFCGroundTempObjWarning = true;
     525         2100 :         RectSurfRefWorldCoordSystem = false;
     526         2100 :         Warning1Count = 0;
     527         2100 :         Warning2Count = 0;
     528         2100 :         Warning3Count = 0;
     529         2100 :         SurfaceTmp.deallocate();
     530         2100 :         GetSurfaceDataOneTimeFlag = false;
     531         2100 :         UniqueSurfaceNames.clear();
     532         2100 :         kivaManager = HeatBalanceKivaManager::KivaManager();
     533         2100 :         firstTime = true;
     534         2100 :         noTransform = true;
     535         2100 :         CheckConvexityFirstTime = true;
     536         2100 :         ErrCount = 0;
     537         2100 :         WarningDisplayed = false;
     538         2100 :         ErrCount2 = 0;
     539         2100 :         ErrCount3 = 0;
     540         2100 :         ErrCount4 = 0;
     541         2100 :         ErrCount5 = 0;
     542         2100 :         ShowZoneSurfaceHeaders = true;
     543         2100 :     }
     544              : 
     545              :     // Default Constructor
     546         2129 :     SurfaceGeometryData()
     547         2129 :         : BaseSurfCls(3, {"WALL", "FLOOR", "ROOF"}),
     548         2129 :           SubSurfCls(6, {"WINDOW", "DOOR", "GLASSDOOR", "SHADING", "TUBULARDAYLIGHTDOME", "TUBULARDAYLIGHTDIFFUSER"}),
     549         2129 :           BaseSurfIDs(3, {DataSurfaces::SurfaceClass::Wall, DataSurfaces::SurfaceClass::Floor, DataSurfaces::SurfaceClass::Roof}),
     550         2129 :           SubSurfIDs(6,
     551              :                      {DataSurfaces::SurfaceClass::Window,
     552              :                       DataSurfaces::SurfaceClass::Door,
     553              :                       DataSurfaces::SurfaceClass::GlassDoor,
     554              :                       DataSurfaces::SurfaceClass::Shading,
     555              :                       DataSurfaces::SurfaceClass::TDD_Dome,
     556         4258 :                       DataSurfaces::SurfaceClass::TDD_Diffuser})
     557              :     {
     558         2129 :     }
     559              : };
     560              : } // namespace EnergyPlus
     561              : 
     562              : #endif
        

Generated by: LCOV version 2.0-1