LCOV - code coverage report
Current view: top level - EnergyPlus - MixedAir.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 2 34 5.9 %
Date: 2024-08-24 18:31:18 Functions: 1 2 50.0 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2024, The Board of Trustees of the University of Illinois,
       2             : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3             : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4             : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5             : // contributors. All rights reserved.
       6             : //
       7             : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8             : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9             : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10             : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11             : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12             : //
      13             : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14             : // provided that the following conditions are met:
      15             : //
      16             : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17             : //     conditions and the following disclaimer.
      18             : //
      19             : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20             : //     conditions and the following disclaimer in the documentation and/or other materials
      21             : //     provided with the distribution.
      22             : //
      23             : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24             : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25             : //     used to endorse or promote products derived from this software without specific prior
      26             : //     written permission.
      27             : //
      28             : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29             : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30             : //     reference solely to the software portion of its product, Licensee must refer to the
      31             : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32             : //     obtained under this License and may not use a different name for the software. Except as
      33             : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34             : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35             : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36             : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37             : //
      38             : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39             : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40             : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41             : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42             : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43             : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44             : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45             : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46             : // POSSIBILITY OF SUCH DAMAGE.
      47             : 
      48             : #ifndef 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             :         std::string MinOASch;    // Name of the minimum outside air schedule
     179             :         int MinOASchPtr = 0;     // Index to the minimum outside air schedule
     180             :         Real64 RelMassFlow = 0.0;
     181             :         Real64 OAMassFlow = 0.0;
     182             :         Real64 ExhMassFlow = 0.0;
     183             :         Real64 MixMassFlow = 0.0;
     184             :         Real64 InletTemp = 0.0;
     185             :         Real64 InletEnth = 0.0;
     186             :         Real64 InletPress = 0.0;
     187             :         Real64 InletHumRat = 0.0;
     188             :         Real64 OATemp = 0.0;
     189             :         Real64 OAEnth = 0.0;
     190             :         Real64 OAPress = 0.0;
     191             :         Real64 OAHumRat = 0.0;
     192             :         Real64 RetTemp = 0.0;
     193             :         Real64 RetEnth = 0.0;
     194             :         Real64 MixSetTemp = 0.0;
     195             :         Real64 MinOAMassFlowRate = 0.0; // Minimum outside air flow (kg/s)
     196             :         Real64 MaxOAMassFlowRate = 0.0; // Maximum outside air flow (kg/s)
     197             :         Real64 RelTemp = 0.0;
     198             :         Real64 RelEnth = 0.0;
     199             :         Real64 RelSensiLossRate = 0.0; // Heat lost to ambient from relief air (W)
     200             :         Real64 RelLatentLossRate = 0.0;
     201             :         Real64 RelTotalLossRate = 0.0;
     202             : 
     203             :         int ZoneEquipZoneNum = 0;
     204             :         std::string VentilationMechanicalName;   // Name of ventilation:mechanical object used for DCV
     205             :         int VentMechObjectNum = 0;               // Index to VENTILATION:MECHANICAL object for this controller
     206             :         int HumidistatZoneNum = 0;               // zone number where humidistat is located
     207             :         int NodeNumofHumidistatZone = 0;         // node number of zone where humidistat is located
     208             :         Real64 HighRHOAFlowRatio = 1.0;          // Modify ratio with respect to maximum outdoor air flow rate (high RH)
     209             :         bool ModifyDuringHighOAMoisture = false; // flag to Modify outdoor air flow, TRUE when modify any time, FALSE when modify only when indoor air
     210             :                                                  // humrat is less than outdoor HR
     211             :         int EconomizerOASchedPtr = 0;            // schedule to modify outdoor air flow
     212             :         std::string MinOAflowSch;                // Name of the Minimum fraction of Design/Mixed Mass of air
     213             :         std::string MaxOAflowSch;                // Name of the Maximum fraction of Design/Mixed Mass of air
     214             :         int MinOAflowSchPtr = 0;                 // Index to the Minimum Fraction of Outdoor Air Schedule
     215             :         int MaxOAflowSchPtr = 0;                 // Index to the Maximum Fraction of Outdoor Air Schedule
     216             :         //   Economizer Status, which is currently following the EconomizerOperationFlag, might be something like "Economizer status
     217             :         //   indicates when the conditions are favorable for the economizer to operate (i.e., none of the control limits have been exceeded).
     218             :         //   While this status signal indicates favorable conditions for economizer operation, it does not guarantee that the air-side
     219             :         //   economizer has increased outdoor air flow above the minimum level since the actual outdoor air flow rate is also governed
     220             :         //   by other controls (e.g., mixed air setpoint temperature, time of day economizer control, etc.).
     221             :         int EconomizerStatus = 0;             // Air Economizer status (1 = on, 0 = off or economizer not exists)
     222             :         int HeatRecoveryBypassStatus = 0;     // OA Sys Heat Recovery Bypass status (1 = on, 0 = off or economizer not exists)
     223             :         int HRHeatingCoilActive = 0;          // OA Sys Heat Recovery Heating Coil Was Active status (1 = on, 0 = off)
     224             :         Real64 MixedAirTempAtMinOAFlow = 0.0; // calculated mixed air temp at min flow rate when using special HX bypass control
     225             :         int HighHumCtrlStatus = 0;            // High Humidity Control status (1 = on, 0 = off or high hum ctrl not used)
     226             :         Real64 OAFractionRpt = 0.0;           // Actual outdoor air fraction for reporting (based on mixed air flow rate),
     227             :         // 0 to 1 (normally)
     228             :         Real64 MinOAFracLimit = 0.0;            // Minimum OA fraction limit
     229             :         Real64 MechVentOAMassFlowRequest = 0.0; // outside air mass flow rate calculated by mechanical ventilation object [kg/s]
     230             :         bool EMSOverrideOARate = false;         // if true, EMS is calling to override OA rate
     231             :         Real64 EMSOARateValue = 0.0;            // Value EMS is directing to use. [kg/s]
     232             :         int HeatRecoveryBypassControlType = HVAC::BypassWhenWithinEconomizerLimits; // User input selects type of heat recovery optimization
     233             :         HVAC::EconomizerStagingType EconomizerStagingType =
     234             :             HVAC::EconomizerStagingType::InterlockedWithMechanicalCooling; // User input select type of economizer staging operation
     235             :         bool ManageDemand = false;                                         // Used by demand manager to manage ventilation
     236             :         Real64 DemandLimitFlowRate = 0.0;                                  // Current demand limit if demand manager is ON
     237             :         Real64 MaxOAFracBySetPoint = 0.0;                                  // The maximum OA fraction due to freezing cooling coil check
     238             :         int MixedAirSPMNum = 0;                                            // index of mixed air setpoint manager
     239             :         bool CoolCoilFreezeCheck = false;                        // if true, cooling coil freezing is prevented by recalculating the amount of OA
     240             :         bool EconoActive = false;                                // if true economizer is active
     241             :         bool HighHumCtrlActive = false;                          // if true high humidity control is active
     242             :         Array1D_int EconmizerFaultNum;                           // index to economizer fault
     243             :         int NumFaultyEconomizer = 0;                             // total number of economizer faults
     244             :         int CountMechVentFrac = 0;                               // Count when OA min fraction > mech vent fraction
     245             :         int IndexMechVentFrac = 0;                               // Index when OA min fraction > mech vent fraction
     246             :         OALimitFactor OALimitingFactor = OALimitFactor::Invalid; // OA controller limiting factor
     247             :         int OALimitingFactorReport = 0;                          // OA controller limiting factor - integer for reporting
     248             : 
     249             :         void CalcOAController(EnergyPlusData &state, int AirLoopNum, bool FirstHVACIteration);
     250             : 
     251             :         void CalcOAEconomizer(
     252             :             EnergyPlusData &state, int AirLoopNum, Real64 OutAirMinFrac, Real64 &OASignal, bool &HighHumidityOperationFlag, bool FirstHVACIteration);
     253             : 
     254             :         void SizeOAController(EnergyPlusData &state);
     255             : 
     256             :         void UpdateOAController(EnergyPlusData &state);
     257             : 
     258             :         void Checksetpoints(EnergyPlusData &state,
     259             :                             Real64 OutAirMinFrac,         // Local variable used to calculate min OA fraction
     260             :                             Real64 &OutAirSignal,         // Used to set OA mass flow rate
     261             :                             bool &EconomizerOperationFlag // logical used to show economizer status
     262             :         );
     263             :     };
     264             : 
     265             :     struct VentilationMechanicalZoneProps
     266             :     {
     267             :         std::string name;                        // name of mech vent zone
     268             :         int zoneNum = 0;                         // Actual zones number
     269             :         Real64 ZoneOAAreaRate = 0.0;             // Mechanical ventilation rate (m3/s/m2) for each zone
     270             :         Real64 ZoneOAPeopleRate = 0.0;           // Mechanical ventilation rate (m3/s/person) for each zone
     271             :         Real64 ZoneOAFlowRate = 0.0;             // OA Flow Rate (m3/s/zone) for each zone
     272             :         Real64 ZoneOAACHRate = 0.0;              // OA ACH (m3/s/volume) for each zone
     273             :         int ZoneDesignSpecOAObjIndex = 0;        // index of the design specification outdoor air object for each zone
     274             :         std::string ZoneDesignSpecOAObjName;     // name of the design specification outdoor air object for each zone
     275             :         Real64 ZoneADEffCooling = 1.0;           // Zone air distribution effectiveness in cooling mode for each zone
     276             :         Real64 ZoneADEffHeating = 1.0;           // Zone air distribution effectiveness in heating mode for each zone
     277             :         int ZoneADEffSchPtr = 0;                 // Pointer to the zone air distribution effectiveness schedule for each zone
     278             :         int ZoneDesignSpecADObjIndex = 0;        // index of the design specification zone air distribution object for each zone
     279             :         std::string ZoneDesignSpecADObjName;     // name of the design specification zone air distribution object for each zone
     280             :         Real64 ZoneSecondaryRecirculation = 0.0; // zone air secondary recirculation ratio for each zone
     281             :         DataSizing::OAFlowCalcMethod ZoneOAFlowMethod = DataSizing::OAFlowCalcMethod::PerPerson; // OA flow method for each zone
     282             :         int ZoneOASchPtr = 0;              // Index to the outdoor air schedule for each zone (from DesignSpecification:OutdoorAir or default)
     283             :         Real64 OAPropCtlMinRateSchPtr = 0; // Outdoor design OA flow rate schedule from DesignSpecification:OutdoorAir
     284             :         EPVector<int> peopleIndexes; // List of People objects in this zone (for SystemOAMethod == DataSizing::SysOAMethod::ProportionalControlDesOcc)
     285             :     };
     286             : 
     287             :     struct VentilationMechanicalProps // Derived type for Ventilation:Mechanical data
     288             :     {
     289             :         // Members
     290             :         std::string Name;             // Name of Ventilation:Mechanical object
     291             :         std::string SchName;          // Name of the mechanical ventilation schedule
     292             :         int SchPtr = 0;               // Index to the mechanical ventilation schedule
     293             :         bool DCVFlag = false;         // if true, implement OA based on demand controlled ventilation
     294             :         int NumofVentMechZones = 0;   // Number of zones with mechanical ventilation
     295             :         Real64 TotAreaOAFlow = 0.0;   // Total outdoor air flow rate for all zones per area (m3/s/m2)
     296             :         Real64 TotPeopleOAFlow = 0.0; // Total outdoor air flow rate for all PEOPLE objects in zones (m3/s)
     297             :         Real64 TotZoneOAFlow = 0.0;   // Total outdoor air flow rate for all zones (m3/s)
     298             :         Real64 TotZoneOAACH = 0.0;    // Total outdoor air flow rate for all zones Air Changes per hour (m3/s/m3)
     299             :         DataSizing::SysOAMethod SystemOAMethod = DataSizing::SysOAMethod::Invalid; // System Outdoor Air Method - SOAM_ZoneSum, SOAM_VRP, SOAM_VRPL
     300             :         Real64 ZoneMaxOAFraction = 1.0;                                            // Zone maximum outdoor air fraction
     301             :         int CO2MaxMinLimitErrorCount = 0; // Counter when max CO2 concentration < min CO2 concentration for SOAM_ProportionalControlSchOcc
     302             :         int CO2MaxMinLimitErrorIndex = 0; // Index for max CO2 concentration < min CO2 concentration recurring error message for
     303             :                                           // SOAM_ProportionalControlSchOcc
     304             :         int CO2GainErrorCount = 0;        // Counter when CO2 generation from people is zero for SOAM_ProportionalControlSchOcc
     305             :         int CO2GainErrorIndex = 0; // Index for recurring error message when CO2 generation from people is zero for SOAM_ProportionalControlSchOcc
     306             :         int OAMaxMinLimitErrorCount = 0; // Counter when max OA < min OA for SOAM_ProportionalControlDesOARate
     307             :         int OAMaxMinLimitErrorIndex = 0; // Index for max OA < min OA recurring error message for SOAM_ProportionalControlDesOARate
     308             :         Real64 Ep = 1.0;                 // zone primary air fraction
     309             :         Real64 Er = 0.0;                 // zone secondary recirculation fraction
     310             :         Real64 Fa = 1.0;                 // temporary variable used in multi-path VRP calc
     311             :         Real64 Fb = 1.0;
     312             :         Real64 Fc = 1.0;
     313             :         Real64 Xs = 1.0;       // uncorrected system outdoor air fraction
     314             :         Real64 Evz = 1.0;      // zone ventilation efficiency
     315             :         Real64 SysDesOA = 0.0; // System design OA
     316             :         EPVector<VentilationMechanicalZoneProps> VentMechZone;
     317             : 
     318             :         Real64 CalcMechVentController(EnergyPlusData &state,
     319             :                                       Real64 SysSA // System supply air mass flow rate [kg/s]
     320             :         );
     321             :     };
     322             : 
     323             :     struct OAMixerProps // Derived type for Outside Air Mixing Component
     324             :     {
     325             :         // Members
     326             :         std::string Name;
     327             :         int MixerIndex = 0; // Set on first call...
     328             :         int MixNode = 0;    // Outlet node - mixed air
     329             :         int InletNode = 0;  // Inlet node for outside air stream (Nov. 2004 BTG was OANode )
     330             :         int RelNode = 0;    // Outlet node - relief air
     331             :         int RetNode = 0;    // Inlet node - return air
     332             :         Real64 MixTemp = 0.0;
     333             :         Real64 MixHumRat = 0.0;
     334             :         Real64 MixEnthalpy = 0.0;
     335             :         Real64 MixPressure = 0.0;
     336             :         Real64 MixMassFlowRate = 0.0;
     337             :         Real64 OATemp = 0.0;
     338             :         Real64 OAHumRat = 0.0;
     339             :         Real64 OAEnthalpy = 0.0;
     340             :         Real64 OAPressure = 0.0;
     341             :         Real64 OAMassFlowRate = 0.0;
     342             :         Real64 RelTemp = 0.0;
     343             :         Real64 RelHumRat = 0.0;
     344             :         Real64 RelEnthalpy = 0.0;
     345             :         Real64 RelPressure = 0.0;
     346             :         Real64 RelMassFlowRate = 0.0;
     347             :         Real64 RetTemp = 0.0;
     348             :         Real64 RetHumRat = 0.0;
     349             :         Real64 RetEnthalpy = 0.0;
     350             :         Real64 RetPressure = 0.0;
     351             :         Real64 RetMassFlowRate = 0.0;
     352             : 
     353             :         void InitOAMixer(EnergyPlusData &state);
     354             : 
     355             :         void CalcOAMixer(EnergyPlusData &state);
     356             : 
     357             :         void UpdateOAMixer(EnergyPlusData &state) const;
     358             :     };
     359             : 
     360             :     // Functions
     361             : 
     362             :     Real64 OAGetFlowRate(EnergyPlusData &state, int OAPtr);
     363             : 
     364             :     Real64 OAGetMinFlowRate(EnergyPlusData &state, int OAPtr);
     365             : 
     366             :     void OASetDemandManagerVentilationState(EnergyPlusData &state, int OAPtr, bool aState);
     367             : 
     368             :     void OASetDemandManagerVentilationFlow(EnergyPlusData &state, int OAPtr, Real64 aFlow);
     369             : 
     370             :     int GetOAController(EnergyPlusData &state, std::string const &OAName);
     371             : 
     372             :     void ManageOutsideAirSystem(EnergyPlusData &state, std::string const &OASysName, bool FirstHVACIteration, int AirLoopNum, int &OASysNum);
     373             : 
     374             :     void SimOutsideAirSys(EnergyPlusData &state, int OASysNum, bool FirstHVACIteration, int AirLoopNum);
     375             : 
     376             :     void SimOASysComponents(EnergyPlusData &state, int OASysNum, bool FirstHVACIteration, int AirLoopNum);
     377             : 
     378             :     void SimOAComponent(EnergyPlusData &state,
     379             :                         std::string const &CompType,              // the component type
     380             :                         std::string const &CompName,              // the component Name
     381             :                         SimAirServingZones::CompType CompTypeNum, // Component Type -- Integerized for this module
     382             :                         bool FirstHVACIteration,
     383             :                         int &CompIndex,
     384             :                         int AirLoopNum,      // air loop index for economizer lockout coordination
     385             :                         bool Sim,            // if TRUE, simulate component; if FALSE, just set the coil exisitence flags
     386             :                         int OASysNum,        // index to outside air system
     387             :                         bool &OAHeatingCoil, // TRUE indicates a heating coil has been found
     388             :                         bool &OACoolingCoil, // TRUE indicates a cooling coil has been found
     389             :                         bool &OAHX);         // TRUE indicates a heat exchanger has been found
     390             : 
     391             :     void SimOAMixer(EnergyPlusData &state, std::string const &CompName, int &CompIndex);
     392             : 
     393             :     void SimOAController(EnergyPlusData &state, std::string const &CtrlName, int &CtrlIndex, bool FirstHVACIteration, int AirLoopNum);
     394             : 
     395             :     void GetOutsideAirSysInputs(EnergyPlusData &state);
     396             : 
     397             :     void GetOAControllerInputs(EnergyPlusData &state);
     398             : 
     399             :     void AllocateOAControllers(EnergyPlusData &state);
     400             : 
     401             :     void GetOAMixerInputs(EnergyPlusData &state);
     402             : 
     403             :     void ProcessOAControllerInputs(EnergyPlusData &state,
     404             :                                    std::string_view CurrentModuleObject,
     405             :                                    int OutAirNum,
     406             :                                    Array1D_string const &AlphArray,
     407             :                                    int &NumAlphas,
     408             :                                    Array1D<Real64> const &NumArray,
     409             :                                    int &NumNums,
     410             :                                    Array1D_bool const &lNumericBlanks, // Unused
     411             :                                    Array1D_bool const &lAlphaBlanks,
     412             :                                    Array1D_string const &cAlphaFields,
     413             :                                    Array1D_string const &cNumericFields, // Unused
     414             :                                    bool &ErrorsFound                     // If errors found in input
     415             :     );
     416             : 
     417             :     void InitOutsideAirSys(EnergyPlusData &state, int OASysNum, int AirLoopNum);
     418             : 
     419             :     void InitOAController(EnergyPlusData &state, int OAControllerNum, bool FirstHVACIteration, int AirLoopNum);
     420             : 
     421             :     Array1D_int GetOAMixerNodeNumbers(EnergyPlusData &state,
     422             :                                       std::string const &OAMixerName, // must match OA mixer names for the OA mixer type
     423             :                                       bool &ErrorsFound               // set to true if problem
     424             :     );
     425             : 
     426             :     int GetNumOAMixers(EnergyPlusData &state);
     427             : 
     428             :     int GetNumOAControllers(EnergyPlusData &state);
     429             : 
     430             :     int GetOAMixerReliefNodeNumber(EnergyPlusData &state, int OAMixerNum); // Which Mixer
     431             : 
     432             :     int GetOASysControllerListIndex(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     433             : 
     434             :     int GetOASysNumSimpControllers(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     435             : 
     436             :     int GetOASysNumHeatingCoils(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     437             : 
     438             :     int GetOASysNumHXs(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     439             : 
     440             :     int GetOASysNumCoolingCoils(EnergyPlusData &state, int OASysNumber); // OA Sys Number
     441             : 
     442             :     int GetOASystemNumber(EnergyPlusData &state, std::string const &OASysName); // OA Sys Name
     443             : 
     444             :     int FindOAMixerMatchForOASystem(EnergyPlusData &state, int OASysNumber); // Which OA System
     445             : 
     446             :     int GetOAMixerIndex(EnergyPlusData &state, std::string const &OAMixerName); // Which Mixer
     447             : 
     448             :     int GetOAMixerInletNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     449             : 
     450             :     int GetOAMixerReturnNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     451             : 
     452             :     int GetOAMixerMixedNodeNumber(EnergyPlusData &state, int OAMixerNumber); // Which Mixer
     453             : 
     454             :     bool CheckForControllerWaterCoil(EnergyPlusData &state,
     455             :                                      DataAirLoop::ControllerKind ControllerType, // should be passed in as UPPERCASE
     456             :                                      std::string const &ControllerName           // should be passed in as UPPERCASE
     457             :     );
     458             : 
     459             :     void CheckControllerLists(EnergyPlusData &state, bool &ErrFound);
     460             : 
     461             :     void CheckOAControllerName(
     462             :         EnergyPlusData &state, std::string &OAControllerName, std::string const &ObjectType, std::string const &FieldName, bool &ErrorsFound);
     463             : 
     464             :     int GetNumOASystems(EnergyPlusData &state);
     465             : 
     466             :     int GetOACompListNumber(EnergyPlusData &state, int OASysNum); // OA Sys Number
     467             : 
     468             :     std::string GetOACompName(EnergyPlusData &state,
     469             :                               int OASysNum, // OA Sys Number
     470             :                               int InListNum // In-list Number
     471             :     );
     472             : 
     473             :     std::string GetOACompType(EnergyPlusData &state,
     474             :                               int OASysNum, // OA Sys Number
     475             :                               int InListNum // In-list Number
     476             :     );
     477             : 
     478             :     SimAirServingZones::CompType GetOACompTypeNum(EnergyPlusData &state,
     479             :                                                   int OASysNum, // OA Sys Number
     480             :                                                   int InListNum // In-list Number
     481             :     );
     482             : 
     483             :     int GetOAMixerNumber(EnergyPlusData &state, std::string const &OAMixerName); // must match OA mixer names for the OA mixer type
     484             : 
     485             : } // namespace MixedAir
     486             : 
     487             : struct MixedAirData : BaseGlobalStruct
     488             : {
     489             : 
     490             :     int NumControllerLists = 0;     // Number of Controller Lists
     491             :     int NumOAControllers = 0;       // Number of OA Controllers (includes ERV controllers)
     492             :     int NumERVControllers = 0;      // Number of ERV Controllers
     493             :     int NumOAMixers = 0;            // Number of Outdoor Air Mixers
     494             :     int NumVentMechControllers = 0; // Number of Controller:MechanicalVentilation objects in input deck
     495             :     Array1D_bool MyOneTimeErrorFlag;
     496             :     Array1D_bool MyOneTimeCheckUnitarySysFlag;
     497             :     Array1D_bool initOASysFlag;
     498             :     bool GetOASysInputFlag = true;
     499             :     bool GetOAMixerInputFlag = true;
     500             :     bool GetOAControllerInputFlag = true;
     501             :     bool InitOAControllerOneTimeFlag = true;
     502             :     Array1D_bool InitOAControllerSetPointCheckFlag;
     503             :     bool InitOAControllerSetUpAirLoopHVACVariables = true;
     504             :     bool AllocateOAControllersFlag = true;
     505             :     Array1D_string DesignSpecOAObjName;     // name of the design specification outdoor air object
     506             :     Array1D_int DesignSpecOAObjIndex;       // index of the design specification outdoor air object
     507             :     Array1D_string VentMechZoneOrListName;  // Zone or Zone List to apply mechanical ventilation rate
     508             :     Array1D_string DesignSpecZoneADObjName; // name of the design specification zone air distribution object
     509             :     Array1D_int DesignSpecZoneADObjIndex;   // index of the design specification zone air distribution object
     510             :     EPVector<MixedAir::ControllerListProps> ControllerLists;
     511             :     EPVector<MixedAir::OAControllerProps> OAController;
     512             :     EPVector<MixedAir::OAMixerProps> OAMixer;
     513             :     EPVector<MixedAir::VentilationMechanicalProps> VentilationMechanical;
     514             :     std::unordered_set<std::string> ControllerListUniqueNames;
     515             :     std::unordered_map<std::string, std::string> OAControllerUniqueNames;
     516             :     std::string CompType;
     517             :     std::string CompName;
     518             :     std::string CtrlName;
     519             :     Array1D_bool OAControllerMyOneTimeFlag;
     520             :     Array1D_bool OAControllerMyEnvrnFlag;
     521             :     Array1D_bool OAControllerMySizeFlag;
     522             :     Array1D_bool MechVentCheckFlag;
     523             : 
     524         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
     525             :     {
     526         796 :     }
     527             : 
     528           0 :     void clear_state() override
     529             :     {
     530           0 :         this->NumControllerLists = 0;
     531           0 :         this->NumOAControllers = 0;
     532           0 :         this->NumERVControllers = 0;
     533           0 :         this->NumOAMixers = 0;
     534           0 :         this->NumVentMechControllers = 0;
     535           0 :         this->MyOneTimeErrorFlag.deallocate();
     536           0 :         this->MyOneTimeCheckUnitarySysFlag.deallocate();
     537           0 :         this->initOASysFlag.deallocate();
     538           0 :         this->GetOASysInputFlag = true;
     539           0 :         this->GetOAMixerInputFlag = true;
     540           0 :         this->GetOAControllerInputFlag = true;
     541           0 :         this->InitOAControllerOneTimeFlag = true;
     542           0 :         this->InitOAControllerSetPointCheckFlag.deallocate();
     543           0 :         this->InitOAControllerSetUpAirLoopHVACVariables = true;
     544           0 :         this->AllocateOAControllersFlag = true;
     545           0 :         this->DesignSpecOAObjName.deallocate();
     546           0 :         this->DesignSpecOAObjIndex.deallocate();
     547           0 :         this->VentMechZoneOrListName.deallocate();
     548           0 :         this->DesignSpecZoneADObjName.deallocate();
     549           0 :         this->DesignSpecZoneADObjIndex.deallocate();
     550           0 :         this->ControllerLists.deallocate();
     551           0 :         this->OAController.deallocate();
     552           0 :         this->OAMixer.deallocate();
     553           0 :         this->VentilationMechanical.deallocate();
     554           0 :         this->ControllerListUniqueNames.clear();
     555           0 :         this->OAControllerUniqueNames.clear();
     556           0 :         this->OAControllerMyOneTimeFlag.clear();
     557           0 :         this->OAControllerMyEnvrnFlag.clear();
     558           0 :         this->OAControllerMySizeFlag.clear();
     559           0 :         this->MechVentCheckFlag.clear();
     560           0 :     }
     561             : };
     562             : 
     563             : } // namespace EnergyPlus
     564             : 
     565             : #endif

Generated by: LCOV version 1.14