LCOV - code coverage report
Current view: top level - EnergyPlus - DisplacementVentMgr.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 18 11.1 %
Date: 2024-08-23 23:50:59 Functions: 1 2 50.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2024, 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 RoomAir {
      62             : 
      63             :     void ManageDispVent3Node(EnergyPlusData &state, int ZoneNum); // index number for the specified zone
      64             : 
      65             :     void InitDispVent3Node(EnergyPlusData &state, int ZoneNum);
      66             : 
      67             :     void HcDispVent3Node(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 CalcDispVent3Node(EnergyPlusData &state, int ZoneNum); // Which Zonenum
      80             : 
      81             :     static constexpr std::array<DataHeatBalance::IntGainType, 51> 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::IndoorGreen,
      94             :         DataHeatBalance::IntGainType::ZoneBaseboardOutdoorTemperatureControlled,
      95             :         DataHeatBalance::IntGainType::GeneratorFuelCell,
      96             :         DataHeatBalance::IntGainType::WaterUseEquipment,
      97             :         DataHeatBalance::IntGainType::GeneratorMicroCHP,
      98             :         DataHeatBalance::IntGainType::ElectricLoadCenterTransformer,
      99             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterSimple,
     100             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterFunctionOfPower,
     101             :         DataHeatBalance::IntGainType::ElectricLoadCenterInverterLookUpTable,
     102             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageLiIonNmcBattery,
     103             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageBattery,
     104             :         DataHeatBalance::IntGainType::ElectricLoadCenterStorageSimple,
     105             :         DataHeatBalance::IntGainType::PipeIndoor,
     106             :         DataHeatBalance::IntGainType::RefrigerationCase,
     107             :         DataHeatBalance::IntGainType::RefrigerationCompressorRack,
     108             :         DataHeatBalance::IntGainType::RefrigerationSystemAirCooledCondenser,
     109             :         DataHeatBalance::IntGainType::RefrigerationSystemSuctionPipe,
     110             :         DataHeatBalance::IntGainType::RefrigerationSecondaryReceiver,
     111             :         DataHeatBalance::IntGainType::RefrigerationSecondaryPipe,
     112             :         DataHeatBalance::IntGainType::RefrigerationWalkIn,
     113             :         DataHeatBalance::IntGainType::RefrigerationTransSysAirCooledGasCooler,
     114             :         DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeMT,
     115             :         DataHeatBalance::IntGainType::RefrigerationTransSysSuctionPipeLT,
     116             :         DataHeatBalance::IntGainType::Pump_VarSpeed,
     117             :         DataHeatBalance::IntGainType::Pump_ConSpeed,
     118             :         DataHeatBalance::IntGainType::Pump_Cond,
     119             :         DataHeatBalance::IntGainType::PumpBank_VarSpeed,
     120             :         DataHeatBalance::IntGainType::PumpBank_ConSpeed,
     121             :         DataHeatBalance::IntGainType::PlantComponentUserDefined,
     122             :         DataHeatBalance::IntGainType::CoilUserDefined,
     123             :         DataHeatBalance::IntGainType::ZoneHVACForcedAirUserDefined,
     124             :         DataHeatBalance::IntGainType::AirTerminalUserDefined,
     125             :         DataHeatBalance::IntGainType::PackagedTESCoilTank,
     126             :         DataHeatBalance::IntGainType::SecCoolingDXCoilSingleSpeed,
     127             :         DataHeatBalance::IntGainType::SecHeatingDXCoilSingleSpeed,
     128             :         DataHeatBalance::IntGainType::SecCoolingDXCoilTwoSpeed,
     129             :         DataHeatBalance::IntGainType::SecCoolingDXCoilMultiSpeed,
     130             :         DataHeatBalance::IntGainType::SecHeatingDXCoilMultiSpeed,
     131             :         DataHeatBalance::IntGainType::ElectricLoadCenterConverter,
     132             :         DataHeatBalance::IntGainType::FanSystemModel};
     133             : 
     134             :     static constexpr std::array<DataHeatBalance::IntGainType, 2> IntGainTypesMixedSubzone = {DataHeatBalance::IntGainType::DaylightingDeviceTubular,
     135             :                                                                                              DataHeatBalance::IntGainType::Lights};
     136             : 
     137             :     // Explicitly list internal gains not applicable for Displacement Vent
     138             :     static constexpr std::array<DataHeatBalance::IntGainType, 2> ExcludedIntGainTypes = {
     139             :         DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkCarbonDioxide,
     140             :         DataHeatBalance::IntGainType::ZoneContaminantSourceAndSinkGenericContam};
     141             : 
     142             : } // namespace RoomAir
     143             : 
     144             : struct DisplacementVentMgrData : BaseGlobalStruct
     145             : {
     146             :     Real64 HAT_MX = 0.0;                  // HAT_MX Convection Coefficient times Area times Temperature for the upper subzone
     147             :     Real64 HA_MX = 0.0;                   // HA_MX Convection Coefficient times Area for the upper subzone
     148             :     Real64 HAT_OC = 0.0;                  // HAT_OC Convection Coefficient times Area times Temperature for the lower subzone
     149             :     Real64 HA_OC = 0.0;                   // HA_OC Convection Coefficient times Area for the lower subzone
     150             :     Real64 HAT_FLOOR = 0.0;               // HAT_FLOOR Convection Coefficient times Area times Temperature for the floor(?) subzone
     151             :     Real64 HA_FLOOR = 0.0;                // HA_FLOOR Convection Coefficient times Area for the floor(?) subzone
     152             :     Real64 HeightFloorSubzoneTop = 0.2;   // Assumed thickness of floor subzone
     153             :     Real64 ThickOccupiedSubzoneMin = 0.2; // Minimum thickness of occupied subzone
     154             :     Real64 HeightIntMass = 0.0;           // Height of internal mass surfaces, assumed vertical, cannot exceed ceiling height
     155             :     Real64 HeightIntMassDefault = 2.0;    // Default height of internal mass surfaces
     156             :     bool InitUCSDDVMyOneTimeFlag = true;
     157             :     Array1D_bool MyEnvrnFlag;
     158             :     Real64 TempDepCoef = 0.0; // Formerly CoefSumha, coef in zone temp equation with dimensions of h*A
     159             :     Real64 TempIndCoef = 0.0; // Formerly CoefSumhat, coef in zone temp equation with dimensions of h*A(T1
     160             : 
     161         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     162             :     {
     163         796 :     }
     164             : 
     165           0 :     void clear_state() override
     166             :     {
     167           0 :         this->HAT_MX = 0.0;
     168           0 :         this->HA_MX = 0.0;
     169           0 :         this->HAT_OC = 0.0;
     170           0 :         this->HA_OC = 0.0;
     171           0 :         this->HAT_FLOOR = 0.0;
     172           0 :         this->HA_FLOOR = 0.0;
     173           0 :         this->HeightFloorSubzoneTop = 0.2;
     174           0 :         this->ThickOccupiedSubzoneMin = 0.2;
     175           0 :         this->HeightIntMass = 0.0;
     176           0 :         this->HeightIntMassDefault = 2.0;
     177           0 :         this->InitUCSDDVMyOneTimeFlag = true;
     178           0 :         this->MyEnvrnFlag.clear();
     179           0 :         this->TempDepCoef = 0.0;
     180           0 :         this->TempIndCoef = 0.0;
     181           0 :     }
     182             : };
     183             : 
     184             : } // namespace EnergyPlus
     185             : 
     186             : #endif

Generated by: LCOV version 1.14