LCOV - code coverage report
Current view: top level - EnergyPlus - DataDefineEquip.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 6 9 66.7 %
Date: 2023-01-17 19:17:23 Functions: 5 8 62.5 %

          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 DataDefineEquip_hh_INCLUDED
      49             : #define DataDefineEquip_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <memory>
      53             : // ObjexxFCL Headers
      54             : #include <ObjexxFCL/Array1D.hh>
      55             : 
      56             : // EnergyPlus Headers
      57             : #include <EnergyPlus/AirTerminalUnit.hh>
      58             : #include <EnergyPlus/Data/BaseData.hh>
      59             : #include <EnergyPlus/DataGlobals.hh>
      60             : #include <EnergyPlus/EnergyPlus.hh>
      61             : 
      62             : namespace EnergyPlus {
      63             : 
      64             : namespace DataDefineEquip {
      65             : 
      66             :     constexpr int MaxZoneAirComponents = 1;
      67             : 
      68             :     // Equipment Types covered by ZoneAirLoopEquipment:
      69             :     enum class ZnAirLoopEquipType
      70             :     {
      71             :         Invalid = -1,
      72             :         DualDuctConstVolume,
      73             :         DualDuctVAV,
      74             :         SingleDuctVAVReheat,
      75             :         SingleDuctVAVNoReheat,
      76             :         SingleDuctConstVolReheat,
      77             :         SingleDuctConstVolNoReheat,
      78             :         SingleDuct_SeriesPIU_Reheat,
      79             :         SingleDuct_ParallelPIU_Reheat,
      80             :         SingleDuct_ConstVol_4PipeInduc,
      81             :         SingleDuctVAVReheatVSFan,
      82             :         SingleDuctCBVAVReheat,
      83             :         SingleDuctCBVAVNoReheat,
      84             :         SingleDuctConstVolCooledBeam,
      85             :         DualDuctVAVOutdoorAir,
      86             :         SingleDuctUserDefined,
      87             :         SingleDuctATMixer,
      88             :         SingleDuctConstVolFourPipeBeam,
      89             :         Num
      90             :     };
      91             : 
      92        7480 :     struct ZoneAirEquip
      93             :     {
      94             :         // Members
      95             :         std::string Name;         // Name or identifier of this piece of equipment
      96             :         int OutletNodeNum = 0;    // index of outlet node
      97             :         int NumComponents = 0;    // number of subcomponents (=1)
      98             :         int NumControls = 0;      // number of controls (not used; =0)
      99             :         Array1D_string EquipType; // Pointer identifying type of subcomponent
     100             :         Array1D<DataDefineEquip::ZnAirLoopEquipType> EquipTypeEnum;
     101             :         ///// Note use of shared_ptr here is not a good pattern, not to be replicated without further discussion.
     102             :         std::shared_ptr<AirTerminalUnit> airTerminalPtr = nullptr;
     103             :         Array1D_string EquipName; // name of subcomponent
     104             :         Array1D_int EquipIndex;
     105             :         int AirTerminalSizingSpecIndex = 0; // index to DesignSpecification:AirTerminal:Sizing obect
     106             :         int TermUnitSizingNum = 0;          // index to TermUnitSizing and TermUnitFinalZoneSizing for this air distribution unit
     107             :         Real64 UpStreamLeakFrac = 0.0;      // upstream nominal leakage fraction
     108             :         Real64 DownStreamLeakFrac = 0.0;    // downstream constant leakage fraction
     109             :         Real64 MassFlowRateUpStrLk = 0.0;   // current air mass flow rate of the upstream leak [kg/s]
     110             :         Real64 MassFlowRateDnStrLk = 0.0;   // current air mass flow rate of the downstream leak [kg/s]
     111             :         Real64 MassFlowRateTU = 0.0;        // current air mass flow rate through the terminal unit [kg/s]
     112             :         Real64 MassFlowRateZSup = 0.0;      // current air mass flow rate of zone supply air [kg/s]
     113             :         Real64 MassFlowRateSup = 0.0;       // current air mass flow rate of supply air upstream of upstream leak [kg/s]
     114             :         Real64 MassFlowRatePlenInd = 0.0;   // current air mass flow rate of induced air from plenum [kg/s]
     115             :         Real64 MaxAvailDelta = 0.0;         // change in max avail mass low rate due to leaks [kg/s]
     116             :         Real64 MinAvailDelta = 0.0;         // change in min avail mass low rate due to leaks [kg/s]
     117             :         int InletNodeNum = 0;               // index of inlet node 1
     118             :         int InletNodeNum2 = 0;              // index of inlet node 2 (used for dual duct airterminals)
     119             :         int ZoneEqNum = 0;                  // index of zone equipment object for this terminal unit
     120             :         int AirLoopNum = 0;                 // index to airloop that this terminal unit is connected to
     121             :         Real64 LeakLoadMult = 0.0;          // zome load multiplier to adjust for downstream leak
     122             :         bool UpStreamLeak = false;          // if true, there is an upstream leak
     123             :         bool DownStreamLeak = false;        // if true, there is an downstream leak
     124             :         int RetPlenumNum = 0;               // return plenum number that this ADU can leak to, zero if none
     125             :         int ZoneNum = 0;                    // index of the zone object for this terminal unit
     126             :         bool AccountForDOAS = false;        // if true user has asked for DOAS
     127             :         Real64 HeatRate = 0.0;              // [W]
     128             :         Real64 CoolRate = 0.0;              // [W]
     129             :         Real64 HeatGain = 0.0;              // [J]
     130             :         Real64 CoolGain = 0.0;              // [J]
     131             :         bool EachOnceFlag = true;
     132             : 
     133             :         // Default Constructor
     134         560 :         ZoneAirEquip()
     135         560 :             : EquipType(MaxZoneAirComponents), EquipTypeEnum(MaxZoneAirComponents, DataDefineEquip::ZnAirLoopEquipType::Invalid),
     136         560 :               EquipName(MaxZoneAirComponents), EquipIndex(MaxZoneAirComponents, 0)
     137             :         {
     138         560 :         }
     139             :     };
     140             : 
     141             : } // namespace DataDefineEquip
     142             : 
     143        1542 : struct DefineEquipData : BaseGlobalStruct
     144             : {
     145             :     Array1D<DataDefineEquip::ZoneAirEquip> AirDistUnit; // Used to specify zone related
     146             : 
     147           0 :     void clear_state() override
     148             :     {
     149           0 :         *this = DefineEquipData();
     150           0 :     }
     151             : };
     152             : 
     153             : } // namespace EnergyPlus
     154             : 
     155             : #endif

Generated by: LCOV version 1.13