LCOV - code coverage report
Current view: top level - EnergyPlus - DataZoneEquipment.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 28 31 90.3 %
Date: 2024-08-23 23:50:59 Functions: 7 8 87.5 %

          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 DataZoneEquipment_hh_INCLUDED
      49             : #define DataZoneEquipment_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <unordered_set>
      53             : 
      54             : // ObjexxFCL Headers
      55             : #include <ObjexxFCL/Array1D.hh>
      56             : #include <ObjexxFCL/Optional.hh>
      57             : 
      58             : // EnergyPlus Headers
      59             : #include <EnergyPlus/Data/BaseData.hh>
      60             : #include <EnergyPlus/DataGlobals.hh>
      61             : #include <EnergyPlus/DataHVACSystems.hh>
      62             : #include <EnergyPlus/DataLoopNode.hh>
      63             : #include <EnergyPlus/DataZoneEnergyDemands.hh>
      64             : #include <EnergyPlus/EnergyPlus.hh>
      65             : #include <EnergyPlus/ExhaustAirSystemManager.hh>
      66             : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
      67             : #include <EnergyPlus/OutputProcessor.hh>
      68             : #include <EnergyPlus/SystemAvailabilityManager.hh>
      69             : #include <EnergyPlus/SystemReports.hh>
      70             : 
      71             : namespace EnergyPlus {
      72             : 
      73             : // Forward declarations
      74             : struct EnergyPlusData;
      75             : 
      76             : namespace DataZoneEquipment {
      77             : 
      78             :     // Using/Aliasing
      79             :     // Data
      80             :     // -only module should be available to other modules and routines.
      81             :     // Thus, all variables in this module must be PUBLIC.
      82             : 
      83             :     // MODULE PARAMETER DEFINITIONS:
      84             :     enum class AirNodeType
      85             :     {
      86             :         Invalid = -1,
      87             :         PathInlet,
      88             :         CompInlet,
      89             :         Intermediate,
      90             :         Outlet,
      91             :         Num
      92             :     };
      93             : 
      94             :     enum class AirLoopHVACZone
      95             :     {
      96             :         Invalid = -1,
      97             :         Splitter,
      98             :         SupplyPlenum,
      99             :         Mixer,
     100             :         ReturnPlenum,
     101             :         Num
     102             :     };
     103             : 
     104             :     constexpr std::array<std::string_view, static_cast<int>(AirLoopHVACZone::Num)> AirLoopHVACTypeNamesCC = {
     105             :         "AirLoopHVAC:ZoneSplitter", "AirLoopHVAC:SupplyPlenum", "AirLoopHVAC:ZoneMixer", "AirLoopHVAC:ReturnPlenum"};
     106             : 
     107             :     constexpr std::array<std::string_view, static_cast<int>(AirLoopHVACZone::Num)> AirLoopHVACTypeNamesUC = {
     108             :         "AIRLOOPHVAC:ZONESPLITTER", "AIRLOOPHVAC:SUPPLYPLENUM", "AIRLOOPHVAC:ZONEMIXER", "AIRLOOPHVAC:RETURNPLENUM"};
     109             : 
     110             :     // Start zone equip objects
     111             :     // list units that are valid for zone system availability managers first
     112             :     enum ZoneEquipType
     113             :     {
     114             :         Invalid = -1,
     115             :         DUMMY,
     116             :         FourPipeFanCoil,
     117             :         PackagedTerminalHeatPump,
     118             :         PackagedTerminalAirConditioner,
     119             :         PackagedTerminalHeatPumpWaterToAir,
     120             :         WindowAirConditioner,
     121             :         UnitHeater,
     122             :         UnitVentilator,
     123             :         EnergyRecoveryVentilator,
     124             :         VentilatedSlab,
     125             :         OutdoorAirUnit,
     126             :         VariableRefrigerantFlowTerminal,
     127             :         PurchasedAir,
     128             :         EvaporativeCooler,
     129             :         HybridEvaporativeCooler, // last zone equipment type to use zone availability manager. The above list must not change or
     130             :                                  // NumValidSysAvailZoneComponents must also change.
     131             :         AirDistributionUnit,
     132             :         BaseboardConvectiveWater,
     133             :         BaseboardConvectiveElectric,
     134             :         BaseboardSteam,
     135             :         BaseboardWater,
     136             :         BaseboardElectric,
     137             :         HighTemperatureRadiant,
     138             :         LowTemperatureRadiant,
     139             :         ExhaustFan,
     140             :         HeatExchanger,
     141             :         HeatPumpWaterHeater,
     142             :         DehumidifierDX,
     143             :         RefrigerationChillerSet,
     144             :         UserDefinedHVACForcedAir,
     145             :         CoolingPanel,
     146             :         UnitarySystem,
     147             :         AirTerminalDualDuctConstantVolume,
     148             :         AirTerminalDualDuctVAV,
     149             :         AirTerminalSingleDuctConstantVolumeReheat,
     150             :         AirTerminalSingleDuctConstantVolumeNoReheat,
     151             :         AirTerminalSingleDuctVAVReheat,
     152             :         AirTerminalSingleDuctVAVNoReheat,
     153             :         AirTerminalSingleDuctSeriesPIUReheat,
     154             :         AirTerminalSingleDuctParallelPIUReheat,
     155             :         AirTerminalSingleDuctCAVFourPipeInduction,
     156             :         AirTerminalSingleDuctVAVReheatVariableSpeedFan,
     157             :         AirTerminalSingleDuctVAVHeatAndCoolReheat,
     158             :         AirTerminalSingleDuctVAVHeatAndCoolNoReheat,
     159             :         AirTerminalSingleDuctConstantVolumeCooledBeam,
     160             :         AirTerminalDualDuctVAVOutdoorAir,
     161             :         AirLoopHVACReturnAir,
     162             :         Num
     163             :     };
     164             : 
     165             :     extern const std::array<std::string_view, static_cast<int>(ZoneEquipType::Num)> zoneEquipTypeNamesUC;
     166             : 
     167             :     constexpr int NumValidSysAvailZoneComponents(14);
     168             :     extern Array1D_string const cValidSysAvailManagerCompTypes;
     169             : 
     170             :     // Per Person Ventilation Rate Mode
     171             :     enum class PerPersonVentRateMode
     172             :     {
     173             :         Invalid = -1,
     174             :         DCVByCurrentLevel,
     175             :         ByDesignLevel,
     176             :         Num
     177             :     };
     178             : 
     179             :     enum class LoadDist
     180             :     {
     181             :         Invalid = -1,
     182             :         Sequential,
     183             :         Uniform,
     184             :         UniformPLR,
     185             :         SequentialUniformPLR,
     186             :         Num
     187             :     };
     188             : 
     189             :     enum class LightReturnExhaustConfig : int
     190             :     {
     191             :         Invalid = -1,
     192             :         NoExhast = 0, // No exhaust node
     193             :         Single = 1,   // One to one configuration
     194             :         Multi = 2,    // Multiple return node referred
     195             :         Shared = 3,   // Shared exhaust node
     196             :         Num
     197             :     };
     198             : 
     199             :     enum class ZoneEquipTstatControl
     200             :     {
     201             :         Invalid = -1,
     202             :         SingleSpace,
     203             :         Maximum,
     204             :         Ideal,
     205             :         Num
     206             :     };
     207             : 
     208             :     enum class SpaceEquipSizingBasis
     209             :     {
     210             :         Invalid = -1,
     211             :         DesignCoolingLoad,
     212             :         DesignHeatingLoad,
     213             :         FloorArea,
     214             :         Volume,
     215             :         PerimeterLength,
     216             :         Num
     217             :     };
     218             : 
     219             :     struct SubSubEquipmentData // data for an individual component
     220             :     {
     221             :         // Members
     222             :         std::string TypeOf; // The 'keyWord' identifying  component type
     223             :         std::string Name;   // Component name
     224             :         int EquipIndex;     // Component Index for routines
     225             :         bool ON;            // When true, the designated component or operation scheme is available
     226             :         int InletNodeNum;
     227             :         int OutletNodeNum;
     228             :         int NumMeteredVars;
     229             :         Array1D<OutputProcessor::MeterData> MeteredVar; // Index of energy output report data
     230             :         int EnergyTransComp;                            // 1=EnergyTransfer, 0=No EnergyTransfer  Flag needed for reporting
     231             :         int ZoneEqToPlantPtr;                           // 0=No plant loop connection, >=0 index to ZoneEqToPlant array
     232             :         int OpMode;
     233             :         Real64 Capacity;
     234             :         Real64 Efficiency;
     235             :         Real64 TotPlantSupplyElec;
     236             :         Real64 TotPlantSupplyGas;
     237             :         Real64 TotPlantSupplyPurch;
     238             : 
     239             :         // Default Constructor
     240        2594 :         SubSubEquipmentData()
     241        7782 :             : EquipIndex(0), ON(true), InletNodeNum(0), OutletNodeNum(0), NumMeteredVars(0), EnergyTransComp(0), ZoneEqToPlantPtr(0), OpMode(0),
     242        2594 :               Capacity(0.0), Efficiency(0.0), TotPlantSupplyElec(0.0), TotPlantSupplyGas(0.0), TotPlantSupplyPurch(0.0)
     243             :         {
     244        2594 :         }
     245             :     };
     246             : 
     247             :     struct SubEquipmentData // data for an individual component
     248             :     {
     249             :         // Members
     250             :         bool Parent; // When true, the designated component is made up of sub-components
     251             :         int NumSubSubEquip;
     252             :         std::string TypeOf; // The 'keyWord' identifying  component type
     253             :         std::string Name;   // Component name
     254             :         int EquipIndex;     // Component Index for routines
     255             :         bool ON;            // When true, the designated component or operation scheme is available
     256             :         int InletNodeNum;
     257             :         int OutletNodeNum;
     258             :         int NumMeteredVars;
     259             :         Array1D<OutputProcessor::MeterData> MeteredVar; // Index of energy output report data
     260             :         Array1D<SubSubEquipmentData> SubSubEquipData;   // Component list
     261             :         int EnergyTransComp;                            // 1=EnergyTransfer, 0=No EnergyTransfer  Flag needed for reporting
     262             :         int ZoneEqToPlantPtr;                           // 0=No plant loop connection, >0 index to ZoneEqToPlant array
     263             :         int OpMode;
     264             :         Real64 Capacity;
     265             :         Real64 Efficiency;
     266             :         Real64 TotPlantSupplyElec;
     267             :         Real64 TotPlantSupplyGas;
     268             :         Real64 TotPlantSupplyPurch;
     269             : 
     270             :         // Default Constructor
     271        4304 :         SubEquipmentData()
     272       12912 :             : Parent(false), NumSubSubEquip(0), EquipIndex(0), ON(true), InletNodeNum(0), OutletNodeNum(0), NumMeteredVars(0), EnergyTransComp(0),
     273        4304 :               ZoneEqToPlantPtr(0), OpMode(0), Capacity(0.0), Efficiency(0.0), TotPlantSupplyElec(0.0), TotPlantSupplyGas(0.0),
     274        4304 :               TotPlantSupplyPurch(0.0)
     275             :         {
     276        4304 :         }
     277             :     };
     278             : 
     279             :     struct AirIn
     280             :     {
     281             :         // Members
     282             :         int InNode;  // Air distribution unit inlet node
     283             :         int OutNode; // Air distribution unit Outlet node
     284             :         bool SupplyAirPathExists;
     285             :         int MainBranchIndex;
     286             :         int SupplyBranchIndex;
     287             :         int AirDistUnitIndex;          // equipment number in EquipList
     288             :         int TermUnitSizingIndex;       // Pointer to TermUnitSizing and TermUnitFinalZoneSizing data for this terminal unit
     289             :         int SupplyAirPathIndex;        // Pointer to SupplyAirPath serving this terminal unit
     290             :         int SupplyAirPathOutNodeIndex; // Pointer to SupplyAirPath OutletNode serving this terminal unit
     291             :         Array1D<SubSubEquipmentData> Coil;
     292             : 
     293             :         // Default Constructor
     294        8644 :         AirIn()
     295        8644 :             : InNode(0), OutNode(0), SupplyAirPathExists(false), MainBranchIndex(0), SupplyBranchIndex(0), AirDistUnitIndex(0),
     296        8644 :               TermUnitSizingIndex(0), SupplyAirPathIndex(0)
     297             :         {
     298        8644 :         }
     299             :     };
     300             : 
     301             :     struct EquipConfiguration
     302             :     {
     303             :         // Members
     304             :         std::string ZoneName;
     305             :         std::string EquipListName;
     306             :         int EquipListIndex;
     307             :         std::string ControlListName;
     308             :         int ZoneNode;
     309             :         int NumInletNodes;                    // number of inlet nodes
     310             :         int NumExhaustNodes;                  // number of exhaust nodes
     311             :         int NumReturnNodes;                   // number of return air nodes
     312             :         int NumReturnFlowBasisNodes;          // number of return air flow basis nodes
     313             :         int ReturnFlowSchedPtrNum;            // return air flow fraction schedule pointer
     314             :         bool FlowError;                       // flow error flag
     315             :         Array1D_int InletNode;                // zone supply air inlet nodes
     316             :         Array1D_int InletNodeAirLoopNum;      // air loop number connected to this inlet node (0 if not an airloop node)
     317             :         Array1D_int InletNodeADUNum;          // AirDistUnit connected to this inlet node (0 if not an ADU node, could be zone equip or direct air)
     318             :         Array1D_int ExhaustNode;              // zone air exhaust nodes
     319             :         Array1D_int ReturnNode;               // zone return air nodes (node numbers)
     320             :         Array1D_int ReturnNodeAirLoopNum;     // air loop number connected to this return node
     321             :         Array1D_int ReturnNodeRetPathNum;     // ReturnPath number connected to this return node
     322             :         Array1D_int ReturnNodeRetPathCompNum; // ReturnPath component number connected to this return node
     323             :         Array1D_int
     324             :             ReturnNodeInletNum; // zone supply air inlet index that matched this return node (same zone, same airloop) - not the inlet node number
     325             :         Array1D_bool FixedReturnFlow;         // true if return node is fixed and cannot be adjusted in CalcZoneReturnFlows
     326             :         Array1D_int ReturnNodePlenumNum;      // number of the return plenum attached to this return node (zero if none)
     327             :         Array1D_int ReturnFlowBasisNode;      // return air flow basis nodes
     328             :         Array1D_int ReturnNodeExhaustNodeNum; // Exhaust node number flow to a corrsponding return node due to light heat gain
     329             :         Array1D<LightReturnExhaustConfig>
     330             :             SharedExhaustNode; // Exhaust node number shared by return nodes 0 No exhaust; 1 No share; > 1 shared; -1 use the exhaust node value
     331             :         Array1D_int returnNodeSpaceMixerIndex; // index to SpaceHVAC:ZoneReturnMixer that feeds this return node (-1 if there is none)
     332             : 
     333             :         bool ZonalSystemOnly;     // TRUE if served by a zonal system (only)
     334             :         bool IsControlled;        // True when this is a controlled zone.
     335             :         Real64 ZoneExh;           // zone exhaust (unbalanced+balanced) mass flow rate [kg/s]
     336             :         Real64 ZoneExhBalanced;   // balanced zone exhaust mass flow rate [kg/s]
     337             :         Real64 PlenumMassFlow;    // zone air mass flow rate induced from plenum [kg/s]
     338             :         Real64 ExcessZoneExh;     // excess zone exhaust to be balanced by other zones (only used when !ZoneAirMassFlow.EnforceZoneMassBalance) [kg/s]
     339             :         Real64 TotAvailAirLoopOA; // total airloop OA available for systems serving this zone (used to apportion excess exhaust) [kg/s}
     340             :         Real64 TotInletAirMassFlowRate;   // total inlet node mass flow rate [kg/s]
     341             :         Real64 TotExhaustAirMassFlowRate; // total exhaust node mass flow rate [kg/s]
     342             :         // AirDistUnitCool and AirDistUnitHeat
     343             :         // do not correspond with the AIR DISTRIBUTION UNIT object in the zone equipment list.
     344             :         // AirDistUnitCool/AirDistUnitHeat, may represent a DIRECT AIR object,
     345             :         // or the cold/hot side of AIR DISTRIBUTION
     346             :         // UNIT object.  That is both AirDistUnitHeat and AirDistUnitCool are required to describe a dual
     347             :         // duct AIR DISTRIBUTION object in the ZoneEquipList.
     348             :         Array1D<AirIn> AirDistUnitHeat; // dimensioned to number of zone inlet nodes
     349             :         Array1D<AirIn> AirDistUnitCool; // dimensioned to number of zone inlet nodes.
     350             :         bool InFloorActiveElement;      // Convection adapation, true if zone has in-floor HVAC
     351             :         bool InWallActiveElement;       // Convection adapation, true if zone has in-wall HVAC
     352             :         bool InCeilingActiveElement;    // Convection adapation,
     353             :         // true when zone has in-ceiling HVAC
     354             :         bool ZoneHasAirLoopWithOASys; // true if zone is served by one or more airloops with an outdoor air system
     355             :         int ZoneAirDistributionIndex; // index to DesignSpecification:ZoneAirDistribution object
     356             :         int ZoneDesignSpecOAIndex;    // index to DesignSpecification:OutdoorAir object
     357             :         Real64 AirLoopDesSupply;      // air lood design supply air flow rate [kg/s]
     358             : 
     359             :         // Default Constructor
     360         798 :         EquipConfiguration()
     361         798 :             : ZoneName("Uncontrolled Zone"), EquipListIndex(0), ZoneNode(0), NumInletNodes(0), NumExhaustNodes(0), NumReturnNodes(0),
     362        1596 :               NumReturnFlowBasisNodes(0), ReturnFlowSchedPtrNum(0), FlowError(false), ZonalSystemOnly(false), IsControlled(false), ZoneExh(0.0),
     363         798 :               ZoneExhBalanced(0.0), PlenumMassFlow(0.0), ExcessZoneExh(0.0), TotAvailAirLoopOA(0.0), TotInletAirMassFlowRate(0.0),
     364        1596 :               TotExhaustAirMassFlowRate(0.0), InFloorActiveElement(false), InWallActiveElement(false), InCeilingActiveElement(false),
     365         798 :               ZoneHasAirLoopWithOASys(false), ZoneAirDistributionIndex(0), ZoneDesignSpecOAIndex(0), AirLoopDesSupply(0.0)
     366             :         {
     367         798 :         }
     368             : 
     369             :         void setTotalInletFlows(EnergyPlusData &state);
     370             : 
     371             :         void beginEnvirnInit(EnergyPlusData &state);
     372             : 
     373             :         void hvacTimeStepInit(EnergyPlusData &state, bool FirstHVACIteration);
     374             : 
     375             :         void calcReturnFlows(EnergyPlusData &state,
     376             :                              Real64 &ExpTotalReturnMassFlow,  // Expected total return air mass flow rate
     377             :                              Real64 &FinalTotalReturnMassFlow // Final total return air mass flow rate
     378             :         );
     379             :     };
     380             : 
     381             :     struct EquipmentData // data for an individual component
     382             :     {
     383             :         // Members
     384             :         bool Parent; // When true, the designated component is made up of sub-components
     385             :         int NumSubEquip;
     386             :         std::string TypeOf; // The 'keyWord' identifying  component type
     387             :         std::string Name;   // Component name
     388             :         bool ON;            // When true, the designated component or operation scheme is available
     389             :         int NumInlets;
     390             :         int NumOutlets;
     391             :         Array1D_int InletNodeNums;
     392             :         Array1D_int OutletNodeNums;
     393             :         int NumMeteredVars;
     394             :         Array1D<OutputProcessor::MeterData> MeteredVar; // Index of energy output report data
     395             :         Array1D<SubEquipmentData> SubEquipData;         // Component list
     396             :         int EnergyTransComp;                            // 1=EnergyTransfer, 0=No EnergyTransfer  Flag needed for reporting
     397             :         int ZoneEqToPlantPtr;                           // 0=No plant loop connection, >0 index to ZoneEqToPlant array
     398             :         Real64 TotPlantSupplyElec;
     399             :         Real64 TotPlantSupplyGas;
     400             :         Real64 TotPlantSupplyPurch;
     401             :         int OpMode;
     402             : 
     403             :         // Default Constructor
     404        4319 :         EquipmentData()
     405       17276 :             : Parent(false), NumSubEquip(0), ON(true), NumInlets(0), NumOutlets(0), NumMeteredVars(0), EnergyTransComp(0), ZoneEqToPlantPtr(0),
     406        4319 :               TotPlantSupplyElec(0.0), TotPlantSupplyGas(0.0), TotPlantSupplyPurch(0.0), OpMode(0)
     407             :         {
     408        4319 :         }
     409             :     };
     410             : 
     411             :     struct EquipList
     412             :     {
     413             :         // Members
     414             :         std::string Name;                                                                     // Name of the equipment list
     415             :         DataZoneEquipment::LoadDist LoadDistScheme = DataZoneEquipment::LoadDist::Sequential; // load distribution scheme
     416             :         int NumOfEquipTypes = 0;                                                              // Number of items on this list
     417             :         int NumAvailHeatEquip = 0;                                                            // Number of pieces of equipment available for heating
     418             :         int NumAvailCoolEquip = 0;                                                            // Number of pieces of equipment available for cooling
     419             :         Array1D_string EquipTypeName; // TODO: Convert this from string to enum and remove EquipTypeEnum below
     420             :         Array1D<DataZoneEquipment::ZoneEquipType> EquipType;
     421             :         Array1D_string EquipName;
     422             :         Array1D_int EquipIndex;
     423             :         EPVector<int> zoneEquipSplitterIndex; // index to SpaceHVAC:ZoneEquipmentSplitter, if any, for this equipment (0 base)
     424             :         // SystemAvailManagers need to know the index of specific equipment (e.g., PTAC as 1,2,3)
     425             :         // if UnitarySystem models PTAC, PTHP, UnitarySystems, then the index to a specific UnitarySystem is not the index to the PTAC
     426             :         std::vector<HVACSystemData *> compPointer;
     427             :         Array1D_int CoolingPriority;
     428             :         Array1D_int HeatingPriority;
     429             :         Array1D_int SequentialCoolingFractionSchedPtr;
     430             :         Array1D_int SequentialHeatingFractionSchedPtr;
     431             :         Array1D_int CoolingCapacity;      // Current cooling capacity (negative) [W]
     432             :         Array1D_int HeatingCapacity;      // Current heating capacity (positive) [W]
     433             :         Array1D<EquipmentData> EquipData; // Index of energy output report data
     434             : 
     435             :         void getPrioritiesForInletNode(EnergyPlusData &state,
     436             :                                        int inletNodeNum,     // Zone inlet node number to match
     437             :                                        int &coolingPriority, // Cooling priority num for matching equipment
     438             :                                        int &heatingPriority  // Heating priority num for matching equipment
     439             :         );
     440             : 
     441             :         Real64 SequentialHeatingFraction(EnergyPlusData &state, int equipNum);
     442             : 
     443             :         Real64 SequentialCoolingFraction(EnergyPlusData &state, int equipNum);
     444             :     };
     445             : 
     446             :     struct ZoneEquipSplitterMixerSpace
     447             :     {
     448             :         int spaceIndex = 0;    // Index to a space
     449             :         Real64 fraction = 0.0; // Fraction of equipment output or flow for this space
     450             :         int spaceNodeNum = 0;  // Space Inlet Node number (zero if not airflow equipment)
     451             :     };
     452             : 
     453             :     struct ZoneEquipmentSplitterMixer
     454             :     {
     455             :         std::string Name;
     456             :         DataLoopNode::ConnectionObjectType spaceEquipType = DataLoopNode::ConnectionObjectType::Invalid;
     457             :         DataZoneEquipment::SpaceEquipSizingBasis spaceSizingBasis = DataZoneEquipment::SpaceEquipSizingBasis::Invalid;
     458             :         std::vector<ZoneEquipSplitterMixerSpace> spaces;
     459             : 
     460             :         void size(EnergyPlusData &state);
     461             :     };
     462             : 
     463             :     struct ZoneEquipmentSplitter : ZoneEquipmentSplitterMixer
     464             :     {
     465             :         DataZoneEquipment::ZoneEquipType zoneEquipType = DataZoneEquipment::ZoneEquipType::Invalid;
     466             :         std::string zoneEquipName;
     467             :         int zoneEquipOutletNodeNum = 0;
     468             :         DataZoneEquipment::ZoneEquipTstatControl tstatControl = DataZoneEquipment::ZoneEquipTstatControl::Invalid;
     469             :         int controlSpaceIndex = 0;                                                 // Index to a space for the thermostat control space
     470             :         int controlSpaceNumber = 0;                                                // Control space number within the zone equipment splitter list
     471             :         DataZoneEnergyDemands::ZoneSystemSensibleDemand saveZoneSysSensibleDemand; // Save unadjusted zone sensible loads
     472             :         DataZoneEnergyDemands::ZoneSystemMoistureDemand saveZoneSysMoistureDemand; // Save unadjusted zone moisture loads
     473             : 
     474             :         void distributeOutput(EnergyPlusData &state,
     475             :                               int const zoneNum,
     476             :                               Real64 const sysOutputProvided,
     477             :                               Real64 const latOutputProvided,
     478             :                               Real64 const nonAirSysOutput,
     479             :                               int const equipTypeNum);
     480             : 
     481             :         void adjustLoads(EnergyPlusData &state, int zoneNum, int equipTypeNum);
     482             :     };
     483             : 
     484             :     struct ZoneMixer : ZoneEquipmentSplitterMixer
     485             :     {
     486             :         int outletNodeNum = 0;
     487             : 
     488             :         void setOutletConditions(EnergyPlusData &state);
     489             :     };
     490             : 
     491             :     struct ZoneEquipmentMixer : ZoneMixer
     492             :     {
     493             :         void setInletFlows(EnergyPlusData &state);
     494             :     };
     495             : 
     496             :     struct ZoneReturnMixer : ZoneMixer
     497             :     {
     498             :         void setInletConditions(EnergyPlusData &state);
     499             : 
     500             :         void setInletFlows(EnergyPlusData &state);
     501             :     };
     502             :     struct ControlList
     503             :     {
     504             :         // Members
     505             :         std::string Name;
     506             :         int NumOfControls;
     507             :         Array1D_string ControlType;
     508             :         Array1D_string ControlName;
     509             : 
     510             :         // Default Constructor
     511             :         ControlList() : NumOfControls(0)
     512             :         {
     513             :         }
     514             :     };
     515             : 
     516             :     struct SupplyAir
     517             :     {
     518             :         // Members
     519             :         std::string Name;
     520             :         int NumOfComponents;
     521             :         int InletNodeNum;
     522             :         Array1D_string ComponentType; // TODO: Convert this from string to enum and remove ComponentTypeEnum below
     523             :         Array1D<DataZoneEquipment::AirLoopHVACZone> ComponentTypeEnum;
     524             :         Array1D_string ComponentName;
     525             :         Array1D_int ComponentIndex;
     526             :         Array1D_int SplitterIndex;
     527             :         Array1D_int PlenumIndex;
     528             :         int NumOutletNodes;
     529             :         Array1D_int OutletNode;
     530             :         Array1D_int OutletNodeSupplyPathCompNum; // Index to the supply path ComponentName and ComponentType lists for this outlet node
     531             :         int NumNodes;
     532             :         Array1D_int Node;
     533             :         Array1D<DataZoneEquipment::AirNodeType> NodeType;
     534             : 
     535             :         // Default Constructor
     536         796 :         SupplyAir() : NumOfComponents(0), InletNodeNum(0), NumOutletNodes(0), NumNodes(0)
     537             :         {
     538         796 :         }
     539             :     };
     540             : 
     541             :     struct ReturnAir
     542             :     {
     543             :         // Members
     544             :         std::string Name;
     545             :         int NumOfComponents = 0;
     546             :         int OutletNodeNum = 0;        // Node num of return path outlet
     547             :         int OutletRetPathCompNum = 0; // Index to return path component number for outlet node
     548             :         Array1D_string ComponentType; // TODO: Convert this from string to enum and remove ComponentTypeEnum below
     549             :         Array1D<DataZoneEquipment::AirLoopHVACZone> ComponentTypeEnum;
     550             :         Array1D_string ComponentName;
     551             :         Array1D_int ComponentIndex;
     552             :     };
     553             : 
     554             :     void GetZoneEquipmentData(EnergyPlusData &state);
     555             : 
     556             :     void processZoneEquipmentInput(EnergyPlusData &state,
     557             :                                    std::string_view zoneEqModuleObject,
     558             :                                    int const zoneOrSpaceNum,
     559             :                                    bool const isSpace,
     560             :                                    int &locTermUnitSizingCounter,
     561             :                                    int &overallEquipCount,
     562             :                                    DataZoneEquipment::EquipConfiguration &thisEquipConfig,
     563             :                                    Array1D_string &AlphArray,
     564             :                                    Array1D_string &cAlphaFields, // Alpha field names
     565             :                                    Array1D_bool &lAlphaBlanks,   // Logical array, alpha field input BLANK = .TRUE.
     566             :                                    Array1D_int &NodeNums);
     567             : 
     568             :     void processZoneEquipSplitterInput(EnergyPlusData &state,
     569             :                                        std::string_view zeqSplitterModuleObject,
     570             :                                        int const zeqSplitterNum,
     571             :                                        int const zoneNum,
     572             :                                        InputProcessor::json const objectSchemaProps,
     573             :                                        InputProcessor::json const objectFields,
     574             :                                        DataZoneEquipment::ZoneEquipmentSplitter &thisZeqSplitter);
     575             : 
     576             :     void processZoneEquipMixerInput(EnergyPlusData &state,
     577             :                                     std::string_view zeqMixerModuleObject,
     578             :                                     int const zoneNum,
     579             :                                     InputProcessor::json const objectSchemaProps,
     580             :                                     InputProcessor::json const objectFields,
     581             :                                     DataZoneEquipment::ZoneEquipmentMixer &thisZeqMixer);
     582             : 
     583             :     void processZoneReturnMixerInput(EnergyPlusData &state,
     584             :                                      std::string_view zeqMixerModuleObject,
     585             :                                      int const zoneNum,
     586             :                                      InputProcessor::json const objectSchemaProps,
     587             :                                      InputProcessor::json const objectFields,
     588             :                                      int mixerIndex);
     589             : 
     590             :     bool CheckZoneEquipmentList(EnergyPlusData &state,
     591             :                                 std::string_view ComponentType, // Type of component
     592             :                                 std::string_view ComponentName, // Name of component
     593             :                                 ObjexxFCL::Optional_int CtrlZoneNum = _);
     594             : 
     595             :     int GetControlledZoneIndex(EnergyPlusData &state, std::string const &ZoneName); // Zone name to match into Controlled Zone structure
     596             : 
     597             :     int FindControlledZoneIndexFromSystemNodeNumberForZone(EnergyPlusData &state,
     598             :                                                            int TrialZoneNodeNum); // Node number to match into Controlled Zone structure
     599             : 
     600             :     int GetSystemNodeNumberForZone(EnergyPlusData &state, int const zoneNum);
     601             : 
     602             :     int GetReturnAirNodeForZone(EnergyPlusData &state,
     603             :                                 int const zoneNum,
     604             :                                 std::string const &NodeName,             // Return air node name to match (may be blank)
     605             :                                 std::string const &calledFromDescription // String identifying the calling function and object
     606             :     );
     607             : 
     608             :     int GetReturnNumForZone(EnergyPlusData &state,
     609             :                             int const zoneNum,
     610             :                             std::string const &NodeName // Return air node name to match (may be blank)
     611             :     );
     612             : 
     613             :     int GetZoneEquipControlledZoneNum(EnergyPlusData &state, DataZoneEquipment::ZoneEquipType const ZoneEquipType, std::string const &EquipmentName);
     614             : 
     615             :     bool VerifyLightsExhaustNodeForZone(EnergyPlusData &state, int const ZoneNum, int const ZoneExhaustNodeNum);
     616             : 
     617             :     void CheckSharedExhaust(EnergyPlusData &state);
     618             : 
     619             :     void scaleInletFlows(EnergyPlusData &state, int const zoneNodeNum, int const spaceNodeNum, Real64 const frac);
     620             : 
     621             : } // namespace DataZoneEquipment
     622             : 
     623             : struct DataZoneEquipmentData : BaseGlobalStruct
     624             : {
     625             : 
     626             :     bool GetZoneEquipmentDataErrorsFound = false;
     627             :     int GetZoneEquipmentDataFound = 0;
     628             :     int NumSupplyAirPaths = 0;
     629             :     int NumReturnAirPaths = 0;
     630             :     int NumExhaustAirSystems = 0;
     631             :     int NumZoneExhaustControls = 0;
     632             :     bool ZoneEquipInputsFilled = false;
     633             :     bool ZoneEquipSimulatedOnce = false;
     634             :     int NumOfZoneEquipLists = 0;
     635             :     Array1D<Avail::Status> ZoneEquipAvail;
     636             :     Array1D<DataZoneEquipment::EquipConfiguration> ZoneEquipConfig;
     637             :     Array1D<DataZoneEquipment::EquipConfiguration> spaceEquipConfig;
     638             :     std::unordered_set<std::string> UniqueZoneEquipListNames;
     639             :     Array1D<DataZoneEquipment::EquipList> ZoneEquipList;
     640             :     Array1D<DataZoneEquipment::SupplyAir> SupplyAirPath;
     641             :     Array1D<DataZoneEquipment::ReturnAir> ReturnAirPath;
     642             :     Array1D<ExhaustAirSystemManager::ExhaustAir> ExhaustAirSystem;
     643             :     Array1D<ExhaustAirSystemManager::ZoneExhaustControl> ZoneExhaustControlSystem; // 2022-01: maybe a better name?
     644             :     std::vector<DataZoneEquipment::ZoneEquipmentSplitter> zoneEquipSplitter;
     645             :     std::vector<DataZoneEquipment::ZoneEquipmentMixer> zoneEquipMixer;
     646             :     std::vector<DataZoneEquipment::ZoneReturnMixer> zoneReturnMixer;
     647             : 
     648         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     649             :     {
     650         796 :     }
     651             : 
     652           0 :     void clear_state() override
     653             :     {
     654           0 :         new (this) DataZoneEquipmentData();
     655           0 :     }
     656             : };
     657             : 
     658             : } // namespace EnergyPlus
     659             : 
     660             : #endif

Generated by: LCOV version 1.14