LCOV - code coverage report
Current view: top level - EnergyPlus - DataHeatBalance.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 24 27 88.9 %
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 DataHeatBalance_hh_INCLUDED
      49             : #define DataHeatBalance_hh_INCLUDED
      50             : 
      51             : // ObjexxFCL Headers
      52             : #include <ObjexxFCL/Array1D.hh>
      53             : #include <ObjexxFCL/Array2D.hh>
      54             : #include <ObjexxFCL/Array3D.hh>
      55             : #include <ObjexxFCL/Array4D.hh>
      56             : #include <ObjexxFCL/Optional.hh>
      57             : 
      58             : // EnergyPlus Headers
      59             : #include <EnergyPlus/ConvectionConstants.hh>
      60             : #include <EnergyPlus/Data/BaseData.hh>
      61             : #include <EnergyPlus/DataComplexFenestration.hh>
      62             : #include <EnergyPlus/DataGlobalConstants.hh>
      63             : #include <EnergyPlus/DataGlobals.hh>
      64             : #include <EnergyPlus/DataSurfaces.hh>
      65             : #include <EnergyPlus/DataVectorTypes.hh>
      66             : #include <EnergyPlus/DataWindowEquivalentLayer.hh>
      67             : #include <EnergyPlus/EPVector.hh>
      68             : #include <EnergyPlus/EnergyPlus.hh>
      69             : #include <EnergyPlus/ExteriorEnergyUse.hh>
      70             : 
      71             : namespace EnergyPlus {
      72             : 
      73             : // Forward declarations
      74             : struct EnergyPlusData;
      75             : 
      76             : namespace DataHeatBalance {
      77             : 
      78             :     // Using/Aliasing
      79             :     using namespace DataComplexFenestration;
      80             :     using DataComplexFenestration::GapDeflectionState;
      81             :     using DataComplexFenestration::GapSupportPillar;
      82             :     using DataVectorTypes::Vector;
      83             : 
      84             :     // Parameters for Interior and Exterior Solar Distribution
      85             :     enum class Shadowing
      86             :     {
      87             :         Invalid = -1,
      88             :         Minimal,              // all incoming solar hits floor, no exterior shadowing except reveals
      89             :         FullExterior,         // all incoming solar hits floor, full exterior shadowing
      90             :         FullInteriorExterior, // full interior solar distribution, full exterior solar shadowing
      91             :         FullExteriorWithRefl, // all incoming solar hits floor, full exterior shadowing and reflections
      92             :         Num
      93             :     };
      94             : 
      95             :     // Parameters to indicate the zone type for use with the Zone derived
      96             :     // type (see below--Zone%OfType):
      97             :     constexpr int StandardZone(1);
      98             : 
      99             :     // Parameters for WarmupDays
     100             :     constexpr int DefaultMaxNumberOfWarmupDays(25); // Default maximum number of warmup days allowed
     101             :     constexpr int DefaultMinNumberOfWarmupDays(1);  // Default minimum number of warmup days allowed
     102             : 
     103             :     // Parameters for ZoneAirSolutionAlgo
     104             :     enum class SolutionAlgo
     105             :     {
     106             :         Invalid = -1,
     107             :         ThirdOrder,
     108             :         AnalyticalSolution,
     109             :         EulerMethod,
     110             :         Num
     111             :     };
     112             : 
     113             :     // Parameter for MRT calculation type
     114             :     enum class CalcMRT
     115             :     {
     116             :         Invalid = -1,
     117             :         EnclosureAveraged,
     118             :         SurfaceWeighted,
     119             :         AngleFactor,
     120             :         Num
     121             :     };
     122             : 
     123             :     // Parameters for Ventilation
     124             :     enum class VentilationType
     125             :     {
     126             :         Invalid = -1,
     127             :         Natural,
     128             :         Intake,
     129             :         Exhaust,
     130             :         Balanced,
     131             :         Num
     132             :     };
     133             : 
     134             :     // Parameters for hybrid ventilation using Ventilation and Mixing objects
     135             :     enum class HybridCtrlType
     136             :     {
     137             :         Invalid = -1,
     138             :         Indiv,
     139             :         Close,
     140             :         Global,
     141             :         Num
     142             :     };
     143             : 
     144             :     // System type, detailed refrigeration or refrigerated case rack
     145             :     enum class RefrigSystemType
     146             :     {
     147             :         Invalid = -1,
     148             :         Detailed,
     149             :         Rack,
     150             :         Num
     151             :     };
     152             : 
     153             :     // Refrigeration condenser type
     154             :     enum class RefrigCondenserType
     155             :     {
     156             :         Invalid = -1,
     157             :         Air,
     158             :         Evap,
     159             :         Water,
     160             :         Cascade,
     161             :         WaterHeater,
     162             :         Num
     163             :     };
     164             : 
     165             :     // Parameters for type of infiltration model
     166             :     enum class InfiltrationModelType
     167             :     {
     168             :         Invalid = -1,
     169             :         DesignFlowRate,
     170             :         ShermanGrimsrud,
     171             :         AIM2,
     172             :         Num
     173             :     };
     174             : 
     175             :     // Parameters for type of ventilation model
     176             :     enum class VentilationModelType
     177             :     {
     178             :         Invalid = -1,
     179             :         DesignFlowRate,
     180             :         WindAndStack,
     181             :         Num
     182             :     };
     183             : 
     184             :     // Parameters for type of zone air balance model
     185             :     enum class AirBalance
     186             :     {
     187             :         Invalid = -1,
     188             :         None,
     189             :         Quadrature,
     190             :         Num
     191             :     };
     192             : 
     193             :     // Parameter for source zone air flow mass balance infiltration treatment
     194             :     enum class InfiltrationFlow
     195             :     {
     196             :         Invalid = -1,
     197             :         No,
     198             :         Add,
     199             :         Adjust,
     200             :         Num
     201             :     };
     202             : 
     203             :     enum class InfiltrationZoneType
     204             :     {
     205             :         Invalid = -1,
     206             :         MixingSourceZonesOnly,
     207             :         AllZones,
     208             :         Num
     209             :     };
     210             : 
     211             :     // zone air flow balancing method
     212             :     enum class AdjustmentType
     213             :     {
     214             :         Invalid = -1,
     215             :         AdjustMixingOnly,
     216             :         AdjustReturnOnly,
     217             :         AdjustMixingThenReturn,
     218             :         AdjustReturnThenMixing,
     219             :         NoAdjustReturnAndMixing,
     220             :         Num
     221             :     };
     222             : 
     223             :     enum class IntGainType
     224             :     {
     225             :         Invalid = -1,
     226             :         People,
     227             :         Lights,
     228             :         ElectricEquipment,
     229             :         GasEquipment,
     230             :         HotWaterEquipment,
     231             :         SteamEquipment,
     232             :         OtherEquipment,
     233             :         ZoneBaseboardOutdoorTemperatureControlled,
     234             :         ZoneContaminantSourceAndSinkCarbonDioxide,
     235             :         WaterUseEquipment,
     236             :         DaylightingDeviceTubular,
     237             :         WaterHeaterMixed,
     238             :         WaterHeaterStratified,
     239             :         ThermalStorageChilledWaterMixed,
     240             :         ThermalStorageChilledWaterStratified,
     241             :         GeneratorFuelCell,
     242             :         GeneratorMicroCHP,
     243             :         ElectricLoadCenterTransformer,
     244             :         ElectricLoadCenterInverterSimple,
     245             :         ElectricLoadCenterInverterFunctionOfPower,
     246             :         ElectricLoadCenterInverterLookUpTable,
     247             :         ElectricLoadCenterStorageLiIonNmcBattery,
     248             :         ElectricLoadCenterStorageBattery,
     249             :         ElectricLoadCenterStorageSimple,
     250             :         PipeIndoor,
     251             :         RefrigerationCase,
     252             :         RefrigerationCompressorRack,
     253             :         RefrigerationSystemAirCooledCondenser,
     254             :         RefrigerationTransSysAirCooledGasCooler,
     255             :         RefrigerationSystemSuctionPipe,
     256             :         RefrigerationTransSysSuctionPipeMT,
     257             :         RefrigerationTransSysSuctionPipeLT,
     258             :         RefrigerationSecondaryReceiver,
     259             :         RefrigerationSecondaryPipe,
     260             :         RefrigerationWalkIn,
     261             :         Pump_VarSpeed,
     262             :         Pump_ConSpeed,
     263             :         Pump_Cond,
     264             :         PumpBank_VarSpeed,
     265             :         PumpBank_ConSpeed,
     266             :         ZoneContaminantSourceAndSinkGenericContam,
     267             :         PlantComponentUserDefined,
     268             :         CoilUserDefined,
     269             :         ZoneHVACForcedAirUserDefined,
     270             :         AirTerminalUserDefined,
     271             :         PackagedTESCoilTank,
     272             :         ElectricEquipmentITEAirCooled,
     273             :         SecCoolingDXCoilSingleSpeed,
     274             :         SecHeatingDXCoilSingleSpeed,
     275             :         SecCoolingDXCoilTwoSpeed,
     276             :         SecCoolingDXCoilMultiSpeed,
     277             :         SecHeatingDXCoilMultiSpeed,
     278             :         ElectricLoadCenterConverter,
     279             :         FanSystemModel,
     280             :         IndoorGreen,
     281             :         Num
     282             :     };
     283             : 
     284             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::CalcMRT::Num)> CalcMRTTypeNamesUC = {
     285             :         "ENCLOSUREAVERAGED", "SURFACEWEIGHTED", "ANGLEFACTOR"};
     286             : 
     287             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::AirBalance::Num)> AirBalanceTypeNamesUC = {"NONE", "QUADRATURE"};
     288             : 
     289             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::InfiltrationFlow::Num)> InfiltrationFlowTypeNamesUC = {
     290             :         "NONE", "ADDINFILTRATIONFLOW", "ADJUSTINFILTRATIONFLOW"};
     291             : 
     292             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::InfiltrationFlow::Num)> InfiltrationFlowTypeNamesCC = {
     293             :         "None", "AddInfiltrationFlow", "AdjustInfiltrationFlow"};
     294             : 
     295             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::InfiltrationZoneType::Num)> InfiltrationZoneTypeNamesUC = {
     296             :         "MIXINGSOURCEZONESONLY", "ALLZONES"};
     297             : 
     298             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::InfiltrationZoneType::Num)> InfiltrationZoneTypeNamesCC = {
     299             :         "MixingSourceZonesOnly", "AllZones"};
     300             : 
     301             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::AdjustmentType::Num)> AdjustmentTypeNamesUC = {
     302             :         "ADJUSTMIXINGONLY", "ADJUSTRETURNONLY", "ADJUSTMIXINGTHENRETURN", "ADJUSTRETURNTHENMIXING", "NONE"};
     303             : 
     304             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::AdjustmentType::Num)> AdjustmentTypeNamesCC = {
     305             :         "AdjustMixingOnly", "AdjustReturnOnly", "AdjustMixingThenReturn", "AdjustReturnThenMixing", "None"};
     306             : 
     307             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::IntGainType::Num)> IntGainTypeNamesUC = {
     308             :         "PEOPLE",
     309             :         "LIGHTS",
     310             :         "ELECTRICEQUIPMENT",
     311             :         "GASEQUIPMENT",
     312             :         "HOTWATEREQUIPMENT",
     313             :         "STEAMEQUIPMENT",
     314             :         "OTHEREQUIPMENT",
     315             :         "ZONEBASEBOARD:OUTDOORTEMPERATURECONTROLLED",
     316             :         "ZONECONTAMINANTSOURCEANDSINK:CARBONDIOXIDE",
     317             :         "WATERUSE:EQUIPMENT",
     318             :         "DAYLIGHTINGDEVICE:TUBULAR",
     319             :         "WATERHEATER:MIXED",
     320             :         "WATERHEATER:STRATIFIED",
     321             :         "THERMALSTORAGE:CHILLEDWATER:MIXED",
     322             :         "THERMALSTORAGE:CHILLEDWATER:STRATIFIED",
     323             :         "GENERATOR:FUELCELL",
     324             :         "GENERATOR:MICROCHP",
     325             :         "ELECTRICLOADCENTER:TRANSFORMER",
     326             :         "ELECTRICLOADCENTER:INVERTER:SIMPLE",
     327             :         "ELECTRICLOADCENTER:INVERTER:FUNCTIONOFPOWER",
     328             :         "ELECTRICLOADCENTER:INVERTER:LOOKUPTABLE",
     329             :         "ELECTRICLOADCENTER:STORAGE:LIIONNMCBATTERY",
     330             :         "ELECTRICLOADCENTER:STORAGE:BATTERY",
     331             :         "ELECTRICLOADCENTER:STORAGE:SIMPLE",
     332             :         "PIPE:INDOOR",
     333             :         "REFRIGERATION:CASE",
     334             :         "REFRIGERATION:COMPRESSORRACK",
     335             :         "REFRIGERATION:SYSTEM:CONDENSER:AIRCOOLED",
     336             :         "REFRIGERATION:TRANSCRITICALSYSTEM:GASCOOLER:AIRCOOLED",
     337             :         "REFRIGERATION:SYSTEM:SUCTIONPIPE",
     338             :         "REFRIGERATION:TRANSCRITICALSYSTEM:SUCTIONPIPEMT",
     339             :         "REFRIGERATION:TRANSCRITICALSYSTEM:SUCTIONPIPELT",
     340             :         "REFRIGERATION:SECONDARYSYSTEM:RECEIVER",
     341             :         "REFRIGERATION:SECONDARYSYSTEM:PIPE",
     342             :         "REFRIGERATION:WALKIN",
     343             :         "PUMP:VARIABLESPEED",
     344             :         "PUMP:CONSTANTSPEED",
     345             :         "PUMP:VARIABLESPEED:CONDENSATE",
     346             :         "HEADEREDPUMPS:VARIABLESPEED",
     347             :         "HEADEREDPUMPS:CONSTANTSPEED",
     348             :         "ZONECONTAMINANTSOURCEANDSINK:GENERICCONTAMINANT",
     349             :         "PLANTCOMPONENT:USERDEFINED",
     350             :         "COIL:USERDEFINED",
     351             :         "ZONEHVAC:FORCEDAIR:USERDEFINED",
     352             :         "AIRTERMINAL:SINGLEDUCT:USERDEFINED",
     353             :         "COIL:COOLING:DX:SINGLESPEED:THERMALSTORAGE",
     354             :         "ELECTRICEQUIPMENT:ITE:AIRCOOLED",
     355             :         "COIL:COOLING:DX:SINGLESPEED",
     356             :         "COIL:HEATING:DX:SINGLESPEED",
     357             :         "COIL:COOLING:DX:TWOSPEED",
     358             :         "COIL:COOLING:DX:MULTISPEED",
     359             :         "COIL:HEATING:DX:MULTISPEED",
     360             :         "ELECTRICLOADCENTER:STORAGE:CONVERTER",
     361             :         "FAN:SYSTEMMODEL",
     362             :         "INDOORGREEN"};
     363             : 
     364             :     static constexpr std::array<std::string_view, static_cast<int>(DataHeatBalance::IntGainType::Num)> IntGainTypeNamesCC = {
     365             :         "People",
     366             :         "Lights",
     367             :         "ElectricEquipment",
     368             :         "GasEquipment",
     369             :         "HotWaterEquipment",
     370             :         "SteamEquipment",
     371             :         "OtherEquipment",
     372             :         "ZoneBaseboard:OutdoorTemperatureControlled",
     373             :         "ZoneContaminantSourceAndSink:CarbonDioxide",
     374             :         "WaterUse:Equipment",
     375             :         "DaylightingDevice:Tubular",
     376             :         "WaterHeater:Mixed",
     377             :         "WaterHeater:Stratified",
     378             :         "ThermalStorage:ChilledWater:Mixed",
     379             :         "ThermalStorage:ChilledWater:Stratified",
     380             :         "Generator:FuelCell",
     381             :         "Generator:MicroCHP",
     382             :         "ElectricLoadCenter:Transformer",
     383             :         "ElectricLoadCenter:Inverter:Simple",
     384             :         "ElectricLoadCenter:Inverter:FunctionOfPower",
     385             :         "ElectricLoadCenter:Inverter:LookUpTable",
     386             :         "ElectricLoadCenter:Storage:LiIonNMCBattery",
     387             :         "ElectricLoadCenter:Storage:Battery",
     388             :         "ElectricLoadCenter:Storage:Simple",
     389             :         "Pipe:Indoor",
     390             :         "Refrigeration:Case",
     391             :         "Refrigeration:CompressorRack",
     392             :         "Refrigeration:System:Condenser:AirCooled",
     393             :         "Refrigeration:TranscriticalSystem:GasCooler:AirCooled",
     394             :         "Refrigeration:System:SuctionPipe",
     395             :         "Refrigeration:TranscriticalSystem:SuctionPipeMT",
     396             :         "Refrigeration:TranscriticalSystem:SuctionPipeLT",
     397             :         "Refrigeration:SecondarySystem:Receiver",
     398             :         "Refrigeration:SecondarySystem:Pipe",
     399             :         "Refrigeration:WalkIn",
     400             :         "Pump:VariableSpeed",
     401             :         "Pump:ConstantSpeed",
     402             :         "Pump:VariableSpeed:Condensate",
     403             :         "HeaderedPumps:VariableSpeed",
     404             :         "HeaderedPumps:ConstantSpeed",
     405             :         "ZoneContaminantSourceAndSink:GenericContaminant",
     406             :         "PlantComponent:UserDefined",
     407             :         "Coil:UserDefined",
     408             :         "ZoneHVAC:ForcedAir:UserDefined",
     409             :         "AirTerminal:SingleDuct:UserDefined",
     410             :         "Coil:Cooling:DX:SingleSpeed:ThermalStorage",
     411             :         "ElectricEquipment:ITE:AirCooled",
     412             :         "Coil:Cooling:DX:SingleSpeed",
     413             :         "Coil:Heating:DX:SingleSpeed",
     414             :         "Coil:Cooling:DX:TwoSpeed",
     415             :         "Coil:Cooling:DX:MultiSpeed",
     416             :         "Coil:Heating:DX:MultiSpeed",
     417             :         "ElectricLoadCenter:Storage:Converter",
     418             :         "Fan:SystemModel",
     419             :         "IndoorGreen"};
     420             : 
     421             :     // Parameters for checking surface heat transfer models
     422             :     constexpr Real64 HighDiffusivityThreshold(1.e-5);   // used to check if Material properties are out of line.
     423             :     constexpr Real64 ThinMaterialLayerThreshold(0.003); // 3 mm lower limit to expected material layers
     424             : 
     425             :     // Const for initialization
     426             :     constexpr Real64 ZoneInitialTemp(23.0);       // Zone temperature for initialization
     427             :     constexpr Real64 SurfInitialTemp(23.0);       // Surface temperature for initialization
     428             :     constexpr Real64 SurfInitialConvCoeff(3.076); // Surface convective coefficient for initialization
     429             : 
     430             :     struct TCGlazingsType
     431             :     {
     432             :         // Members
     433             :         std::string Name;         // Name
     434             :         int NumGlzMat = 0;        // Number of TC glazing materials
     435             :         Array1D_int LayerPoint;   // Layer pointer
     436             :         Array1D<Real64> SpecTemp; // Temperature corresponding to the specified TC glazing optical data
     437             :         Array1D_string LayerName; // Name of the referenced WindowMaterial:Glazing object
     438             :     };
     439             : 
     440             :     struct SpectralDataProperties
     441             :     {
     442             :         // Members
     443             :         std::string Name;           // Name of spectral data set
     444             :         int NumOfWavelengths = 0;   // Number of wavelengths in the data set
     445             :         Array1D<Real64> WaveLength; // Wavelength (microns)
     446             :         Array1D<Real64> Trans;      // Transmittance at normal incidence
     447             :         Array1D<Real64> ReflFront;  // Front reflectance at normal incidence
     448             :         Array1D<Real64> ReflBack;   // Back reflectance at normal incidence
     449             :     };
     450             : 
     451             :     struct ZoneSpaceData
     452             :     {
     453             :         // Base class for zones and spaces.
     454             :         // For now, only including fields that are new to Space to avoid excess changes
     455             :         // due to case differences between existing space and zone field names.
     456             :         std::string Name;
     457             :         Real64 CeilingHeight = Constant::AutoCalculate; // Ceiling Height entered by user [m] or calculated
     458             :         Real64 Volume = Constant::AutoCalculate;        // Volume entered by user [m3] or calculated
     459             :         Real64 ExtGrossWallArea = 0.0;                  // Exterior Wall Area for Zone (Gross)
     460             :         Real64 ExteriorTotalSurfArea = 0.0;             // Total surface area of all exterior surfaces for Zone
     461             :         int SystemZoneNodeNumber = 0;                   // This is the zone or space node number for the system for a controlled zone
     462             :         Real64 FloorArea = 0.0;                         // Floor area used for this space
     463             :         Real64 TotOccupants = 0.0;                      // total design occupancy (sum of NumberOfPeople for the space People objects, not multiplied)
     464             :         bool IsControlled = false;                      // True when this is a controlled zone or space.
     465             :     };
     466             : 
     467             :     struct SpaceData : ZoneSpaceData
     468             :     {
     469             :         int zoneNum = 0;                                       // Pointer to Zone wich contains this space
     470             :         Real64 userEnteredFloorArea = Constant::AutoCalculate; // User input floor area for this space
     471             :         std::string spaceType = "General";                     // Space type tag
     472             :         int spaceTypeNum = 0;                                  // Points to spaceType for this space
     473             :         EPVector<std::string> tags;                            // Optional tags for reporting
     474             :         EPVector<int> surfaces;                                // Pointers to surfaces in this space
     475             :         Real64 calcFloorArea = 0.0;                            // Calculated floor area used for this space
     476             :         bool hasFloor = false;                                 // Has "Floor" surface
     477             :         Real64 fracZoneFloorArea = 0.0;                        // fraction of total floor area for all spaces in zone
     478             :         Real64 fracZoneVolume = 0.0;                           // fraction of total volume for all spaces in zone
     479             :         Real64 extWindowArea = 0.0;                            // Exterior Window Area for space
     480             :         Real64 totalSurfArea = 0.0;                            // Total surface area for space
     481             :         int radiantEnclosureNum = 0;                           // Radiant exchange enclosure this space belongs to
     482             :         int solarEnclosureNum = 0;                             // Solar distribution enclosure this space belongs to
     483             :         Real64 minOccupants = 0.0;     // minimum occupancy (sum of NomMinNumberPeople for the space People objects, not multiplied)
     484             :         Real64 maxOccupants = 0.0;     // maximum occupancy (sum of NomMaxNumberPeople for the space People objects, not multiplied)
     485             :         bool isRemainderSpace = false; // True if this space is auto-generated "-Remainder" space
     486             : 
     487             :         std::vector<Constant::eFuel> otherEquipFuelTypeNums; // List of fuel types used by other equipment in this space
     488             : 
     489             :         // Pointers to Surface Data Structure
     490             :         // |AllSurfF                                                                      |AllSurfL
     491             :         // |            |HTSurfF                                                          |HTSurfL
     492             :         // |            |OpaqOrWinMassSurfF                              |OpaqOrWinSurfL  |
     493             :         // |            |OpaqOrIntMassSurfF      |OpaqOrIntMassSurfL                      |
     494             :         // |            |                        ||WindowSurfF           |WindowSurfL     |
     495             :         // |            |                        ||                      ||DomeF          |DomeL
     496             :         // {[ SurfAir ] [(   SurfOpaqOrIntMass   )( SurfWinOrTDDDiffuser )( TDDDome       )]}
     497             :         // HTSurfaceFirst == OpaqOrWinMassSurfaceFirst == OpaqOrIntMassSurfaceFirst
     498             :         // WindowSurfaceFirst == OpaqOrIntMassSurfaceLast + 1
     499             :         // TDDDomeFirst == OpaqOrWinSurfaceLast + 1 == WindowSurfaceLast + 1
     500             :         // AllSurfaceLast == HTSurfaceLast = TDDDomeLast
     501             :         int AllSurfaceFirst = 0;           // First surface in space including air boundaries
     502             :         int AllSurfaceLast = -1;           // Last  surface in space including air boundaries
     503             :         int HTSurfaceFirst = 0;            // First Heat Transfer Surface in space
     504             :         int HTSurfaceLast = -1;            // Last  Heat Transfer Surface in space
     505             :         int OpaqOrIntMassSurfaceFirst = 0; // First Opaque or Interior Mass Heat Transfer Surface (including opaque doors) in space
     506             :         int OpaqOrIntMassSurfaceLast = -1; // Last  Opaque or Interior Mass Heat Transfer Surface (including opaque doors) in space
     507             :         int WindowSurfaceFirst = 0;        // First Window Heat Transfer Surface in space
     508             :         int WindowSurfaceLast = -1;        // Last  Window Heat Transfer Surface in space
     509             :         int OpaqOrWinSurfaceFirst = 0;     // First opaque (including IntMass) or window (non TDD Dome) Surface in space
     510             :         int OpaqOrWinSurfaceLast = -1;     // Last  opaque (including IntMass) or window (non TDD Dome) Surface in space
     511             :         int TDDDomeFirst = 0;              // First TDD Dome Surface in space
     512             :         int TDDDomeLast = -1;              // Last  TDD Dome Surface in space
     513             : 
     514             :         Real64 sumHATsurf(EnergyPlusData &state);
     515             :     };
     516             : 
     517             :     struct SpaceListData
     518             :     {
     519             :         std::string Name;                               // Space List name
     520             :         int numListSpaces = 0;                          // Number of spaces in the list
     521             :         std::string::size_type maxSpaceNameLength = 0u; // Max Name length of Spaces in the list
     522             :         EPVector<int> spaces;                           // Pointers to Spaces in the list
     523             :     };
     524             : 
     525             :     //    number of columns in resilience report tables
     526             :     constexpr int numColumnThermalTbl(5);
     527             :     constexpr int numColumnUnmetDegreeHourTbl(6);
     528             :     constexpr int numColumnDiscomfortWtExceedHourTbl(4);
     529             :     constexpr int numColumnCO2Tbl(3);
     530             :     constexpr int numColumnVisualTbl(4);
     531             : 
     532             :     struct ZoneResilience
     533             :     {
     534             :         Real64 ZoneNumOcc;
     535             :         Real64 ColdStressTempThresh;
     536             :         Real64 HeatStressTempThresh;
     537             :         Real64 PierceSET;
     538             :         Real64 PMV;
     539             :         Real64 ZonePierceSET;
     540             :         Real64 ZonePierceSETLastStep;
     541             :         Real64 ZoneHeatIndex;
     542             :         Real64 ZoneHumidex;
     543             :         bool CrossedColdThresh;
     544             :         bool CrossedHeatThresh;
     545             : 
     546             :         std::array<Real64, numColumnThermalTbl> ZoneHeatIndexHourBins = {0.0};
     547             :         std::array<Real64, numColumnThermalTbl> ZoneHeatIndexOccuHourBins = {0.0};
     548             :         std::array<Real64, numColumnThermalTbl> ZoneHeatIndexOccupiedHourBins = {0.0};
     549             :         std::array<Real64, numColumnThermalTbl> ZoneHumidexHourBins = {0.0};
     550             :         std::array<Real64, numColumnThermalTbl> ZoneHumidexOccuHourBins = {0.0};
     551             :         std::array<Real64, numColumnThermalTbl> ZoneHumidexOccupiedHourBins = {0.0};
     552             :         std::array<Real64, numColumnThermalTbl> ZoneLowSETHours = {0.0};
     553             :         std::array<Real64, numColumnThermalTbl> ZoneHighSETHours = {0.0};
     554             :         std::array<Real64, numColumnThermalTbl> ZoneColdHourOfSafetyBins = {0.0};
     555             :         std::array<Real64, numColumnThermalTbl> ZoneHeatHourOfSafetyBins = {0.0};
     556             :         std::array<Real64, numColumnUnmetDegreeHourTbl> ZoneUnmetDegreeHourBins = {0.0};
     557             :         std::array<Real64, numColumnDiscomfortWtExceedHourTbl> ZoneDiscomfortWtExceedOccuHourBins = {0.0};
     558             :         std::array<Real64, numColumnDiscomfortWtExceedHourTbl> ZoneDiscomfortWtExceedOccupiedHourBins = {0.0};
     559             : 
     560             :         std::array<Real64, numColumnCO2Tbl> ZoneCO2LevelHourBins = {0.0};
     561             :         std::array<Real64, numColumnCO2Tbl> ZoneCO2LevelOccuHourBins = {0.0};
     562             :         std::array<Real64, numColumnCO2Tbl> ZoneCO2LevelOccupiedHourBins = {0.0};
     563             : 
     564             :         std::array<Real64, numColumnVisualTbl> ZoneLightingLevelHourBins = {0.0};
     565             :         std::array<Real64, numColumnVisualTbl> ZoneLightingLevelOccuHourBins = {0.0};
     566             :         std::array<Real64, numColumnVisualTbl> ZoneLightingLevelOccupiedHourBins = {0.0};
     567             : 
     568             :         // Default Constructor
     569        5852 :         ZoneResilience()
     570        5852 :             : ZoneNumOcc(0.0), ColdStressTempThresh(15.56), HeatStressTempThresh(30.0), PierceSET(-999.0), PMV(0.0), ZonePierceSET(-1.0),
     571        5852 :               ZonePierceSETLastStep(-1.0), ZoneHeatIndex(0.0), ZoneHumidex(0.0), CrossedColdThresh(false), CrossedHeatThresh(false)
     572             :         {
     573        5852 :         }
     574             :     };
     575             :     struct ZoneData : ZoneSpaceData
     576             :     {
     577             :         // Members
     578             :         int Multiplier = 1;     // Used in reporting and for systems calculations
     579             :         int ListMultiplier = 1; // For Zone Group object:  used in reporting and systems calculations
     580             :         int ListGroup = 0;      // used only in Zone Group verification.  and for error message.
     581             :         Real64 RelNorth = 0.0;  // Relative North (to building north) [Degrees]
     582             :         Real64 OriginX = 0.0;   // X origin  [m]
     583             :         Real64 OriginY = 0.0;   // Y origin  [m]
     584             :         Real64 OriginZ = 0.0;   // Z origin  [m]
     585             :         int OfType = 1;         // 1=Standard Zone, Not yet used:
     586             :         // 2=Plenum Zone, 11=Solar Wall, 12=Roof Pond
     587             :         Real64 UserEnteredFloorArea = Constant::AutoCalculate; // User input floor area for this zone
     588             :         // Calculated after input
     589             :         Real64 CalcFloorArea = 0.0;        // Calculated floor area excluding air boundary surfaces
     590             :         Real64 geometricFloorArea = 0.0;   // Calculated floor area including air boundary surfaces
     591             :         Real64 CeilingArea = 0.0;          // Ceiling area excluding air boundary surfaces
     592             :         Real64 geometricCeilingArea = 0.0; // Ceiling area area including air boundary surfaces
     593             :         bool ceilingHeightEntered = false; // True is user input ceiling height
     594             :         bool HasFloor = false;             // Has "Floor" surface
     595             :         bool HasRoof = false;              // Has "Roof" or "Ceiling" Surface
     596             :         bool HasWindow = false;            // Window(s) present in this zone
     597             :         Real64 AirCapacity = 0.0;
     598             :         Real64 ExtWindowArea = 0.0;               // Exterior Window Area for Zone
     599             :         Real64 ExtWindowArea_Multiplied = 0.0;    // Exterior Window Area for Zone with multipliers
     600             :         Real64 ExtGrossWallArea_Multiplied = 0.0; // Exterior Wall Area for Zone (Gross) with multipliers
     601             :         Real64 ExtNetWallArea = 0.0;              // Exterior Wall Area for Zone (Net)
     602             :         Real64 TotalSurfArea = 0.0;               // Total surface area for Zone
     603             :         // (ignoring windows as they will be included in their base surfaces)
     604             :         Real64 ExteriorTotalGroundSurfArea = 0.0;                  // Total surface area of all surfaces for Zone with ground contact
     605             :         Real64 ExtGrossGroundWallArea = 0.0;                       // Ground contact Wall Area for Zone (Gross)
     606             :         Real64 ExtGrossGroundWallArea_Multiplied = 0.0;            // Ground contact Wall Area for Zone (Gross) with multipliers
     607             :         bool IsSupplyPlenum = false;                               // True when this zone is a supply plenum
     608             :         bool IsReturnPlenum = false;                               // True when this zone is a return plenum
     609             :         int PlenumCondNum = 0;                                     // Supply or return plenum conditions number, 0 if this is not a plenum zone
     610             :         int TempControlledZoneIndex = 0;                           // this is the index number for TempControlledZone structure for lookup
     611             :         int humidityControlZoneIndex = 0;                          // this is the index number for HumidityControlZone structure for lookup
     612             :         int AllSurfaceFirst = 0;                                   // First surface in zone including air boundaries
     613             :         int AllSurfaceLast = -1;                                   // Last  surface in zone including air boundaries
     614             :         Convect::HcInt IntConvAlgo = Convect::HcInt::ASHRAESimple; // Ref: appropriate values for Inside Convection solution
     615             :         int NumSurfaces = 0;                                       // Number of surfaces for this zone
     616             :         int NumSubSurfaces = 0;                                    // Number of subsurfaces for this zone (windows, doors, tdd dome and diffusers)
     617             :         int NumShadingSurfaces = 0;                                // Number of shading surfaces for this zone
     618             :         Convect::HcExt ExtConvAlgo = Convect::HcExt::ASHRAESimple; // Ref: appropriate values for Outside Convection solution
     619             :         Vector Centroid;                                           // Center of the zone found by averaging wall, floor, and roof centroids
     620             :         Real64 MinimumX = 0.0;                                     // Minimum X value for entire zone
     621             :         Real64 MaximumX = 0.0;                                     // Maximum X value for entire zone
     622             :         Real64 MinimumY = 0.0;                                     // Minimum Y value for entire zone
     623             :         Real64 MaximumY = 0.0;                                     // Maximum Y value for entire zone
     624             :         Real64 MinimumZ = 0.0;                                     // Minimum Z value for entire zone
     625             :         Real64 MaximumZ = 0.0;                                     // Maximum Z value for entire zone
     626             :         std::vector<int> ZoneHTSurfaceList;                        // List of HT surfaces related to this zone (includes adjacent interzone surfaces)
     627             :         std::vector<int> ZoneIZSurfaceList;                        // List of interzone surfaces in this zone
     628             :         std::vector<int> ZoneHTNonWindowSurfaceList; // List of non-window HT surfaces related to this zone (includes adjacent interzone surfaces)
     629             :         std::vector<int> ZoneHTWindowSurfaceList;    // List of window surfaces related to this zone (includes adjacent interzone surfaces)
     630             :         int zoneRadEnclosureFirst = -1;              // For Zone resimulation, need a range of enclosures for CalcInteriorRadExchange
     631             :         int zoneRadEnclosureLast = -1;               // For Zone resimulation, need a range of enclosures for CalcInteriorRadExchange
     632             : 
     633             :         Real64 OutDryBulbTemp = 0.0;                 // Zone outside dry bulb air temperature (C)
     634             :         bool OutDryBulbTempEMSOverrideOn = false;    // if true, EMS is calling to override the surface's outdoor air temp
     635             :         Real64 OutDryBulbTempEMSOverrideValue = 0.0; // value to use for EMS override of outdoor air drybulb temp (C)
     636             :         Real64 OutWetBulbTemp = 0.0;                 // Zone outside wet bulb air temperature (C)
     637             :         bool OutWetBulbTempEMSOverrideOn = false;    // if true, EMS is calling to override the surface's outdoor wetbulb
     638             :         Real64 OutWetBulbTempEMSOverrideValue = 0.0; // value to use for EMS override of outdoor air wetbulb temp (C)
     639             :         Real64 WindSpeed = 0.0;                      // Zone outside wind speed (m/s)
     640             :         bool WindSpeedEMSOverrideOn = false;         // if true, EMS is calling to override the surface's outside wind speed
     641             :         Real64 WindSpeedEMSOverrideValue = 0.0;      // value to use for EMS override of the surface's outside wind speed
     642             :         Real64 WindDir = 0.0;                        // Zone outside wind direction (degree)
     643             :         bool WindDirEMSOverrideOn = false;           // if true, EMS is calling to override the surface's outside wind direction
     644             :         Real64 WindDirEMSOverrideValue = 0.0;        // value to use for EMS override of the surface's outside wind speed
     645             : 
     646             :         int LinkedOutAirNode = 0; // Index of the an OutdoorAir:Node,, zero if none
     647             : 
     648             :         bool isPartOfTotalArea = true;           // Count the zone area when determining the building total floor area
     649             :         bool isNominalOccupied = false;          // has occupancy nominally specified
     650             :         bool isNominalControlled = false;        // has Controlled Zone Equip Configuration reference
     651             :         Real64 minOccupants = 0.0;               // minimum occupancy (sum of NomMinNumberPeople for the zone People objects, not multiplied)
     652             :         Real64 maxOccupants = 0.0;               // maximum occupancy (sum of NomMaxNumberPeople for the zone People objects, not multiplied)
     653             :         int AirHBimBalanceErrIndex = 0;          // error management counter
     654             :         bool NoHeatToReturnAir = false;          // TRUE means that heat to return air should be added to the zone load
     655             :         bool RefrigCaseRA = false;               // TRUE means there is potentially heat removal from return air
     656             :         bool HasAdjustedReturnTempByITE = false; // TRUE means that return temp to return air is adjusted by return temperature of ITE object
     657             :         Real64 AdjustedReturnTempByITE = 0.0;    // Diff of the return temp from the zone mixed air temp adjusted by ITE object
     658             : 
     659             :         bool HasLtsRetAirGain = false;       // TRUE means that zone lights return air heat > 0.0 calculated from plenum temperature
     660             :         bool HasAirFlowWindowReturn = false; // TRUE means that zone has return air flow from windows
     661             :         // from refrigeration cases for this zone
     662             :         Real64 InternalHeatGains = 0.0;                      // internal loads (W)
     663             :         Real64 NominalInfilVent = 0.0;                       // internal infiltration/ventilation
     664             :         Real64 NominalMixing = 0.0;                          // internal mixing/cross mixing
     665             :         bool TempOutOfBoundsReported = false;                // if any temp out of bounds errors, first will show zone details.
     666             :         bool EnforcedReciprocity = false;                    // if zone/space required forced reciprocity -- less out of bounds temp errors allowed
     667             :         int ZoneMinCO2SchedIndex = 0;                        // Index for the schedule the schedule which determines minimum CO2 concentration
     668             :         int ZoneMaxCO2SchedIndex = 0;                        // Index for the schedule the schedule which determines maximum CO2 concentration
     669             :         int ZoneContamControllerSchedIndex = 0;              // Index for this schedule
     670             :         bool FlagCustomizedZoneCap = false;                  // True if customized Zone Capacitance Multiplier is used
     671             :         std::vector<Constant::eFuel> otherEquipFuelTypeNums; // List of fuel types used by other equipment in this zone
     672             : 
     673             :         // Hybrid Modeling
     674             :         Real64 ZoneMeasuredTemperature = 0.0;               // Measured zone air temperature input by user
     675             :         Real64 ZoneMeasuredHumidityRatio = 0.0;             // Measured zone air humidity ratio by user
     676             :         Real64 ZoneMeasuredCO2Concentration = 0.0;          // Measured zone air CO2 concentration input by user
     677             :         Real64 ZoneMeasuredSupplyAirTemperature = 0.0;      // Measured zone supply air temperature input by user
     678             :         Real64 ZoneMeasuredSupplyAirFlowRate = 0.0;         // Measured zone supply air flow rate input by user
     679             :         Real64 ZoneMeasuredSupplyAirHumidityRatio = 0.0;    // Measured zone supply air flow rate input by user
     680             :         Real64 ZoneMeasuredSupplyAirCO2Concentration = 0.0; // Measured zone supply air flow rate input by user
     681             :         Real64 ZonePeopleActivityLevel = 0.0;               // People activity level input by user
     682             :         Real64 ZonePeopleSensibleHeatFraction = 0.0;        // People activity level input by user
     683             :         Real64 ZonePeopleRadiantHeatFraction = 0.0;         // People activity level input by user
     684             :         Real64 ZoneVolCapMultpSens = 1.0;                   // Zone temperature capacity multiplier, i.e. internal thermal mass multiplier
     685             :         Real64 ZoneVolCapMultpMoist = 1.0;                  // Zone humidity capacity multiplier
     686             :         Real64 ZoneVolCapMultpCO2 = 1.0;                    // Zone carbon dioxide capacity multiplier
     687             :         Real64 ZoneVolCapMultpGenContam = 1.0;              // Zone generic contaminant capacity multiplier
     688             :         Real64 ZoneVolCapMultpSensHM = 1.0;                 // Calculated temperature capacity multiplier by hybrid model
     689             :         Real64 ZoneVolCapMultpSensHMSum = 0.0;              // for temperature capacity multiplier average calculation
     690             :         Real64 ZoneVolCapMultpSensHMCountSum = 0.0;         // for temperature capacity multiplier average calculation
     691             :         Real64 ZoneVolCapMultpSensHMAverage = 1.0;          // Temperature capacity multiplier average
     692             :         Real64 MCPIHM = 0.0;                                // Calculated mass flow rate by hybrid model
     693             :         Real64 InfilOAAirChangeRateHM = 0.0;                // Calculated infiltration air change per hour by hybrid model
     694             :         Real64 NumOccHM = 0.0;                              // Inversely solved people count
     695             :         Real64 delta_T = 0.0;                               // Indoor and outdoor temperature
     696             :         Real64 delta_HumRat = 0.0;                          // Indoor and outdoor humidity ratio delta
     697             : 
     698             :         bool zoneOAQuadratureSum = false; // True when zone OA balance method is Quadrature
     699             :         int zoneOABalanceIndex = 0;       // Index to ZoneAirBalance for this zone, if any
     700             : 
     701             :         // Spaces
     702             :         EPVector<int> spaceIndexes; // Indexes to spaces in this zone
     703             :         int numSpaces = 0;          // Number of spaces in this zone
     704             : 
     705             :         // Default Constructor
     706        5852 :         ZoneData() : Centroid(0.0, 0.0, 0.0)
     707             :         {
     708        5852 :         }
     709             : 
     710             :         void SetOutBulbTempAt(EnergyPlusData &state);
     711             : 
     712             :         void SetWindSpeedAt(EnergyPlusData const &state, Real64 fac);
     713             : 
     714             :         void SetWindDirAt(Real64 fac);
     715             : 
     716             :         Real64 sumHATsurf(EnergyPlusData &state);
     717             :     };
     718             : 
     719             :     struct ZoneListData
     720             :     {
     721             :         // Members
     722             :         std::string Name;                         // Zone List name
     723             :         int NumOfZones = 0;                       // Number of zones in the list
     724             :         std::string::size_type MaxZoneNameLength; // Max Name length of zones in the list
     725             :         Array1D_int Zone;                         // Pointers to zones in the list
     726             : 
     727             :         // Default Constructor
     728          81 :         ZoneListData() : MaxZoneNameLength(0u)
     729             :         {
     730          81 :         }
     731             :     };
     732             : 
     733             :     struct ZoneGroupData
     734             :     {
     735             :         // Members
     736             :         std::string Name;   // Zone Group name
     737             :         int ZoneList = 0;   // Pointer to the zone list
     738             :         int Multiplier = 1; // Zone List multiplier
     739             :     };
     740             : 
     741             :     enum class ClothingType
     742             :     {
     743             :         Invalid = -1,
     744             :         InsulationSchedule,
     745             :         DynamicAshrae55,
     746             :         CalculationSchedule,
     747             :         Num
     748             :     };
     749             :     constexpr std::array<std::string_view, static_cast<int>(ClothingType::Num)> clothingTypeNamesUC = {
     750             :         "CLOTHINGINSULATIONSCHEDULE", "DYNAMICCLOTHINGMODELASHRAE55", "CALCULATIONMETHODSCHEDULE"};
     751             :     constexpr std::array<std::string_view, static_cast<int>(ClothingType::Num)> clothingTypeEIOStrings = {
     752             :         "Clothing Insulation Schedule,", "Dynamic Clothing Model ASHRAE55,", "Calculation Method Schedule,"};
     753             : 
     754             :     struct PeopleData
     755             :     {
     756             :         // Members
     757             :         std::string Name;               // PEOPLE object name
     758             :         int ZonePtr = 0;                // Zone index for this people statement
     759             :         int spaceIndex = 0;             // Space index for this people statement
     760             :         Real64 NumberOfPeople = 0.0;    // Maximum number of people for this statement
     761             :         int NumberOfPeoplePtr = -1;     // Pointer to schedule for number of people
     762             :         bool EMSPeopleOn = false;       // EMS actuating number of people if .TRUE.
     763             :         Real64 EMSNumberOfPeople = 0.0; // Value EMS is directing to use for override
     764             :         // Note that the schedule and maximum number was kept for people since it seemed likely that
     765             :         // users would want to assign the same schedule to multiple people statements.
     766             :         int ActivityLevelPtr = -1;    // Pointer to schedule for activity level
     767             :         Real64 FractionRadiant = 0.0; // Percentage (fraction 0.0-1.0) of sensible heat gain from people
     768             :         // that is radiant
     769             :         Real64 FractionConvected = 0.0; // Percentage (fraction 0.0-1.0) of sensible heat gain from people
     770             :         // that is convective
     771             :         Real64 NomMinNumberPeople = 0.0; // Nominal Minimum Number of People (min sch X number of people)
     772             :         Real64 NomMaxNumberPeople = 0.0; // Nominal Maximum Number of People (min sch X number of people)
     773             :         int WorkEffPtr = -1;             // Pointer to schedule for work efficiency
     774             :         int ClothingPtr = -1;            // Pointer to schedule for clothing insulation
     775             :         int ClothingMethodPtr = -1;
     776             :         ClothingType clothingType = ClothingType::Invalid; // Clothing type
     777             :         int AirVelocityPtr = -1;                           // Pointer to schedule for air velocity in zone
     778             :         int AnkleAirVelocityPtr = -1;                      // Pointer to schedule for air velocity in zone
     779             :         bool Fanger = false;                               // True when Fanger calculation to be performed
     780             :         bool Pierce = false;                               // True when Pierce 2-node calculation to be performed
     781             :         bool KSU = false;                                  // True when KSU 2-node calculation to be performed
     782             :         bool AdaptiveASH55 = false;                        // True when ASHRAE Standard 55 adaptive comfort calculation
     783             :         //   to be performed
     784             :         bool AdaptiveCEN15251 = false; // True when CEN Standard 15251 adaptive comfort calculation
     785             :         //   to be performed
     786             :         bool CoolingEffectASH55 = false;                         // True when ASHRAE Standard 55 cooling effect calculation to be performed
     787             :         bool AnkleDraftASH55 = false;                            // True when ASHRAE Standard 55 ankle draft calculation to be performed
     788             :         CalcMRT MRTCalcType = DataHeatBalance::CalcMRT::Invalid; // MRT calculation type (See MRT Calculation type parameters)
     789             :         int SurfacePtr = -1;                                     // Pointer to the name of surface
     790             :         std::string AngleFactorListName;                         // Name of angle factor list
     791             :         int AngleFactorListPtr = -1;                             // Pointer to the name of angle factor list
     792             :         Real64 UserSpecSensFrac = 0.0;                           // User specified sensible fraction
     793             :         bool Show55Warning = false;                              // show the warning messages about ASHRAE 55-2004
     794             :         Real64 CO2RateFactor = 0.0;                              // Carbon Dioxide Generation Rate [m3/s-W]
     795             :         // Report variables
     796             :         Real64 NumOcc = 0.0;            // Number of occupants at current timestep []
     797             :         Real64 TemperatureInZone = 0.0; // Temperature in zone (C)
     798             :         Real64 ColdStressTempThresh = 15.56;
     799             :         Real64 HeatStressTempThresh = 30.0;
     800             :         Real64 RelativeHumidityInZone = 0.0; // Relative humidity in zone
     801             :         Real64 RadGainRate = 0.0;            // Radiant heat gain [W]
     802             :         Real64 ConGainRate = 0.0;            // Convective heat gain [W]
     803             :         Real64 SenGainRate = 0.0;            // Sensible heat gain [W]
     804             :         Real64 LatGainRate = 0.0;            // Latent heat gain [W]
     805             :         Real64 TotGainRate = 0.0;            // Total heat gain [W]
     806             :         Real64 CO2GainRate = 0.0;            // Carbon Dioxide Gain Rate [m3/s]
     807             :         Real64 RadGainEnergy = 0.0;          // Radiant heat gain [J]
     808             :         Real64 ConGainEnergy = 0.0;          // Convective heat gain [J]
     809             :         Real64 SenGainEnergy = 0.0;          // Sensible heat gain [J]
     810             :         Real64 LatGainEnergy = 0.0;          // Latent heat gain [J]
     811             :         Real64 TotGainEnergy = 0.0;          // Total heat gain [J]
     812             :         // Air velocity check during run time for thermal comfort control
     813             :         int AirVelErrIndex = 0; // Air velocity error index
     814             :         // For AdaptiveComfort tabular report
     815             :         Real64 TimeNotMetASH5580 = 0.0;
     816             :         Real64 TimeNotMetASH5590 = 0.0;
     817             :         Real64 TimeNotMetCEN15251CatI = 0.0;
     818             :         Real64 TimeNotMetCEN15251CatII = 0.0;
     819             :         Real64 TimeNotMetCEN15251CatIII = 0.0;
     820             :     };
     821             : 
     822             :     struct LightsData
     823             :     {
     824             :         // Members
     825             :         std::string Name;                 // LIGHTS object name
     826             :         int ZonePtr = 0;                  // Which zone lights are in
     827             :         int spaceIndex = 0;               // Space index for this lights instance
     828             :         int SchedPtr = -1;                // Schedule for lights
     829             :         Real64 DesignLevel = 0.0;         // design level for lights [W]
     830             :         bool EMSLightsOn = false;         // EMS actuating Lighting power if .TRUE.
     831             :         Real64 EMSLightingPower = 0.0;    // Value EMS is directing to use for override
     832             :         Real64 FractionReturnAir = 0.0;   // Percentage (fraction 0.0-1.0) of sensible heat gain that is return air
     833             :         Real64 FractionRadiant = 0.0;     // Percentage (fraction 0.0-1.0) of sensible heat gain that is radiant
     834             :         Real64 FractionShortWave = 0.0;   // Percentage (fraction 0.0-1.0) of sensible heat gain that is short wave
     835             :         Real64 FractionReplaceable = 0.0; // Percentage (fraction 0.0-1.0) of sensible heat gain that is replaceable
     836             :         Real64 FractionConvected = 0.0;   // Percentage (fraction 0.0-1.0) of sensible heat gain that is convective
     837             :         bool FractionReturnAirIsCalculated = false;
     838             :         Real64 FractionReturnAirPlenTempCoeff1 = 0.0;
     839             :         Real64 FractionReturnAirPlenTempCoeff2 = 0.0;
     840             :         int ZoneReturnNum = 1;          // zone return index (not the node number) for return heat gain
     841             :         std::string RetNodeName;        // Zone return node name
     842             :         int ZoneExhaustNodeNum = 0;     // Exhaust node number
     843             :         Real64 NomMinDesignLevel = 0.0; // Nominal Minimum Design Level (min sch X design level)
     844             :         Real64 NomMaxDesignLevel = 0.0; // Nominal Maximum Design Level (max sch X design level)
     845             :         bool ManageDemand = false;      // Flag to indicate whether to use demand limiting
     846             :         Real64 DemandLimit = 0.0;       // Demand limit set by demand manager [W]
     847             :         // Report variables
     848             :         Real64 Power = 0.0;              // Electric power [W]
     849             :         Real64 RadGainRate = 0.0;        // Radiant heat gain [W]
     850             :         Real64 VisGainRate = 0.0;        // Visible heat gain [W]
     851             :         Real64 ConGainRate = 0.0;        // Convective heat gain [W]
     852             :         Real64 RetAirGainRate = 0.0;     // Return air heat gain [W]
     853             :         Real64 TotGainRate = 0.0;        // Total heat gain [W]
     854             :         Real64 Consumption = 0.0;        // Electric consumption [J]
     855             :         Real64 RadGainEnergy = 0.0;      // Radiant heat gain [J]
     856             :         Real64 VisGainEnergy = 0.0;      // Visible heat gain [J]
     857             :         Real64 ConGainEnergy = 0.0;      // Convective heat gain [J]
     858             :         Real64 RetAirGainEnergy = 0.0;   // Return air heat gain [J]
     859             :         Real64 TotGainEnergy = 0.0;      // Total heat gain [J]
     860             :         std::string EndUseSubcategory;   // user defined name for the end use category
     861             :         Real64 SumConsumption = 0.0;     // sum of electric consumption [J] for reporting
     862             :         Real64 SumTimeNotZeroCons = 0.0; // sum of time of positive electric consumption [hr]
     863             :     };
     864             : 
     865             :     struct ZoneEquipData // Electric, Gas, Other Equipment, CO2
     866             :     {
     867             :         // Members
     868             :         std::string Name;                    // EQUIPMENT object name
     869             :         int ZonePtr = 0;                     // Which zone internal gain is in
     870             :         int spaceIndex = 0;                  // Space index for this equipment instance
     871             :         int SchedPtr = 0;                    // Schedule for internal gain
     872             :         Real64 DesignLevel = 0.0;            // design level for internal gain [W]
     873             :         bool EMSZoneEquipOverrideOn = false; // EMS actuating equipment power if .TRUE.
     874             :         Real64 EMSEquipPower = 0.0;          // Value EMS is directing to use for override
     875             :         Real64 FractionLatent = 0.0;         // Percentage (fraction 0.0-1.0) of sensible heat gain that is latent
     876             :         Real64 FractionRadiant = 0.0;        // Percentage (fraction 0.0-1.0) of sensible heat gain that is radiant
     877             :         Real64 FractionLost = 0.0;           // Percentage (fraction 0.0-1.0) of sensible heat gain that is lost
     878             :         Real64 FractionConvected = 0.0;      // Percentage (fraction 0.0-1.0) of sensible heat gain that is convective
     879             :         Real64 CO2DesignRate = 0.0;          // CO2 design Rate [m3/s]
     880             :         Real64 CO2RateFactor = 0.0;          // CO2 rate factor [m3/s/W]
     881             :         Real64 NomMinDesignLevel = 0.0;      // Nominal Minimum Design Level (min sch X design level)
     882             :         Real64 NomMaxDesignLevel = 0.0;      // Nominal Maximum Design Level (max sch X design level)
     883             :         bool ManageDemand = false;           // Flag to indicate whether to use demand limiting
     884             :         Real64 DemandLimit = 0.0;            // Demand limit set by demand manager [W]
     885             :         // Report variables
     886             :         Real64 Power = 0.0;                                            // Electric/Gas/Fuel power [W]
     887             :         Real64 RadGainRate = 0.0;                                      // Radiant heat gain [W]
     888             :         Real64 ConGainRate = 0.0;                                      // Convective heat gain [W]
     889             :         Real64 LatGainRate = 0.0;                                      // Latent heat gain [W]
     890             :         Real64 LostRate = 0.0;                                         // Lost energy (converted to work) [W]
     891             :         Real64 TotGainRate = 0.0;                                      // Total heat gain [W]
     892             :         Real64 CO2GainRate = 0.0;                                      // CO2 gain rate [m3/s]
     893             :         Real64 Consumption = 0.0;                                      // Electric/Gas/Fuel consumption [J]
     894             :         Real64 RadGainEnergy = 0.0;                                    // Radiant heat gain [J]
     895             :         Real64 ConGainEnergy = 0.0;                                    // Convective heat gain [J]
     896             :         Real64 LatGainEnergy = 0.0;                                    // Latent heat gain [J]
     897             :         Real64 LostEnergy = 0.0;                                       // Lost energy (converted to work) [J]
     898             :         Real64 TotGainEnergy = 0.0;                                    // Total heat gain [J]
     899             :         std::string EndUseSubcategory;                                 // user defined name for the end use category
     900             :         std::string otherEquipFuelTypeString;                          // Fuel Type string for Other Equipment
     901             :         Constant::eFuel OtherEquipFuelType = Constant::eFuel::Invalid; // Fuel Type Number of the Other Equipment
     902             :     };
     903             : 
     904             :     struct ExtVentedCavityStruct
     905             :     {
     906             :         // Members
     907             :         // from input data
     908             :         std::string Name;
     909             :         std::string OSCMName;                       // OtherSideConditionsModel
     910             :         int OSCMPtr;                                // OtherSideConditionsModel index
     911             :         Real64 Porosity;                            // fraction of absorber plate [--]
     912             :         Real64 LWEmitt;                             // Thermal Emissivity of Baffle Surface [dimensionless]
     913             :         Real64 SolAbsorp;                           // Solar Absorbtivity of Baffle Surface [dimensionless]
     914             :         Material::SurfaceRoughness BaffleRoughness; // surface roughness for exterior convection calcs.
     915             :         Real64 PlenGapThick;                        // Depth of Plenum Behind Baffle [m]
     916             :         int NumSurfs;                               // a single baffle can have multiple surfaces underneath it
     917             :         Array1D_int SurfPtrs;                       // = 0  ! array of pointers for participating underlying surfaces
     918             :         Real64 HdeltaNPL;                           // Height scale for Cavity buoyancy  [m]
     919             :         Real64 AreaRatio;                           // Ratio of actual surface are to projected surface area [dimensionless]
     920             :         Real64 Cv;                                  // volume-based effectiveness of openings for wind-driven vent when Passive
     921             :         Real64 Cd;                                  // discharge coefficient of openings for buoyancy-driven vent when Passive
     922             :         // data from elsewhere and calculated
     923             :         Real64 ActualArea;  // Overall Area of Collect with surface corrugations.
     924             :         Real64 ProjArea;    // Overall Area of Collector projected, as if flat [m2]
     925             :         Vector Centroid;    // computed centroid
     926             :         Real64 TAirCav;     // modeled drybulb temperature for air between baffle and wall [C]
     927             :         Real64 Tbaffle;     // modeled surface temperature for baffle[C]
     928             :         Real64 TairLast;    // Old Value for modeled drybulb temp of air between baffle and wall [C]
     929             :         Real64 TbaffleLast; // Old value for modeled surface temperature for baffle [C]
     930             :         Real64 HrPlen;      // Modeled radiation coef for OSCM [W/m2-C]
     931             :         Real64 HcPlen;      // Modeled Convection coef for OSCM [W/m2-C]
     932             :         Real64 MdotVent;    // air mass flow exchanging with ambient when passive.
     933             :         Real64 Tilt;        // Tilt from area weighted average of underlying surfaces
     934             :         Real64 Azimuth;     // Azimuth from area weighted average of underlying surfaces
     935             :         Real64 QdotSource;  // Source/sink term
     936             :         // reporting data
     937             :         Real64 Isc;              // total incident solar on baffle [W]
     938             :         Real64 PassiveACH;       // air changes per hour when passive [1/hr]
     939             :         Real64 PassiveMdotVent;  // Total Nat Vent air change rate  [kg/s]
     940             :         Real64 PassiveMdotWind;  // Nat Vent air change rate from Wind-driven [kg/s]
     941             :         Real64 PassiveMdotTherm; // Nat. Vent air change rate from buoyancy-driven flow [kg/s]
     942             : 
     943             :         // Default Constructor
     944         801 :         ExtVentedCavityStruct()
     945        1602 :             : OSCMPtr(0), Porosity(0.0), LWEmitt(0.0), SolAbsorp(0.0), BaffleRoughness(Material::SurfaceRoughness::VeryRough), PlenGapThick(0.0),
     946         801 :               NumSurfs(0), HdeltaNPL(0.0), AreaRatio(0.0), Cv(0.0), Cd(0.0), ActualArea(0.0), ProjArea(0.0), Centroid(0.0, 0.0, 0.0), TAirCav(0.0),
     947         801 :               Tbaffle(0.0), TairLast(20.0), TbaffleLast(20.0), HrPlen(0.0), HcPlen(0.0), MdotVent(0.0), Tilt(0.0), Azimuth(0.0), QdotSource(0.0),
     948         801 :               Isc(0.0), PassiveACH(0.0), PassiveMdotVent(0.0), PassiveMdotWind(0.0), PassiveMdotTherm(0.0)
     949             :         {
     950         801 :         }
     951             :     };
     952             : 
     953             :     // ITE Equipment Environmental Class Data
     954             :     // MODULE PARAMETER DEFINITIONS:
     955             :     enum class ITEClass
     956             :     {
     957             :         Invalid = -1,
     958             :         None, // (0)
     959             :         A1,   // (1)
     960             :         A2,   // (2)
     961             :         A3,   // (3)
     962             :         A4,   // (4)
     963             :         B,    // (5)
     964             :         C,    // (6)
     965             :         H1,   // (7)
     966             :         Num
     967             :     };
     968             :     static constexpr std::array<std::string_view, static_cast<int>(ITEClass::Num)> ITEClassNamesUC = {"NONE", "A1", "A2", "A3", "A4", "B", "C", "H1"};
     969             : 
     970             :     enum class ITEInletConnection
     971             :     {
     972             :         Invalid = -1,
     973             :         AdjustedSupply,
     974             :         ZoneAirNode,
     975             :         RoomAirModel,
     976             :         Num
     977             :     };
     978             :     static constexpr std::array<std::string_view, static_cast<int>(ITEInletConnection::Num)> ITEInletConnectionNamesUC = {
     979             :         "ADJUSTEDSUPPLY", "ZONEAIRNODE", "ROOMAIRMODEL"};
     980             : 
     981             :     enum class PERptVars
     982             :     {
     983             :         CPU = 0,       // ITE CPU Electric Power/Energy
     984             :         Fan,           // ITE Fan Electric Power/Energy
     985             :         UPS,           // ITE UPS Electric Power/Energy
     986             :         CPUAtDesign,   // ITE CPU Electric Power/Energy at Design Inlet Conditions
     987             :         FanAtDesign,   // ITE Fan Electric Power/Energy at Design Inlet Conditions
     988             :         UPSGainToZone, // ITE UPS Heat Gain to Zone Power(Rate)/Energy - convective gain
     989             :         ConGainToZone, // ITE Total Heat Gain to Zone Power(Rate)/Energy - convective gain - includes heat gain from UPS, plus CPU and Fans if
     990             :                        // room air model not used
     991             :         Num
     992             :     };
     993             : 
     994             :     struct ITEquipData // IT Equipment
     995             :     {
     996             :         // Members
     997             :         std::string Name;                          // EQUIPMENT object name
     998             :         int ZonePtr = 0;                           // Which zone internal gain is in
     999             :         int spaceIndex = 0;                        // Space index for this equipment instance
    1000             :         bool FlowControlWithApproachTemps = false; // True if using supply and return approach temperature for ITE object.
    1001             :         Real64 DesignTotalPower = 0.0;             // Design level for internal gain [W]
    1002             :         Real64 NomMinDesignLevel = 0.0;            // Nominal Minimum Design Level (min sch X design level)
    1003             :         Real64 NomMaxDesignLevel = 0.0;            // Nominal Maximum Design Level (max sch X design level)
    1004             :         Real64 DesignFanPowerFrac = 0.0;           // Fraction (0.0-1.0) of design power level that is fans
    1005             :         int OperSchedPtr = 0;                      // Schedule pointer for design power input or operating schedule
    1006             :         int CPULoadSchedPtr = 0;                   // Schedule pointer for CPU loading schedule
    1007             :         Real64 SizingTAirIn = 0.0;                 // Entering air dry-bulb temperature at maximum value during sizing[C]
    1008             :         Real64 DesignTAirIn = 0.0;                 // Design entering air dry-bulb temperature [C]
    1009             :         Real64 DesignFanPower = 0.0;               // Design fan power input [W]
    1010             :         Real64 DesignCPUPower = 0.0;               // Design CPU power input [W]
    1011             :         Real64 DesignAirVolFlowRate = 0.0;         // Design air volume flow rate [m3/s]
    1012             :         ITEClass Class = ITEClass::None;           // Environmental class index (A1=1, A2=2, A3=3, A4=4, B=5, C=6, H1=7)
    1013             :         int AirFlowFLTCurve = 0;                   // Index for airflow function of CPULoadFrac (x) and TAirIn (y) curve
    1014             :         int CPUPowerFLTCurve = 0;                  // Index for CPU power function of CPULoadFrac (x) and TAirIn (y) curve
    1015             :         int FanPowerFFCurve = 0;                   // Index for fan power function of flow fraction curve
    1016             :         ITEInletConnection AirConnectionType = ITEInletConnection::AdjustedSupply; // Air connection type (AdjustedSupply, ZoneAirNode, RoomAirModel)
    1017             :         int InletRoomAirNodeNum = 0;                                               // Room air model node number for air inlet
    1018             :         int OutletRoomAirNodeNum = 0;                                              // Room air model node number for air outlet
    1019             :         int SupplyAirNodeNum = 0;                                                  // Node number for supply air inlet
    1020             :         Real64 DesignRecircFrac = 0.0;                                             // Design recirculation fraction (0.0-0.5)
    1021             :         int RecircFLTCurve = 0;             // Index for recirculation function of CPULoadFrac (x) and TSupply (y) curve
    1022             :         Real64 DesignUPSEfficiency = 0.0;   // Design power supply efficiency (>0.0 - 1.0)
    1023             :         int UPSEfficFPLRCurve = 0;          // Index for recirculation function of part load ratio
    1024             :         Real64 UPSLossToZoneFrac = 0.0;     // Fraction of UPS power loss to zone (0.0 - 1.0); remainder is lost
    1025             :         std::string EndUseSubcategoryCPU;   // User defined name for the end use category for the CPU
    1026             :         std::string EndUseSubcategoryFan;   // User defined name for the end use category for the Fans
    1027             :         std::string EndUseSubcategoryUPS;   // User defined name for the end use category for the power supply
    1028             :         bool EMSCPUPowerOverrideOn = false; // EMS actuating CPU power if .TRUE.
    1029             :         Real64 EMSCPUPower = 0.0;           // Value EMS is directing to use for override of CPU power [W]
    1030             :         bool EMSFanPowerOverrideOn = false; // EMS actuating Fan power if .TRUE.
    1031             :         Real64 EMSFanPower = 0.0;           // Value EMS is directing to use for override of Fan power [W]
    1032             :         bool EMSUPSPowerOverrideOn = false; // EMS actuating UPS power if .TRUE.
    1033             :         Real64 EMSUPSPower = 0.0;           // Value EMS is directing to use for override of UPS power [W]
    1034             :         Real64 SupplyApproachTemp = 0.0;    // The difference of the IT inlet temperature from the AHU supply air temperature
    1035             :         int SupplyApproachTempSch = 0;      // The difference schedule of the IT inlet temperature from the AHU supply air temperature
    1036             :         Real64 ReturnApproachTemp = 0.0;    // The difference of the unit outlet temperature from the well mixed zone temperature
    1037             :         int ReturnApproachTempSch = 0;      // The difference schedule of the unit outlet temperature from the well mixed zone temperature
    1038             :         bool inControlledZone = false;      // True if in a controlled zone
    1039             : 
    1040             :         // Report variables
    1041             :         std::array<Real64, (int)PERptVars::Num> PowerRpt;
    1042             :         std::array<Real64, (int)PERptVars::Num> EnergyRpt;
    1043             : 
    1044             :         Real64 AirVolFlowStdDensity = 0.0; // Air volume flow rate at standard density [m3/s]
    1045             :         Real64 AirVolFlowCurDensity = 0.0; // Air volume flow rate at current density [m3/s]
    1046             :         Real64 AirMassFlow = 0.0;          // Air mass flow rate [kg/s]
    1047             :         Real64 AirInletDryBulbT = 0.0;     // Air inlet dry-bulb temperature [C]
    1048             :         Real64 AirInletDewpointT = 0.0;    // Air inlet dewpoint temperature [C]
    1049             :         Real64 AirInletRelHum = 0.0;       // Air inlet relative humidity [%]
    1050             :         Real64 AirOutletDryBulbT = 0.0;    // Air outlet dry-bulb temperature [C]
    1051             :         Real64 SHI = 0.0;                  // Supply Heat Index []
    1052             :         Real64 TimeOutOfOperRange = 0.0;   // ITE Air Inlet Operating Range Exceeded Time [hr]
    1053             :         Real64 TimeAboveDryBulbT = 0.0;    // ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time [hr]
    1054             :         Real64 TimeBelowDryBulbT = 0.0;    // ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time [hr]
    1055             :         Real64 TimeAboveDewpointT = 0.0;   // ITE Air Inlet Dewpoint Temperature Above Operating Range Time [hr]
    1056             :         Real64 TimeBelowDewpointT = 0.0;   // ITE Air Inlet Dewpoint Temperature Below Operating Range Time [hr]
    1057             :         Real64 TimeAboveRH = 0.0;          // ITE Air Inlet Relative Humidity Above Operating Range Time [hr]
    1058             :         Real64 TimeBelowRH = 0.0;          // ITE Air Inlet Relative Humidity Below Operating Range Time [hr]
    1059             :         Real64 DryBulbTAboveDeltaT = 0.0;  // ITE Air Inlet Dry-Bulb Temperature Difference Above Operating Range [deltaC]
    1060             :         Real64 DryBulbTBelowDeltaT = 0.0;  // ITE Air Inlet Dry-Bulb Temperature Difference Below Operating Range [deltaC]
    1061             :         Real64 DewpointTAboveDeltaT = 0.0; // ITE Air Inlet Dewpoint Temperature Difference Above Operating Range [deltaC]
    1062             :         Real64 DewpointTBelowDeltaT = 0.0; // ITE Air Inlet Dewpoint Temperature Difference Below Operating Range [deltaC]
    1063             :         Real64 RHAboveDeltaRH = 0.0;       // ITE Air Inlet Relative Humidity Difference Above Operating Range [%]
    1064             :         Real64 RHBelowDeltaRH = 0.0;       // ITE Air Inlet Relative Humidity Difference Below Operating Range [%]
    1065             :     };
    1066             : 
    1067             :     struct BBHeatData
    1068             :     {
    1069             :         // Members
    1070             :         std::string Name; // BASEBOARD HEAT object name
    1071             :         int ZonePtr = 0;
    1072             :         int spaceIndex = 0; // Space index for this equipment instance
    1073             :         int SchedPtr = 0;
    1074             :         Real64 CapatLowTemperature = 0.0;
    1075             :         Real64 LowTemperature = 0.0;
    1076             :         Real64 CapatHighTemperature = 0.0;
    1077             :         Real64 HighTemperature = 0.0;
    1078             :         bool EMSZoneBaseboardOverrideOn = false; // EMS actuating equipment power if .TRUE.
    1079             :         Real64 EMSZoneBaseboardPower = 0.0;      // Value EMS is directing to use for override
    1080             :         Real64 FractionRadiant = 0.0;
    1081             :         Real64 FractionConvected = 0.0;
    1082             :         bool ManageDemand = false; // Flag to indicate whether to use demand limiting
    1083             :         Real64 DemandLimit = 0.0;  // Demand limit set by demand manager [W]
    1084             :         // Report variables
    1085             :         Real64 Power = 0.0;            // Electric power [W]
    1086             :         Real64 RadGainRate = 0.0;      // Radiant heat gain [W]
    1087             :         Real64 ConGainRate = 0.0;      // Convective heat gain [W]
    1088             :         Real64 TotGainRate = 0.0;      // Total heat gain [W]
    1089             :         Real64 Consumption = 0.0;      // Electric consumption [J]
    1090             :         Real64 RadGainEnergy = 0.0;    // Radiant heat gain [J]
    1091             :         Real64 ConGainEnergy = 0.0;    // Convective heat gain [J]
    1092             :         Real64 TotGainEnergy = 0.0;    // Total heat gain [J]
    1093             :         std::string EndUseSubcategory; // user defined name for the end use category
    1094             :     };
    1095             : 
    1096             :     struct InfiltrationData
    1097             :     {
    1098             :         // Members
    1099             :         std::string Name;
    1100             :         int ZonePtr = 0;                                                  // Which zone infiltration is in
    1101             :         int spaceIndex = 0;                                               // Space index for this infiltration instance
    1102             :         int SchedPtr = 0;                                                 // Schedule for infiltration
    1103             :         InfiltrationModelType ModelType = InfiltrationModelType::Invalid; // which model is used for infiltration
    1104             :         // Design Flow Rate model terms
    1105             :         Real64 DesignLevel = 0.0;
    1106             :         Real64 ConstantTermCoef = 0.0;
    1107             :         Real64 TemperatureTermCoef = 0.0;
    1108             :         Real64 VelocityTermCoef = 0.0;
    1109             :         Real64 VelocitySQTermCoef = 0.0;
    1110             :         // Effective Leakage Area, Sherman Grimsrud terms
    1111             :         Real64 LeakageArea = 0.0;           // "AL" effective air leakage area
    1112             :         Real64 BasicStackCoefficient = 0.0; // "Cs" Stack coefficient
    1113             :         Real64 BasicWindCoefficient = 0.0;  // "Cw" wind coefficient
    1114             :         // Flow Coefficient, AIM-2, Walker and Wilson terms
    1115             :         Real64 FlowCoefficient = 0.0;       // "c" Flow coefficient
    1116             :         Real64 AIM2StackCoefficient = 0.0;  // "Cs" stack coefficient
    1117             :         Real64 AIM2WindCoefficient = 0.0;   // "Cw" wind coefficient
    1118             :         Real64 PressureExponent = 0.0;      // "n" pressure power law exponent
    1119             :         Real64 ShelterFactor = 0.0;         // "s" shelter factor
    1120             :         bool EMSOverrideOn = false;         // if true then EMS is requesting to override
    1121             :         Real64 EMSAirFlowRateValue = 0.0;   // value EMS is setting for air flow rate
    1122             :         Real64 VolumeFlowRate = 0.0;        // infiltration air volume flow rate
    1123             :         Real64 MassFlowRate = 0.0;          // infiltration air mass flow rate
    1124             :         Real64 MCpI_temp = 0.0;             // INFILTRATION MASS FLOW * AIR SPECIFIC HEAT
    1125             :         Real64 InfilHeatGain = 0.0;         // Heat Gain {J} due to infiltration
    1126             :         Real64 InfilHeatLoss = 0.0;         // Heat Loss {J} due to infiltration
    1127             :         Real64 InfilLatentGain = 0.0;       // Latent Gain {J} due to infiltration
    1128             :         Real64 InfilLatentLoss = 0.0;       // Latent Loss {J} due to infiltration
    1129             :         Real64 InfilTotalGain = 0.0;        // Total Gain {J} due to infiltration (sensible+latent)
    1130             :         Real64 InfilTotalLoss = 0.0;        // Total Loss {J} due to infiltration (sensible+latent)
    1131             :         Real64 InfilVolumeCurDensity = 0.0; // Volume of Air {m3} due to infiltration at current zone air density
    1132             :         Real64 InfilVolumeStdDensity = 0.0; // Volume of Air {m3} due to infiltration at standard density (adjusted for elevation)
    1133             :         Real64 InfilVdotCurDensity = 0.0;   // Volume flow rate of Air {m3/s} due to infiltration at current zone air density
    1134             :         Real64 InfilVdotStdDensity = 0.0;   // Volume flow rate of Air {m3/s} due to infiltration standard density (adjusted elevation)
    1135             :         Real64 InfilMdot = 0.0;             // Mass flow rate {kg/s} due to infiltration for reporting
    1136             :         Real64 InfilMass = 0.0;             // Mass of Air {kg} due to infiltration
    1137             :         Real64 InfilAirChangeRate = 0.0;    // Infiltration air change rate {ach}
    1138             :     };
    1139             : 
    1140             :     struct VentilationData
    1141             :     {
    1142             :         // Members
    1143             :         std::string Name;
    1144             :         int ZonePtr = 0;
    1145             :         int spaceIndex = 0; // Space index for this ventilation instance
    1146             :         int SchedPtr = 0;
    1147             :         VentilationModelType ModelType =
    1148             :             VentilationModelType::Invalid; // which model is used for ventilation: DesignFlowRate and WindandStackOpenArea
    1149             :         Real64 DesignLevel = 0.0;
    1150             :         bool EMSSimpleVentOn = false;      // EMS actuating ventilation flow rate if .TRUE.
    1151             :         Real64 EMSimpleVentFlowRate = 0.0; // Value EMS is directing to use for override
    1152             :         Real64 MinIndoorTemperature = -100.0;
    1153             :         Real64 DelTemperature = 0.0;
    1154             :         VentilationType FanType = VentilationType::Natural;
    1155             :         Real64 FanPressure = 0.0;
    1156             :         Real64 FanEfficiency = 0.0;
    1157             :         Real64 FanPower = 0.0;
    1158             :         Real64 AirTemp = 0.0;
    1159             :         Real64 ConstantTermCoef = 0.0;
    1160             :         Real64 TemperatureTermCoef = 0.0;
    1161             :         Real64 VelocityTermCoef = 0.0;
    1162             :         Real64 VelocitySQTermCoef = 0.0;
    1163             :         Real64 MaxIndoorTemperature = 100.0;
    1164             :         Real64 MinOutdoorTemperature = -100.0;
    1165             :         Real64 MaxOutdoorTemperature = 100.0;
    1166             :         Real64 MaxWindSpeed = 40.0;
    1167             :         int MinIndoorTempSchedPtr = 0;                            // Minimum indoor temperature schedule index
    1168             :         int MaxIndoorTempSchedPtr = 0;                            // Maximum indoor temperature schedule index
    1169             :         int DeltaTempSchedPtr = 0;                                // Delta temperature schedule index
    1170             :         int MinOutdoorTempSchedPtr = 0;                           // Minimum outdoor temperature schedule index
    1171             :         int MaxOutdoorTempSchedPtr = 0;                           // Maximum outdoor temperature schedule index
    1172             :         int IndoorTempErrCount = 0;                               // Indoor temperature error count
    1173             :         int OutdoorTempErrCount = 0;                              // Outdoor temperature error count
    1174             :         int IndoorTempErrIndex = 0;                               // Indoor temperature error Index
    1175             :         int OutdoorTempErrIndex = 0;                              // Outdoor temperature error Index
    1176             :         HybridCtrlType HybridControlType = HybridCtrlType::Indiv; // Hybrid ventilation control type: 0 Individual, 1 Close, 2 Global
    1177             :         int HybridControlMasterNum = 0;                           // Hybrid ventilation control master object number
    1178             :         bool HybridControlMasterStatus = false;                   // Hybrid ventilation control master object opening status
    1179             :         // WindandStackOpenArea
    1180             :         Real64 OpenArea = 0.0;    // Opening area [m2]
    1181             :         int OpenAreaSchedPtr = 0; // Opening area fraction schedule pointer
    1182             :         Real64 OpenEff = 0.0;     // Opening effectiveness [dimensionless]
    1183             :         Real64 EffAngle = 0.0;    // Effective angle [degree]
    1184             :         Real64 DH = 0.0;          // Height difference [m]
    1185             :         Real64 DiscCoef = 0.0;    // Discharge coefficient
    1186             :         Real64 MCP = 0.0;         // Product of mass flow rate and Cp
    1187             :     };
    1188             : 
    1189             :     struct ZoneAirBalanceData
    1190             :     {
    1191             :         // Members
    1192             :         std::string Name;                            // Object name
    1193             :         std::string ZoneName;                        // Zone name
    1194             :         int ZonePtr = 0;                             // Zone number
    1195             :         AirBalance BalanceMethod = AirBalance::None; // Air Balance Method
    1196             :         Real64 InducedAirRate = 0.0;                 // Induced Outdoor Air Due to Duct Leakage Unbalance [m3/s]
    1197             :         int InducedAirSchedPtr = 0;                  // Induced Outdoor Air Fraction Schedule
    1198             :         Real64 BalMassFlowRate = 0.0;                // balanced mass flow rate
    1199             :         Real64 InfMassFlowRate = 0.0;                // unbalanced mass flow rate from infiltration
    1200             :         Real64 NatMassFlowRate = 0.0;                // unbalanced mass flow rate from natural ventilation
    1201             :         Real64 ExhMassFlowRate = 0.0;                // unbalanced mass flow rate from exhaust ventilation
    1202             :         Real64 IntMassFlowRate = 0.0;                // unbalanced mass flow rate from intake ventilation
    1203             :         Real64 ERVMassFlowRate = 0.0;                // unbalanced mass flow rate from stand-alone ERV
    1204             :         bool OneTimeFlag = false;                    // One time flag to get nodes of stand alone ERV
    1205             :         int NumOfERVs = 0;                           // Number of zone stand alone ERVs
    1206             :         Array1D_int ERVInletNode;                    // Stand alone ERV supply air inlet nodes
    1207             :         Array1D_int ERVExhaustNode;                  // Stand alone ERV air exhaust nodes
    1208             :     };
    1209             : 
    1210             :     struct MixingData
    1211             :     {
    1212             :         // Members
    1213             :         std::string Name;
    1214             :         int ZonePtr = 0;
    1215             :         int spaceIndex = 0; // Space index for this mixing instance
    1216             :         int SchedPtr = 0;
    1217             :         Real64 DesignLevel = 0.0;
    1218             :         int FromZone = 0;
    1219             :         int fromSpaceIndex = 0; // Source space index for this mixing instance
    1220             :         Real64 DeltaTemperature = 0.0;
    1221             :         Real64 DesiredAirFlowRate = 0.0;
    1222             :         Real64 DesiredAirFlowRateSaved = 0.0;
    1223             :         Real64 MixingMassFlowRate = 0.0;
    1224             :         int DeltaTempSchedPtr = 0;                                // Delta temperature schedule index
    1225             :         int MinIndoorTempSchedPtr = 0;                            // Minimum indoor temperature schedule index
    1226             :         int MaxIndoorTempSchedPtr = 0;                            // Maximum indoor temperature schedule index
    1227             :         int MinSourceTempSchedPtr = 0;                            // Minimum source zone temperature schedule index
    1228             :         int MaxSourceTempSchedPtr = 0;                            // Maximum source zone temperature schedule index
    1229             :         int MinOutdoorTempSchedPtr = 0;                           // Minimum outdoor temperature schedule index
    1230             :         int MaxOutdoorTempSchedPtr = 0;                           // Maximum outdoor temperature schedule index
    1231             :         int IndoorTempErrCount = 0;                               // Indoor temperature error count
    1232             :         int SourceTempErrCount = 0;                               // Source zone temperature error count
    1233             :         int OutdoorTempErrCount = 0;                              // Outdoor temperature error count
    1234             :         int IndoorTempErrIndex = 0;                               // Indoor temperature error Index
    1235             :         int SourceTempErrIndex = 0;                               // Source zone temperature error Index
    1236             :         int OutdoorTempErrIndex = 0;                              // Outdoor temperature error Index
    1237             :         HybridCtrlType HybridControlType = HybridCtrlType::Indiv; // Hybrid ventilation control type: 0 Individual, 1 Close, 2 Global
    1238             :         int HybridControlMasterNum = 0;                           // Hybrid ventilation control master ventilation object number
    1239             :         int NumRefDoorConnections = 0;
    1240             :         bool EMSSimpleMixingOn = false;      // EMS actuating ventilation flow rate if .TRUE.
    1241             :         bool RefDoorMixFlag = false;         // Refrigeration door mixing within zone
    1242             :         bool ReportFlag = false;             // TRUE when Mixing or Cross Mixing is active based on controls
    1243             :         Real64 EMSimpleMixingFlowRate = 0.0; // Value EMS is directing to use for override
    1244             :         Array1D_bool EMSRefDoorMixingOn;
    1245             :         Array1D<Real64> EMSRefDoorFlowRate;
    1246             :         Array1D<Real64> VolRefDoorFlowRate;
    1247             :         Array1D_int OpenSchedPtr;            // Schedule for Refrigeration door open fraction
    1248             :         Array1D<Real64> DoorHeight;          // Door height for refrigeration door, m
    1249             :         Array1D<Real64> DoorArea;            // Door area for refrigeration door, m2
    1250             :         Array1D<Real64> Protection;          // Refrigeration door protection factor, dimensionless
    1251             :         Array1D_int MateZonePtr;             // Zone connected by refrigeration door (MateZone > ZonePtr)
    1252             :         Array1D_string DoorMixingObjectName; // Used in one error statement and eio
    1253             :         Array1D_string DoorProtTypeName;     // Used in eio
    1254             :                                              // Note, for mixing and crossmixing, this type dimensioned by number of mixing objects.
    1255             :         // For ref door mixing, dimensioned by number of zones.
    1256             :     };
    1257             : 
    1258             :     struct AirBoundaryMixingSpecs
    1259             :     {
    1260             :         int space1;                  // Air boundary simple mixing space 1
    1261             :         int space2;                  // Air boundary simple mixing space 2
    1262             :         int scheduleIndex;           // Air boundary simple mixing schedule index
    1263             :         Real64 mixingVolumeFlowRate; // Air boundary simple mixing volume flow rate [m3/s]
    1264             :     };
    1265             : 
    1266             :     struct ZoneAirMassFlowConservation
    1267             :     {
    1268             :         // Members
    1269             :         bool EnforceZoneMassBalance = false; // flag to enforce zone air mass conservation
    1270             :         AdjustmentType ZoneFlowAdjustment =
    1271             :             AdjustmentType::NoAdjustReturnAndMixing; // determines how zone air flow is adjusted (AdjustMixingOnly, AdjustReturnOnly,
    1272             :                                                      // AdjustMixingThenReturn, AdjustReturnThenMixing, None)        int InfiltrationTreatment;   //
    1273             :                                                      // determines how infiltration is treated for zone mass balance
    1274             :         InfiltrationFlow InfiltrationTreatment = InfiltrationFlow::No;             // determines how infiltration is treated for zone mass balance
    1275             :         InfiltrationZoneType InfiltrationForZones = InfiltrationZoneType::Invalid; // specifies which types of zones allow infiltration to be changed
    1276             :         bool AdjustZoneMixingFlow = false;                                         // used to adjust zone mixing air flows to enforce air flow balance
    1277             :         bool AdjustZoneInfiltrationFlow = false; // used to adjust zone infiltration air flows to enforce air flow balance
    1278             :                                                  // Note, unique global object
    1279             :     };
    1280             : 
    1281             :     struct ZoneMassConservationData
    1282             :     {
    1283             :         // Members
    1284             :         std::string Name;
    1285             :         int ZonePtr = 0;                       // pointer to the mixing zone
    1286             :         Real64 InMassFlowRate = 0.0;           // zone total supply air mass flow rate, kg/s
    1287             :         Real64 ExhMassFlowRate = 0.0;          // zone exhaust total air mass flow rate, kg/s
    1288             :         Real64 RetMassFlowRate = 0.0;          // zone return air mass flow rate, kg/s
    1289             :         Real64 MixingMassFlowRate = 0.0;       // zone mixing air mass flow rate, kg/s
    1290             :         Real64 MixingSourceMassFlowRate = 0.0; // Zone source mass flow rate for mixing zone, kg/s
    1291             :         int NumSourceZonesMixingObject = 0;    // number of zone mixing object references as a source zone
    1292             :         int NumReceivingZonesMixingObject = 0; // number of zone mixing object references as a receiving zone
    1293             :         bool IsOnlySourceZone = false;         // true only if used only as a source zone in zone mixing object
    1294             :         bool IsSourceAndReceivingZone = false; // true only if a zone is used as a source and receiving zone in zone mixing objects
    1295             :         int InfiltrationPtr = 0;               // pointer to infiltration object
    1296             :         Real64 InfiltrationMassFlowRate = 0.0; // infiltration added to enforced source zone mass balance, kg/s
    1297             :         int IncludeInfilToZoneMassBal = 0;     // not self-balanced, include infiltration in zone air mass balance
    1298             :         Array1D_int ZoneMixingSourcesPtr;      // source zones pointer
    1299             :         Array1D_int ZoneMixingReceivingPtr;    // receiving zones pointer
    1300             :         Array1D<Real64> ZoneMixingReceivingFr; // receiving zones fraction
    1301             :                                                // Note, this type dimensioned by number of zones
    1302             :     };
    1303             : 
    1304             :     struct GenericComponentZoneIntGainStruct
    1305             :     {
    1306             :         // Members
    1307             :         std::string CompObjectName;                   // device user unique name
    1308             :         IntGainType CompType = IntGainType::Invalid;  // type of internal gain device identifier
    1309             :         Real64 spaceGainFrac = 1.0;                   // Fraction of gain value assigned to this Space (because gain rate might be for an entire zone)
    1310             :         Real64 *PtrConvectGainRate = nullptr;         // POINTER to value of convection heat gain rate for device, watts
    1311             :         Real64 ConvectGainRate = 0.0;                 // current timestep value of convection heat gain rate for device, watts
    1312             :         Real64 *PtrReturnAirConvGainRate = nullptr;   // POINTER to value of return air convection heat gain rate for device, W
    1313             :         Real64 ReturnAirConvGainRate = 0.0;           // current timestep value of return air convection heat gain rate for device, W
    1314             :         Real64 *PtrRadiantGainRate = nullptr;         // POINTER to value of thermal radiation heat gain rate for device, watts
    1315             :         Real64 RadiantGainRate = 0.0;                 // current timestep value of thermal radiation heat gain rate for device, watts
    1316             :         Real64 *PtrLatentGainRate = nullptr;          // POINTER to value of moisture gain rate for device, Watts
    1317             :         Real64 LatentGainRate = 0.0;                  // current timestep value of moisture gain rate for device, Watts
    1318             :         Real64 *PtrReturnAirLatentGainRate = nullptr; // POINTER to value of return air moisture gain rate for device, Watts
    1319             :         Real64 ReturnAirLatentGainRate = 0.0;         // current timestep value of return air moisture gain rate for device, Watts
    1320             :         Real64 *PtrCarbonDioxideGainRate = nullptr;   // POINTER to value of carbon dioxide gain rate for device
    1321             :         Real64 CarbonDioxideGainRate = 0.0;           // current timestep value of carbon dioxide gain rate for device
    1322             :         Real64 *PtrGenericContamGainRate = nullptr;   // POINTER to value of generic contaminant gain rate for device
    1323             :         Real64 GenericContamGainRate = 0.0;           // current timestep value of generic contaminant gain rate for device
    1324             :         int ReturnAirNodeNum = 0;                     // return air node number for retrun air convection heat gain
    1325             :     };
    1326             : 
    1327             :     struct SpaceZoneSimData // Calculated data by Space or Zone during each time step/hour
    1328             :     {
    1329             :         Real64 NOFOCC = 0.0; // Number of Occupants
    1330             :         Real64 QLTSW = 0.0;  // VISIBLE ENERGY FROM LIGHTS
    1331             :     };
    1332             : 
    1333             :     struct SpaceIntGainDeviceData
    1334             :     {
    1335             :         int numberOfDevices = 0;
    1336             :         int maxNumberOfDevices = 0;
    1337             :         Array1D<GenericComponentZoneIntGainStruct> device;
    1338             :     };
    1339             : 
    1340             :     struct ZoneCatEUseData
    1341             :     {
    1342             :         // Members
    1343             :         Array1D<Real64> EEConvected; // Category (0 to 25) Energy Convected from Electric Equipment
    1344             :         Array1D<Real64> EERadiated;  // Category (0 to 25) Energy Radiated from Electric Equipment
    1345             :         Array1D<Real64> EELost;      // Category (0 to 25) Energy from Electric Equipment (lost)
    1346             :         Array1D<Real64> EELatent;    // Category (0 to 25) Latent Energy from Electric Equipment
    1347             : 
    1348             :         // Default Constructor
    1349        6648 :         ZoneCatEUseData() : EEConvected({0, 25}, 0.0), EERadiated({0, 25}, 0.0), EELost({0, 25}, 0.0), EELatent({0, 25}, 0.0)
    1350             :         {
    1351        6648 :         }
    1352             :     };
    1353             : 
    1354             :     struct RefrigCaseCreditData
    1355             :     {
    1356             :         // Members
    1357             :         Real64 SenCaseCreditToZone = 0.0; // Refrigerated display case sensible energy delivered to zone
    1358             :         // includes refrigeration pipe and receiver heat exchange with zone
    1359             :         Real64 LatCaseCreditToZone = 0.0; // Refrigerated display case latent energy delivered to zone
    1360             :         Real64 SenCaseCreditToHVAC = 0.0; // Refrigerated display case sensible energy delivered to HVAC RA duct
    1361             :         Real64 LatCaseCreditToHVAC = 0.0; // Refrigerated display case latent energy delivered to HVAC RA duct
    1362             : 
    1363             :         // Reset to Zeros
    1364     3306095 :         void reset()
    1365             :         {
    1366     3306095 :             SenCaseCreditToZone = 0.0;
    1367     3306095 :             LatCaseCreditToZone = 0.0;
    1368     3306095 :             SenCaseCreditToHVAC = 0.0;
    1369     3306095 :             LatCaseCreditToHVAC = 0.0;
    1370     3306095 :         }
    1371             :     };
    1372             : 
    1373             :     struct HeatReclaimDataBase
    1374             :     {
    1375             :         // Members
    1376             :         std::string Name;                                         // Name of Coil
    1377             :         std::string SourceType;                                   // SourceType for Coil
    1378             :         Real64 AvailCapacity = 0.0;                               // Total available heat reclaim capacity
    1379             :         Real64 ReclaimEfficiencyTotal = 0.0;                      // Total reclaimed portion
    1380             :         Real64 WaterHeatingDesuperheaterReclaimedHeatTotal = 0.0; // total reclaimed heat by water heating desuperheater coils
    1381             :         Real64 HVACDesuperheaterReclaimedHeatTotal = 0.0;         // total reclaimed heat by water heating desuperheater coils
    1382             :         Array1D<Real64> WaterHeatingDesuperheaterReclaimedHeat;   // heat reclaimed by water heating desuperheater coils
    1383             :         Array1D<Real64> HVACDesuperheaterReclaimedHeat;           // heat reclaimed by water heating desuperheater coils
    1384             :     };
    1385             : 
    1386             :     struct HeatReclaimRefrigCondenserData : HeatReclaimDataBase // inherited from base struct
    1387             :     {
    1388             :         // Customized Members
    1389             :         Real64 AvailTemperature = 0.0; // Temperature of heat reclaim source
    1390             :     };
    1391             : 
    1392             :     struct AirReportVars
    1393             :     {
    1394             :         // Members
    1395             :         Real64 MeanAirTemp = 0.0;            // Mean Air Temperature {C}
    1396             :         Real64 OperativeTemp = 0.0;          // Average of Mean Air Temperature {C} and Mean Radiant Temperature {C}
    1397             :         Real64 WetbulbGlobeTemp = 0.0;       // Wet-bulb Globe Temperature
    1398             :         Real64 MeanAirHumRat = 0.0;          // Mean Air Humidity Ratio {kg/kg} (averaged over zone time step)
    1399             :         Real64 MeanAirDewPointTemp = 0.0;    // Mean Air Dewpoint Temperature {C}
    1400             :         Real64 ThermOperativeTemp = 0.0;     // Mix of MRT and MAT for Zone Control:Thermostatic:Operative Temperature {C}
    1401             :         Real64 InfilHeatGain = 0.0;          // Heat Gain {J} due to infiltration
    1402             :         Real64 InfilHeatLoss = 0.0;          // Heat Loss {J} due to infiltration
    1403             :         Real64 InfilLatentGain = 0.0;        // Latent Gain {J} due to infiltration
    1404             :         Real64 InfilLatentLoss = 0.0;        // Latent Loss {J} due to infiltration
    1405             :         Real64 InfilTotalGain = 0.0;         // Total Gain {J} due to infiltration (sensible+latent)
    1406             :         Real64 InfilTotalLoss = 0.0;         // Total Loss {J} due to infiltration (sensible+latent)
    1407             :         Real64 InfilVolumeCurDensity = 0.0;  // Volume of Air {m3} due to infiltration at current zone air density
    1408             :         Real64 InfilVolumeStdDensity = 0.0;  // Volume of Air {m3} due to infiltration at standard density (adjusted for elevation)
    1409             :         Real64 InfilVdotCurDensity = 0.0;    // Volume flow rate of Air {m3/s} due to infiltration at current zone air density
    1410             :         Real64 InfilVdotStdDensity = 0.0;    // Volume flow rate of Air {m3/s} due to infiltration standard density (adjusted elevation)
    1411             :         Real64 InfilMass = 0.0;              // Mass of Air {kg} due to infiltration
    1412             :         Real64 InfilMdot = 0.0;              // Mass flow rate of Air (kg/s) due to infiltration
    1413             :         Real64 InfilAirChangeRate = 0.0;     // Infiltration air change rate {ach}
    1414             :         Real64 VentilHeatLoss = 0.0;         // Heat Gain {J} due to ventilation
    1415             :         Real64 VentilHeatGain = 0.0;         // Heat Loss {J} due to ventilation
    1416             :         Real64 VentilLatentLoss = 0.0;       // Latent Gain {J} due to ventilation
    1417             :         Real64 VentilLatentGain = 0.0;       // Latent Loss {J} due to ventilation
    1418             :         Real64 VentilTotalLoss = 0.0;        // Total Gain {J} due to ventilation
    1419             :         Real64 VentilTotalGain = 0.0;        // Total Loss {J} due to ventilation
    1420             :         Real64 VentilVolumeCurDensity = 0.0; // Volume of Air {m3} due to ventilation at current zone air density
    1421             :         Real64 VentilVolumeStdDensity = 0.0; // Volume of Air {m3} due to ventilation at standard density (adjusted for elevation)
    1422             :         Real64 VentilVdotCurDensity = 0.0;   // Volume flow rate of Air {m3/s} due to ventilation at current zone air density
    1423             :         Real64 VentilVdotStdDensity = 0.0;   // Volume flow rate of Air {m3/s} due to ventilation at standard density (adjusted elevation)
    1424             :         Real64 VentilMass = 0.0;             // Mass of Air {kg} due to ventilation
    1425             :         Real64 VentilMdot = 0.0;             // Mass flow rate of Air {kg/s} due to ventilation
    1426             :         Real64 VentilAirChangeRate = 0.0;    // Ventilation air change rate (ach)
    1427             :         Real64 VentilFanElec = 0.0;          // Fan Electricity {W} due to ventilation
    1428             :         Real64 VentilAirTemp = 0.0;          // Air Temp {C} of ventilation
    1429             :         Real64 MixVolume = 0.0;              // Mixing volume of Air {m3}
    1430             :         Real64 MixVdotCurDensity = 0.0;      // Mixing volume flow rate of Air {m3/s} at current zone air density
    1431             :         Real64 MixVdotStdDensity = 0.0;      // Mixing volume flow rate of Air {m3/s} at standard density (adjusted for elevation)
    1432             :         Real64 MixMass = 0.0;                // Mixing mass of air {kg}
    1433             :         Real64 MixMdot = 0.0;                // Mixing mass flow rate of air {kg/s}
    1434             :         Real64 MixHeatLoss = 0.0;            // Heat Gain {J} due to mixing and cross mixing and refrigeration door mixing
    1435             :         Real64 MixHeatGain = 0.0;            // Heat Loss {J} due to mixing and cross mixing and refrigeration door mixing
    1436             :         Real64 MixLatentLoss = 0.0;          // Latent Gain {J} due to mixing and cross mixing and refrigeration door mixing
    1437             :         Real64 MixLatentGain = 0.0;          // Latent Loss {J} due to mixing and cross mixing and refrigeration door mixing
    1438             :         Real64 MixTotalLoss = 0.0;           // Total Gain {J} due to mixing and cross mixing and refrigeration door mixing
    1439             :         Real64 MixTotalGain = 0.0;           // Total Loss {J} due to mixing and cross mixing and refrigeration door mixing
    1440             :         Real64 SysInletMass = 0.0;           // Total mass of Air {kg} from all system inlets
    1441             :         Real64 SysOutletMass = 0.0;          // Total mass of Air {kg} from all system outlets
    1442             :         Real64 ExfilMass = 0.0;              // Mass of Air {kg} due to exfiltration
    1443             :         Real64 ExfilTotalLoss = 0.0;         // Total Loss rate {W} due to exfiltration (sensible+latent)
    1444             :         Real64 ExfilSensiLoss = 0.0;         // Sensible Loss rate {W} due to exfiltration
    1445             :         Real64 ExfilLatentLoss = 0.0;        // Latent Loss rate {W} due to exfiltration
    1446             :         Real64 ExhTotalLoss = 0.0;           // Total Loss rate {W} due to zone exhaust air (sensible+latent)
    1447             :         Real64 ExhSensiLoss = 0.0;           // Sensible Loss rate {W} due to zone exhaust air
    1448             :         Real64 ExhLatentLoss = 0.0;          // Latent Loss rate {W} due to zone exhaust air
    1449             :         // air heat balance component load summary results
    1450             :         Real64 SumIntGains = 0.0;     // Zone sum of convective internal gains
    1451             :         Real64 SumHADTsurfs = 0.0;    // Zone sum of Hc*Area*(Tsurf - Tz)
    1452             :         Real64 SumMCpDTzones = 0.0;   // zone sum of MassFlowRate*cp*(TremotZone - Tz) transfer air from other zone, Mixing
    1453             :         Real64 SumMCpDtInfil = 0.0;   // Zone sum of MassFlowRate*Cp*(Tout - Tz) transfer from outside, ventil, earth tube
    1454             :         Real64 SumMCpDTsystem = 0.0;  // Zone sum of air system MassFlowRate*Cp*(Tsup - Tz)
    1455             :         Real64 SumNonAirSystem = 0.0; // Zone sum of system convective gains, collected via NonAirSystemResponse
    1456             :         Real64 CzdTdt = 0.0;          // Zone air energy storage term.
    1457             :         Real64 imBalance = 0.0;       // put all terms in eq. 5 on RHS , should be zero
    1458             :         // for ZoneAirBalance:OutdoorAir object Outputs only
    1459             :         Real64 OABalanceHeatLoss = 0.0;         // Heat Gain {J} due to OA air balance
    1460             :         Real64 OABalanceHeatGain = 0.0;         // Heat Loss {J} due to OA air balance
    1461             :         Real64 OABalanceLatentLoss = 0.0;       // Latent Gain {J} due to OA air balance
    1462             :         Real64 OABalanceLatentGain = 0.0;       // Latent Loss {J} due to OA air balance
    1463             :         Real64 OABalanceTotalLoss = 0.0;        // Total Gain {J} due to OA air balance
    1464             :         Real64 OABalanceTotalGain = 0.0;        // Total Loss {J} due to OA air balance
    1465             :         Real64 OABalanceVolumeCurDensity = 0.0; // Volume of Air {m3} due to OA air balance
    1466             :         // at current zone air density
    1467             :         Real64 OABalanceVolumeStdDensity = 0.0; // Volume of Air {m3} due to OA air balance
    1468             :         // at standard density (adjusted for elevation)
    1469             :         Real64 OABalanceVdotCurDensity = 0.0; // Volume flow rate of Air {m3/s} due to OA air balance
    1470             :         // at current zone air density
    1471             :         Real64 OABalanceVdotStdDensity = 0.0; // Volume flow rate of Air {m3/s} due to OA air balance
    1472             :         // at standard density (adjusted elevation)
    1473             :         Real64 OABalanceMass = 0.0;          // Mass of Air {kg} due to OA air balance
    1474             :         Real64 OABalanceMdot = 0.0;          // Mass flow rate of Air {kg/s} due to OA air balance
    1475             :         Real64 OABalanceAirChangeRate = 0.0; // OA air balance air change rate (ach)
    1476             :         Real64 OABalanceFanElec = 0.0;       // Fan Electricity {W} due to OA air balance
    1477             :         Real64 SumEnthalpyM = 0.0;           // Zone sum of EnthalpyM
    1478             :         Real64 SumEnthalpyH = 0.0;           // Zone sum of EnthalpyH
    1479             :         // reporting flags
    1480             :         bool ReportWBGT = false; // whether the wetbulb globe temperature is reqeusted as an output variable or used as an EMS sensor
    1481             : 
    1482             :         void setUpOutputVars(EnergyPlusData &state, std::string_view prefix, std::string const &name);
    1483             :     };
    1484             : 
    1485             :     struct ZonePreDefRepType
    1486             :     {
    1487             :         // Members
    1488             :         bool isOccupied = false;      // occupied during the current time step
    1489             :         Real64 NumOcc = 0.0;          // number of occupants - used in calculating Vbz
    1490             :         Real64 NumOccAccum = 0.0;     // number of occupants accumulating for entire simulation
    1491             :         Real64 NumOccAccumTime = 0.0; // time that the number of occupants is accumulating to compute average
    1492             :         //  - zone time step [hrs]
    1493             :         Real64 TotTimeOcc = 0.0; // time occupied (and the mechanical ventilation volume is accumulating)
    1494             :         //  - system time step [hrs]
    1495             : 
    1496             :         // OA Reports - accumulated values
    1497             :         // All Vol variables are in m3
    1498             :         Real64 MechVentVolTotalOcc = 0.0;    // volume for mechanical ventilation of outside air for entire simulation during occupied at current
    1499             :         Real64 MechVentVolMin = 9.9e9;       // a large number since finding minimum volume at current zone air density
    1500             :         Real64 InfilVolTotalOcc = 0.0;       // volume for infiltration of outside air for entire simulation during occupied at current density
    1501             :         Real64 InfilVolMin = 9.9e9;          // a large number since finding minimum volume at current zone air density
    1502             :         Real64 AFNInfilVolTotalOcc = 0.0;    // volume for AFN infiltration of outside air for entire simulation during occupied at zone air density
    1503             :         Real64 AFNInfilVolMin = 9.9e9;       // a large number since finding minimum volume at current zone air density
    1504             :         Real64 SimpVentVolTotalOcc = 0.0;    // volume for simple 'ZoneVentilation' of outside air for entire simulation during occupied current
    1505             :         Real64 SimpVentVolMin = 9.9e9;       // a large number since finding minimum volumeat current zone air density
    1506             :         Real64 AFNVentVolTotalOcc = 0.0;     // volume for AFN ventilation of outside air for entire simulation during occupied at zone air density
    1507             :         Real64 AFNVentVolMin = 9.9e9;        // a large number since finding minimum volume at current zone air density
    1508             :         Real64 MechVentVolTotalStdDen = 0.0; // volume for mechanical ventilation of outside air for entire simulation at standard density
    1509             :         Real64 MechVentVolTotalOccStdDen = 0.0; // volume for mechanical ventilation of outside air for entire simulation during occupied at std
    1510             :         Real64 InfilVolTotalStdDen = 0.0;       // volume for infiltration of outside air for entire simulation at standard density
    1511             :         Real64 InfilVolTotalOccStdDen = 0.0;    // volume for infiltration of outside air for entire simulation during occupied standard density
    1512             :         Real64 AFNInfilVolTotalStdDen = 0.0;    // volume for AFN infiltration of outside air for entire simulation at standard density
    1513             :         Real64 AFNInfilVolTotalOccStdDen = 0.0; // volume for AFN infiltration of outside air for entire simulation during occupied at std density
    1514             :         Real64 AFNVentVolStdDen = 0.0;          // volume flow rate for natural ventilation at standard density
    1515             :         Real64 AFNVentVolTotalStdDen = 0.0;     // volume for natural ventilation for entire simulation at standard density
    1516             :         Real64 AFNVentVolTotalOccStdDen = 0.0;  // volume for natural ventilatiofor entire simulation n during occupied at standard density
    1517             :         Real64 SimpVentVolTotalStdDen = 0.0;    // volume for simple 'ZoneVentilation' for entire simulation at standard density
    1518             :         Real64 SimpVentVolTotalOccStdDen = 0.0; // volume for simple 'ZoneVentilation' for entire simulation during occupied at standard density
    1519             :         Real64 VozMin = 0.0;                    // minimum outdoor zone ventilation
    1520             :         Real64 VozTargetTotal = 0.0;            // volume for target Voz-dyn for entire simulation at std density
    1521             :         Real64 VozTargetTotalOcc = 0.0;         // volume for target Voz-dyn for entire simulation during occupied
    1522             :         Real64 VozTargetTimeBelow = 0.0;        // time [hrs] that mechanical+natural ventilation is < VozTarget - 1%
    1523             :         Real64 VozTargetTimeAt = 0.0;           // time [hrs] that mechanical+natural ventilation is = VozTarget within 1% and > zero
    1524             :         Real64 VozTargetTimeAbove = 0.0;        // time [hrs] that mechanical+natural ventilation is > VozTarget + 1%
    1525             :         Real64 VozTargetTimeBelowOcc = 0.0;     // time [hrs] that mechanical+natural ventilation is < VozTarget - 1% during occupied
    1526             :         Real64 VozTargetTimeAtOcc = 0.0;        // time [hrs] that mechanical+natural ventilation is = VozTarget within 1% and > zero during occupied
    1527             :         Real64 VozTargetTimeAboveOcc = 0.0;     // time [hrs] that mechanical+natural ventilation is > VozTarget + 1% during occupied
    1528             :         Real64 TotVentTimeNonZeroUnocc = 0.0;   // time [hrs] that mechanical+natural ventilation is > zero during UNoccupied
    1529             : 
    1530             :         // for Sensible Heat Gas Component Report
    1531             :         // annual
    1532             :         Real64 SHGSAnZoneEqHt = 0.0;  // Zone Eq heating
    1533             :         Real64 SHGSAnZoneEqCl = 0.0;  // Zone Eq cooling
    1534             :         Real64 SHGSAnHvacATUHt = 0.0; // heating by Air Terminal Unit [J]
    1535             :         Real64 SHGSAnHvacATUCl = 0.0; // cooling by Air Terminal Unit [J]
    1536             :         Real64 SHGSAnSurfHt = 0.0;    // heated surface heating
    1537             :         Real64 SHGSAnSurfCl = 0.0;    // cooled surface cooling
    1538             :         Real64 SHGSAnPeoplAdd = 0.0;  // people additions
    1539             :         Real64 SHGSAnLiteAdd = 0.0;   // lighting addition
    1540             :         Real64 SHGSAnEquipAdd = 0.0;  // equipment addition
    1541             :         Real64 SHGSAnWindAdd = 0.0;   // window addition
    1542             :         Real64 SHGSAnIzaAdd = 0.0;    // inter zone air addition
    1543             :         Real64 SHGSAnInfilAdd = 0.0;  // infiltration addition
    1544             :         Real64 SHGSAnOtherAdd = 0.0;  // opaque surface and other addition
    1545             :         Real64 SHGSAnEquipRem = 0.0;  // equipment removal
    1546             :         Real64 SHGSAnWindRem = 0.0;   // window removal
    1547             :         Real64 SHGSAnIzaRem = 0.0;    // inter-zone air removal
    1548             :         Real64 SHGSAnInfilRem = 0.0;  // infiltration removal
    1549             :         Real64 SHGSAnOtherRem = 0.0;  // opaque surface and other removal
    1550             :         // peak cooling
    1551             :         int clPtTimeStamp = 0;        // timestamp for the cooling peak
    1552             :         Real64 clPeak = 0.0;          // cooling peak value (hvac air cooling + cooled surface)
    1553             :         Real64 SHGSClHvacHt = 0.0;    // hvac air heating
    1554             :         Real64 SHGSClHvacCl = 0.0;    // hvac air cooling
    1555             :         Real64 SHGSClHvacATUHt = 0.0; // heating by air terminal unit at cool peak [W]
    1556             :         Real64 SHGSClHvacATUCl = 0.0; // cooling by air terminal unit at cool peak [W]
    1557             :         Real64 SHGSClSurfHt = 0.0;    // heated surface heating
    1558             :         Real64 SHGSClSurfCl = 0.0;    // cooled surface cooling
    1559             :         Real64 SHGSClPeoplAdd = 0.0;  // people additions
    1560             :         Real64 SHGSClLiteAdd = 0.0;   // lighting addition
    1561             :         Real64 SHGSClEquipAdd = 0.0;  // equipment addition
    1562             :         Real64 SHGSClWindAdd = 0.0;   // window addition
    1563             :         Real64 SHGSClIzaAdd = 0.0;    // inter zone air addition
    1564             :         Real64 SHGSClInfilAdd = 0.0;  // infiltration addition
    1565             :         Real64 SHGSClOtherAdd = 0.0;  // opaque surface and other addition
    1566             :         Real64 SHGSClEquipRem = 0.0;  // equipment removal
    1567             :         Real64 SHGSClWindRem = 0.0;   // window removal
    1568             :         Real64 SHGSClIzaRem = 0.0;    // inter-zone air removal
    1569             :         Real64 SHGSClInfilRem = 0.0;  // infiltration removal
    1570             :         Real64 SHGSClOtherRem = 0.0;  // opaque surface and other removal
    1571             :         // peak heating
    1572             :         int htPtTimeStamp = 0;        // timestamp for the heating peak
    1573             :         Real64 htPeak = 0.0;          // heating peak value (hvac air heating + heated surface)
    1574             :         Real64 SHGSHtHvacHt = 0.0;    // hvac air heating
    1575             :         Real64 SHGSHtHvacCl = 0.0;    // hvac air cooling
    1576             :         Real64 SHGSHtHvacATUHt = 0.0; // heating by air terminal unit at heat peak [W]
    1577             :         Real64 SHGSHtHvacATUCl = 0.0; // cooling by air terminal unit at heat peak [W]
    1578             :         Real64 SHGSHtSurfHt = 0.0;    // heated surface heating
    1579             :         Real64 SHGSHtSurfCl = 0.0;    // cooled surface cooling
    1580             :         Real64 SHGSHtPeoplAdd = 0.0;  // people additions
    1581             :         Real64 SHGSHtLiteAdd = 0.0;   // lighting addition
    1582             :         Real64 SHGSHtEquipAdd = 0.0;  // equipment addition
    1583             :         Real64 SHGSHtWindAdd = 0.0;   // window addition
    1584             :         Real64 SHGSHtIzaAdd = 0.0;    // inter zone air addition
    1585             :         Real64 SHGSHtInfilAdd = 0.0;  // infiltration addition
    1586             :         Real64 SHGSHtOtherAdd = 0.0;  // opaque surface and other addition
    1587             :         Real64 SHGSHtEquipRem = 0.0;  // equipment removal
    1588             :         Real64 SHGSHtWindRem = 0.0;   // window removal
    1589             :         Real64 SHGSHtIzaRem = 0.0;    // inter-zone air removal
    1590             :         Real64 SHGSHtInfilRem = 0.0;  // infiltration removal
    1591             :         Real64 SHGSHtOtherRem = 0.0;  // opaque surface and other removal
    1592             : 
    1593             :         // heat emission
    1594             :         Real64 emiEnvelopConv = 0.0;      // heat emission from envelope convection
    1595             :         Real64 emiZoneExfiltration = 0.0; // heat emission from zone exfiltration
    1596             :         Real64 emiZoneExhaust = 0.0;      // heat emission from zone exhaust air
    1597             :         Real64 emiHVACRelief = 0.0;       // heat emission from HVAC relief air
    1598             :         Real64 emiHVACReject = 0.0;       // heat emission from HVAC reject air
    1599             :         Real64 emiTotHeat = 0.0;          // total building heat emission
    1600             :     };
    1601             : 
    1602             :     struct ZoneLocalEnvironmentData
    1603             :     {
    1604             :         // Members
    1605             :         std::string Name;
    1606             :         int ZonePtr = 0;           // surface pointer
    1607             :         int OutdoorAirNodePtr = 0; // schedule pointer
    1608             :     };
    1609             : 
    1610             :     struct ZoneReportVars // Zone and Space report variables
    1611             :     {
    1612             :         // Members
    1613             :         // People
    1614             :         Real64 PeopleRadGain = 0.0;
    1615             :         Real64 PeopleConGain = 0.0;
    1616             :         Real64 PeopleSenGain = 0.0;
    1617             :         Real64 PeopleNumOcc = 0.0;
    1618             :         Real64 PeopleLatGain = 0.0;
    1619             :         Real64 PeopleTotGain = 0.0;
    1620             :         Real64 PeopleRadGainRate = 0.0;
    1621             :         Real64 PeopleConGainRate = 0.0;
    1622             :         Real64 PeopleSenGainRate = 0.0;
    1623             :         Real64 PeopleLatGainRate = 0.0;
    1624             :         Real64 PeopleTotGainRate = 0.0;
    1625             :         // Lights
    1626             :         Real64 LtsPower = 0.0;
    1627             :         Real64 LtsElecConsump = 0.0;
    1628             :         Real64 LtsRadGain = 0.0;
    1629             :         Real64 LtsVisGain = 0.0;
    1630             :         Real64 LtsConGain = 0.0;
    1631             :         Real64 LtsRetAirGain = 0.0;
    1632             :         Real64 LtsTotGain = 0.0;
    1633             :         Real64 LtsRadGainRate = 0.0;
    1634             :         Real64 LtsVisGainRate = 0.0;
    1635             :         Real64 LtsConGainRate = 0.0;
    1636             :         Real64 LtsRetAirGainRate = 0.0;
    1637             :         Real64 LtsTotGainRate = 0.0;
    1638             :         // Baseboard Heat
    1639             :         Real64 BaseHeatPower = 0.0;
    1640             :         Real64 BaseHeatElecCons = 0.0;
    1641             :         Real64 BaseHeatRadGain = 0.0;
    1642             :         Real64 BaseHeatConGain = 0.0;
    1643             :         Real64 BaseHeatTotGain = 0.0;
    1644             :         Real64 BaseHeatRadGainRate = 0.0;
    1645             :         Real64 BaseHeatConGainRate = 0.0;
    1646             :         Real64 BaseHeatTotGainRate = 0.0;
    1647             :         // Electric Equipment
    1648             :         Real64 ElecPower = 0.0;
    1649             :         Real64 ElecConsump = 0.0;
    1650             :         Real64 ElecRadGain = 0.0;
    1651             :         Real64 ElecConGain = 0.0;
    1652             :         Real64 ElecLatGain = 0.0;
    1653             :         Real64 ElecLost = 0.0;
    1654             :         Real64 ElecTotGain = 0.0;
    1655             :         Real64 ElecRadGainRate = 0.0;
    1656             :         Real64 ElecConGainRate = 0.0;
    1657             :         Real64 ElecLatGainRate = 0.0;
    1658             :         Real64 ElecLostRate = 0.0;
    1659             :         Real64 ElecTotGainRate = 0.0;
    1660             :         // Gas Equipment
    1661             :         Real64 GasPower = 0.0;
    1662             :         Real64 GasConsump = 0.0;
    1663             :         Real64 GasRadGain = 0.0;
    1664             :         Real64 GasConGain = 0.0;
    1665             :         Real64 GasLatGain = 0.0;
    1666             :         Real64 GasLost = 0.0;
    1667             :         Real64 GasTotGain = 0.0;
    1668             :         Real64 GasRadGainRate = 0.0;
    1669             :         Real64 GasConGainRate = 0.0;
    1670             :         Real64 GasLatGainRate = 0.0;
    1671             :         Real64 GasLostRate = 0.0;
    1672             :         Real64 GasTotGainRate = 0.0;
    1673             :         // Hot Water Equipment
    1674             :         Real64 HWPower = 0.0;
    1675             :         Real64 HWConsump = 0.0;
    1676             :         Real64 HWRadGain = 0.0;
    1677             :         Real64 HWConGain = 0.0;
    1678             :         Real64 HWLatGain = 0.0;
    1679             :         Real64 HWLost = 0.0;
    1680             :         Real64 HWTotGain = 0.0;
    1681             :         Real64 HWRadGainRate = 0.0;
    1682             :         Real64 HWConGainRate = 0.0;
    1683             :         Real64 HWLatGainRate = 0.0;
    1684             :         Real64 HWLostRate = 0.0;
    1685             :         Real64 HWTotGainRate = 0.0;
    1686             :         // Steam Equipment
    1687             :         Real64 SteamPower = 0.0;
    1688             :         Real64 SteamConsump = 0.0;
    1689             :         Real64 SteamRadGain = 0.0;
    1690             :         Real64 SteamConGain = 0.0;
    1691             :         Real64 SteamLatGain = 0.0;
    1692             :         Real64 SteamLost = 0.0;
    1693             :         Real64 SteamTotGain = 0.0;
    1694             :         Real64 SteamRadGainRate = 0.0;
    1695             :         Real64 SteamConGainRate = 0.0;
    1696             :         Real64 SteamLatGainRate = 0.0;
    1697             :         Real64 SteamLostRate = 0.0;
    1698             :         Real64 SteamTotGainRate = 0.0;
    1699             :         // Other Equipment
    1700             :         std::array<Real64, (int)Constant::eFuel::Num> OtherPower;
    1701             :         std::array<Real64, (int)Constant::eFuel::Num> OtherConsump;
    1702             :         Real64 OtherRadGain = 0.0;
    1703             :         Real64 OtherConGain = 0.0;
    1704             :         Real64 OtherLatGain = 0.0;
    1705             :         Real64 OtherLost = 0.0;
    1706             :         Real64 OtherTotGain = 0.0;
    1707             :         Real64 OtherRadGainRate = 0.0;
    1708             :         Real64 OtherConGainRate = 0.0;
    1709             :         Real64 OtherLatGainRate = 0.0;
    1710             :         Real64 OtherLostRate = 0.0;
    1711             :         Real64 OtherTotGainRate = 0.0;
    1712             :         // IT Equipment
    1713             :         std::array<Real64, (int)PERptVars::Num> PowerRpt;
    1714             :         std::array<Real64, (int)PERptVars::Num> EnergyRpt;
    1715             :         Real64 ITEqAirVolFlowStdDensity = 0.0; // Zone Air volume flow rate at standard density [m3/s]
    1716             :         Real64 ITEqAirMassFlow = 0.0;          // Zone Air mass flow rate [kg/s]
    1717             :         Real64 ITEqSHI = 0.0;                  // Zone Supply Heat Index []
    1718             :         Real64 ITEqTimeOutOfOperRange = 0.0;   // Zone ITE Air Inlet Operating Range Exceeded Time [hr]
    1719             :         Real64 ITEqTimeAboveDryBulbT = 0.0;    // Zone ITE Air Inlet Dry-Bulb Temperature Above Operating Range Time [hr]
    1720             :         Real64 ITEqTimeBelowDryBulbT = 0.0;    // Zone ITE Air Inlet Dry-Bulb Temperature Below Operating Range Time [hr]
    1721             :         Real64 ITEqTimeAboveDewpointT = 0.0;   // Zone ITE Air Inlet Dewpoint Temperature Above Operating Range Time [hr]
    1722             :         Real64 ITEqTimeBelowDewpointT = 0.0;   // Zone ITE Air Inlet Dewpoint Temperature Below Operating Range Time [hr]
    1723             :         Real64 ITEqTimeAboveRH = 0.0;          // Zone ITE Air Inlet Relative Humidity Above Operating Range Time [hr]
    1724             :         Real64 ITEqTimeBelowRH = 0.0;          // Zone ITE Air Inlet Relative Humidity Below Operating Range Time [hr]
    1725             :         Real64 ITEAdjReturnTemp = 0.0;         // Zone ITE Adjusted Return Air Temperature
    1726             :         // Overall Zone Variables
    1727             :         Real64 TotRadiantGain = 0.0;
    1728             :         Real64 TotVisHeatGain = 0.0;
    1729             :         Real64 TotConvectiveGain = 0.0;
    1730             :         Real64 TotLatentGain = 0.0;
    1731             :         Real64 TotTotalHeatGain = 0.0;
    1732             :         Real64 TotRadiantGainRate = 0.0;
    1733             :         Real64 TotVisHeatGainRate = 0.0;
    1734             :         Real64 TotConvectiveGainRate = 0.0;
    1735             :         Real64 TotLatentGainRate = 0.0;
    1736             :         Real64 TotTotalHeatGainRate = 0.0;
    1737             :         // Contaminant
    1738             :         Real64 CO2Rate = 0.0;
    1739             :         Real64 GCRate = 0.0;
    1740             : 
    1741             :         Real64 SumTinMinusTSup = 0.0;  // Numerator for zone-level sensible heat index (SHI)
    1742             :         Real64 SumToutMinusTSup = 0.0; // Denominator for zone-level sensible heat index (SHI)
    1743             :     };
    1744             : 
    1745             :     // Functions
    1746             : 
    1747             :     void SetZoneOutBulbTempAt(EnergyPlusData &state);
    1748             : 
    1749             :     void CheckZoneOutBulbTempAt(EnergyPlusData &state);
    1750             : 
    1751             :     void SetZoneWindSpeedAt(EnergyPlusData &state);
    1752             : 
    1753             :     void SetZoneWindDirAt(EnergyPlusData &state);
    1754             : 
    1755             :     void CheckAndSetConstructionProperties(EnergyPlusData &state,
    1756             :                                            int ConstrNum,    // Construction number to be set/checked
    1757             :                                            bool &ErrorsFound // error flag that is set when certain errors have occurred
    1758             :     );
    1759             : 
    1760             :     int AssignReverseConstructionNumber(EnergyPlusData &state,
    1761             :                                         int ConstrNum, // Existing Construction number of first surface
    1762             :                                         bool &ErrorsFound);
    1763             : 
    1764             :     void AddVariableSlatBlind(EnergyPlusData &state,
    1765             :                               int inBlindNumber,   // current Blind Number/pointer to name
    1766             :                               int &outBlindNumber, // resultant Blind Number to pass back
    1767             :                               bool &errFlag        // error flag should one be needed
    1768             :     );
    1769             : 
    1770             :     void CalcScreenTransmittance(EnergyPlusData &state,
    1771             :                                  int SurfaceNum,
    1772             :                                  ObjexxFCL::Optional<Real64 const> Phi = _,     // Optional sun altitude relative to surface outward normal (radians)
    1773             :                                  ObjexxFCL::Optional<Real64 const> Theta = _,   // Optional sun azimuth relative to surface outward normal (radians)
    1774             :                                  ObjexxFCL::Optional_int_const ScreenNumber = _ // Optional screen number
    1775             :     );
    1776             : 
    1777             :     Real64 ComputeNominalUwithConvCoeffs(EnergyPlusData &state,
    1778             :                                          int numSurf,  // index for Surface array.
    1779             :                                          bool &isValid // returns true if result is valid
    1780             :     );
    1781             : 
    1782             :     void SetFlagForWindowConstructionWithShadeOrBlindLayer(EnergyPlusData &state);
    1783             : 
    1784             :     void AllocateIntGains(EnergyPlusData &state);
    1785             : 
    1786             : } // namespace DataHeatBalance
    1787             : 
    1788             : struct HeatBalanceData : BaseGlobalStruct
    1789             : {
    1790             : 
    1791             :     int MaxSolidWinLayers = 0; // Maximum number of solid layers in a window construction
    1792             : 
    1793             :     // SiteData aka building data
    1794             :     Real64 LowHConvLimit = 0.1; // Lowest allowed convection coefficient for detailed model
    1795             :     // before reverting to the simple model.  This avoids a
    1796             :     // divide by zero elsewhere.  Not based on any physical
    1797             :     // reasoning, just the number that was picked.  It corresponds
    1798             :     // to a delta T for a vertical surface of 0.000444C.
    1799             :     //                           ! A lower limit is needed to avoid numerical problems
    1800             :     //                           ! Natural convection correlations are a function of temperature difference,
    1801             :     //                           !   there are many times when those temp differences pass through zero leading to non-physical results
    1802             :     //                           ! Value of 1.0 chosen here is somewhat arbitrary, but based on the following reasons:
    1803             :     //                           !  1) Low values of HconvIn indicate a layer of high thermal resistance, however
    1804             :     //                           !       the R-value of a convection film layer should be relatively low (compared to building surfaces)
    1805             :     //                           !  2) The value of 1.0 corresponds to the thermal resistance of 0.05 m of batt insulation
    1806             :     //                           !  3) Limit on the order of 1.0 is suggested by the abrupt changes in an inverse relationship
    1807             :     //                           !  4) A conduction-only analysis can model a limit by considering the thermal performance of
    1808             :     //                           !       boundary layer to be pure conduction (with no movement to enhance heat transfer);
    1809             :     //                           !       Taking the still gas thermal conductivity for air at 0.0267 W/m-K (at 300K), then
    1810             :     //                           !       this limit of 1.0 corresponds to a completely still layer of air that is around 0.025 m thick
    1811             :     //                           !  5) The previous limit of 0.1 (before ver. 3.1) caused loads initialization problems in test files
    1812             :     Real64 HighHConvLimit = 1000.0;         // upper limit for HConv, mostly used for user input limits in practice. !W/m2-K
    1813             :     Real64 MaxAllowedDelTemp = 0.002;       // Convergence criteria for inside surface temperatures
    1814             :     Real64 MaxAllowedDelTempCondFD = 0.002; // Convergence criteria for inside surface temperatures for CondFD
    1815             :     std::string BuildingName;               // Name of building
    1816             :     Real64 BuildingAzimuth = 0.0;           // North Axis of Building
    1817             :     Real64 LoadsConvergTol = 0.0;           // Tolerance value for Loads Convergence
    1818             :     Real64 TempConvergTol = 0.0;            // Tolerance value for Temperature Convergence
    1819             :     Convect::HcInt DefaultIntConvAlgo = Convect::HcInt::ASHRAESimple;
    1820             :     Convect::HcExt DefaultExtConvAlgo = Convect::HcExt::ASHRAESimple;
    1821             :     DataHeatBalance::Shadowing SolarDistribution = DataHeatBalance::Shadowing::FullExterior;                // Solar Distribution Algorithm
    1822             :     int InsideSurfIterations = 0;                                                                           // Counts inside surface iterations
    1823             :     DataSurfaces::HeatTransferModel OverallHeatTransferSolutionAlgo = DataSurfaces::HeatTransferModel::CTF; // Global HeatBalanceAlgorithm setting
    1824             :     // Flags for HeatTransfer Algorithms Used
    1825             :     bool AllCTF = true;                  // CTF used for everything - no EMPD, no CondFD, No HAMT, No Kiva - true until flipped otherwise
    1826             :     bool AnyCTF = false;                 // CTF used
    1827             :     bool AnyEMPD = false;                // EMPD used
    1828             :     bool AnyCondFD = false;              // CondFD used
    1829             :     bool AnyHAMT = false;                // HAMT used
    1830             :     bool AnyKiva = false;                // Kiva used
    1831             :     bool AnyAirBoundary = false;         // Construction:AirBoundary used (implies grouped solar and radiant is present)
    1832             :     bool AnyBSDF = false;                // True if any WindowModelType == WindowModel:: BSDF
    1833             :     bool AnyVariableAbsorptance = false; // true if any MaterialProperty:VariableAbsorptance is present
    1834             :     int MaxNumberOfWarmupDays = 25;      // Maximum number of warmup days allowed
    1835             :     int MinNumberOfWarmupDays = 1;       // Minimum number of warmup days allowed
    1836             :     Real64 CondFDRelaxFactor = 1.0;      // Relaxation factor, for looping across all the surfaces.
    1837             :     Real64 CondFDRelaxFactorInput = 1.0; // Relaxation factor, for looping across all the surfaces, user input value
    1838             :     DataHeatBalance::SolutionAlgo ZoneAirSolutionAlgo =
    1839             :         DataHeatBalance::SolutionAlgo::ThirdOrder; // ThirdOrderBackwardDifference, AnalyticalSolution, and EulerMethod
    1840             :     bool doSpaceHeatBalanceSizing = false;         // Do space heat balance during sizing
    1841             :     bool doSpaceHeatBalanceSimulation = false;     // Do space heat balance during simulation
    1842             :     bool doSpaceHeatBalance = false;               // Do space heat balance currently
    1843             :     bool OverrideZoneAirSolutionAlgo = false;      // Override the zone air solution algorithm in PerformancePrecisionTradeoffs
    1844             :     Real64 BuildingRotationAppendixG = 0.0;        // Building Rotation for Appendix G
    1845             :     Real64 ZoneTotalExfiltrationHeatLoss = 0.0;    // Building total heat emission through zone exfiltration;
    1846             :     Real64 ZoneTotalExhaustHeatLoss = 0.0;         // Building total heat emission through zone air exhaust;
    1847             :     Real64 SysTotalHVACReliefHeatLoss = 0.0;       // Building total heat emission through HVAC system relief air;
    1848             :     Real64 SysTotalHVACRejectHeatLoss = 0.0;       // Building total heat emission through HVAC system heat rejection;
    1849             :     // END SiteData
    1850             :     int NumOfZoneLists = 0;     // Total number of zone lists
    1851             :     int NumOfZoneGroups = 0;    // Total number of zone groups
    1852             :     int TotPeople = 0;          // Total People instances after expansion to spaces
    1853             :     int TotLights = 0;          // Total Lights instances after expansion to spaces
    1854             :     int TotElecEquip = 0;       // Total Electric Equipment instances after expansion to spaces
    1855             :     int TotGasEquip = 0;        // Total Gas Equipment instances after expansion to spaces
    1856             :     int TotOthEquip = 0;        // Total Other Equipment instances after expansion to spaces
    1857             :     int TotHWEquip = 0;         // Total Hot Water Equipment instances after expansion to spaces
    1858             :     int TotStmEquip = 0;        // Total Steam Equipment instances after expansion to spaces
    1859             :     int TotITEquip = 0;         // Total IT Equipment instances after expansion to spaces
    1860             :     int TotInfiltration = 0;    // Total Infiltration (all types) instances after expansion to spaces
    1861             :     int TotVentilation = 0;     // Total Ventilation (all types) instances after expansion to spaces
    1862             :     int TotMixing = 0;          // Total Mixing Statementsn instances after expansion to spaces
    1863             :     int TotCrossMixing = 0;     // Total Cross Mixing Statementsn instances after expansion to spaces
    1864             :     int TotRefDoorMixing = 0;   // Total RefrigerationDoor Mixing Statements in input
    1865             :     int TotBBHeat = 0;          // Total BBHeat Statements instances after expansion to spaces
    1866             :     int TotConstructs = 0;      // Total number of unique constructions in this simulation
    1867             :     int TotSpectralData = 0;    // Total window glass spectral data sets
    1868             :     int W5GlsMat = 0;           // Window5 Glass Materials, specified by transmittance and front and back reflectance
    1869             :     int W5GlsMatAlt = 0;        // Window5 Glass Materials, specified by index of refraction and extinction coeff
    1870             :     int W5GasMat = 0;           // Window5 Single-Gas Materials
    1871             :     int W5GasMatMixture = 0;    // Window5 Gas Mixtures
    1872             :     int W7SupportPillars = 0;   // Complex fenestration support pillars
    1873             :     int W7DeflectionStates = 0; // Complex fenestration deflection states
    1874             :     int W7MaterialGaps = 0;     // Complex fenestration material gaps
    1875             :     int TotBlinds = 0;          // Total number of blind materials
    1876             :     int TotScreens = 0;         // Total number of exterior window screen materials
    1877             :     int TotTCGlazings = 0;      // Number of TC glazing object - WindowMaterial:Glazing:Thermochromic found in the idf file
    1878             :     int NumScreens = 0;         // Total number of screens on exterior windows
    1879             :     int TotShades = 0;          // Total number of shade materials
    1880             :     int TotComplexGaps = 0;     // Total number of window gaps for complex fenestrations
    1881             :     int TotSimpleWindow = 0;    // number of simple window systems.
    1882             :     int W5GlsMatEQL = 0;        // Window5 Single-Gas Materials for Equivalent Layer window model
    1883             :     int TotShadesEQL = 0;       // Total number of shade materials for Equivalent Layer window model
    1884             :     int TotDrapesEQL = 0;       // Total number of drape materials for Equivalent Layer window model
    1885             :     int TotBlindsEQL = 0;       // Total number of blind materials for Equivalent Layer window model
    1886             :     int TotScreensEQL = 0;      // Total number of exterior window screen materials for Equivalent Layer window model
    1887             :     int W5GapMatEQL = 0;        // Window5 Equivalent Layer Single-Gas Materials
    1888             :     int TotZoneAirBalance = 0;  // Total Zone Air Balance Statements in input
    1889             :     int TotFrameDivider = 0;    // Total number of window frame/divider objects
    1890             :     bool AirFlowFlag = false;
    1891             :     int TotCO2Gen = 0;                       // Total CO2 source and sink statements in input
    1892             :     bool CalcWindowRevealReflection = false; // True if window reveal reflection is to be calculated for at least one exterior window
    1893             :     bool StormWinChangeThisDay = false; // True if a storm window has been added or removed from any window during the current day; can only be true
    1894             :                                         // for first time step of the day.
    1895             :     bool SimpleCTFOnly = true;          // true if all constructions are simple CTF construction (CTFTimestep = TimeStepZone) with no internal sources
    1896             :     int MaxCTFTerms = 0;                // Maximum CTF terms to shift for all surfaces in the simulation
    1897             :     bool AnyInternalHeatSourceInInput = false;        // true if the user has entered any constructions with internal sources
    1898             :     bool AdaptiveComfortRequested_CEN15251 = false;   // true if people objects have adaptive comfort requests. CEN15251
    1899             :     bool AdaptiveComfortRequested_ASH55 = false;      // true if people objects have adaptive comfort requests. ASH55
    1900             :     bool AnyThermalComfortPierceModel = false;        // true if people objects use pierce thermal comfort model
    1901             :     bool AnyThermalComfortKSUModel = false;           // true if people objects use KSU thermal comfort model
    1902             :     bool AnyThermalComfortCoolingEffectModel = false; // true if people objects use ASH55 cooling effect adjusted thermal comfort model
    1903             :     bool AnyThermalComfortAnkleDraftModel = false;    // true if people objects use ASH55 ankle draft thermal comfort model
    1904             : 
    1905             :     bool NoFfactorConstructionsUsed = true;
    1906             :     bool NoCfactorConstructionsUsed = true;
    1907             :     bool NoRegularMaterialsUsed = true;
    1908             :     bool DoLatentSizing = false; // true when latent sizing is performed during zone sizing
    1909             :     bool isAnyLatentLoad = false;
    1910             : 
    1911             :     Array1D<Real64> ZoneListSNLoadHeatEnergy;
    1912             :     Array1D<Real64> ZoneListSNLoadCoolEnergy;
    1913             :     Array1D<Real64> ZoneListSNLoadHeatRate;
    1914             :     Array1D<Real64> ZoneListSNLoadCoolRate;
    1915             :     Array1D<Real64> ZoneGroupSNLoadHeatEnergy;
    1916             :     Array1D<Real64> ZoneGroupSNLoadCoolEnergy;
    1917             :     Array1D<Real64> ZoneGroupSNLoadHeatRate;
    1918             :     Array1D<Real64> ZoneGroupSNLoadCoolRate;
    1919             : 
    1920             :     Array1D<Real64> ZoneTransSolar; // Exterior beam plus diffuse solar entering zone sum of WinTransSolar for exterior windows in zone (W)
    1921             :     Array1D<Real64>
    1922             :         ZoneWinHeatGain; // Heat gain to zone from all exterior windows (includes oneTransSolar); sum of WinHeatGain for exterior windows in zone (W)
    1923             :     Array1D<Real64> ZoneWinHeatGainRep;             // = ZoneWinHeatGain when ZoneWinHeatGain >= 0
    1924             :     Array1D<Real64> ZoneWinHeatLossRep;             // = -ZoneWinHeatGain when ZoneWinHeatGain < 0
    1925             :     Array1D<Real64> ZoneBmSolFrExtWinsRep;          // Beam solar into zone from exterior windows [W]
    1926             :     Array1D<Real64> ZoneBmSolFrIntWinsRep;          // Beam solar into zone from interior windows [W]
    1927             :     Array1D<Real64> EnclSolInitialDifSolReflW;      // Initial diffuse solar in zone from ext and int windows reflected from interior surfaces [W]
    1928             :     Array1D<Real64> ZoneDifSolFrExtWinsRep;         // Diffuse solar into zone from exterior windows [W]
    1929             :     Array1D<Real64> ZoneDifSolFrIntWinsRep;         // Diffuse solar into zone from interior windows [W]
    1930             :     Array1D<Real64> ZoneOpaqSurfInsFaceCond;        // Zone inside face opaque surface conduction (W)
    1931             :     Array1D<Real64> ZoneOpaqSurfInsFaceCondGainRep; // = Zone inside face opaque surface conduction when >= 0
    1932             :     Array1D<Real64> ZoneOpaqSurfInsFaceCondLossRep; // = -Zone inside face opaque surface conduction when < 0
    1933             :     Array1D<Real64> ZoneOpaqSurfExtFaceCond;        // Zone outside face opaque surface conduction (W)
    1934             :     Array1D<Real64> ZoneOpaqSurfExtFaceCondGainRep; // = Zone outside face opaque surface conduction when >= 0
    1935             :     Array1D<Real64> ZoneOpaqSurfExtFaceCondLossRep; // = -Zone outside face opaque surface conduction when < 0
    1936             :     Array1D<Real64> ZoneTransSolarEnergy;           // Energy of ZoneTransSolar [J]
    1937             :     Array1D<Real64> ZoneWinHeatGainRepEnergy;       // Energy of ZoneWinHeatGainRep [J]
    1938             :     Array1D<Real64> ZoneWinHeatLossRepEnergy;       // Energy of ZoneWinHeatLossRep [J]
    1939             :     Array1D<Real64> ZoneBmSolFrExtWinsRepEnergy;    // Energy of ZoneBmSolFrExtWinsRep [J]
    1940             :     Array1D<Real64> ZoneBmSolFrIntWinsRepEnergy;    // Energy of ZoneBmSolFrIntWinsRep [J]
    1941             :     Array1D<Real64> ZoneDifSolFrExtWinsRepEnergy;   // Energy of ZoneDifSolFrExtWinsRep [J]
    1942             :     Array1D<Real64> ZoneDifSolFrIntWinsRepEnergy;   // Energy of ZoneDifSolFrIntWinsRep [J]
    1943             :     Array1D<Real64> ZnOpqSurfInsFaceCondGnRepEnrg;  // Energy of ZoneOpaqSurfInsFaceCondGainRep [J]
    1944             :     Array1D<Real64> ZnOpqSurfInsFaceCondLsRepEnrg;  // Energy of ZoneOpaqSurfInsFaceCondLossRep [J]
    1945             :     Array1D<Real64> ZnOpqSurfExtFaceCondGnRepEnrg;  // Energy of ZoneOpaqSurfInsFaceCondGainRep [J]
    1946             :     Array1D<Real64> ZnOpqSurfExtFaceCondLsRepEnrg;  // Energy of ZoneOpaqSurfInsFaceCondLossRep [J]
    1947             : 
    1948             :     Array1D<Real64> SurfQdotRadIntGainsInPerArea;       // Thermal radiation absorbed on inside surfaces
    1949             :     Array1D<Real64> SurfQRadSWOutIncident;              // Exterior beam plus diffuse solar incident on surface (W/m2)
    1950             :     Array1D<Real64> SurfQRadSWOutIncidentBeam;          // Exterior beam solar incident on surface (W/m2)
    1951             :     Array1D<Real64> SurfBmIncInsSurfIntensRep;          // Beam sol irrad from ext wins on inside of surface (W/m2)
    1952             :     Array1D<Real64> SurfBmIncInsSurfAmountRep;          // Beam sol amount from ext wins incident on inside of surface (W)
    1953             :     Array1D<Real64> SurfIntBmIncInsSurfIntensRep;       // Beam sol irrad from int wins on inside of surface (W/m2)
    1954             :     Array1D<Real64> SurfIntBmIncInsSurfAmountRep;       // Beam sol amount from int wins incident on inside of surface (W)
    1955             :     Array1D<Real64> SurfQRadSWOutIncidentSkyDiffuse;    // Exterior sky diffuse solar incident on surface (W/m2)
    1956             :     Array1D<Real64> SurfQRadSWOutIncidentGndDiffuse;    // Exterior ground diffuse solar incident on surface (W/m2)
    1957             :     Array1D<Real64> SurfQRadSWOutIncBmToDiffReflGnd;    // Exterior diffuse solar incident from beam to diffuse reflection from ground (W/m2)
    1958             :     Array1D<Real64> SurfQRadSWOutIncSkyDiffReflGnd;     // Exterior diffuse solar incident from sky diffuse reflection from ground (W/m2)
    1959             :     Array1D<Real64> SurfQRadSWOutIncBmToBmReflObs;      // Exterior beam solar incident from beam-to-beam reflection from obstructions (W/m2)
    1960             :     Array1D<Real64> SurfQRadSWOutIncBmToDiffReflObs;    // Exterior diffuse solar incident from beam-to-diffuse reflection from obstructions (W/m2)
    1961             :     Array1D<Real64> SurfQRadSWOutIncSkyDiffReflObs;     // Exterior diffuse solar incident from sky diffuse reflection from obstructions (W/m2)
    1962             :     Array1D<Real64> SurfSWInAbsTotalReport;             // Report - Total interior/exterior shortwave absorbed on inside of surface (W)
    1963             :     Array1D<Real64> SurfBmIncInsSurfAmountRepEnergy;    // energy of BmIncInsSurfAmountRep [J]
    1964             :     Array1D<Real64> SurfIntBmIncInsSurfAmountRepEnergy; // energy of IntBmIncInsSurfAmountRep [J]
    1965             :     Array1D<Real64> SurfInitialDifSolInAbsReport;       // Report - Initial transmitted diffuse solar absorbed on inside of surface (W)
    1966             :     Array1D_int SurfWinBSDFBeamDirectionRep;            // BSDF beam direction number for given complex fenestration state (for reporting) []
    1967             :     Array1D<Real64> SurfWinBSDFBeamThetaRep;            // BSDF beam Theta angle (for reporting) [rad]
    1968             :     Array1D<Real64> SurfWinBSDFBeamPhiRep;              // BSDF beam Phi angle (for reporting) [rad]
    1969             :     Array1D<Real64> SurfWinQRadSWwinAbsTot;             // Exterior beam plus diffuse solar absorbed in glass layers of window (W)
    1970             :     Array2D<Real64> SurfWinQRadSWwinAbsLayer;           // Exterior beam plus diffuse solar absorbed in glass layers of window (W)
    1971             :     Array2D<Real64> SurfWinFenLaySurfTempFront;         // Front surface temperatures of fenestration layers
    1972             :     Array2D<Real64> SurfWinFenLaySurfTempBack;          // Back surface temperatures of fenestration layers
    1973             :     Array1D<Real64> SurfWinQRadSWwinAbsTotEnergy;       // Energy of QRadSWwinAbsTot [J]
    1974             :     Array1D<Real64> SurfWinSWwinAbsTotalReport;         // Report - Total interior/exterior shortwave absorbed in all glass layers of window (W)
    1975             :     Array1D<Real64> SurfWinInitialDifSolInTransReport;  // Report - Initial transmitted diffuse solar transmitted out
    1976             :                                                         // through inside of window surface (W)
    1977             :     Array2D<Real64> SurfWinQRadSWwinAbs;                // Short wave radiation absorbed in window glass layers
    1978             :     Array2D<Real64> SurfWinInitialDifSolwinAbs;         // Initial diffuse solar absorbed in window glass layers from inside(W/m2)
    1979             :     Array1D<Real64> SurfOpaqSWOutAbsTotalReport;        // Report - Total exterior shortwave/solar absorbed on outside of surface (W)
    1980             :     Array1D<Real64> SurfOpaqSWOutAbsEnergyReport;       // Report - Total exterior shortwave/solar absorbed on outside of surface (j)
    1981             :     Array1D<Real64> SurfTempEffBulkAir;                 // air temperature adjacent to the surface used for inside surface heat balances
    1982             : 
    1983             :     // Material
    1984             :     Array1D<Real64> NominalR;                       // Nominal R value of each material -- used in matching interzone surfaces
    1985             :     Array1D<Real64> NominalRforNominalUCalculation; // Nominal R values are summed to calculate NominalU values for constructions
    1986             :     Array1D<Real64> NominalU;                       // Nominal U value for each construction -- used in matching interzone surfaces
    1987             :     Array1D<Real64> NominalUBeforeAdjusted;         // Nominal U value for glazing system only
    1988             :     Array1D<Real64> CoeffAdjRatio;                  // Conductive coefficient adjustment ratio
    1989             : 
    1990             :     Array1D<Real64>
    1991             :         EnclSolQSWRad; // Zone short-wave flux density; used to calculate short-wave  radiation absorbed on inside surfaces of zone or enclosure
    1992             :     Array1D<Real64> EnclSolQSWRadLights; // Like QS, but Lights short-wave only.
    1993             :     Array1D<Real64> EnclSolDB;           // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces
    1994             :     Array1D<Real64> EnclSolDBSSG;        // Factor for diffuse radiation in a zone from beam reflecting from inside surfaces.
    1995             :     // Used only for scheduled surface gains
    1996             :     Array1D<Real64> EnclSolDBIntWin; // Value of factor for beam solar entering a zone through interior windows
    1997             :     // (considered to contribute to diffuse in zone)
    1998             :     Array1D<Real64> EnclSolQSDifSol; // Like QS, but diffuse solar short-wave only.
    1999             :     Array1D<Real64> EnclSolQD;       // Diffuse solar radiation in a zone from sky and ground diffuse entering
    2000             :     // through exterior windows and reflecting from interior surfaces,
    2001             :     // beam from exterior windows reflecting from interior surfaces,
    2002             :     // and beam entering through interior windows (considered diffuse)
    2003             :     Array1D<Real64> EnclSolQDforDaylight; // Diffuse solar radiation in a zone from sky and ground diffuse entering
    2004             :     // through exterior windows, beam from exterior windows reflecting
    2005             :     // from interior surfaces, and beam entering through interior windows
    2006             :     // (considered diffuse)
    2007             :     // Originally QD, now used only for EnclSolQSDifSol calc for daylighting
    2008             : 
    2009             :     bool EnclRadAlwaysReCalc = false; // Enclosure solar or thermal radiation properties always needs to be recalc at any time step
    2010             : 
    2011             :     Array1D<Real64> SurfCosIncidenceAngle;       // Cosine of beam solar incidence angle (for reporting)
    2012             :     Array2D<Real64> SurfSunlitFracHR;            // Hourly fraction of heat transfer surface that is sunlit
    2013             :     Array2D<Real64> SurfCosIncAngHR;             // Hourly cosine of beam radiation incidence angle on surface
    2014             :     Array3D<Real64> SurfSunlitFrac;              // TimeStep fraction of heat transfer surface that is sunlit
    2015             :     Array3D<Real64> SurfSunlitFracWithoutReveal; // For a window with reveal, the sunlit fraction  without shadowing by the reveal
    2016             :     Array3D<Real64> SurfCosIncAng;               // TimeStep cosine of beam radiation incidence angle on surface
    2017             :     Array4D_int SurfWinBackSurfaces;     // For a given hour and timestep, a list of up to 20 surfaces receiving  beam solar radiation from a given
    2018             :                                          // exterior window
    2019             :     Array4D<Real64> SurfWinOverlapAreas; // For a given hour and timestep, the areas of the exterior window sending beam solar radiation to the
    2020             :                                          // surfaces listed in BackSurfaces
    2021             :     Real64 zeroPointerVal = 0.0;
    2022             :     EPVector<DataHeatBalance::ZonePreDefRepType> ZonePreDefRep;
    2023             :     DataHeatBalance::ZonePreDefRepType BuildingPreDefRep;
    2024             :     EPVector<DataHeatBalance::SpaceZoneSimData> ZoneIntGain;
    2025             :     EPVector<DataHeatBalance::SpaceZoneSimData> spaceIntGain;
    2026             :     EPVector<DataHeatBalance::SpaceIntGainDeviceData> spaceIntGainDevices;
    2027             :     EPVector<DataHeatBalance::GapSupportPillar> SupportPillar;
    2028             :     EPVector<DataHeatBalance::GapDeflectionState> DeflectionState;
    2029             :     EPVector<DataHeatBalance::SpectralDataProperties> SpectralData;
    2030             :     EPVector<DataHeatBalance::SpaceData> space;
    2031             :     EPVector<DataHeatBalance::SpaceListData> spaceList;
    2032             :     EPVector<DataHeatBalance::ZoneData> Zone;
    2033             :     EPVector<DataHeatBalance::ZoneResilience> Resilience;
    2034             :     EPVector<DataHeatBalance::ZoneListData> ZoneList;
    2035             :     EPVector<DataHeatBalance::ZoneGroupData> ZoneGroup;
    2036             :     EPVector<DataHeatBalance::PeopleData> People;
    2037             :     EPVector<DataHeatBalance::LightsData> Lights;
    2038             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneElectric;
    2039             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneGas;
    2040             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneOtherEq;
    2041             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneHWEq;
    2042             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneSteamEq;
    2043             :     EPVector<DataHeatBalance::ITEquipData> ZoneITEq;
    2044             :     EPVector<DataHeatBalance::BBHeatData> ZoneBBHeat;
    2045             :     EPVector<DataHeatBalance::InfiltrationData> Infiltration;
    2046             :     EPVector<DataHeatBalance::VentilationData> Ventilation;
    2047             :     EPVector<DataHeatBalance::ZoneAirBalanceData> ZoneAirBalance;
    2048             :     EPVector<DataHeatBalance::MixingData> Mixing;
    2049             :     EPVector<DataHeatBalance::MixingData> CrossMixing;
    2050             :     EPVector<DataHeatBalance::AirBoundaryMixingSpecs> airBoundaryMixing;
    2051             :     EPVector<DataHeatBalance::MixingData> RefDoorMixing;
    2052             :     EPVector<DataHeatBalance::ZoneCatEUseData> ZoneIntEEuse;
    2053             :     EPVector<DataHeatBalance::RefrigCaseCreditData> RefrigCaseCredit;
    2054             :     EPVector<DataHeatBalance::HeatReclaimDataBase> HeatReclaimRefrigeratedRack;
    2055             :     EPVector<DataHeatBalance::HeatReclaimRefrigCondenserData> HeatReclaimRefrigCondenser;
    2056             :     EPVector<DataHeatBalance::HeatReclaimDataBase> HeatReclaimDXCoil;
    2057             :     EPVector<DataHeatBalance::HeatReclaimDataBase> HeatReclaimVS_DXCoil;
    2058             :     EPVector<DataHeatBalance::HeatReclaimDataBase> HeatReclaimSimple_WAHPCoil;
    2059             :     EPVector<DataHeatBalance::AirReportVars> ZnAirRpt;
    2060             :     EPVector<DataHeatBalance::AirReportVars> spaceAirRpt;
    2061             :     EPVector<DataHeatBalance::TCGlazingsType> TCGlazings;
    2062             :     EPVector<DataHeatBalance::ZoneEquipData> ZoneCO2Gen;
    2063             :     EPVector<DataHeatBalance::ZoneReportVars> ZoneRpt;
    2064             :     EPVector<DataHeatBalance::ZoneReportVars> spaceRpt;
    2065             :     EPVector<DataHeatBalance::ZoneMassConservationData> MassConservation;
    2066             :     DataHeatBalance::ZoneAirMassFlowConservation ZoneAirMassFlow;
    2067             :     EPVector<DataHeatBalance::ZoneLocalEnvironmentData> ZoneLocalEnvironment;
    2068             :     bool MundtFirstTimeFlag = true;
    2069             :     EPVector<std::string> spaceTypes;
    2070             :     EPVector<DataHeatBalance::ExtVentedCavityStruct> ExtVentedCavity;
    2071             : 
    2072         796 :     void init_state([[maybe_unused]] EnergyPlusData &state) override
    2073             :     {
    2074         796 :     }
    2075             : 
    2076           0 :     void clear_state() override
    2077             :     {
    2078           0 :         new (this) HeatBalanceData();
    2079           0 :     }
    2080             : };
    2081             : 
    2082             : } // namespace EnergyPlus
    2083             : 
    2084             : #endif

Generated by: LCOV version 1.14