LCOV - code coverage report
Current view: top level - EnergyPlus - DataZoneEnergyDemands.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 4 7 57.1 %
Date: 2023-01-17 19:17:23 Functions: 10 14 71.4 %

          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 DataZoneEnergyDemands_hh_INCLUDED
      49             : #define DataZoneEnergyDemands_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/EPVector.hh>
      57             : #include <EnergyPlus/EnergyPlus.hh>
      58             : 
      59             : namespace EnergyPlus {
      60             : 
      61             : namespace DataZoneEnergyDemands {
      62             : 
      63       20824 :     struct ZoneSystemDemandData // Sensible cooling/heating loads to be met (watts) or Humidification/dehumidification loads to be met (kg water per
      64             :                                 // second)
      65             :     {
      66             :         Real64 RemainingOutputRequired = 0.0;      // The load each equipment sees as what is remaining with load fractions applied [W] (multiplied)
      67             :         Real64 UnadjRemainingOutputRequired = 0.0; // The total unadjusted load remaining to be met [W] (multiplied)
      68             :         Real64 TotalOutputRequired = 0.0;          // The total output required from all equipment [W] (multiplied)
      69             :         int NumZoneEquipment = 0;                  // count of zone equipment for this zone, from ZoneHVAC:EquipmentList
      70             :         Real64 SupplyAirAdjustFactor = 1.0;        // supply air adjustment factor due to the cap of
      71             :         // zone maximum outdoor air fraction
      72             :         int StageNum = 0; // The stage number when staged thermostate is used:
      73             :         // 0 no load, >0 Heating stage, <0 Cooling stage
      74             : 
      75             :         virtual void beginEnvironmentInit() = 0;
      76             : 
      77             :         virtual void setUpOutputVars(
      78             :             EnergyPlusData &state, std::string_view prefix, std::string_view name, bool staged, bool attachMeters, int zoneMult, int listMult) = 0;
      79             :     };
      80             : 
      81       16004 :     struct ZoneSystemSensibleDemand : ZoneSystemDemandData // Sensible cooling/heating loads to be met (watts)
      82             :     {
      83             :         Real64 OutputRequiredToHeatingSP = 0.0; // Load required to meet heating setpoint (>0 is a heating load) [W] (multiplied)
      84             :         Real64 OutputRequiredToCoolingSP = 0.0; // Load required to meet cooling setpoint (<0 is a cooling load) [W] (multiplied)
      85             :         Real64 RemainingOutputReqToHeatSP =
      86             :             0.0; // Remaining load required to meet heating setpoint with load fractions applied (>0 is a heating load) [W] (multiplied)
      87             :         Real64 RemainingOutputReqToCoolSP =
      88             :             0.0; // Remaining load required to meet cooling setpoint with load fractions applied (<0 is a cooling load) [W] (multiplied)
      89             :         Real64 UnadjRemainingOutputReqToHeatSP =
      90             :             0.0; // Remaining unadjusted load required to meet heating setpoint (>0 is a heating load) [W] (multiplied)
      91             :         Real64 UnadjRemainingOutputReqToCoolSP =
      92             :             0.0; // Remaining unadjusted load required to meet cooling setpoint (<0 is a cooling load) [W] (multiplied)
      93             :         EPVector<Real64> SequencedOutputRequired;            // load required to meet setpoint by sequence [W] (multiplied)
      94             :         EPVector<Real64> SequencedOutputRequiredToHeatingSP; // load required to meet heating setpoint by sequence [W] (multiplied)
      95             :         EPVector<Real64> SequencedOutputRequiredToCoolingSP; // load required to meet cooling setpoint by sequence [W] (multiplied)
      96             :         Real64 ZoneSNLoadPredictedRate = 0.0;                // Predicted sensible load [W] (unmultiplied)
      97             :         Real64 ZoneSNLoadPredictedHSPRate = 0.0;             // Predicted sensible load to heating setpoint [W] (unmultiplied)
      98             :         Real64 ZoneSNLoadPredictedCSPRate = 0.0;             // Predicted sensible load to cooling setpoint [W] (unmultiplied)
      99             :         Real64 ZoneSNLoadHeatRate = 0.0;                     // sensible heating rate [W] (unmultiplied)
     100             :         Real64 ZoneSNLoadCoolRate = 0.0;                     // sensible cooling rate [W] (unmultiplied)
     101             :         Real64 ZoneSNLoadHeatEnergy = 0.0;                   // sensible heating energy [J] (unmultiplied)
     102             :         Real64 ZoneSNLoadCoolEnergy = 0.0;                   // sensible cooling energy [J] (unmultiplied)
     103             : 
     104             :         void beginEnvironmentInit() override;
     105             : 
     106             :         void setUpOutputVars(EnergyPlusData &state,
     107             :                              std::string_view prefix,
     108             :                              std::string_view name,
     109             :                              bool staged,
     110             :                              bool attachMeters,
     111             :                              int zoneMult,
     112             :                              int listMult) override;
     113             : 
     114             :         void reportZoneAirSystemSensibleLoads(EnergyPlusData &state, Real64 SNLoad);
     115             : 
     116             :         void reportSensibleLoadsZoneMultiplier(
     117             :             EnergyPlusData &state, int zoneNum, Real64 totalLoad, Real64 loadToHeatingSetPoint, Real64 loadToCoolingSetPoint);
     118             :     };
     119       16004 :     struct ZoneSystemMoistureDemand : ZoneSystemDemandData // Humidification/dehumidification loads to be met (kg water per second)
     120             :     {
     121             :         Real64 OutputRequiredToHumidifyingSP = 0.0; // Load required to meet humidifying setpoint (>0 = a humidify load) [kgWater/s] (multiplied)
     122             :         Real64 OutputRequiredToDehumidifyingSP =
     123             :             0.0;                                  // Load required to meet dehumidifying setpoint (<0 = a dehumidify load) [kgWater/s] (multiplied)
     124             :         Real64 RemainingOutputReqToHumidSP = 0.0; // Remaining load required to meet humidifying setpoint with load fractions applied
     125             :         // (>0 is a humidify load) [kgWater/s] (multiplied)
     126             :         Real64 RemainingOutputReqToDehumidSP = 0.0; // Remaining load required to meet dehumidifying setpoint with load fractions applied
     127             :         // (<0 is a dehumidify load) [kgWater/s] (multiplied)
     128             :         Real64 UnadjRemainingOutputReqToHumidSP = 0.0; // Remaining unadjusted load required to meet humidifying setpoint
     129             :         // (>0 is a humidify load) [kgWater/s] (multiplied)
     130             :         Real64 UnadjRemainingOutputReqToDehumidSP = 0.0; // Remaining unadjusted load required to meet dehumidifying setpoint
     131             :         // (<0 is a dehumidify load) [kgWater/s] (multiplied)
     132             :         EPVector<Real64> SequencedOutputRequired;            // load required to meet setpoint by sequence [kgWater/s] (multiplied)
     133             :         EPVector<Real64> SequencedOutputRequiredToHumidSP;   // load required to meet humidify setpoint by sequence [kgWater/s] (multiplied)
     134             :         EPVector<Real64> SequencedOutputRequiredToDehumidSP; // load required to meet dehumidify setpoint by sequenc [kgWater/s] (multiplied)
     135             :         Real64 ZoneMoisturePredictedRate = 0.0;              // Predicted moisture load to setpoint [kgWater/s] (unmultiplied)
     136             :         Real64 ZoneMoisturePredictedHumSPRate = 0.0;         // Predicted latent load to humidification setpoint [kgWater/s] (unmultiplied)
     137             :         Real64 ZoneMoisturePredictedDehumSPRate = 0.0;       // Predicted latent load to dehumidification setpoint [kgWater/s] (unmultiplied)
     138             :         Real64 ZoneLTLoadHeatRate = 0.0;                     // latent heating rate [W] (unmultiplied)
     139             :         Real64 ZoneLTLoadCoolRate = 0.0;                     // latent cooling rate [W] (unmultiplied)
     140             :         Real64 ZoneLTLoadHeatEnergy = 0.0;                   // latent heating energy [J] (unmultiplied)
     141             :         Real64 ZoneLTLoadCoolEnergy = 0.0;                   // latent cooling energy [J] (unmultiplied)
     142             :         Real64 ZoneSensibleHeatRatio = 0.0;                  // zone load SHR []
     143             :         Real64 ZoneVaporPressureDifference = 0.0;            // vapor pressure depression [Pa]
     144             : 
     145             :         void beginEnvironmentInit() override;
     146             : 
     147             :         void setUpOutputVars(EnergyPlusData &state,
     148             :                              std::string_view prefix,
     149             :                              std::string_view name,
     150             :                              [[maybe_unused]] bool staged = false,
     151             :                              [[maybe_unused]] bool attachMeters = false,
     152             :                              [[maybe_unused]] int zoneMult = 0,
     153             :                              [[maybe_unused]] int listMult = 0) override;
     154             : 
     155             :         void reportZoneAirSystemMoistureLoads(EnergyPlusData &state, Real64 latentGain, Real64 sensibleLoad, Real64 vaporPressureDiff);
     156             : 
     157             :         void reportMoistLoadsZoneMultiplier(
     158             :             EnergyPlusData &state, int zoneNum, Real64 totalLoad, Real64 loadToHumidifySetPoint, Real64 loadToDehumidifySetPoint);
     159             :     };
     160             : 
     161             : } // namespace DataZoneEnergyDemands
     162             : 
     163        1542 : struct DataZoneEnergyDemandsData : BaseGlobalStruct
     164             : {
     165             :     Array1D_bool DeadBandOrSetback;    // true if zone temperature is in the thermostat deadband before any heating / cooling done
     166             :     Array1D_bool Setback;              // true if zone temperature has increased from previous setting
     167             :     Array1D_bool CurDeadBandOrSetback; // same as above except updated after each piece of zone equipment in a zone is simulated
     168             :     EPVector<DataZoneEnergyDemands::ZoneSystemSensibleDemand> ZoneSysEnergyDemand;
     169             :     EPVector<DataZoneEnergyDemands::ZoneSystemMoistureDemand> ZoneSysMoistureDemand;
     170             :     EPVector<DataZoneEnergyDemands::ZoneSystemSensibleDemand> spaceSysEnergyDemand;
     171             :     EPVector<DataZoneEnergyDemands::ZoneSystemMoistureDemand> spaceSysMoistureDemand;
     172             : 
     173           0 :     void clear_state() override
     174             :     {
     175           0 :         new (this) DataZoneEnergyDemandsData();
     176           0 :     }
     177             : };
     178             : 
     179             : } // namespace EnergyPlus
     180             : 
     181             : #endif

Generated by: LCOV version 1.13