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

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

Generated by: LCOV version 2.0-1