LCOV - code coverage report
Current view: top level - EnergyPlus - DataHeatBalFanSys.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 5 40.0 %
Date: 2023-01-17 19:17:23 Functions: 3 5 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 DataHeatBalFanSys_hh_INCLUDED
      49             : #define DataHeatBalFanSys_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/DataHVACGlobals.hh>
      57             : #include <EnergyPlus/EPVector.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : 
      60             : namespace EnergyPlus {
      61             : 
      62             : namespace DataHeatBalFanSys {
      63             : 
      64             :     // Data
      65             :     // -only module should be available to other modules and routines.
      66             :     // Thus, all variables in this module must be PUBLIC.
      67             : 
      68             :     constexpr Real64 MaxRadHeatFlux = 4000.0; // [W/m2] max limit for radiant heat flux at a surface due to HVAC equipment
      69             : 
      70             :     enum class PredictorCorrectorCtrl
      71             :     {
      72             :         Invalid = -1,
      73             :         GetZoneSetPoints,
      74             :         PredictStep,
      75             :         CorrectStep,
      76             :         RevertZoneTimestepHistories,
      77             :         PushZoneTimestepHistories,
      78             :         PushSystemTimestepHistories,
      79             :         Num
      80             :     };
      81             : 
      82           3 :     struct ZoneComfortControlsFangerData
      83             :     {
      84             :         // Members
      85             :         int FangerType = 0;      // Index for Fanger type
      86             :         Real64 LowPMV = 0.0;     // Low PMV value
      87             :         Real64 HighPMV = 0.0;    // High PMV Value
      88             :         int DualPMVErrCount = 0; // Dual PMV setpoint error count
      89             :         int DualPMVErrIndex = 0; // Dual PMV setpoint error index
      90             :     };
      91             : 
      92             : } // namespace DataHeatBalFanSys
      93             : 
      94        1542 : struct HeatBalFanSysData : BaseGlobalStruct
      95             : {
      96             :     Array1D<Real64> SumConvHTRadSys;             // Sum of convection to zone air from hi temp radiant heaters
      97             :     Array1D<Real64> SumLatentHTRadSys;           // Sum of latent gains from hi temp radiant heaters
      98             :     Array1D<Real64> SumConvPool;                 // Sum of convection to zone air from pools
      99             :     Array1D<Real64> SumLatentPool;               // Sum of latent gains from pools
     100             :     Array1D<Real64> ZoneQdotRadHVACToPerson;     // Sum of radiant gains to people from all radiant HVAC sources
     101             :     Array1D<Real64> ZoneQHTRadSysToPerson;       // Sum of radiant gains to people from hi temp radiant heaters
     102             :     Array1D<Real64> ZoneQHWBaseboardToPerson;    // Sum of radiant gains to people from hot water baseboard heaters
     103             :     Array1D<Real64> ZoneQSteamBaseboardToPerson; // Sum of radiant gains to people from steam baseboard heaters
     104             :     Array1D<Real64> ZoneQElecBaseboardToPerson;  // Sum of radiant gains to people from electric baseboard heaters
     105             :     Array1D<Real64> ZoneQCoolingPanelToPerson;   // Sum of radiant losses to people from cooling panels
     106             : 
     107             :     // Zone air drybulb conditions variables
     108             :     Array1D<Real64> TempTstatAir; // temperature of air near the thermo stat
     109             : 
     110             :     Array1D_bool ZoneMassBalanceFlag;  // zone mass flow balance flag
     111             :     Array1D_bool ZoneInfiltrationFlag; // Zone Infiltration flag
     112             :     Array1D_int ZoneReOrder;           // zone number reordered for zone mass balance
     113             : 
     114             :     // REAL Variables for the Heat Balance Simulation
     115             : 
     116             :     Array1D<Real64> QRadSysSource;     // Current source/sink for a particular surface (radiant sys)
     117             :     Array1D<Real64> TCondFDSourceNode; // Temperature of source/sink location in surface from CondFD algo
     118             :     Array1D<Real64> QPVSysSource;      // Current source/sink for a surface (integrated PV sys)
     119             : 
     120             :     Array1D<Real64> CTFTsrcConstPart; // Constant Outside Portion of the CTF calculation of
     121             :     // temperature at source
     122             :     Array1D<Real64> CTFTuserConstPart; // Constant Outside Portion of the CTF calculation of
     123             :     // temperature at the user specified location
     124             :     Array1D<Real64> SurfQHTRadSys; // Current radiant heat flux at a surface due to the presence
     125             :     // of high temperature radiant heaters
     126             :     Array1D<Real64> SurfQHWBaseboard; // Current radiant heat flux at a surface due to the presence
     127             :     // of hot water baseboard heaters
     128             :     Array1D<Real64> SurfQSteamBaseboard; // Current radiant heat flux at a surface due to the presence
     129             :     // of steam baseboard heaters
     130             :     Array1D<Real64> SurfQElecBaseboard; // Current radiant heat flux at a surface due to the presence
     131             :     // of electric baseboard heaters
     132             :     Array1D<Real64> SurfQCoolingPanel; // Current radiant heat flux at a surface due to the presence
     133             :     // of simple cooling panels
     134             :     Array1D<Real64> QRadSurfAFNDuct;     // Current radiant heat flux at a surface due to radiation from AFN ducts
     135             :     Array1D<Real64> QPoolSurfNumerator;  // Current pool heat flux impact at the surface (numerator of surface heat balance)
     136             :     Array1D<Real64> PoolHeatTransCoefs;  // Current pool heat transfer coefficients (denominator of surface heat balance)
     137             :     Array1D<Real64> RadSysTiHBConstCoef; // Inside heat balance coefficient that is constant
     138             :     Array1D<Real64> RadSysTiHBToutCoef;  // Inside heat balance coefficient that modifies Toutside
     139             :     Array1D<Real64> RadSysTiHBQsrcCoef;  // Inside heat balance coefficient that modifies source/sink
     140             :     Array1D<Real64> RadSysToHBConstCoef; // Outside heat balance coefficient that is constant
     141             :     Array1D<Real64> RadSysToHBTinCoef;   // Outside heat balance coefficient that modifies Toutside
     142             :     Array1D<Real64> RadSysToHBQsrcCoef;  // Outside heat balance coefficient that modifies source/sink
     143             : 
     144             :     Array1D<Real64> TempZoneThermostatSetPoint;
     145             :     Array1D<Real64> AdapComfortCoolingSetPoint;
     146             :     Array1D<Real64> ZoneThermostatSetPointHi;
     147             :     Array1D<Real64> ZoneThermostatSetPointLo;
     148             :     Array1D<Real64> ZoneThermostatSetPointHiAver;
     149             :     Array1D<Real64> ZoneThermostatSetPointLoAver;
     150             : 
     151             :     EPVector<Real64> LoadCorrectionFactor; // PH 3/3/04
     152             : 
     153             :     // Hybrid Modeling
     154             :     Array1D<Real64> PreviousMeasuredZT1;     // Measured zone air temperature at previous timestep1
     155             :     Array1D<Real64> PreviousMeasuredZT2;     // Measured zone air temperature at previous timestep2
     156             :     Array1D<Real64> PreviousMeasuredZT3;     // Measured zone air temperature at previous timestep3
     157             :     Array1D<Real64> PreviousMeasuredHumRat1; // Hybrid model zone humidity ratio at previous timestep
     158             :     Array1D<Real64> PreviousMeasuredHumRat2; // Hybrid model zone humidity ratio at previous timestep
     159             :     Array1D<Real64> PreviousMeasuredHumRat3; // Hybrid model zone humidity ratio at previous timestep
     160             :     EPVector<DataHVACGlobals::ThermostatType> TempControlType;
     161             :     EPVector<int> TempControlTypeRpt;
     162             :     EPVector<DataHVACGlobals::ThermostatType> ComfortControlType;
     163             :     EPVector<int> ComfortControlTypeRpt;
     164             : 
     165             :     Array2D<bool> CrossedColdThreshRepPeriod;
     166             :     Array2D<bool> CrossedHeatThreshRepPeriod;
     167             : 
     168             :     Array2D<std::vector<Real64>> ZoneHeatIndexHourBinsRepPeriod;
     169             :     Array2D<std::vector<Real64>> ZoneHeatIndexOccuHourBinsRepPeriod;
     170             :     Array2D<std::vector<Real64>> ZoneHeatIndexOccupiedHourBinsRepPeriod;
     171             :     Array2D<std::vector<Real64>> ZoneHumidexHourBinsRepPeriod;
     172             :     Array2D<std::vector<Real64>> ZoneHumidexOccuHourBinsRepPeriod;
     173             :     Array2D<std::vector<Real64>> ZoneHumidexOccupiedHourBinsRepPeriod;
     174             :     Array2D<Real64> lowSETLongestHoursRepPeriod;
     175             :     Array2D<Real64> highSETLongestHoursRepPeriod;
     176             :     Array2D<int> lowSETLongestStartRepPeriod;
     177             :     Array2D<int> highSETLongestStartRepPeriod;
     178             :     Array2D<std::vector<Real64>> ZoneColdHourOfSafetyBinsRepPeriod;
     179             :     Array2D<std::vector<Real64>> ZoneHeatHourOfSafetyBinsRepPeriod;
     180             :     Array2D<std::vector<Real64>> ZoneUnmetDegreeHourBinsRepPeriod;
     181             :     Array2D<std::vector<Real64>> ZoneDiscomfortWtExceedOccuHourBinsRepPeriod;
     182             :     Array2D<std::vector<Real64>> ZoneDiscomfortWtExceedOccupiedHourBinsRepPeriod;
     183             :     Array2D<std::vector<Real64>> ZoneCO2LevelHourBinsRepPeriod;
     184             :     Array2D<std::vector<Real64>> ZoneCO2LevelOccuHourBinsRepPeriod;
     185             :     Array2D<std::vector<Real64>> ZoneCO2LevelOccupiedHourBinsRepPeriod;
     186             :     Array2D<std::vector<Real64>> ZoneLightingLevelHourBinsRepPeriod;
     187             :     Array2D<std::vector<Real64>> ZoneLightingLevelOccuHourBinsRepPeriod;
     188             :     Array2D<std::vector<Real64>> ZoneLightingLevelOccupiedHourBinsRepPeriod;
     189             : 
     190             :     Array2D<std::vector<Real64>> ZoneLowSETHoursRepPeriod;
     191             :     Array2D<std::vector<Real64>> ZoneHighSETHoursRepPeriod;
     192             : 
     193             :     int PierceSETerrorIndex = 0;
     194             :     int PMVerrorIndex = 0;
     195             : 
     196             :     EPVector<DataHeatBalFanSys::ZoneComfortControlsFangerData> ZoneComfortControlsFanger;
     197             : 
     198           0 :     void clear_state() override
     199             :     {
     200           0 :         *this = HeatBalFanSysData();
     201           0 :     }
     202             : };
     203             : 
     204             : } // namespace EnergyPlus
     205             : 
     206             : #endif

Generated by: LCOV version 1.13