LCOV - code coverage report
Current view: top level - EnergyPlus - DataErrorTracking.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 6 9 66.7 %
Date: 2023-01-17 19:17:23 Functions: 6 10 60.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 DataErrorTracking_hh_INCLUDED
      49             : #define DataErrorTracking_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/EnergyPlus.hh>
      57             : 
      58             : namespace EnergyPlus {
      59             : 
      60             : namespace DataErrorTracking {
      61             : 
      62             :     int constexpr SearchCounts(20);
      63             : 
      64             :     std::array<const char *, 21> constexpr MessageSearch({"",
      65             :                                                           "InterZone Surface Areas",
      66             :                                                           "CAUTION -- Interzone",
      67             :                                                           "Node Connection Error",
      68             :                                                           "InterZone Surface Azimu",
      69             :                                                           "InterZone Surface Tilts",
      70             :                                                           "Suspected non-planar",
      71             :                                                           "Deprecated",
      72             :                                                           "Floor Tilt=",
      73             :                                                           "Roof/Ceiling Tilt=",
      74             :                                                           "View factors not",
      75             :                                                           "Unbalanced exhaust air",
      76             :                                                           "Loads Initialization",
      77             :                                                           "CalcDaylightMapPoints:",
      78             :                                                           "Zone Air Heat Balance",
      79             :                                                           "occupant density is ext",
      80             :                                                           "Temperature (low) out o",
      81             :                                                           "Temperature (high) out",
      82             :                                                           "nominally unused",
      83             :                                                           "InfraredTransparent",
      84             :                                                           "No reporting elements"});
      85             :     std::array<const char *, 21> constexpr Summaries({"",
      86             :                                                       "InterZone Surface Areas -- mismatch",
      87             :                                                       "Interzone surfaces - different zones",
      88             :                                                       "Node Connection Errors",
      89             :                                                       "InterZone Surface Azimuths -- mismatch",
      90             :                                                       "InterZone Surface Tilts -- mismatch",
      91             :                                                       "Likely non-planar surfaces",
      92             :                                                       "Deprecated Features or Key Values",
      93             :                                                       "Incorrect Floor Tilt",
      94             :                                                       "Incorrect Roof/Ceiling Tilt",
      95             :                                                       "Incomplete View factors",
      96             :                                                       "Unbalanced exhaust air flow",
      97             :                                                       "Loads Initialization did not Converge",
      98             :                                                       "CalcDaylightMapPoints: Window",
      99             :                                                       "Zone Air Heat Balance Warnings",
     100             :                                                       "Occupant density is extremely high",
     101             :                                                       "Temperature (low) out of bounds",
     102             :                                                       "Temperature (high) out of bounds",
     103             :                                                       "Nominally Unused Constructions",
     104             :                                                       "Material:InfraredTransparent usage",
     105             :                                                       "No Reporting Elements requested"});
     106             : 
     107             :     // in below -- simple line end <CR>.  End of Whole message <CRE>
     108             :     auto constexpr MoreDetails_0("");
     109             :     auto constexpr MoreDetails_1(
     110             :         "Area mismatch errors happen when the interzone surface in zone A is<CR>not the same size as it's companion in zone B.<CRE>"); // InterZone
     111             :     // Surface
     112             :     // Areas --
     113             :     // mismatch
     114             :     auto constexpr MoreDetails_2(""); // Interzone surfaces - different zones
     115             :     auto constexpr MoreDetails_3(
     116             :         "Node connection errors are often caused by spelling mistakes in a node name field.<CR>To track down the problem, search the "
     117             :         "idf file for each node name listed to see if it<CR>occurs in the expected input fields.<CRE>"); // Node Connection Errors
     118             :     auto constexpr MoreDetails_4("The azimuths (outward facing angle) of two interzone surfaces should not be the same.<CR>Normally, the absolute "
     119             :                                  "difference between the two azimuths will be 180 degrees.<CR>You can turn on the report: "
     120             :                                  "Output:Surfaces:List,Details; to inspect your surfaces.<CRE>"); // InterZone Surface Azimuths -- mismatch
     121             :     auto constexpr MoreDetails_5("");                                                             // InterZone Surface Tilts -- mismatch
     122             :     auto constexpr MoreDetails_6("EnergyPlus Surfaces should be planar. If the error indicates a small increment for the<CR>out of planar bounds, "
     123             :                                  "then the calculations are likely okay though you should try to fix<CR>the problem. If a greater increment, the "
     124             :                                  "calculations will likely be incorrect.<CRE>"); // Likely non-planar surfaces
     125             :     auto constexpr MoreDetails_7(
     126             :         "A deprecated feature warning/severe error indicates that you are using a feature which will be<CR>removed in a future "
     127             :         "release. The new feature is likely included in the EnergyPlus version you are<CR>using.  Consider switching now to avoid "
     128             :         "future problems.<CR>A deprecated key value message indicates you are using an out-dated key value in your input "
     129             :         "file.<CR>While EnergyPlus may continue to accept these values, some other input file readers may not.<CR>Consider changing to "
     130             :         "values that are included as valid in the Energy+.idd for these objects.<CRE>"); // Deprecated Features or Key Values
     131             :     auto constexpr MoreDetails_8("Floors are usually flat and \"tilted\" 180 degrees.  If you get this error message,<CR>it's likely that you "
     132             :                                  "need to reverse the vertices of the surface to remove the error.<CR>EnergyPlus will attempt to fix the vertices "
     133             :                                  "for the running simulation.<CR>You can turn on the report: Output:Surfaces:List,Details; to inspect your "
     134             :                                  "surfaces.<CRE>"); // Incorrect Floor Tilt
     135             :     auto constexpr MoreDetails_9("Flat roofs/ceilings are \"tilted\" 0 degrees. Pitched roofs should be \"near\" 0 degrees.<CR>If you get this "
     136             :                                  "error message, it's likely that you need to reverse the vertices of<CR>the surface to remove the error. "
     137             :                                  "EnergyPlus will attempt to fix the vertices for the<CR>running simulation. You can turn on the report: "
     138             :                                  "Output:Surfaces:List,Details;<CR>to inspect your surfaces.<CRE>"); // Incorrect Roof/Ceiling Tilt
     139             :     auto constexpr MoreDetails_10(
     140             :         "Incomplete view factors can result from incorrect floor specifications (such as tilting 0<CR>instead of 180) or not enough "
     141             :         "surfaces in a zone to make an enclosure.  The error message<CR>also shows an enforced reciprocity value.  You can decide if "
     142             :         "you need to make geometry<CR>changes based on that value.<CRE>"); // Incomplete View factors
     143             :     auto constexpr MoreDetails_11("Unbalanced exhaust air flow errors can occur when exhaust fans are running but there is no<CR>supply air. Turn "
     144             :                                   "off exhaust fans when the system is not running may help resolve the problem.<CR>Time shown is first "
     145             :                                   "occurrence of error.<CRE>"); // Unbalanced exhaust air flow
     146             :     auto constexpr MoreDetails_12(
     147             :         "1) very high thermal mass such as very thick concrete (solution: increase max number of warmup<CR>   days in the BUILDING "
     148             :         "object);<CR>2) moderate mass and inadequate space conditioning such that the building keeps getting warmer<CR>   and warmer "
     149             :         "on successive days (solution: add HVAC, check building thermal properties,<CR>   check if infiltration is included, make "
     150             :         "sure HVAC properly controlled);<CR>3) a soil layer modeled below the concrete slab - (solution remove this layer and read "
     151             :         "about<CR>   ground temperatures in the Auxiliary Programs document).<CR>4) unreasonable (too small) limits in the BUILDING "
     152             :         "object for temperature (.4 default) or<CR>   loads tolerances (.04 default)<CRE>"); // Loads Initialization did not Converge
     153             :     auto constexpr MoreDetails_13(
     154             :         "Window is too close to map points for accurate calculation.  Suggested change is to create<CR>Output:IlluminanceMap "
     155             :         "coordinates (x,y,z) that are more \"inside\" the zone<CRE>"); // CalcDaylightMapPoints: Window
     156             :     auto constexpr MoreDetails_14("Zone Air Heat Balance out of Balance warnings are currently used by developers.<CR>Users can safely ignore "
     157             :                                   "these warnings.<CRE>"); // Zone Air Heat Balance Warnings
     158             :     auto constexpr MoreDetails_15("The occupant density warning is provided to alert you to potential conditions that can cause<CR>problems with "
     159             :                                   "the heat balance calculations. Too high a density could be cause for severe<CR>temperature out of bounds "
     160             :                                   "errors in a zone leading to program termination.<CRE>"); // Occupant density is extremely high
     161             :     auto constexpr MoreDetails_16(
     162             :         "A temperature out of bounds problem can be caused by several things. The user should check:<CR>1) the weather environment "
     163             :         "(including the horizontal IR from sky)<CR>2) the level of internal gains with respect to the zone<CR>3) the thermal "
     164             :         "properties of their materials.  And other things.<CR>A common cause is a building with no or little thermal mass - all "
     165             :         "materials with Material:NoMass definitions.<CRE>"); // Temperature (low) out of bounds AND Temperature (high) out of bounds
     166             :     auto constexpr MoreDetails_18(
     167             :         "The nominally unused constructions warning is provided to alert you to potential conditions that can cause<CR>extra time "
     168             :         "during simulation. Each construction is calculated by the algorithm indicated in the HeatBalanceAlgorithm<CR>object. You may "
     169             :         "remove the constructions indicated (when you use the DisplayExtraWarnings option).<CRE>"); // Nominally unused constructions
     170             :     auto constexpr MoreDetails_19(
     171             :         "Using Material:InfraredTransparent materials in constructions are correctly used in interzone surface<CR>constructions. "
     172             :         "Warnings are given if they are used in other kinds of surfaces.<CR>They CANNOT currently be used with "
     173             :         "ConductionFiniteDifference algorithms.<CRE>"); // InfraredTransparent constructions in non-interzone surfaces
     174             :     auto constexpr MoreDetails_20(
     175             :         "No Reporting elements have been requested. You will see no output values from your run.<CR>Add Output:Variable, "
     176             :         "Output:Meter, Output:Table:SummaryReports, Output:Table:Monthly, Output:Table:TimeBins<CR>objects to your input file to "
     177             :         "receive output values from the simulation.<CRE>"); // No reporting elements requested
     178             : 
     179             :     std::array<const char *, 21> constexpr MoreDetails({MoreDetails_0,  MoreDetails_1,  MoreDetails_2,  MoreDetails_3,  MoreDetails_4,
     180             :                                                         MoreDetails_5,  MoreDetails_6,  MoreDetails_7,  MoreDetails_8,  MoreDetails_9,
     181             :                                                         MoreDetails_10, MoreDetails_11, MoreDetails_12, MoreDetails_13, MoreDetails_14,
     182             :                                                         MoreDetails_15, MoreDetails_16, MoreDetails_16, MoreDetails_18, MoreDetails_19,
     183             :                                                         MoreDetails_20}); // Details 16 applies to both temperature out of bounds |
     184             : 
     185        2864 :     struct RecurringErrorData
     186             :     {
     187             :         // Members
     188             :         std::string Message;    // Message to be written to "error file" at end of simulation
     189             :         int Count = 0;          // Count of total times this recurring error message has been called
     190             :         int WarmupCount = 0;    // Count of times this recurring error message has been called during warmup
     191             :         int SizingCount = 0;    // Count of times this recurring error message has been called during sizing
     192             :         Real64 MaxValue = 0.0;  // Max of the values passed for this recurring error message
     193             :         Real64 MinValue = 0.0;  // Min of the values passed for this recurring error message
     194             :         Real64 SumValue = 0.0;  // Sum of the values passed for this recurring error message
     195             :         std::string MaxUnits;   // units for Max values
     196             :         std::string MinUnits;   // units for Min values
     197             :         std::string SumUnits;   // units for Sum values
     198             :         bool ReportMax = false; // Flag to report max value
     199             :         bool ReportMin = false; // Flag to report min value
     200             :         bool ReportSum = false; // Flag to report sum value
     201             :     };
     202             : 
     203             : } // namespace DataErrorTracking
     204             : 
     205         771 : struct ErrorTrackingData : BaseGlobalStruct
     206             : {
     207             :     Array1D<DataErrorTracking::RecurringErrorData> RecurringErrors;
     208             :     Array1D_int MatchCounts;
     209             :     bool AbortProcessing = false;            // Flag used to if currently in "abort processing"
     210             :     int NumRecurringErrors = 0;              // Number of stored recurring error messages
     211             :     int TotalSevereErrors = 0;               // Counter
     212             :     int TotalWarningErrors = 0;              // Counter
     213             :     int TotalSevereErrorsDuringWarmup = 0;   // Counter
     214             :     int TotalWarningErrorsDuringWarmup = 0;  // Counter
     215             :     int TotalSevereErrorsDuringSizing = 0;   // Counter
     216             :     int TotalWarningErrorsDuringSizing = 0;  // Counter
     217             :     int TotalMultipliedWindows = 0;          // Counter
     218             :     int TotalCoincidentVertices = 0;         // Counter
     219             :     int TotalDegenerateSurfaces = 0;         // Counter
     220             :     int TotalReceivingNonConvexSurfaces = 0; // Counter
     221             :     int TotalCastingNonConvexSurfaces = 0;   // Counter
     222             :     int TotalRoomAirPatternTooLow = 0;       // Counter
     223             :     int TotalRoomAirPatternTooHigh = 0;      // Counter
     224             :     bool AskForConnectionsReport = false;    // Flag used to tell when connections should be reported
     225             :     bool AskForSurfacesReport = false;       // Flag used to tell when surfaces should be reported
     226             :     bool AskForPlantCheckOnAbort = false;    // flag used to tell if plant structure can be checked
     227             :     bool ExitDuringSimulations = false;      // flag used to tell if program is in simulation mode when fatal occurs
     228             :     std::string LastSevereError;
     229             : 
     230         771 :     ErrorTrackingData()
     231         771 :     {
     232         771 :         MatchCounts = Array1D_int(DataErrorTracking::SearchCounts, 0);
     233         771 :     }
     234             : 
     235           0 :     void clear_state() override
     236             :     {
     237           0 :         *this = ErrorTrackingData();
     238           0 :     }
     239             : };
     240             : 
     241             : } // namespace EnergyPlus
     242             : 
     243             : #endif

Generated by: LCOV version 1.13