LCOV - code coverage report
Current view: top level - EnergyPlus - DisplacementVentMgr.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 1 17 5.9 %
Date: 2023-01-17 19:17:23 Functions: 2 3 66.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 DisplacementVentMgr_hh_INCLUDED
      49             : #define DisplacementVentMgr_hh_INCLUDED
      50             : 
      51             : // EnergyPlus Headers
      52             : #include <EnergyPlus/ConvectionCoefficients.hh>
      53             : #include <EnergyPlus/Data/BaseData.hh>
      54             : #include <EnergyPlus/EnergyPlus.hh>
      55             : 
      56             : namespace EnergyPlus {
      57             : 
      58             : // Forward declarations
      59             : struct EnergyPlusData;
      60             : 
      61             : namespace DisplacementVentMgr {
      62             : 
      63             :     void ManageUCSDDVModel(EnergyPlusData &state, int ZoneNum); // index number for the specified zone
      64             : 
      65             :     void InitUCSDDV(EnergyPlusData &state, int ZoneNum);
      66             : 
      67             :     void HcUCSDDV(EnergyPlusData &state, int ZoneNum, Real64 FractionHeight);
      68             : 
      69             :     Real64 calculateThirdOrderFloorTemperature(Real64 temperatureHistoryTerm,
      70             :                                                Real64 HAT_floor,
      71             :                                                Real64 HA_floor,
      72             :                                                Real64 MCpT_Total,
      73             :                                                Real64 MCp_Total,
      74             :                                                Real64 occupiedTemp,
      75             :                                                Real64 nonAirSystemResponse,
      76             :                                                Real64 zoneMultiplier,
      77             :                                                Real64 airCap);
      78             : 
      79             :     void CalcUCSDDV(EnergyPlusData &state, int ZoneNum); // Which Zonenum
      80             : 
      81             :     static constexpr std::array<DataHeatBalance::IntGainType, 30> IntGainTypesOccupied = {
      82             :         DataHeatBalance::IntGainType::People,
      83             :         DataHeatBalance::IntGainType::WaterHeaterMixed,
      84             :         DataHeatBalance::IntGainType::WaterHeaterStratified,
      85             :         DataHeatBalance::IntGainType::ThermalStorageChilledWaterMixed,
      86             :         DataHeatBalance::IntGainType::ThermalStorageChilledWaterStratified,
      87             :         DataHeatBalance::IntGainType::ElectricEquipment,
      88             :         DataHeatBalance::IntGainType::ElectricEquipmentITEAirCooled,
      89             :         DataHeatBalance::IntGainType::GasEquipment,
      90             :         DataHeatBalance::IntGainType::HotWaterEquipment,
      91             :         DataHeatBalance::IntGainType::SteamEquipment,
      92             :         DataHeatBalance::IntGainType::OtherEquipment,
      93             :         DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
      94             :         DataHeatBalance::IntGainType::GeneratorFuelCell,
      95             :         DataHeatBalance::IntGainType::WaterUseEquipment,
      96             :         DataHeatBalance::IntGainType::GeneratorMicroCHP,
      97             :         DataHeatBalance::IntGainType::ElectricLoadCenterTransformer,
      98             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple,
      99             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower,
     100             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable,
     101             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery,
     102             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery,
     103             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple,
     104             :         DataHeatBalance::IntGainType::PipeIndoor,
     105             :         DataHeatBalance::IntGainType::RefrigerationCase,
     106             :         DataHeatBalance::IntGainType::RefrigerationCompressorRack,
     107             :         DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser,
     108             :         DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe,
     109             :         DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver,
     110             :         DataHeatBalance::IntGainType::RefrigerationSecondaryPipe,
     111             :         DataHeatBalance::IntGainType::RefrigerationWalkIn};
     112             : 
     113             :     static constexpr std::array<DataHeatBalance::IntGainType, 2> IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular,
     114             :                                                                                              DataHeatBalance::IntGainType::Lights};
     115             : 
     116             : } // namespace DisplacementVentMgr
     117             : 
     118        1542 : struct DisplacementVentMgrData : BaseGlobalStruct
     119             : {
     120             :     Real64 HAT_MX = 0.0;                  // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone
     121             :     Real64 HA_MX = 0.0;                   // HA_MX Convection Coefficient times Area for the upper subzone
     122             :     Real64 HAT_OC = 0.0;                  // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone
     123             :     Real64 HA_OC = 0.0;                   // HA_OC Convection Coefficient times Area for the lower subzone
     124             :     Real64 HAT_FLOOR = 0.0;               // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone
     125             :     Real64 HA_FLOOR = 0.0;                // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone
     126             :     Real64 HeightFloorSubzoneTop = 0.2;   // Assumed thickness of floor subzone
     127             :     Real64 ThickOccupiedSubzoneMin = 0.2; // Minimum thickness of occupied subzone
     128             :     Real64 HeightIntMass = 0.0;           // Height of internal mass surfaces, assumed vertical, cannot exceed ceiling height
     129             :     Real64 HeightIntMassDefault = 2.0;    // Default height of internal mass surfaces
     130             :     bool InitUCSDDVMyOneTimeFlag = true;
     131             :     Array1D_bool MyEnvrnFlag;
     132             :     Real64 TempDepCoef = 0.0; // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A
     133             :     Real64 TempIndCoef = 0.0; // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1
     134             : 
     135           0 :     void clear_state() override
     136             :     {
     137           0 :         this->HAT_MX = 0.0;
     138           0 :         this->HA_MX = 0.0;
     139           0 :         this->HAT_OC = 0.0;
     140           0 :         this->HA_OC = 0.0;
     141           0 :         this->HAT_FLOOR = 0.0;
     142           0 :         this->HA_FLOOR = 0.0;
     143           0 :         this->HeightFloorSubzoneTop = 0.2;
     144           0 :         this->ThickOccupiedSubzoneMin = 0.2;
     145           0 :         this->HeightIntMass = 0.0;
     146           0 :         this->HeightIntMassDefault = 2.0;
     147           0 :         this->InitUCSDDVMyOneTimeFlag = true;
     148           0 :         this->MyEnvrnFlag.clear();
     149           0 :         this->TempDepCoef = 0.0;
     150           0 :         this->TempIndCoef = 0.0;
     151           0 :     }
     152             : };
     153             : 
     154             : } // namespace EnergyPlus
     155             : 
     156             : #endif

Generated by: LCOV version 1.13