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

            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 ZoneDehumidifier_hh_INCLUDED
      49              : #define ZoneDehumidifier_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 Curve {
      65              :     struct Curve;
      66              : }
      67              : 
      68              : namespace ZoneDehumidifier {
      69              : 
      70              :     enum class CondensateOutlet
      71              :     { // Water Systems
      72              :         Invalid = -1,
      73              :         Discarded, // Default mode where water is "lost"
      74              :         ToTank,    // Collect coil condensate from air and store in water storage tank
      75              :         Num
      76              :     };
      77              : 
      78              :     struct ZoneDehumidifierParams
      79              :     {
      80              :         // input data and others required during calculations
      81              :         std::string Name;                                                     // Name of unit
      82              :         std::string UnitType;                                                 // Type of unit
      83              :         Sched::Schedule *availSched = nullptr;                                // availability schedule
      84              :         Real64 RatedWaterRemoval = 0.0;                                       // Rated water removal [liters/day]
      85              :         Real64 RatedEnergyFactor = 0.0;                                       // Rated energy factor [liters/kWh]
      86              :         Real64 RatedAirVolFlow = 0.0;                                         // Rated air flow rate through the dehumidifier [m3/s]
      87              :         Real64 RatedAirMassFlow = 0.0;                                        // Rated air mass flow rate through the dehumidifier [kg/s]
      88              :         Real64 MinInletAirTemp = 0.0;                                         // Minimum dry-bulb temperature for dehumidifier operation [C]
      89              :         Real64 MaxInletAirTemp = 0.0;                                         // Maximum dry-bulb temperature for dehumidifier operation [C]
      90              :         Real64 InletAirMassFlow = 0.0;                                        // Inlet air mass flow rate for the time step being simulated [kg/s]
      91              :         Real64 OutletAirEnthalpy = 0.0;                                       // Dehumidifier outlet air enthalpy [J/kg]
      92              :         Real64 OutletAirHumRat = 0.0;                                         // Dehumidifier outlet air humidity ratio [kg/kg]
      93              :         Real64 OffCycleParasiticLoad = 0.0;                                   // Off Cycle Parasitic Load, user input [W]
      94              :         int AirInletNodeNum = 0;                                              // Inlet air node number
      95              :         int AirOutletNodeNum = 0;                                             // Outlet air node number
      96              :         Curve::Curve *WaterRemovalCurve = nullptr;                            // Water removal curve
      97              :         int WaterRemovalCurveErrorCount = 0;                                  // Count number of times water removal curve returns a negative value
      98              :         int WaterRemovalCurveErrorIndex = 0;                                  // Index for negative value water removal factor recurring messages
      99              :         Curve::Curve *EnergyFactorCurve = nullptr;                            // Energy factor curve
     100              :         int EnergyFactorCurveErrorCount = 0;                                  // Count number of times energy factor curve returns negative value
     101              :         int EnergyFactorCurveErrorIndex = 0;                                  // Index for negative value energy factor recurring messages
     102              :         Curve::Curve *PartLoadCurve = nullptr;                                // Index for part load curve
     103              :         int LowPLFErrorCount = 0;                                             // Count number of times PLF < 0.7
     104              :         int LowPLFErrorIndex = 0;                                             // Index for PLF < 0.7 recurring warning messages
     105              :         int HighPLFErrorCount = 0;                                            // Count number of times PLF > 1.0
     106              :         int HighPLFErrorIndex = 0;                                            // Index for PLF > 1.0 recurring warning messages
     107              :         int HighRTFErrorCount = 0;                                            // Count number of times RTF > 1.0
     108              :         int HighRTFErrorIndex = 0;                                            // Index for RTF > 1.0 recurring warning messages
     109              :         int PLFPLRErrorCount = 0;                                             // Count number of times PLF < PLR
     110              :         int PLFPLRErrorIndex = 0;                                             // Index for PLF < PLR recurring warning messages
     111              :         CondensateOutlet CondensateCollectMode = CondensateOutlet::Discarded; // Where does water come from
     112              :         std::string CondensateCollectName;                                    // Name of water storage (collection) tank
     113              :         int CondensateTankID = 0;                                             // Condensate collection tank ID number
     114              :         int CondensateTankSupplyARRID = 0;                                    // Condensate collection tank supply ID number
     115              :         // Report data
     116              :         Real64 SensHeatingRate = 0.0;            // Zone Dehumidifier Sensible Heating Rate [W]
     117              :         Real64 SensHeatingEnergy = 0.0;          // Zone Dehumidifier Sensible Heating Energy [J]
     118              :         Real64 WaterRemovalRate = 0.0;           // Zone Dehumidifier Water Removal Rate [kg/s]
     119              :         Real64 WaterRemoved = 0.0;               // Zone Dehumidifier Water Removed [kg]
     120              :         Real64 ElecPower = 0.0;                  // Zone Dehumidifier Electric Power [W]
     121              :         Real64 ElecConsumption = 0.0;            // Zone Dehumidifier Electric Consumption [J]
     122              :         Real64 DehumidPLR = 0.0;                 // Zone Dehumidifier Part-Load Ratio [-]
     123              :         Real64 DehumidRTF = 0.0;                 // Zone Dehumidifier Runtime Fraction [-]
     124              :         Real64 DehumidCondVolFlowRate = 0.0;     // Zone Dehumidifier Condensate Volumetric Flow Rate [m3/s]
     125              :         Real64 DehumidCondVol = 0.0;             // Zone Dehumidifier Condensate Volume [m3]
     126              :         Real64 OutletAirTemp = 0.0;              // Zone Dehumidifier Outlet Air Temperature [C]
     127              :         Real64 OffCycleParasiticElecPower = 0.0; // Zone Dehumidifier Off-Cycle Parasitic Electric Power [W]
     128              :         Real64 OffCycleParasiticElecCons = 0.0;  // Zone Dehumidifier Off-Cycle Parasitic Electric Consumption [J]
     129              :         bool MyEnvrnFlag = true;
     130              :         bool CheckEquipName = true;
     131              :         bool ZoneEquipmentListChecked = false;
     132              :     };
     133              : 
     134              :     void SimZoneDehumidifier(EnergyPlusData &state,
     135              :                              std::string const &CompName, // Name of the zone dehumidifier
     136              :                              int ZoneNum,                 // Number of zone being served
     137              :                              bool FirstHVACIteration,     // TRUE if 1st HVAC simulation of system timestep
     138              :                              Real64 &QSensOut,            // Sensible capacity delivered to zone (W)
     139              :                              Real64 &QLatOut,             // Latent capacity delivered to zone (kg/s), dehumidify = negative
     140              :                              int &CompIndex               // Index to the zone dehumidifier
     141              :     );
     142              : 
     143              :     void GetZoneDehumidifierInput(EnergyPlusData &state);
     144              : 
     145              :     void InitZoneDehumidifier(EnergyPlusData &state, int ZoneDehumNum); // Number of the current zone dehumidifier being simulated
     146              : 
     147              :     void CalcZoneDehumidifier(EnergyPlusData &state,
     148              :                               int ZoneDehumNum,       // Index number of the current zone dehumidifier being simulated
     149              :                               Real64 QZnDehumidReq,   // Dehumidification load to be met (kg/s), negative value means dehumidification load
     150              :                               Real64 &SensibleOutput, // Sensible (heating) output (W), sent to load predictor for next simulation time step
     151              :                               Real64 &LatentOutput    // Latent (dehumidification) output provided (kg/s)
     152              :     );
     153              : 
     154              :     void UpdateZoneDehumidifier(EnergyPlusData &state, int ZoneDehumNum); // Number of the current zone dehumidifier being simulated
     155              : 
     156              :     void ReportZoneDehumidifier(EnergyPlusData &state, int DehumidNum); // Index of the current zone dehumidifier being simulated
     157              : 
     158              :     bool GetZoneDehumidifierNodeNumber(EnergyPlusData &state, int NodeNumber); // Node being tested
     159              : 
     160              :     int getZoneDehumidifierIndex(EnergyPlusData &state, std::string_view CompName);
     161              : 
     162              : } // namespace ZoneDehumidifier
     163              : 
     164              : struct ZoneDehumidifierData : BaseGlobalStruct
     165              : {
     166              :     bool GetInputFlag = true; // Set to FALSE after first time input is "gotten"
     167              :     EPVector<ZoneDehumidifier::ZoneDehumidifierParams> ZoneDehumid;
     168              : 
     169         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     170              :     {
     171         2126 :     }
     172              : 
     173         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     174              :     {
     175         1152 :     }
     176              : 
     177         2100 :     void clear_state() override
     178              :     {
     179         2100 :         new (this) ZoneDehumidifierData();
     180         2100 :     }
     181              : };
     182              : 
     183              : } // namespace EnergyPlus
     184              : 
     185              : #endif
        

Generated by: LCOV version 2.0-1