LCOV - code coverage report
Current view: top level - EnergyPlus - HighTempRadiantSystem.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 10 27 37.0 %
Date: 2023-01-17 19:17:23 Functions: 8 11 72.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 HighTempRadiantSystem_hh_INCLUDED
      49             : #define HighTempRadiantSystem_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/DataGlobals.hh>
      57             : #include <EnergyPlus/EnergyPlus.hh>
      58             : 
      59             : namespace EnergyPlus {
      60             : 
      61             : // Forward declarations
      62             : struct EnergyPlusData;
      63             : 
      64             : namespace HighTempRadiantSystem {
      65             : 
      66             :     // Using/Aliasing
      67             : 
      68             :     // Data
      69             :     // MODULE PARAMETER DEFINITIONS:
      70             : 
      71             :     enum class RadHeaterType
      72             :     {
      73             :         Invalid = -1,
      74             :         Gas,
      75             :         Electric,
      76             :         Num
      77             :     };
      78             : 
      79             :     enum class RadControlType : int
      80             :     {
      81             :         Invalid = -1,
      82             :         MATControl = 1001,
      83             :         MRTControl = 1002,
      84             :         OperativeControl = 1003,
      85             :         MATSPControl = 1004,
      86             :         MRTSPControl = 1005,
      87             :         OperativeSPControl = 1006,
      88             :         Num
      89             :     };
      90             : 
      91             :     // DERIVED TYPE DEFINITIONS:
      92             : 
      93             :     // MODULE VARIABLE DECLARATIONS:
      94             : 
      95             :     // SUBROUTINE SPECIFICATIONS FOR MODULE HighTempRadiantSystem
      96             : 
      97             :     // Types
      98             : 
      99          24 :     struct HighTempRadiantSystemData
     100             :     {
     101             :         // Members
     102             :         // Input data
     103             :         std::string Name;         // name of hydronic radiant system
     104             :         std::string SchedName;    // availability schedule
     105             :         int SchedPtr;             // index to schedule
     106             :         std::string ZoneName;     // Name of zone the system is serving
     107             :         int ZonePtr;              // Point to this zone in the Zone derived type
     108             :         RadHeaterType HeaterType; // Type of heater (gas or electric)
     109             :         Real64 MaxPowerCapac;     // Maximum capacity of the radiant heater in Watts
     110             :         Real64 CombustionEffic;   // Combustion efficiency (only valid for a gas heater)
     111             :         Real64 FracRadiant;       // Fraction of heater power that is given off as radiant heat
     112             :         Real64 FracLatent;        // Fraction of heater power that is given off as latent heat
     113             :         Real64 FracLost;          // Fraction of heater power that is lost to the outside environment
     114             :         Real64 FracConvect;       // Fraction of heater power that is given off as convective heat
     115             :         // (by definition this is 1 minus the sum of all other fractions)
     116             :         RadControlType ControlType;        // Control type for the system (MAT, MRT, or op temp)
     117             :         Real64 ThrottlRange;               // Throttling range for heating [C]
     118             :         std::string SetptSched;            // Schedule name for the zone setpoint temperature
     119             :         int SetptSchedPtr;                 // Schedule index for the zone setpoint temperature
     120             :         Real64 FracDistribPerson;          // Fraction of fraction radiant incident on a "person" in the space
     121             :         int TotSurfToDistrib;              // Total number of surfaces the heater sends radiation to
     122             :         Array1D_string SurfaceName;        // Surface name in the list of surfaces heater sends radiation to
     123             :         Array1D_int SurfacePtr;            // Surface number in the list of surfaces heater sends radiation to
     124             :         Array1D<Real64> FracDistribToSurf; // Fraction of fraction radiant incident on the surface
     125             :         // Other parameters
     126             :         // Report data
     127             :         Real64 ElecPower;     // system electric consumption in Watts
     128             :         Real64 ElecEnergy;    // system electric consumption in Joules
     129             :         Real64 GasPower;      // system gas consumption in Watts
     130             :         Real64 GasEnergy;     // system gas consumption in Joules
     131             :         Real64 HeatPower;     // actual heating sent to zone (convective and radiative) in Watts
     132             :         Real64 HeatEnergy;    // actual heating sent to zone (convective and radiative) in Joules
     133             :         int HeatingCapMethod; // - Method for High Temperature Radiant heating capacity scalable sizing calculation (HeatingDesignCapacity,
     134             :                               // CapacityPerFloorArea, FracOfAutosizedHeatingCapacity)
     135             :         Real64
     136             :             ScaledHeatingCapacity; // - High Temperature Radiant scaled maximum heating capacity {W} or scalable variable for sizing in {-}, or {W/m2}
     137             : 
     138             :         // Default Constructor
     139           4 :         HighTempRadiantSystemData()
     140           4 :             : SchedPtr(0), ZonePtr(0), HeaterType(RadHeaterType::Invalid), MaxPowerCapac(0.0), CombustionEffic(0.0), FracRadiant(0.0),
     141             :               FracLatent(0.0), FracLost(0.0), FracConvect(0.0), ControlType(RadControlType::Invalid), ThrottlRange(0.0), SetptSchedPtr(0),
     142             :               FracDistribPerson(0.0), TotSurfToDistrib(0), ElecPower(0.0), ElecEnergy(0.0), GasPower(0.0), GasEnergy(0.0), HeatPower(0.0),
     143           4 :               HeatEnergy(0.0), HeatingCapMethod(0), ScaledHeatingCapacity(0.0)
     144             :         {
     145           4 :         }
     146             :     };
     147             : 
     148          24 :     struct HighTempRadSysNumericFieldData
     149             :     {
     150             :         // Members
     151             :         Array1D_string FieldNames;
     152             : 
     153             :         // Default Constructor
     154           4 :         HighTempRadSysNumericFieldData()
     155           4 :         {
     156           4 :         }
     157             :     };
     158             : 
     159             :     // Functions
     160             : 
     161             :     void SimHighTempRadiantSystem(EnergyPlusData &state,
     162             :                                   std::string_view CompName,     // name of the low temperature radiant system
     163             :                                   bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     164             :                                   Real64 &LoadMet,               // load met by the radiant system, in Watts
     165             :                                   int &CompIndex);
     166             : 
     167             :     void GetHighTempRadiantSystem(EnergyPlusData &state, bool &ErrorsFound); // Error flag if problems encountered on reading user input
     168             : 
     169             :     void InitHighTempRadiantSystem(EnergyPlusData &state,
     170             :                                    bool const FirstHVACIteration, // TRUE if 1st HVAC simulation of system timestep
     171             :                                    int const RadSysNum // Index for the low temperature radiant system under consideration within the derived types
     172             :     );
     173             : 
     174             :     void SizeHighTempRadiantSystem(EnergyPlusData &state, int const RadSysNum);
     175             : 
     176             :     void CalcHighTempRadiantSystem(EnergyPlusData &state, int const RadSysNum); // name of the low temperature radiant system
     177             : 
     178             :     void CalcHighTempRadiantSystemSP(EnergyPlusData &state,
     179             :                                      bool const FirstHVACIteration, // true if this is the first HVAC iteration at this system time step !unused1208
     180             :                                      int const RadSysNum            // name of the low temperature radiant system
     181             :     );
     182             : 
     183             :     void UpdateHighTempRadiantSystem(EnergyPlusData &state,
     184             :                                      int const RadSysNum, // Index for the low temperature radiant system under consideration within the derived types
     185             :                                      Real64 &LoadMet      // load met by the radiant system, in Watts
     186             :     );
     187             : 
     188             :     void UpdateHTRadSourceValAvg(EnergyPlusData &state, bool &HighTempRadSysOn); // .TRUE. if the radiant system has run this zone time step
     189             : 
     190             :     void DistributeHTRadGains(EnergyPlusData &state);
     191             : 
     192             :     void ReportHighTempRadiantSystem(EnergyPlusData &state,
     193             :                                      int RadSysNum); // Index for the low temperature radiant system under consideration within the derived types
     194             : 
     195             : } // namespace HighTempRadiantSystem
     196             : 
     197        1542 : struct HighTempRadiantSystemData : BaseGlobalStruct
     198             : {
     199             : 
     200             :     // Standard, run-of-the-mill variables...
     201             :     int NumOfHighTempRadSys = 0;          // Number of hydronic low tempererature radiant systems
     202             :     Array1D<Real64> QHTRadSource;         // Need to keep the last value in case we are still iterating
     203             :     Array1D<Real64> QHTRadSrcAvg;         // Need to keep the last value in case we are still iterating
     204             :     Array1D<Real64> ZeroSourceSumHATsurf; // Equal to the SumHATsurf for all the walls in a zone with no source
     205             :     // Record keeping variables used to calculate QHTRadSrcAvg locally
     206             :     Array1D<Real64> LastQHTRadSrc;      // Need to keep the last value in case we are still iterating
     207             :     Array1D<Real64> LastSysTimeElapsed; // Need to keep the last value in case we are still iterating
     208             :     Array1D<Real64> LastTimeStepSys;    // Need to keep the last value in case we are still iterating
     209             :     Array1D_bool MySizeFlag;
     210             :     Array1D_bool CheckEquipName;
     211             : 
     212             :     // Object Data
     213             :     Array1D<HighTempRadiantSystem::HighTempRadiantSystemData> HighTempRadSys;
     214             :     Array1D<HighTempRadiantSystem::HighTempRadSysNumericFieldData> HighTempRadSysNumericFields;
     215             : 
     216             :     bool GetInputFlag = true;
     217             :     bool firstTime = true; // For one-time initializations
     218             :     bool MyEnvrnFlag = true;
     219             :     bool ZoneEquipmentListChecked = false; // True after the Zone Equipment List has been checked for items
     220             : 
     221           0 :     void clear_state() override
     222             :     {
     223           0 :         NumOfHighTempRadSys = 0;
     224           0 :         QHTRadSource.clear();
     225           0 :         QHTRadSrcAvg.clear();
     226           0 :         ZeroSourceSumHATsurf.clear();
     227           0 :         LastQHTRadSrc.clear();
     228           0 :         LastSysTimeElapsed.clear();
     229           0 :         LastTimeStepSys.clear();
     230           0 :         MySizeFlag.clear();
     231           0 :         CheckEquipName.clear();
     232             : 
     233           0 :         HighTempRadSys.clear();
     234           0 :         HighTempRadSysNumericFields.clear();
     235             : 
     236           0 :         GetInputFlag = true;
     237           0 :         firstTime = true;
     238           0 :         MyEnvrnFlag = true;
     239           0 :         ZoneEquipmentListChecked = false;
     240           0 :     }
     241             : };
     242             : 
     243             : } // namespace EnergyPlus
     244             : 
     245             : #endif

Generated by: LCOV version 1.13