LCOV - code coverage report
Current view: top level - EnergyPlus - DataAirLoop.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 9 12 75.0 %
Date: 2023-01-17 19:17:23 Functions: 22 29 75.9 %

          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 DataAirLoop_hh_INCLUDED
      49             : #define DataAirLoop_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/DataHVACSystems.hh>
      59             : #include <EnergyPlus/EPVector.hh>
      60             : #include <EnergyPlus/EnergyPlus.hh>
      61             : #include <EnergyPlus/Plant/PlantAvailManager.hh>
      62             : #include <EnergyPlus/SimAirServingZones.hh>
      63             : 
      64             : namespace EnergyPlus {
      65             : 
      66             : namespace DataAirLoop {
      67             : 
      68        4301 :     struct AirLoopZoneEquipConnectData
      69             :     {
      70             :         // Members
      71             :         std::string AirLoopName;                              // Name of Primary Air System
      72             :         int NumReturnNodes = 0;                               // Number of return nodes entering primary air system (currently limited to 1 node)
      73             :         int NumSupplyNodes = 0;                               // number of supply nodes exiting primary air system
      74             :         int NumZonesCooled = 0;                               // number of zones cooled by this primary air system
      75             :         int NumZonesHeated = 0;                               // number of zones heated by this primary air system
      76             :         Array1D_int ZoneEquipReturnNodeNum;                   // Zone Equip side return air node numbers (currently limited to 1 node)
      77             :         Array1D_int ZoneEquipSupplyNodeNum;                   // Zone equip side supply air node numbers
      78             :         Array1D_int AirLoopReturnNodeNum;                     // Air loop side return air node numbers
      79             :         Array1D_int AirLoopSupplyNodeNum;                     // Air loop side supply air node numbers
      80             :         Array1D_int CoolCtrlZoneNums;                         // Controlled zone numbers of zones cooled by this air loop
      81             :         Array1D_int HeatCtrlZoneNums;                         // Controlled zone numbers of zones heated by this air loop
      82             :         Array1D_int CoolZoneInletNodes;                       // Zone inlet node numbers of zones cooled by this air loop
      83             :         Array1D_int HeatZoneInletNodes;                       // Zone inlet node numbers of zones heated by this air loop
      84             :         Array1D_int TermUnitCoolInletNodes;                   // Air terminal unit cooling inlet node numbers for this air loop
      85             :         Array1D_int TermUnitHeatInletNodes;                   // Air terminal unit heating inlet node numbers for this air loop
      86             :         Array1D_int TermUnitCoolSizingIndex;                  // Air terminal sizing numbers for zones cooled by this air loop
      87             :         Array1D_int TermUnitHeatSizingIndex;                  // Air terminal sizing numbers for zones heated by this air loop
      88             :         Array1D<DataHVACGlobals::AirDuctType> SupplyDuctType; // 1=main, 2=cooling, 3=heating, 4=other
      89             :     };
      90             : 
      91        1177 :     struct AirLoopOutsideAirConnectData
      92             :     {
      93             :         // Members
      94             :         bool OASysExists = false;   // true if there is an Outside Air Sys
      95             :         int OASysInletNodeNum = 0;  // node number of return air inlet to OA sys
      96             :         int OASysOutletNodeNum = 0; // node number of mixed air outlet of OA sys
      97             :     };
      98             : 
      99        4055 :     struct DefinePriAirSysAvailMgrs
     100             :     {
     101             :         // Members
     102             :         int NumAvailManagers = 0;                                    // number of availability managers for this system
     103             :         int AvailStatus = 0;                                         // system availability status
     104             :         int StartTime = 0;                                           // cycle on time (in SimTimeSteps)
     105             :         int StopTime = 0;                                            // cycle off time (in SimTimeSteps)
     106             :         Real64 ReqSupplyFrac = 0.0;                                  // required system flow rate (as a fraction)
     107             :         Array1D_string AvailManagerName;                             // name of each availability manager
     108             :         Array1D<DataPlant::SystemAvailabilityType> AvailManagerType; // type of availability manager
     109             :         Array1D_int AvailManagerNum;                                 // index for availability manager
     110             :     };
     111             : 
     112        4301 :     struct AirLooptoZoneData // Derived type for air loop connection to zones on air loop
     113             :     {
     114             :         // Members
     115             :         int NumZones = 0;
     116             :         Array1D_int Zone;
     117             :         Array1D_int ActualZoneNumber;
     118             :     };
     119             : 
     120      388562 :     struct AirLoopControlData // Derived type for air control information
     121             :     {
     122             :         // Members
     123             :         std::string OACtrlName;                     // name of OA controller
     124             :         int OACtrlNum = 0;                          // index of OA controller
     125             :         int OASysNum = 0;                           // index of OA System
     126             :         bool CyclingFan = false;                    // TRUE if currently the air loop supply fan is cycling
     127             :         bool AnyContFan = false;                    // TRUE if at any time supply fan is continuous
     128             :         int CycFanSchedPtr = 0;                     // index of schedule indicating whether fan is cycling or continuous in a unitary system
     129             :         int FanOpMode = 0;                          // 1=cycling fan cycling compressor; 2=constant fan cycling comptressor
     130             :         bool UnitarySys = false;                    // TRUE if a unitary system
     131             :         bool UnitarySysSimulating = true;           // set FALSE for AirloopUnitarySystem after simulating to downstream coils can size independently
     132             :         bool Simple = false;                        // TRUE if system has 1 branch and 1 component
     133             :         bool CanNotLockoutEcono = false;            // user input says econo lockout not allowed
     134             :         bool CanLockoutEconoWithHeating = false;    // user input says econo lockout with heating is allowed
     135             :         bool CanLockoutEconoWithCompressor = false; // user input says econo lockout with compressor is allowed
     136             :         bool ReqstEconoLockoutWithHeating = false;  // there is a request to lockout the economizer due to heating
     137             :         bool ReqstEconoLockoutWithCompressor = false; // there is a request to lockout the economizer due to compressor operation
     138             :         bool EconoActive = false;                     // if true economizer is active
     139             :         bool HeatRecoveryBypass = false;              // if true heat recovery is bypassed (not active)
     140             :         bool ResimAirLoopFlag = false;                // Same as SimAir, will trigger re-sim of air loops
     141             :         bool HeatRecoveryResimFlag = true;            // Used to trigger new air loop sim when HX is used in OA system
     142             :         bool HeatRecoveryResimFlag2 = false;          // Used to trigger new air loop sim when HX is used in OA system
     143             :         bool CheckHeatRecoveryBypassStatus = false;   // determines when heat recovery bypass is set
     144             :         bool EconomizerFlowLocked = false;            // locks economizer flow for custon ERV operation
     145             :         bool HighHumCtrlActive = false;               // if true high humidity control is active
     146             :         bool EconoLockout = false;                    // if true the economizer will be locked out (OA flow set to minimum)
     147             :         bool LoopFlowRateSet = false;                 // if true then the air loop flow rate should be set using ReqSupplyFrac
     148             :         bool NightVent = false;                       // if true then air loop is in night ventilation mode
     149             :         bool AllowWarmRestartFlag = false;            // if true then speculative warm restart is attempted after first HVAC iteration
     150             :         bool NewFlowRateFlag = false;                 // true whenever the air mass flow rates have changed since last air loop sim
     151             :         bool ConvergedFlag = false;                   // true whenever the air loop sim was converged overall
     152             :         bool CoolingActiveFlag = false;               // true whenever the air loop cooling coil is operating
     153             :         bool HeatingActiveFlag = false;               // true whenever the air loop heating coil is operating
     154             :         bool OASysComponentsSimulated = false;        // - true after OA components have been simulated
     155             :         Real64 ZoneExhMassFlow = 0.0;                 // zone exhaust flow rate not accounted for by zone inlet flow
     156             :         bool AirLoopDCVFlag = true;                   // TRUE if the air loop has OA Controller specifying a Mechanical controller with DCV
     157             :         int AirLoopPass = 0;                          // number of air loop passes during iteration
     158             :         // - internal flag only
     159             :     };
     160             : 
     161        1177 :     struct AirLoopFlowData // Derived type for air loop flow information
     162             :     {
     163             :         // Members
     164             :         Real64 DesSupply = 0.0;             // design supply air mass flow rate for loop [kg/s]
     165             :         Real64 DesReturnFrac = 1.0;         // the design return flow rate as a fraction of supply flow assuming no exhaust (0 to 1)
     166             :         Real64 SysToZoneDesFlowRatio = 0.0; // System design flow divided by the sum of the zone design flows
     167             :         Real64 ReqSupplyFrac = 1.0;         // required flow (as a fraction of DesSupply) set by a manager
     168             :         Real64 MinOutAir = 0.0;             // minimum outside air mass flow rate [kg/s]
     169             :         Real64 MaxOutAir = 0.0;             // current maximum available outside air mass flow rate [kg/s]
     170             :         Real64 OAMinFrac = 0.0;             // minimum outside air flow fraction this time step
     171             :         Real64 Previous = 0.0;              // Previous mass air flow rate for this loop [kg/s]
     172             :         Real64 SupFlow = 0.0;               // supply air flow rate (includes LeakFlow) [kg/s]
     173             :         Real64 ZoneRetFlow = 0.0;           // return air flow rate at all zone return air nodes (includes RecircFlow, excludes LeakFlow) [kg/s]
     174             :         Real64 ZoneRetFlowRatio = 1.0;      // ratio for adjusting zone return flows for excess zone exhaust
     175             :         Real64 SysRetFlow = 0.0;            // return air flow rate back to central return (excludes RecircFlow, includes LeakFlow) [kg/s]
     176             :         Real64 RecircFlow = 0.0;            // sum of zone plenum recirculated flows [kg/s]
     177             :         Real64 LeakFlow = 0.0;              // sum of air distribution leak flows to return plenum [kg/s]
     178             :         Real64 ExcessZoneExhFlow = 0.0;     // excess zone exhuast flows made up by reduced return flow in other zones on same airloop [kg/s]
     179             :         Real64 FanPLR = 1.0;                // Operating PLR of air loop fan
     180             :         Real64 OAFrac = 0.0;                // fraction of outside air to mixed air mass flow rate
     181             :         Real64 OAFlow = 0.0;                // oa flow rate this time step [kg/s]
     182             :         bool FlowError = false;             // error flag for flow error message
     183             :         Real64 BypassMassFlow = 0.0;        // air loop bypass mass flow NOT entering splitter but included in mixer or plenum
     184             :     };
     185             : 
     186      384574 :     struct OutsideAirSysProps
     187             :     {
     188             :         // Members
     189             :         std::string Name;
     190             :         std::string ControllerListName;
     191             :         std::string ComponentListName;
     192             :         int ControllerListNum = 0; // index of the Controller List
     193             :         int NumComponents = 0;
     194             :         int NumControllers = 0;
     195             :         int NumSimpleControllers = 0; // number of CONTROLLER:SIMPLE objects in OA Sys controller list
     196             :         std::string OAControllerName; // OA controller name
     197             :         int OAControllerIndex = 0;    // OA controller index in OAController
     198             :         Array1D_string ComponentName;
     199             :         Array1D_string ComponentType;
     200             :         Array1D<SimAirServingZones::CompType> ComponentTypeEnum; // Parameterized (see above) Component Types this
     201             :         // module can address
     202             :         Array1D_int ComponentIndex; // Which one in list -- updated by routines called from here
     203             :         std::vector<HVACSystemData *> compPointer;
     204             :         Array1D_string ControllerName;
     205             :         Array1D_string ControllerType;
     206             :         Array1D_int ControllerIndex;    // Which one in list -- updated by routines called from here
     207             :         Array1D_int InletNodeNum;       // component inlet node number
     208             :         Array1D_int OutletNodeNum;      // component outlet node number
     209             :         bool HeatExchangerFlag = false; // True to have a heat exchanger in the equipment list
     210             :         int AirLoopDOASNum = -1;        // AirLoopHVAC:DedicatedOutdoorAirSystem number
     211             :     };
     212             : 
     213          24 :     struct AirLoopAFNData
     214             :     {
     215             :         // Members
     216             :         int LoopFanOperationMode = 0;           // OnOff fan operation mode
     217             :         Real64 LoopSystemOnMassFlowrate = 0.0;  // Loop mass flow rate during on cycle using an OnOff fan
     218             :         Real64 LoopSystemOffMassFlowrate = 0.0; // Loop mass flow rate during off cycle using an OnOff fan
     219             :         Real64 LoopOnOffFanPartLoadRatio = 0.0; // OnOff fan part load ratio
     220             :         Real64 LoopCompCycRatio = 0.0;          // Loop compressor cycling ratio for multispeed heat pump
     221             :         Real64 AFNLoopHeatingCoilMaxRTF = 0.0;  // Maximum run time fraction for electric or gas heating coil in an HVAC Air Loop
     222             :         Real64 AFNLoopOnOffFanRTF = 0.0;        // OnOff fan run time fraction in an HVAC Air Loop
     223             :         Real64 AFNLoopDXCoilRTF = 0.0;          // OnOff fan run time fraction in an HVAC Air Loop
     224             :     };
     225             : 
     226             : } // namespace DataAirLoop
     227             : 
     228        1542 : struct DataAirLoopData : BaseGlobalStruct
     229             : {
     230             : 
     231             :     int NumOASystems = 0;             // Number of Outdoor Air Systems
     232             :     bool AirLoopInputsFilled = false; // Set to TRUE after first pass through air loop
     233             :     Real64 LoopDXCoilRTF = 0.0;       // OnOff fan run time fraction in an HVAC Air Loop
     234             : 
     235             :     EPVector<DataAirLoop::AirLoopZoneEquipConnectData> AirToZoneNodeInfo;
     236             :     EPVector<DataAirLoop::AirLoopOutsideAirConnectData> AirToOANodeInfo;
     237             :     EPVector<DataAirLoop::DefinePriAirSysAvailMgrs> PriAirSysAvailMgr;
     238             :     EPVector<DataAirLoop::AirLooptoZoneData> AirLoopZoneInfo;
     239             :     EPVector<DataAirLoop::AirLoopControlData> AirLoopControlInfo;
     240             :     EPVector<DataAirLoop::AirLoopFlowData> AirLoopFlow;
     241             :     EPVector<DataAirLoop::OutsideAirSysProps> OutsideAirSys;
     242             :     EPVector<DataAirLoop::AirLoopAFNData> AirLoopAFNInfo;
     243             : 
     244           0 :     void clear_state() override
     245             :     {
     246           0 :         *this = DataAirLoopData();
     247           0 :     }
     248             : };
     249             : 
     250             : } // namespace EnergyPlus
     251             : 
     252             : #endif

Generated by: LCOV version 1.13