LCOV - code coverage report
Current view: top level - EnergyPlus - MixedAir.hh (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 100.0 % 31 31
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 3 3

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, 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 MixedAir_hh_INCLUDED
      49              : #define MixedAir_hh_INCLUDED
      50              : 
      51              : // C++ Headers
      52              : #include <unordered_set>
      53              : 
      54              : // ObjexxFCL Headers
      55              : #include <ObjexxFCL/Array1D.hh>
      56              : 
      57              : // EnergyPlus Headers
      58              : #include <EnergyPlus/Data/BaseData.hh>
      59              : #include <EnergyPlus/DataAirLoop.hh>
      60              : // #include <EnergyPlus/DataGlobals.hh>
      61              : #include <EnergyPlus/DataHVACGlobals.hh>
      62              : #include <EnergyPlus/DataSizing.hh>
      63              : #include <EnergyPlus/EPVector.hh>
      64              : #include <EnergyPlus/EnergyPlus.hh>
      65              : #include <EnergyPlus/SimAirServingZones.hh>
      66              : 
      67              : namespace EnergyPlus {
      68              : 
      69              : // Forward declarations
      70              : struct EnergyPlusData;
      71              : 
      72              : namespace MixedAir {
      73              : 
      74              :     // Data
      75              :     // MODULE PARAMETER DEFINITIONS
      76              : 
      77              :     enum class LockoutType
      78              :     {
      79              :         Invalid = -1,
      80              :         NoLockoutPossible,
      81              :         LockoutWithHeatingPossible,
      82              :         LockoutWithCompressorPossible,
      83              :         Num
      84              :     };
      85              : 
      86              :     enum class EconoOp
      87              :     {
      88              :         Invalid = -1,
      89              :         NoEconomizer,
      90              :         FixedDryBulb,
      91              :         FixedEnthalpy,
      92              :         DifferentialDryBulb,
      93              :         DifferentialEnthalpy,
      94              :         FixedDewPointAndDryBulb,
      95              :         ElectronicEnthalpy,
      96              :         DifferentialDryBulbAndEnthalpy,
      97              :         Num
      98              :     };
      99              : 
     100              :     enum class MixedAirControllerType
     101              :     {
     102              :         Invalid = -1,
     103              :         ControllerOutsideAir,
     104              :         ControllerStandAloneERV,
     105              :         Num,
     106              :     };
     107              : 
     108              :     // Parameters below (CMO - Current Module Object.  used primarily in Get Inputs)
     109              :     // Multiple Get Input routines in this module or these would be in individual routines.
     110              :     enum class CMO
     111              :     {
     112              :         Invalid = -1,
     113              :         None,
     114              :         OASystem,
     115              :         AirLoopEqList,
     116              :         ControllerList,
     117              :         SysAvailMgrList,
     118              :         OAController,
     119              :         ERVController,
     120              :         MechVentilation,
     121              :         OAMixer,
     122              :         Num,
     123              :     };
     124              : 
     125              :     // OA Controller Limiting Factor
     126              :     // Must keep these values to use for integer output variable OAControllerProps::OALimitingFactorReport
     127              :     enum class OALimitFactor
     128              :     {
     129              :         Invalid = -1,
     130              :         None = 0,        // No limit other than fixed OA amount
     131              :         Limits = 1,      // Limits and scheduled limits
     132              :         Economizer = 2,  // Economizer operation
     133              :         Exhaust = 3,     // Exhaust flow
     134              :         MixedAir = 4,    // Mixed air flow rate
     135              :         HighHum = 5,     // High humidity economizer control
     136              :         DCV = 6,         // Demand-controlled ventilation
     137              :         NightVent = 7,   // Night ventilation
     138              :         DemandLimit = 8, // Demand-limiting
     139              :         EMS = 9,         // EMS override
     140              :         Num
     141              :     };
     142              : 
     143              :     extern const std::array<std::string_view, static_cast<int>(CMO::Num)> CurrentModuleObjects;
     144              : 
     145              :     struct ControllerListProps
     146              :     {
     147              :         // Members
     148              :         std::string Name;
     149              :         int NumControllers = 0; // number of controllers on list
     150              :         EPVector<DataAirLoop::ControllerKind> ControllerType;
     151              :         Array1D_string ControllerName;
     152              :     };
     153              : 
     154              :     struct OAControllerProps // Derived type for Outside Air Controller data
     155              :     {
     156              :         // Members
     157              :         std::string Name;
     158              :         MixedAirControllerType ControllerType = MixedAirControllerType::Invalid; // Mixed air controller type
     159              :         LockoutType Lockout = LockoutType::NoLockoutPossible;                    // 0=NoLockoutPossible; 1=LockoutWithHeatingPossible;
     160              :         // 2=LockoutWithCompressorPossible;
     161              :         bool FixedMin = true;                  // Fixed Minimum or Proportional Minimum
     162              :         Real64 TempLim = 0.0;                  // Temperature Limit
     163              :         Real64 TempLowLim = 0.0;               // Temperature Lower Limit
     164              :         Real64 EnthLim = 0.0;                  // Enthalpy Limit
     165              :         Real64 DPTempLim = 0.0;                // Dew Point Temperature Limit
     166              :         int EnthalpyCurvePtr = 0;              // Electronic Enthalpy Curve Index (max HumRat = f[OAT])
     167              :         Real64 MinOA = 0.0;                    // Minimum outside air flow (m3/sec)
     168              :         Real64 MaxOA = 0.0;                    // Maximum outside air flow (m3/sec)
     169              :         EconoOp Econo = EconoOp::NoEconomizer; // 0 = NoEconomizer, 1 = FixedDryBulb, 2 = FixedEnthalpy, 3=DifferentialDryBulb,
     170              :         // 4=DifferentialEnthalpy, 5=FixedDewPointAndDryBulb, 6 = ElectronicEnthalpy,
     171              :         // 7 =DifferentialDryBulbAndEnthalpy
     172              :         bool EconBypass = false;               // ModulateFlow =FALSE , MinimumFlowWithBypass =TRUE
     173              :         int MixNode = 0;                       // Controlled node (mixed air node)
     174              :         int OANode = 0;                        // Actuated node (outside air node)
     175              :         int InletNode = 0;                     // Inlet Air Node for into Mixer  (BTG Nov 2004)
     176              :         int RelNode = 0;                       // Relief Air Node Number
     177              :         int RetNode = 0;                       // Return Air Node Number
     178              :         Sched::Schedule *minOASched = nullptr; // minimum outside air schedule
     179              :         Real64 RelMassFlow = 0.0;
     180              :         Real64 OAMassFlow = 0.0;
     181              :         Real64 ExhMassFlow = 0.0;
     182              :         Real64 MixMassFlow = 0.0;
     183              :         Real64 InletTemp = 0.0;
     184              :         Real64 InletEnth = 0.0;
     185              :         Real64 InletPress = 0.0;
     186              :         Real64 InletHumRat = 0.0;
     187              :         Real64 OATemp = 0.0;
     188              :         Real64 OAEnth = 0.0;
     189              :         Real64 OAPress = 0.0;
     190              :         Real64 OAHumRat = 0.0;
     191              :         Real64 RetTemp = 0.0;
     192              :         Real64 RetEnth = 0.0;
     193              :         Real64 MixSetTemp = 0.0;
     194              :         Real64 MinOAMassFlowRate = 0.0; // Minimum outside air flow (kg/s)
     195              :         Real64 MaxOAMassFlowRate = 0.0; // Maximum outside air flow (kg/s)
     196              :         Real64 RelTemp = 0.0;
     197              :         Real64 RelEnth = 0.0;
     198              :         Real64 RelSensiLossRate = 0.0; // Heat lost to ambient from relief air (W)
     199              :         Real64 RelLatentLossRate = 0.0;
     200              :         Real64 RelTotalLossRate = 0.0;
     201              : 
     202              :         int ZoneEquipZoneNum = 0;
     203              :         std::string VentilationMechanicalName;   // Name of ventilation:mechanical object used for DCV
     204              :         int VentMechObjectNum = 0;               // Index to VENTILATION:MECHANICAL object for this controller
     205              :         int HumidistatZoneNum = 0;               // zone number where humidistat is located
     206              :         int NodeNumofHumidistatZone = 0;         // node number of zone where humidistat is located
     207              :         Real64 HighRHOAFlowRatio = 1.0;          // Modify ratio with respect to maximum outdoor air flow rate (high RH)
     208              :         bool ModifyDuringHighOAMoisture = false; // flag to Modify outdoor air flow, TRUE when modify any time, FALSE when modify only when indoor air
     209              :                                                  // humrat is less than outdoor HR
     210              :         Sched::Schedule *economizerOASched = nullptr; // schedule to modify outdoor air flow
     211              :         Sched::Schedule *minOAflowSched = nullptr;    // Index to the Minimum Fraction of Outdoor Air Schedule
     212              :         Sched::Schedule *maxOAflowSched = nullptr;    // Index to the Maximum Fraction of Outdoor Air Schedule
     213              :         //   Economizer Status, which is currently following the EconomizerOperationFlag, might be something like "Economizer status
     214              :         //   indicates when the conditions are favorable for the economizer to operate (i.e., none of the control limits have been exceeded).
     215              :         //   While this status signal indicates favorable conditions for economizer operation, it does not guarantee that the air-side
     216              :         //   economizer has increased outdoor air flow above the minimum level since the actual outdoor air flow rate is also governed
     217              :         //   by other controls (e.g., mixed air setpoint temperature, time of day economizer control, etc.).
     218              :         int EconomizerStatus = 0;             // Air Economizer status (1 = on, 0 = off or economizer not exists)
     219              :         int HeatRecoveryBypassStatus = 0;     // OA Sys Heat Recovery Bypass status (1 = on, 0 = off or economizer not exists)
     220              :         int HRHeatingCoilActive = 0;          // OA Sys Heat Recovery Heating Coil Was Active status (1 = on, 0 = off)
     221              :         Real64 MixedAirTempAtMinOAFlow = 0.0; // calculated mixed air temp at min flow rate when using special HX bypass control
     222              :         int HighHumCtrlStatus = 0;            // High Humidity Control status (1 = on, 0 = off or high hum ctrl not used)
     223              :         Real64 OAFractionRpt = 0.0;           // Actual outdoor air fraction for reporting (based on mixed air flow rate),
     224              :         // 0 to 1 (normally)
     225              :         Real64 MinOAFracLimit = 0.0;            // Minimum OA fraction limit
     226              :         Real64 MechVentOAMassFlowRequest = 0.0; // outside air mass flow rate calculated by mechanical ventilation object [kg/s]
     227              :         bool EMSOverrideOARate = false;         // if true, EMS is calling to override OA rate
     228              :         Real64 EMSOARateValue = 0.0;            // Value EMS is directing to use. [kg/s]
     229              :         int HeatRecoveryBypassControlType = HVAC::BypassWhenWithinEconomizerLimits; // User input selects type of heat recovery optimization
     230              :         HVAC::EconomizerStagingType EconomizerStagingType =
     231              :             HVAC::EconomizerStagingType::InterlockedWithMechanicalCooling; // User input select type of economizer staging operation
     232              :         bool ManageDemand = false;                                         // Used by demand manager to manage ventilation
     233              :         Real64 DemandLimitFlowRate = 0.0;                                  // Current demand limit if demand manager is ON
     234              :         Real64 MaxOAFracBySetPoint = 0.0;                                  // The maximum OA fraction due to freezing cooling coil check
     235              :         int MixedAirSPMNum = 0;                                            // index of mixed air setpoint manager
     236              :         bool CoolCoilFreezeCheck = false;                        // if true, cooling coil freezing is prevented by recalculating the amount of OA
     237              :         bool EconoActive = false;                                // if true economizer is active
     238              :         bool HighHumCtrlActive = false;                          // if true high humidity control is active
     239              :         Array1D_int EconmizerFaultNum;                           // index to economizer fault
     240              :         int NumFaultyEconomizer = 0;                             // total number of economizer faults
     241              :         int CountMechVentFrac = 0;                               // Count when OA min fraction > mech vent fraction
     242              :         int IndexMechVentFrac = 0;                               // Index when OA min fraction > mech vent fraction
     243              :         OALimitFactor OALimitingFactor = OALimitFactor::Invalid; // OA controller limiting factor
     244              :         int OALimitingFactorReport = 0;                          // OA controller limiting factor - integer for reporting
     245              : 
     246              :         void CalcOAController(EnergyPlusData &state, int AirLoopNum, bool FirstHVACIteration);
     247              : 
     248              :         void CalcOAEconomizer(
     249              :             EnergyPlusData &state, int AirLoopNum, Real64 OutAirMinFrac, Real64 &OASignal, bool &HighHumidityOperationFlag, bool FirstHVACIteration);
     250              : 
     251              :         void SizeOAController(EnergyPlusData &state);
     252              : 
     253              :         void UpdateOAController(EnergyPlusData &state);
     254              : 
     255              :         void Checksetpoints(EnergyPlusData &state,
     256              :                             Real64 OutAirMinFrac,         // Local variable used to calculate min OA fraction
     257              :                             Real64 &OutAirSignal,         // Used to set OA mass flow rate
     258              :                             bool &EconomizerOperationFlag // logical used to show economizer status
     259              :         );
     260              :     };
     261              : 
     262              :     struct VentilationMechanicalZoneProps
     263              :     {
     264              :         std::string name;                                   // name of mech vent zone
     265              :         int zoneNum = 0;                                    // Actual zones number
     266              :         int ZoneDesignSpecOAObjIndex = 0;                   // index of the design specification outdoor air object for each zone
     267              :         Real64 ZoneADEffCooling = 1.0;                      // Zone air distribution effectiveness in cooling mode for each zone
     268              :         Real64 ZoneADEffHeating = 1.0;                      // Zone air distribution effectiveness in heating mode for each zone
     269              :         Sched::Schedule *zoneADEffSched = nullptr;          // air distribution effectiveness schedule for each zone
     270              :         int ZoneDesignSpecADObjIndex = 0;                   // index of the design specification zone air distribution object for each zone
     271              :         Real64 ZoneSecondaryRecirculation = 0.0;            // zone air secondary recirculation ratio for each zone
     272              :         Sched::Schedule *zoneOASched = nullptr;             // Outdoor air schedule for each zone (from DesignSpecification:OutdoorAir or default)
     273              :         Sched::Schedule *zonePropCtlMinRateSched = nullptr; // Outdoor design OA flow rate schedule from DesignSpecification:OutdoorAir
     274              :         Real64 zoneOABZ = 0.0;                              // Zone breathing-zone OA flow rate [m3/s]
     275              :         EPVector<int> peopleIndexes; // List of People objects in this zone (for SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc)
     276              :     };
     277              : 
     278              :     struct VentilationMechanicalProps // Derived type for Ventilation:Mechanical data
     279              :     {
     280              :         // Members
     281              :         std::string Name;                                                          // Name of Ventilation:Mechanical object
     282              :         Sched::Schedule *availSched = nullptr;                                     // Mechanical ventilation schedule
     283              :         bool DCVFlag = false;                                                      // if true, implement OA based on demand controlled ventilation
     284              :         int NumofVentMechZones = 0;                                                // Number of zones with mechanical ventilation
     285              :         DataSizing::SysOAMethod SystemOAMethod = DataSizing::SysOAMethod::Invalid; // System Outdoor Air Method - SOAM_ZoneSum, SOAM_VRP, SOAM_VRPL
     286              :         Real64 ZoneMaxOAFraction = 1.0;                                            // Zone maximum outdoor air fraction
     287              :         int CO2MaxMinLimitErrorCount = 0; // Counter when max CO2 concentration < min CO2 concentration for SOAM_ProportionalControlSchOcc
     288              :         int CO2MaxMinLimitErrorIndex = 0; // Index for max CO2 concentration < min CO2 concentration recurring error message for
     289              :                                           // SOAM_ProportionalControlSchOcc
     290              :         int CO2GainErrorCount = 0;        // Counter when CO2 generation from people is zero for SOAM_ProportionalControlSchOcc
     291              :         int CO2GainErrorIndex = 0; // Index for recurring error message when CO2 generation from people is zero for SOAM_ProportionalControlSchOcc
     292              :         int OAMaxMinLimitErrorCount = 0; // Counter when max OA < min OA for SOAM_ProportionalControlDesOARate
     293              :         int OAMaxMinLimitErrorIndex = 0; // Index for max OA < min OA recurring error message for SOAM_ProportionalControlDesOARate
     294              :         Real64 Ep = 1.0;                 // zone primary air fraction
     295              :         Real64 Er = 0.0;                 // zone secondary recirculation fraction
     296              :         Real64 Fa = 1.0;                 // temporary variable used in multi-path VRP calc
     297              :         Real64 Fb = 1.0;
     298              :         Real64 Fc = 1.0;
     299              :         Real64 Xs = 1.0;       // uncorrected system outdoor air fraction
     300              :         Real64 Evz = 1.0;      // zone ventilation efficiency
     301              :         Real64 SysDesOA = 0.0; // System design OA
     302              :         EPVector<VentilationMechanicalZoneProps> VentMechZone;
     303              : 
     304              :         Real64 CalcMechVentController(EnergyPlusData &state,
     305              :                                       Real64 SysSA // System supply air mass flow rate [kg/s]
     306              :         );
     307              :     };
     308              : 
     309              :     struct OAMixerProps // Derived type for Outside Air Mixing Component
     310              :     {
     311              :         // Members
     312              :         std::string Name;
     313              :         int MixerIndex = 0; // Set on first call...
     314              :         int MixNode = 0;    // Outlet node - mixed air
     315              :         int InletNode = 0;  // Inlet node for outside air stream (Nov. 2004 BTG was OANode )
     316              :         int RelNode = 0;    // Outlet node - relief air
     317              :         int RetNode = 0;    // Inlet node - return air
     318              :         Real64 MixTemp = 0.0;
     319              :         Real64 MixHumRat = 0.0;
     320              :         Real64 MixEnthalpy = 0.0;
     321              :         Real64 MixPressure = 0.0;
     322              :         Real64 MixMassFlowRate = 0.0;
     323              :         Real64 OATemp = 0.0;
     324              :         Real64 OAHumRat = 0.0;
     325              :         Real64 OAEnthalpy = 0.0;
     326              :         Real64 OAPressure = 0.0;
     327              :         Real64 OAMassFlowRate = 0.0;
     328              :         Real64 RelTemp = 0.0;
     329              :         Real64 RelHumRat = 0.0;
     330              :         Real64 RelEnthalpy = 0.0;
     331              :         Real64 RelPressure = 0.0;
     332              :         Real64 RelMassFlowRate = 0.0;
     333              :         Real64 RetTemp = 0.0;
     334              :         Real64 RetHumRat = 0.0;
     335              :         Real64 RetEnthalpy = 0.0;
     336              :         Real64 RetPressure = 0.0;
     337              :         Real64 RetMassFlowRate = 0.0;
     338              : 
     339              :         void InitOAMixer(EnergyPlusData &state);
     340              : 
     341              :         void CalcOAMixer(EnergyPlusData &state);
     342              : 
     343              :         void UpdateOAMixer(EnergyPlusData &state) const;
     344              :     };
     345              : 
     346              :     // Functions
     347              : 
     348              :     Real64 OAGetFlowRate(EnergyPlusData &state, int OAPtr);
     349              : 
     350              :     Real64 OAGetMinFlowRate(EnergyPlusData &state, int OAPtr);
     351              : 
     352              :     void OASetDemandManagerVentilationState(EnergyPlusData &state, int OAPtr, bool aState);
     353              : 
     354              :     void OASetDemandManagerVentilationFlow(EnergyPlusData &state, int OAPtr, Real64 aFlow);
     355              : 
     356              :     int GetOAController(EnergyPlusData &state, std::string const &OAName);
     357              : 
     358              :     void ManageOutsideAirSystem(EnergyPlusData &state, std::string const &OASysName, bool FirstHVACIteration, int AirLoopNum, int &OASysNum);
     359              : 
     360              :     void SimOutsideAirSys(EnergyPlusData &state, int OASysNum, bool FirstHVACIteration, int AirLoopNum);
     361              : 
     362              :     void SimOASysComponents(EnergyPlusData &state, int OASysNum, bool FirstHVACIteration, int AirLoopNum);
     363              : 
     364              :     void SimOAComponent(EnergyPlusData &state,
     365              :                         std::string const &CompType,              // the component type
     366              :                         std::string const &CompName,              // the component Name
     367              :                         SimAirServingZones::CompType CompTypeNum, // Component Type -- Integerized for this module
     368              :                         bool FirstHVACIteration,
     369              :                         int &CompIndex,
     370              :                         int AirLoopNum,      // air loop index for economizer lockout coordination
     371              :                         bool Sim,            // if TRUE, simulate component; if FALSE, just set the coil exisitence flags
     372              :                         int OASysNum,        // index to outside air system
     373              :                         bool &OAHeatingCoil, // TRUE indicates a heating coil has been found
     374              :                         bool &OACoolingCoil, // TRUE indicates a cooling coil has been found
     375              :                         bool &OAHX);         // TRUE indicates a heat exchanger has been found
     376              : 
     377              :     void SimOAMixer(EnergyPlusData &state, std::string const &CompName, int &CompIndex);
     378              : 
     379              :     void SimOAController(EnergyPlusData &state, std::string const &CtrlName, int &CtrlIndex, bool FirstHVACIteration, int AirLoopNum);
     380              : 
     381              :     void GetOutsideAirSysInputs(EnergyPlusData &state);
     382              : 
     383              :     void GetOAControllerInputs(EnergyPlusData &state);
     384              : 
     385              :     void AllocateOAControllers(EnergyPlusData &state);
     386              : 
     387              :     void GetOAMixerInputs(EnergyPlusData &state);
     388              : 
     389              :     void ProcessOAControllerInputs(EnergyPlusData &state,
     390              :                                    std::string_view CurrentModuleObject,
     391              :                                    int OutAirNum,
     392              :                                    Array1D_string const &AlphArray,
     393              :                                    int const NumAlphas,
     394              :                                    Array1D<Real64> const &NumArray,
     395              :                                    int const NumNums,
     396              :                                    Array1D_bool const &lNumericBlanks, // Unused
     397              :                                    Array1D_bool const &lAlphaBlanks,
     398              :                                    Array1D_string const &cAlphaFields,
     399              :                                    Array1D_string const &cNumericFields, // Unused
     400              :                                    bool &ErrorsFound                     // If errors found in input
     401              :     );
     402              : 
     403              :     void InitOutsideAirSys(EnergyPlusData &state, int OASysNum, int AirLoopNum);
     404              : 
     405              :     void InitOAController(EnergyPlusData &state, int OAControllerNum, bool FirstHVACIteration, int AirLoopNum);
     406              : 
     407              :     Array1D_int GetOAMixerNodeNumbers(EnergyPlusData &state,
     408              :                                       std::string const &OAMixerName, // must match OA mixer names for the OA mixer type
     409              :                                       bool &ErrorsFound               // set to true if problem
     410              :     );
     411              : 
     412              :     int GetNumOAMixers(EnergyPlusData &state);
     413              : 
     414              :     int GetNumOAControllers(EnergyPlusData &state);
     415              : 
     416              :     int GetOAMixerReliefNodeNumber(EnergyPlusData &state, int OAMixerNum); // Which Mixer
     417              : 
     418              :     int GetOASysControllerListIndex(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     419              : 
     420              :     int GetOASysNumSimpControllers(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     421              : 
     422              :     int GetOASysNumHeatingCoils(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     423              : 
     424              :     int GetOASysNumHXs(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     425              : 
     426              :     int GetOASysNumCoolingCoils(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     427              : 
     428              :     int GetOASystemNumber(EnergyPlusData &state, std::string const &OASysName); // OA Sys Name
     429              : 
     430              :     int FindOAMixerMatchForOASystem(EnergyPlusData &state, int OASysNumber); // Which OA System
     431              : 
     432              :     int GetOAMixerIndex(EnergyPlusData &state, std::string const &OAMixerName); // Which Mixer
     433              : 
     434              :     int GetOAMixerInletNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     435              : 
     436              :     int GetOAMixerReturnNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     437              : 
     438              :     int GetOAMixerMixedNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     439              : 
     440              :     bool CheckForControllerWaterCoil(EnergyPlusData &state,
     441              :                                      DataAirLoop::ControllerKind ControllerType, // should be passed in as UPPERCASE
     442              :                                      std::string const &ControllerName           // should be passed in as UPPERCASE
     443              :     );
     444              : 
     445              :     void CheckControllerLists(EnergyPlusData &state, bool &ErrFound);
     446              : 
     447              :     void CheckOAControllerName(
     448              :         EnergyPlusData &state, std::string &OAControllerName, std::string const &ObjectType, std::string const &FieldName, bool &ErrorsFound);
     449              : 
     450              :     int GetNumOASystems(EnergyPlusData &state);
     451              : 
     452              :     int GetOACompListNumber(EnergyPlusData &state, int OASysNum); // OA Sys Number
     453              : 
     454              :     std::string GetOACompName(EnergyPlusData &state,
     455              :                               int OASysNum, // OA Sys Number
     456              :                               int InListNum // In-list Number
     457              :     );
     458              : 
     459              :     std::string GetOACompType(EnergyPlusData &state,
     460              :                               int OASysNum, // OA Sys Number
     461              :                               int InListNum // In-list Number
     462              :     );
     463              : 
     464              :     SimAirServingZones::CompType GetOACompTypeNum(EnergyPlusData &state,
     465              :                                                   int OASysNum, // OA Sys Number
     466              :                                                   int InListNum // In-list Number
     467              :     );
     468              : 
     469              :     int GetOAMixerNumber(EnergyPlusData &state, std::string const &OAMixerName); // must match OA mixer names for the OA mixer type
     470              : 
     471              : } // namespace MixedAir
     472              : 
     473              : struct MixedAirData : BaseGlobalStruct
     474              : {
     475              : 
     476              :     int NumControllerLists = 0;     // Number of Controller Lists
     477              :     int NumOAControllers = 0;       // Number of OA Controllers (includes ERV controllers)
     478              :     int NumERVControllers = 0;      // Number of ERV Controllers
     479              :     int NumOAMixers = 0;            // Number of Outdoor Air Mixers
     480              :     int NumVentMechControllers = 0; // Number of Controller:MechanicalVentilation objects in input deck
     481              :     Array1D_bool MyOneTimeErrorFlag;
     482              :     Array1D_bool MyOneTimeCheckUnitarySysFlag;
     483              :     Array1D_bool initOASysFlag;
     484              :     bool GetOASysInputFlag = true;
     485              :     bool GetOAMixerInputFlag = true;
     486              :     bool GetOAControllerInputFlag = true;
     487              :     bool InitOAControllerOneTimeFlag = true;
     488              :     Array1D_bool InitOAControllerSetPointCheckFlag;
     489              :     bool InitOAControllerSetUpAirLoopHVACVariables = true;
     490              :     bool AllocateOAControllersFlag = true;
     491              :     EPVector<MixedAir::ControllerListProps> ControllerLists;
     492              :     EPVector<MixedAir::OAControllerProps> OAController;
     493              :     EPVector<MixedAir::OAMixerProps> OAMixer;
     494              :     EPVector<MixedAir::VentilationMechanicalProps> VentilationMechanical;
     495              :     std::unordered_set<std::string> ControllerListUniqueNames;
     496              :     std::unordered_map<std::string, std::string> OAControllerUniqueNames;
     497              :     std::string CompType;
     498              :     std::string CompName;
     499              :     std::string CtrlName;
     500              :     Array1D_bool OAControllerMyOneTimeFlag;
     501              :     Array1D_bool OAControllerMyEnvrnFlag;
     502              :     Array1D_bool OAControllerMySizeFlag;
     503              :     Array1D_bool MechVentCheckFlag;
     504              : 
     505         2126 :     void init_constant_state([[maybe_unused]] EnergyPlusData &state) override
     506              :     {
     507         2126 :     }
     508              : 
     509         1152 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     510              :     {
     511         1152 :     }
     512              : 
     513         2100 :     void clear_state() override
     514              :     {
     515         2100 :         this->NumControllerLists = 0;
     516         2100 :         this->NumOAControllers = 0;
     517         2100 :         this->NumERVControllers = 0;
     518         2100 :         this->NumOAMixers = 0;
     519         2100 :         this->NumVentMechControllers = 0;
     520         2100 :         this->MyOneTimeErrorFlag.deallocate();
     521         2100 :         this->MyOneTimeCheckUnitarySysFlag.deallocate();
     522         2100 :         this->initOASysFlag.deallocate();
     523         2100 :         this->GetOASysInputFlag = true;
     524         2100 :         this->GetOAMixerInputFlag = true;
     525         2100 :         this->GetOAControllerInputFlag = true;
     526         2100 :         this->InitOAControllerOneTimeFlag = true;
     527         2100 :         this->InitOAControllerSetPointCheckFlag.deallocate();
     528         2100 :         this->InitOAControllerSetUpAirLoopHVACVariables = true;
     529         2100 :         this->AllocateOAControllersFlag = true;
     530         2100 :         this->ControllerLists.deallocate();
     531         2100 :         this->OAController.deallocate();
     532         2100 :         this->OAMixer.deallocate();
     533         2100 :         this->VentilationMechanical.deallocate();
     534         2100 :         this->ControllerListUniqueNames.clear();
     535         2100 :         this->OAControllerUniqueNames.clear();
     536         2100 :         this->OAControllerMyOneTimeFlag.clear();
     537         2100 :         this->OAControllerMyEnvrnFlag.clear();
     538         2100 :         this->OAControllerMySizeFlag.clear();
     539         2100 :         this->MechVentCheckFlag.clear();
     540         2100 :     }
     541              : };
     542              : 
     543              : } // namespace EnergyPlus
     544              : 
     545              : #endif
        

Generated by: LCOV version 2.0-1