LCOV - code coverage report
Current view: top level - EnergyPlus - DataGlobalConstants.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 1 3 33.3 %
Date: 2023-01-17 19:17:23 Functions: 2 3 66.7 %

          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 DataGlobalConstants_hh_INCLUDED
      49             : #define DataGlobalConstants_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <map>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/EnergyPlus.hh>
      57             : 
      58             : namespace EnergyPlus {
      59             : 
      60             : namespace DataGlobalConstants {
      61             : 
      62             :     enum class EndUse
      63             :     {
      64             :         Invalid = -1,
      65             :         Heating,
      66             :         Cooling,
      67             :         InteriorLights,
      68             :         ExteriorLights,
      69             :         InteriorEquipment,
      70             :         ExteriorEquipment,
      71             :         Fans,
      72             :         Pumps,
      73             :         HeatRejection,
      74             :         Humidification,
      75             :         HeatRecovery,
      76             :         WaterSystem,
      77             :         Refrigeration,
      78             :         Cogeneration,
      79             :         Num
      80             :     };
      81             : 
      82             :     enum class ResourceType
      83             :     {
      84             :         Invalid = -1,
      85             :         None,
      86             :         Electricity,
      87             :         Natural_Gas,
      88             :         Gasoline,
      89             :         Diesel,
      90             :         Coal,
      91             :         FuelOil_1,
      92             :         FuelOil_2,
      93             :         Propane,
      94             :         Water,
      95             :         EnergyTransfer,
      96             :         Steam,
      97             :         DistrictCooling,
      98             :         DistrictHeating,
      99             :         ElectricityProduced,
     100             :         ElectricityPurchased,
     101             :         ElectricitySurplusSold,
     102             :         ElectricityNet,
     103             :         SolarWater,
     104             :         SolarAir,
     105             :         SO2,
     106             :         NOx,
     107             :         N2O,
     108             :         PM,
     109             :         PM2_5,
     110             :         PM10,
     111             :         CO,
     112             :         CO2,
     113             :         CH4,
     114             :         NH3,
     115             :         NMVOC,
     116             :         Hg,
     117             :         Pb,
     118             :         NuclearHigh,
     119             :         NuclearLow,
     120             :         WaterEnvironmentalFactors,
     121             :         CarbonEquivalent,
     122             :         Source,
     123             :         PlantLoopHeatingDemand,
     124             :         PlantLoopCoolingDemand,
     125             :         OnSiteWater,
     126             :         MainsWater,
     127             :         RainWater,
     128             :         WellWater,
     129             :         Condensate,
     130             :         OtherFuel1,
     131             :         OtherFuel2,
     132             :         Num
     133             :     };
     134             : 
     135             :     enum class CallIndicator
     136             :     {
     137             :         Invalid = -1,
     138             :         BeginDay,
     139             :         DuringDay,
     140             :         EndDay,
     141             :         EndZoneSizingCalc,
     142             :         EndSysSizingCalc,
     143             :         Num
     144             :     };
     145             : 
     146             :     // Parameters for KindOfSim
     147             :     enum class KindOfSim
     148             :     {
     149             :         // TODO: enum check
     150             :         Invalid = -1,
     151             :         DesignDay = 1,
     152             :         RunPeriodDesign = 2,
     153             :         RunPeriodWeather = 3,
     154             :         HVACSizeDesignDay = 4,       // a regular design day run during HVAC Sizing Simulation
     155             :         HVACSizeRunPeriodDesign = 5, // a weather period design day run during HVAC Sizing Simulation
     156             :         ReadAllWeatherData = 6,      // a weather period for reading all weather data prior to the simulation
     157             :         Num
     158             :     };
     159             : 
     160             :     Real64 constexpr MaxEXPArg = 709.78;       // maximum exponent in EXP() function
     161             :     Real64 constexpr Pi = 3.14159265358979324; // Pi 3.1415926535897932384626435
     162             :     Real64 constexpr PiOvr2 = Pi / 2.0;        // Pi/2
     163             :     Real64 constexpr TwoPi = 2.0 * Pi;         // 2*Pi 6.2831853071795864769252868
     164             :     Real64 constexpr GravityConstant = 9.807;
     165             :     Real64 constexpr DegToRadians = Pi / 180.0;                           // Conversion for Degrees to Radians
     166             :     Real64 constexpr RadToDeg = 180.0 / Pi;                               // Conversion for Radians to Degrees
     167             :     Real64 constexpr SecInHour = 3600.0;                                  // Conversion for hours to seconds
     168             :     Real64 constexpr HoursInDay = 24.0;                                   // Number of Hours in Day
     169             :     Real64 constexpr SecsInDay = SecInHour * HoursInDay;                  // Number of seconds in Day
     170             :     Real64 constexpr BigNumber = std::numeric_limits<Real64>::max();      // Max Number real used for initializations
     171             :     Real64 constexpr rTinyValue = std::numeric_limits<Real64>::epsilon(); // Tiny value to replace use of TINY(x)
     172             :     std::string::size_type constexpr MaxNameLength =
     173             :         100;                              // Maximum Name Length in Characters -- should be the same as MaxAlphaArgLength in InputProcessor module
     174             :     Real64 constexpr KelvinConv = 273.15; // Conversion factor for C to K and K to C
     175             :     Real64 constexpr TriplePointOfWaterTempKelvin = 273.16; // The triple point of water, in Kelvin
     176             :     Real64 constexpr InitConvTemp = 5.05;                   // [deg C], standard init vol to mass flow conversion temp
     177             :     Real64 constexpr AutoCalculate = -99999.0;              // automatically calculate some fields.
     178             :     Real64 constexpr CWInitConvTemp = 5.05;                 // [deg C], standard init chilled water vol to mass flow conversion temp
     179             :     Real64 constexpr HWInitConvTemp = 60.0;                 // [deg C], standard init hot water vol to mass flow conversion temp
     180             :     Real64 constexpr SteamInitConvTemp = 100.0;             // [deg C], standard init steam vol to mass flow conversion temp
     181             :     Real64 constexpr StefanBoltzmann = 5.6697E-8;           // Stefan-Boltzmann constant in W/(m2*K4)
     182             :     Real64 constexpr UniversalGasConst = 8314.462175;       // Universal Gas Constant (J/mol*K)
     183             :     Real64 constexpr convertJtoGJ = 1.0E-9;                 // Conversion factor for J to GJ
     184             :     int constexpr MaxSpeedLevels = 10;                      // Maximum number of speed that supports
     185             :     int constexpr ScheduleAlwaysOn = -1;                    // Value when passed to schedule routines gives back 1.0 (on)
     186             :     int constexpr MaxCTFTerms = 19; // Maximum number of CTF terms allowed to still allow stability //Note Duplicate of DataHeatBalance::MaxCTFTerms
     187             : 
     188             :     ResourceType AssignResourceTypeNum(std::string const &ResourceTypeChar);
     189             :     std::string GetResourceTypeChar(ResourceType ResourceTypeNum);
     190             : 
     191             : } // namespace DataGlobalConstants
     192             : 
     193        1542 : struct DataGlobalConstantsData : BaseGlobalStruct
     194             : {
     195             :     std::map<DataGlobalConstants::EndUse, int> iEndUse = {
     196             :         {DataGlobalConstants::EndUse::Heating, 1},
     197             :         {DataGlobalConstants::EndUse::Cooling, 2},
     198             :         {DataGlobalConstants::EndUse::InteriorLights, 3},
     199             :         {DataGlobalConstants::EndUse::ExteriorLights, 4},
     200             :         {DataGlobalConstants::EndUse::InteriorEquipment, 5},
     201             :         {DataGlobalConstants::EndUse::ExteriorEquipment, 6},
     202             :         {DataGlobalConstants::EndUse::Fans, 7},
     203             :         {DataGlobalConstants::EndUse::Pumps, 8},
     204             :         {DataGlobalConstants::EndUse::HeatRejection, 9},
     205             :         {DataGlobalConstants::EndUse::Humidification, 10},
     206             :         {DataGlobalConstants::EndUse::HeatRecovery, 11},
     207             :         {DataGlobalConstants::EndUse::WaterSystem, 12},
     208             :         {DataGlobalConstants::EndUse::Refrigeration, 13},
     209             :         {DataGlobalConstants::EndUse::Cogeneration, 14},
     210             :     };
     211             :     static int constexpr iEndUseSize = 14;
     212             : 
     213             :     std::vector<DataGlobalConstants::ResourceType> AllResourceTypes = {DataGlobalConstants::ResourceType::None,
     214             :                                                                        DataGlobalConstants::ResourceType::Electricity,
     215             :                                                                        DataGlobalConstants::ResourceType::Natural_Gas,
     216             :                                                                        DataGlobalConstants::ResourceType::Gasoline,
     217             :                                                                        DataGlobalConstants::ResourceType::Diesel,
     218             :                                                                        DataGlobalConstants::ResourceType::Coal,
     219             :                                                                        DataGlobalConstants::ResourceType::FuelOil_1,
     220             :                                                                        DataGlobalConstants::ResourceType::FuelOil_2,
     221             :                                                                        DataGlobalConstants::ResourceType::Propane,
     222             :                                                                        DataGlobalConstants::ResourceType::Water,
     223             :                                                                        DataGlobalConstants::ResourceType::EnergyTransfer,
     224             :                                                                        DataGlobalConstants::ResourceType::Steam,
     225             :                                                                        DataGlobalConstants::ResourceType::DistrictCooling,
     226             :                                                                        DataGlobalConstants::ResourceType::DistrictHeating,
     227             :                                                                        DataGlobalConstants::ResourceType::ElectricityProduced,
     228             :                                                                        DataGlobalConstants::ResourceType::ElectricityPurchased,
     229             :                                                                        DataGlobalConstants::ResourceType::ElectricitySurplusSold,
     230             :                                                                        DataGlobalConstants::ResourceType::ElectricityNet,
     231             :                                                                        DataGlobalConstants::ResourceType::SolarWater,
     232             :                                                                        DataGlobalConstants::ResourceType::SolarAir,
     233             :                                                                        DataGlobalConstants::ResourceType::SO2,
     234             :                                                                        DataGlobalConstants::ResourceType::NOx,
     235             :                                                                        DataGlobalConstants::ResourceType::N2O,
     236             :                                                                        DataGlobalConstants::ResourceType::PM,
     237             :                                                                        DataGlobalConstants::ResourceType::PM2_5,
     238             :                                                                        DataGlobalConstants::ResourceType::PM10,
     239             :                                                                        DataGlobalConstants::ResourceType::CO,
     240             :                                                                        DataGlobalConstants::ResourceType::CO2,
     241             :                                                                        DataGlobalConstants::ResourceType::CH4,
     242             :                                                                        DataGlobalConstants::ResourceType::NH3,
     243             :                                                                        DataGlobalConstants::ResourceType::NMVOC,
     244             :                                                                        DataGlobalConstants::ResourceType::Hg,
     245             :                                                                        DataGlobalConstants::ResourceType::Pb,
     246             :                                                                        DataGlobalConstants::ResourceType::NuclearHigh,
     247             :                                                                        DataGlobalConstants::ResourceType::NuclearLow,
     248             :                                                                        DataGlobalConstants::ResourceType::WaterEnvironmentalFactors,
     249             :                                                                        DataGlobalConstants::ResourceType::CarbonEquivalent,
     250             :                                                                        DataGlobalConstants::ResourceType::Source,
     251             :                                                                        DataGlobalConstants::ResourceType::PlantLoopHeatingDemand,
     252             :                                                                        DataGlobalConstants::ResourceType::PlantLoopCoolingDemand,
     253             :                                                                        DataGlobalConstants::ResourceType::OnSiteWater,
     254             :                                                                        DataGlobalConstants::ResourceType::MainsWater,
     255             :                                                                        DataGlobalConstants::ResourceType::RainWater,
     256             :                                                                        DataGlobalConstants::ResourceType::WellWater,
     257             :                                                                        DataGlobalConstants::ResourceType::Condensate,
     258             :                                                                        DataGlobalConstants::ResourceType::OtherFuel1,
     259             :                                                                        DataGlobalConstants::ResourceType::OtherFuel2};
     260             : 
     261           0 :     void clear_state() override
     262             :     {
     263             :         // nothing to clear
     264           0 :     }
     265             : };
     266             : 
     267             : } // namespace EnergyPlus
     268             : 
     269             : #endif

Generated by: LCOV version 1.13