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

Generated by: LCOV version 2.0-1