LCOV - code coverage report
Current view: top level - EnergyPlus - HVACUnitaryBypassVAV.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 23 8.7 %
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 HVACUnitaryBypassVAV_hh_INCLUDED
      49             : #define HVACUnitaryBypassVAV_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : 
      54             : // EnergyPlus Headers
      55             : #include <EnergyPlus/Data/BaseData.hh>
      56             : #include <EnergyPlus/DataGlobals.hh>
      57             : #include <EnergyPlus/DataHVACGlobals.hh>
      58             : #include <EnergyPlus/EnergyPlus.hh>
      59             : 
      60             : namespace EnergyPlus {
      61             : 
      62             : // Forward declarations
      63             : struct EnergyPlusData;
      64             : 
      65             : namespace HVACUnitaryBypassVAV {
      66             : 
      67             :     // Using/Aliasing
      68             : 
      69             :     // Data
      70             :     // MODULE PARAMETER DEFINITIONS
      71             : 
      72             :     // Mode of operation
      73             :     // can't change these to enum class since these are used in SetupOutputVariable()
      74             :     int constexpr CoolingMode(1); // System operating mode is cooling
      75             :     int constexpr HeatingMode(2); // System operating mode is heating
      76             : 
      77             :     enum class DehumidControl // Dehumidification control modes (DehumidControlMode) for Multimode units only
      78             :     {
      79             :         // TODO: enum check
      80             :         Invalid = -1,
      81             :         None,
      82             :         Multimode,
      83             :         CoolReheat,
      84             :         Num
      85             :     };
      86             : 
      87             :     enum class PriorityCtrlMode // Priority control mode (prioritized thermostat signal)
      88             :     {
      89             :         Invalid = -1,
      90             :         CoolingPriority, // Controls CBVAV system based on cooling priority
      91             :         HeatingPriority, // Controls CBVAV system based on heating priority
      92             :         ZonePriority,    // Controls CBVAV system based on number of zones priority
      93             :         LoadPriority,    // Controls CBVAV system based on total load priority
      94             :         Num
      95             :     };
      96             : 
      97             :     enum class AirFlowCtrlMode // Airflow control for contant fan mode
      98             :     {
      99             :         Invalid = -1,
     100             :         UseCompressorOnFlow,  // Set compressor OFF air flow rate equal to compressor ON air flow rate
     101             :         UseCompressorOffFlow, // Set compressor OFF air flow rate equal to user defined value
     102             :         Num
     103             :     };
     104             : 
     105             :     // SUBROUTINE SPECIFICATIONS FOR MODULE
     106             : 
     107             :     struct CBVAVData
     108             :     {
     109             :         std::string Name;                      // Name of unit
     110             :         std::string UnitType;                  // Type of unit
     111             :         std::string Sched;                     // Availability schedule name
     112             :         int SchedPtr = 0;                      // Index number to availability schedule
     113             :         Real64 MaxCoolAirVolFlow = 0.0;        // System air volumetric flow rate during cooling operation [m3/s]
     114             :         Real64 MaxHeatAirVolFlow = 0.0;        // System air volumetric flow rate during heating operation [m3/s]
     115             :         Real64 MaxNoCoolHeatAirVolFlow = 0.0;  // System air volumetric flow rate when no cooling or heating [m3/s]
     116             :         Real64 MaxCoolAirMassFlow = 0.0;       // System air mass flow rate during cooling operation [kg/s]
     117             :         Real64 MaxHeatAirMassFlow = 0.0;       // System air mass flow rate during heating operation [kg/s]
     118             :         Real64 MaxNoCoolHeatAirMassFlow = 0.0; // System air mass flow rate when no cooling or heating [kg/s]
     119             :         Real64 CoolOutAirVolFlow = 0.0;        // OA volumetric flow rate during cooling operation [m3/s]
     120             :         Real64 HeatOutAirVolFlow = 0.0;        // OA volumetric flow rate during heating operation [m3/s]
     121             :         Real64 NoCoolHeatOutAirVolFlow = 0.0;  // OA volumetric flow rate when no cooling or heating [m3/s]
     122             :         Real64 CoolOutAirMassFlow = 0.0;       // OA mass flow rate during cooling operation [kg/s]
     123             :         Real64 HeatOutAirMassFlow = 0.0;       // OA mass flow rate during heating operation [kg/s]
     124             :         Real64 NoCoolHeatOutAirMassFlow = 0.0; // OA mass flow rate when no cooling or heating [kg/s]
     125             :         int OutAirSchPtr = 0;                  // Index number to outside air multiplier schedule
     126             :         int AirInNode = 0;                     // Inlet air node number for CBVAV unit
     127             :         int AirOutNode = 0;                    // Outlet air node number for CBVAV unit
     128             :         int CondenserNodeNum = 0;              // DX Coil condenser air inlet node number
     129             :         int MixerOutsideAirNode = 0;           // Outside air node number for OA mixer
     130             :         int MixerMixedAirNode = 0;             // Mixed air node number for OA mixer
     131             :         int MixerReliefAirNode = 0;            // Relief air node number for OA mixer
     132             :         int MixerInletAirNode = 0;             // Return air node number for OA mixer
     133             :         int SplitterOutletAirNode = 0;         // Air node number for splitter (last component outlet node)
     134             :         int PlenumMixerInletAirNode = 0;       // only used when bypass is connected to plenum or mixer
     135             :         std::string OAMixType;                 // type of outside air mixer
     136             :         std::string OAMixName;                 // Name of OA mixer
     137             :         int OAMixIndex = 0;                    // Index to OA mixer
     138             :         std::string FanName;                   // Name of fan
     139             :         HVAC::FanType fanType = HVAC::FanType::Invalid;
     140             :         HVAC::FanPlace fanPlace = HVAC::FanPlace::Invalid; // Fan placement is either blowthru (1) or drawthru (2)
     141             :         int FanIndex = 0;                                  // Index number to fan
     142             :         int FanOpModeSchedPtr = 0;                         // Fan operating mode schedule pointer
     143             :         Real64 FanVolFlow = 0.0;                           // Volumetric flow rate of system supply air fan [m3/s]
     144             :         Real64 HeatingSpeedRatio = 1.0;                    // Fan speed ratio in heating mode
     145             :         Real64 CoolingSpeedRatio = 1.0;                    // Fan speed ratio in cooling mode
     146             :         Real64 NoHeatCoolSpeedRatio = 1.0;                 // Fan speed ratio when no cooling or heating
     147             :         bool CheckFanFlow = true;                          // Check fan volumetric flow versus system flow in init routine.
     148             :         std::string DXCoolCoilName;                        // Name of DX cooling coil
     149             :         HVAC::CoilType CoolCoilType = HVAC::CoilType::Invalid;
     150             :         int CoolCoilCompIndex = 0;  // cooling coil component index number
     151             :         int DXCoolCoilIndexNum = 0; // actual DX cooling coil index number
     152             :         int DXHeatCoilIndexNum = 0; // actual DX heating coil index number
     153             :         std::string HeatCoilName;   // Name of heating coil
     154             :         HVAC::CoilType HeatCoilType = HVAC::CoilType::Invalid;
     155             :         int HeatCoilIndex = 0;                    // DX heating coil index number
     156             :         HVAC::FanOp fanOp = HVAC::FanOp::Invalid; // mode of operation
     157             :         int CoilControlNode = 0;                  // heating coil hot water or steam inlet node
     158             :         int CoilOutletNode = 0;                   // outlet node for hot water and steam coil
     159             :         PlantLocation plantLoc;                   // plant loop component location object for water heating coil
     160             :         int HotWaterCoilMaxIterIndex = 0;         // Index to recurring warning message
     161             :         int HotWaterCoilMaxIterIndex2 = 0;        // Index to recurring warning message
     162             :         Real64 MaxHeatCoilFluidFlow = 0.0;        // water or steam mass flow rate for heating coil [kg/s]
     163             :         Real64 DesignHeatingCapacity = 0.0;       // design heating capacity of the heating coil
     164             :         Real64 DesignSuppHeatingCapacity = 0.0;   // Operating capacity of supplemental Heating Coil [W]
     165             :         Real64 MinOATCompressor = 0.0;            // Minimum OAT for compressor operation [C]
     166             :         Real64 MinLATCooling = 0.0;               // Minimum leaving air temp for compressor cooling operation [C]
     167             :         Real64 MaxLATHeating = 0.0;               // Maximum leaving air temp for heating operation [C]
     168             :         // Report data
     169             :         Real64 TotHeatEnergyRate = 0.0;                            // Total heating output [W]
     170             :         Real64 TotHeatEnergy = 0.0;                                // Total heating output [J]
     171             :         Real64 TotCoolEnergyRate = 0.0;                            // Total cooling output [W]
     172             :         Real64 TotCoolEnergy = 0.0;                                // Total cooling output [J]
     173             :         Real64 SensHeatEnergyRate = 0.0;                           // Sensible heating output [W]
     174             :         Real64 SensHeatEnergy = 0.0;                               // Sensible heating output [J]
     175             :         Real64 SensCoolEnergyRate = 0.0;                           // Sensible cooling output [W]
     176             :         Real64 SensCoolEnergy = 0.0;                               // Sensible cooling output [J]
     177             :         Real64 LatHeatEnergyRate = 0.0;                            // Latent heating output [W]
     178             :         Real64 LatHeatEnergy = 0.0;                                // Latent heating output [J]
     179             :         Real64 LatCoolEnergyRate = 0.0;                            // Latent cooling output [W]
     180             :         Real64 LatCoolEnergy = 0.0;                                // Latent cooling output [J]
     181             :         Real64 ElecPower = 0.0;                                    // Electricity consumed [W]
     182             :         Real64 ElecConsumption = 0.0;                              // Electricity consumed [J]
     183             :         Real64 FanPartLoadRatio = 0.0;                             // Fan part-load ratio for time step
     184             :         Real64 CompPartLoadRatio = 0.0;                            // Compressor part-load ratio for time step
     185             :         int LastMode = 0;                                          // Last mode of operation, coolingmode or heatingmode
     186             :         AirFlowCtrlMode AirFlowControl = AirFlowCtrlMode::Invalid; // Fan control mode, UseCompressorOnFlow or UseCompressorOffFlow
     187             :         Real64 CompPartLoadFrac = 0.0;                             // Compressor part load ratio
     188             :         int AirLoopNumber = 0;                                     // Air loop served by the CBVAV system
     189             :         int NumControlledZones = 0;
     190             :         Array1D_int ControlledZoneNum;                                // Index to controlled zones
     191             :         Array1D_int ControlledZoneNodeNum;                            // Zone node num of controlled zone
     192             :         Array1D_int CBVAVBoxOutletNode;                               // Outlet node of CBVAV Box in controlled zone
     193             :         Array1D_int ZoneSequenceCoolingNum;                           // Index to cooling sequence/priority for this zone
     194             :         Array1D_int ZoneSequenceHeatingNum;                           // Index to heating sequence/priority for this zone
     195             :         PriorityCtrlMode PriorityControl = PriorityCtrlMode::Invalid; // Control mode - CoolingPriority, HeatingPriority, ZonePriority or LoadPriority
     196             :         int NumZonesCooled = 0;                                       // Number of zones requesting cooling
     197             :         int NumZonesHeated = 0;                                       // Number of zones requesting heating
     198             :         int PLRMaxIter = 0;                                           // Counter for recurring warning message
     199             :         int PLRMaxIterIndex = 0;                                      // Index to recurring warning message
     200             :         int DXCoilInletNode = 0;                                      // Inlet node number of DX cooling coil
     201             :         int DXCoilOutletNode = 0;                                     // Outlet node number of DX cooling coil
     202             :         int HeatingCoilInletNode = 0;                                 // Inlet node of heating coil
     203             :         int HeatingCoilOutletNode = 0;                                // Outlet node of heating coil
     204             :         int FanInletNodeNum = 0;                                      // fan inlet node number
     205             :         Real64 OutletTempSetPoint = 0.0;                              // Oulet node temperature setpoint [C]
     206             :         Real64 CoilTempSetPoint = 0.0;                                // Coil oulet node temperature setpoint (inc. fan heat) [C]
     207             :         int HeatCoolMode = 0;                                         // System operating mode (0 = floating, 1 = cooling, 2 = heating)
     208             :         Real64 BypassMassFlowRate = 0.0;                              // Bypass mass flow rate report variable [m3/s]
     209             :         HVAC::CoilMode DehumidificationMode = HVAC::CoilMode::Invalid; // Dehumidification mode (0=normal, 1=enhanced)
     210             :         DehumidControl DehumidControlType = DehumidControl::None;      // Dehumidification control type (currently only for multimode coil)
     211             :         bool HumRatMaxCheck = true;                                    // Used in Init for warning messages
     212             :         int DXIterationExceeded = 0;                                   // Counter for DX coil messages
     213             :         int DXIterationExceededIndex = 0;                              // Counter for DX coil messages
     214             :         int DXIterationFailed = 0;                                     // Counter for DX coil messages
     215             :         int DXIterationFailedIndex = 0;                                // Counter for DX coil messages
     216             :         int DXCyclingIterationExceeded = 0;                            // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     217             :         int DXCyclingIterationExceededIndex = 0;                       // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     218             :         int DXCyclingIterationFailed = 0;                              // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     219             :         int DXCyclingIterationFailedIndex = 0;                         // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     220             :         int DXHeatIterationExceeded = 0;                               // Counter for DX coil messages
     221             :         int DXHeatIterationExceededIndex = 0;                          // Counter for DX coil messages
     222             :         int DXHeatIterationFailed = 0;                                 // Counter for DX coil messages
     223             :         int DXHeatIterationFailedIndex = 0;                            // Counter for DX coil messages
     224             :         int DXHeatCyclingIterationExceeded = 0;                        // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     225             :         int DXHeatCyclingIterationExceededIndex = 0;                   // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     226             :         int DXHeatCyclingIterationFailed = 0;                          // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     227             :         int DXHeatCyclingIterationFailedIndex = 0;                     // Counter for VS DX coil messages, when on/off cycling between off and speed 1
     228             :         int HXDXIterationExceeded = 0;                                 // Counter for HX assisted DX coil messages
     229             :         int HXDXIterationExceededIndex = 0;                            // Counter for HX assisted DX coil messages
     230             :         int HXDXIterationFailed = 0;                                   // Counter for HX assisted DX coil messages
     231             :         int HXDXIterationFailedIndex = 0;                              // Counter for HX assisted DX coil messages
     232             :         int MMDXIterationExceeded = 0;                                 // Counter for multimode DX coil messages
     233             :         int MMDXIterationExceededIndex = 0;                            // Counter for multimode DX coil messages
     234             :         int MMDXIterationFailed = 0;                                   // Counter for multimode DX coil messages
     235             :         int MMDXIterationFailedIndex = 0;                              // Counter for multimode DX coil messages
     236             :         int DMDXIterationExceeded = 0;                                 // Counter for dehumidifying multimode DX coil messages
     237             :         int DMDXIterationExceededIndex = 0;                            // Counter for dehumidifying multimode DX coil messages
     238             :         int DMDXIterationFailed = 0;                                   // Counter for dehumidifying multimode DX coil messages
     239             :         int DMDXIterationFailedIndex = 0;                              // Counter for dehumidifying multimode DX coil messages
     240             :         int CRDXIterationExceeded = 0;                                 // Counter for cool reheat multimode DX coil messages
     241             :         int CRDXIterationExceededIndex = 0;                            // Counter for cool reheat multimode DX coil messages
     242             :         int CRDXIterationFailed = 0;                                   // Counter for cool reheat multimode DX coil messages
     243             :         int CRDXIterationFailedIndex = 0;                              // Counter for cool reheat multimode DX coil messages
     244             :         bool FirstPass = true;                                         // used to determine when first call is made
     245             :         int plenumIndex = 0;                                           // index to AirloopHVAC:ReturnPlenum
     246             :         int mixerIndex = 0;                                            // index to AirloopHVAC:ZoneMixer
     247             :         Real64 changeOverTimer = -1.0;                                 // timer to avoid rapid change of operating modes (e.g., cooling to heating)
     248             :         Real64 minModeChangeTime = -1.0;                               // time limit before mode change is allowed (hr)
     249             :         int OutNodeSPMIndex = 0;                                       // set point manager index if exists on outlet node
     250             :         bool modeChanged = false;                                      // identifies operating mode changed this time step
     251             :     };
     252             : 
     253             :     void SimUnitaryBypassVAV(EnergyPlusData &state,
     254             :                              std::string_view CompName, // Name of the CBVAV system
     255             :                              bool FirstHVACIteration,   // TRUE if 1st HVAC simulation of system time step
     256             :                              int AirLoopNum,            // air loop index
     257             :                              int &CompIndex             // Index to changeover-bypass VAV system
     258             :     );
     259             : 
     260             :     void SimCBVAV(EnergyPlusData &state,
     261             :                   int CBVAVNum,              // Index of the current CBVAV system being simulated
     262             :                   bool FirstHVACIteration,   // TRUE if 1st HVAC simulation of system timestep
     263             :                   Real64 &QSensUnitOut,      // Sensible delivered capacity [W]
     264             :                   Real64 &OnOffAirFlowRatio, // Ratio of compressor ON airflow to AVERAGE airflow over timestep
     265             :                   bool HXUnitOn              // flag to enable heat exchanger
     266             :     );
     267             : 
     268             :     void GetCBVAV(EnergyPlusData &state);
     269             : 
     270             :     void InitCBVAV(EnergyPlusData &state,
     271             :                    int CBVAVNum,              // Index of the current CBVAV unit being simulated
     272             :                    bool FirstHVACIteration,   // TRUE if first HVAC iteration
     273             :                    int AirLoopNum,            // air loop index
     274             :                    Real64 &OnOffAirFlowRatio, // Ratio of compressor ON airflow to average airflow over timestep
     275             :                    bool HXUnitOn              // flag to enable heat exchanger
     276             :     );
     277             : 
     278             :     void SizeCBVAV(EnergyPlusData &state, int CBVAVNum); // Index to CBVAV system
     279             : 
     280             :     void ControlCBVAVOutput(EnergyPlusData &state,
     281             :                             int CBVAVNum,              // Index to CBVAV system
     282             :                             bool FirstHVACIteration,   // Flag for 1st HVAC iteration
     283             :                             Real64 &PartLoadFrac,      // Unit part load fraction
     284             :                             Real64 &OnOffAirFlowRatio, // Ratio of compressor ON airflow to AVERAGE airflow over timestep
     285             :                             bool HXUnitOn              // flag to enable heat exchanger
     286             :     );
     287             : 
     288             :     void CalcCBVAV(EnergyPlusData &state,
     289             :                    int CBVAVNum,              // Unit index in fan coil array
     290             :                    bool FirstHVACIteration,   // Flag for 1st HVAC iteration
     291             :                    Real64 &PartLoadFrac,      // Compressor part load fraction
     292             :                    Real64 &LoadMet,           // Load met by unit (W)
     293             :                    Real64 &OnOffAirFlowRatio, // Ratio of compressor ON airflow to AVERAGE airflow over timestep
     294             :                    bool HXUnitOn              // flag to enable heat exchanger
     295             :     );
     296             : 
     297             :     void GetZoneLoads(EnergyPlusData &state, int CBVAVNum // Index to CBVAV unit being simulated
     298             :     );
     299             : 
     300             :     Real64 CalcSetPointTempTarget(EnergyPlusData &state, int CBVAVNumber); // Index to changeover-bypass VAV system
     301             : 
     302             :     void SetAverageAirFlow(EnergyPlusData &state,
     303             :                            int CBVAVNum,             // Index to CBVAV system
     304             :                            Real64 &OnOffAirFlowRatio // Ratio of compressor ON airflow to average airflow over timestep
     305             :     );
     306             : 
     307             :     void ReportCBVAV(EnergyPlusData &state, int CBVAVNum); // Index of the current CBVAV unit being simulated
     308             : 
     309             :     void CalcNonDXHeatingCoils(EnergyPlusData &state,
     310             :                                int CBVAVNum,            // Changeover bypass VAV unit index
     311             :                                bool FirstHVACIteration, // flag for first HVAC iteration in the time step
     312             :                                Real64 &HeatCoilLoad,    // heating coil load to be met (Watts)
     313             :                                HVAC::FanOp const fanOp, // fan operation mode
     314             :                                Real64 &HeatCoilLoadmet  // coil heating load met
     315             :     );
     316             : 
     317             : } // namespace HVACUnitaryBypassVAV
     318             : 
     319             : struct HVACUnitaryBypassVAVData : BaseGlobalStruct
     320             : {
     321             : 
     322             :     // TODO: Try to eliminate these global-ish variables.  Just use data stored right in the component instances.
     323             :     int NumCBVAV = 0;                    // Number of CBVAV systems in input file
     324             :     Real64 CompOnMassFlow = 0.0;         // System air mass flow rate w/ compressor ON
     325             :     Real64 OACompOnMassFlow = 0.0;       // OA mass flow rate w/ compressor ON
     326             :     Real64 CompOffMassFlow = 0.0;        // System air mass flow rate w/ compressor OFF
     327             :     Real64 OACompOffMassFlow = 0.0;      // OA mass flow rate w/ compressor OFF
     328             :     Real64 CompOnFlowRatio = 0.0;        // fan flow ratio when coil on
     329             :     Real64 CompOffFlowRatio = 0.0;       // fan flow ratio when coil off
     330             :     Real64 FanSpeedRatio = 0.0;          // ratio of air flow ratio passed to fan object
     331             :     Real64 BypassDuctFlowFraction = 0.0; // Fraction of unit mass flow that returns to inlet of CBVAV unit through bypass duct
     332             :     Real64 PartLoadFrac = 0.0;           // Compressor part-load fraction
     333             :     Real64 SaveCompressorPLR = 0.0;      // Holds DX compressor PLR from active DX coil
     334             :     Real64 TempSteamIn = 100.0;          // steam coil steam inlet temperature
     335             :     Array1D_bool CheckEquipName;
     336             : 
     337             :     EPVector<HVACUnitaryBypassVAV::CBVAVData> CBVAV;
     338             :     bool GetInputFlag = true; // Flag set to make sure you get input once
     339             : 
     340             :     bool MyOneTimeFlag = true; // Initialization flag
     341             :     // TODO: Get rid of these arrays, make them bools in the data structure and probably get rid of one time flag
     342             :     Array1D_bool MyEnvrnFlag;     // Used for initializations each begin environment flag
     343             :     Array1D_bool MySizeFlag;      // Used for sizing CBVAV inputs one time
     344             :     Array1D_bool MyPlantScanFlag; // Used for initializations plant component for heating coils
     345             : 
     346         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     347             :     {
     348         796 :     }
     349             : 
     350           0 :     void clear_state() override
     351             :     {
     352           0 :         this->CBVAV.deallocate();
     353           0 :         this->NumCBVAV = 0;
     354           0 :         this->CompOnMassFlow = 0.0;
     355           0 :         this->OACompOnMassFlow = 0.0;
     356           0 :         this->CompOffMassFlow = 0.0;
     357           0 :         this->OACompOffMassFlow = 0.0;
     358           0 :         this->CompOnFlowRatio = 0.0;
     359           0 :         this->CompOffFlowRatio = 0.0;
     360           0 :         this->FanSpeedRatio = 0.0;
     361           0 :         this->BypassDuctFlowFraction = 0.0;
     362           0 :         this->PartLoadFrac = 0.0;
     363           0 :         this->SaveCompressorPLR = 0.0;
     364           0 :         this->TempSteamIn = 100.0;
     365           0 :         this->CheckEquipName.deallocate();
     366           0 :         this->GetInputFlag = true;
     367           0 :         this->MyOneTimeFlag = true;
     368           0 :         this->MyEnvrnFlag.deallocate();
     369           0 :         this->MySizeFlag.deallocate();
     370           0 :         this->MyPlantScanFlag.deallocate();
     371           0 :     }
     372             : };
     373             : 
     374             : } // namespace EnergyPlus
     375             : 
     376             : #endif

Generated by: LCOV version 1.14